agent-yes 1.305.0 → 1.306.1-beta.816.1

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 (39) hide show
  1. package/dist/{SUPPORTED_CLIS-BtuN8Jno.js → SUPPORTED_CLIS-BTELZ21y.js} +3 -3
  2. package/dist/{SUPPORTED_CLIS-xz97HGFk.js → SUPPORTED_CLIS-DQnzXb7B.js} +2 -2
  3. package/dist/{agentShare-Bx13a3Zs.js → agentShare-lQDp74LV.js} +2 -2
  4. package/dist/{askCli-Dtxxwl28.js → askCli-D4czi-_j.js} +2 -2
  5. package/dist/{callback-turLEkYO.js → callback--2XpYCAY.js} +3 -3
  6. package/dist/{callback-CSseYNlQ.js → callback-0mssVwk7.js} +2 -2
  7. package/dist/cli.js +5 -5
  8. package/dist/{cmdPs-DuLjljRT.js → cmdPs-CTsV34p6.js} +2 -2
  9. package/dist/{identity-C0MxfwI2.js → identity-D3hr59eC.js} +1 -1
  10. package/dist/{identity-Ckav3-Up.js → identity-puvd7hVQ.js} +3 -3
  11. package/dist/index.js +2 -2
  12. package/dist/{notifyDaemon-Du7zud2V.js → notifyDaemon-CoPXYE9P.js} +2 -2
  13. package/dist/{parentPingLoop-DevcqVfR.js → parentPingLoop-DV_QBhM6.js} +2 -2
  14. package/dist/rustBinary-CPHKqwXS.js +4 -0
  15. package/dist/{rustBinary-DcMdwutV.js → rustBinary-DzcwVevc.js} +60 -15
  16. package/dist/{schedule-GTAtx9pc.js → schedule-Cc5v2hHB.js} +4 -4
  17. package/dist/{serve-DRUfCtkt.js → serve-DkwZLz0s.js} +21 -21
  18. package/dist/{setup-Bb0VJTJV.js → setup-CZPOcZ77.js} +2 -2
  19. package/dist/{shareCmd-DBLlNKvE.js → shareCmd-CaFVrCyX.js} +5 -5
  20. package/dist/{subcommands-BEaUJBT2.js → subcommands-CE5QJHvX.js} +23 -24
  21. package/dist/{subcommands-5Hfj3FRI.js → subcommands-DABBFDHL.js} +1 -1
  22. package/dist/{terminal-Cjl0C7Ya.js → terminal-BmL1frIq.js} +2 -2
  23. package/dist/{trayApp-C9bZt7ff.js → trayApp-BVTKPDB5.js} +2 -2
  24. package/dist/trayApp-lzLjlztu.js +5 -0
  25. package/dist/{ts-HJEVAXyh.js → ts-DJ6zhsLK.js} +4 -4
  26. package/dist/{versionChecker-D2r5fiHj.js → versionChecker-Ccww1lqR.js} +2 -2
  27. package/dist/{widget-DEzS79sn.js → widget-J1iMwvNM.js} +3 -3
  28. package/dist/{ws-BJQOtqWN.js → ws-BVYuH1sE.js} +2 -2
  29. package/dist/{ws-PYHbe3A1.js → ws-C7EUYis6.js} +2 -2
  30. package/lab/ui/index.html +3 -0
  31. package/lab/ui/landing.html +3 -0
  32. package/package.json +3 -1
  33. package/ts/identity.ts +2 -2
  34. package/ts/remoteHealth.ts +4 -5
  35. package/ts/rustBinary.bun.spec.ts +63 -1
  36. package/ts/rustBinary.ts +63 -10
  37. package/ts/subcommands.ts +1 -1
  38. package/dist/rustBinary-H4aw9Spj.js +0 -4
  39. package/dist/trayApp-BWLgy2u_.js +0 -5
@@ -1,12 +1,12 @@
1
1
  import "./logger-CDIsZ-Pp.js";
2
- import "./versionChecker-D2r5fiHj.js";
3
- import "./ts-HJEVAXyh.js";
2
+ import "./versionChecker-Ccww1lqR.js";
3
+ import "./ts-DJ6zhsLK.js";
4
4
  import "./todoAutomation-CKlrxuZv.js";
5
5
  import "./JsonlStore-CB_0sfdT.js";
6
6
  import "./globalPidIndex-C6p_AY4D.js";
7
7
  import "./pidStore-DUXifdBr.js";
8
8
  import "./messageLog-Dq_ka-Bt.js";
9
9
  import "./todoStore-msRCEUi1.js";
10
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-xz97HGFk.js";
10
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-DQnzXb7B.js";
11
11
 
12
12
  export { SUPPORTED_CLIS };
@@ -1,8 +1,8 @@
1
- import { t as CLIS_CONFIG } from "./ts-HJEVAXyh.js";
1
+ import { t as CLIS_CONFIG } from "./ts-DJ6zhsLK.js";
2
2
 
3
3
  //#region ts/SUPPORTED_CLIS.ts
4
4
  const SUPPORTED_CLIS = Object.keys(CLIS_CONFIG);
5
5
 
6
6
  //#endregion
7
7
  export { SUPPORTED_CLIS as t };
8
- //# sourceMappingURL=SUPPORTED_CLIS-xz97HGFk.js.map
8
+ //# sourceMappingURL=SUPPORTED_CLIS-DQnzXb7B.js.map
@@ -5,7 +5,7 @@ import "./pidStore-DUXifdBr.js";
5
5
  import "./messageLog-Dq_ka-Bt.js";
6
6
  import "./e2e-BdLf8DvY.js";
7
7
  import "./configShared-De4bR5hH.js";
8
- import { ot as resolveOne } from "./subcommands-BEaUJBT2.js";
8
+ import { ot as resolveOne } from "./subcommands-CE5QJHvX.js";
9
9
  import "./webrtcLink-DcvacEci.js";
10
10
  import "./remotes-BsMGvAay.js";
11
11
  import "./roomReplyAlias-B-v76TA8.js";
@@ -234,4 +234,4 @@ function transformEvent(rawEvent, agentId, forwarded) {
234
234
 
235
235
  //#endregion
236
236
  export { createScopedShare, listShares, revokeAllShares, revokeShare };
237
- //# sourceMappingURL=agentShare-Bx13a3Zs.js.map
237
+ //# sourceMappingURL=agentShare-lQDp74LV.js.map
@@ -2,7 +2,7 @@ import "./logger-CDIsZ-Pp.js";
2
2
  import "./JsonlStore-CB_0sfdT.js";
3
3
  import "./globalPidIndex-C6p_AY4D.js";
4
4
  import { r as openStore } from "./todoStore-msRCEUi1.js";
5
- import { t as formatIdentity } from "./identity-Ckav3-Up.js";
5
+ import { t as formatIdentity } from "./identity-puvd7hVQ.js";
6
6
  import { a as resolveTodoRoot, i as resolveSelf } from "./todoIdentity-DeDp7LKl.js";
7
7
  import yargs from "yargs";
8
8
  import { randomBytes } from "crypto";
@@ -269,4 +269,4 @@ async function runAnswerSubcommand(rest, deps) {
269
269
 
270
270
  //#endregion
271
271
  export { runAnswerSubcommand, runAskSubcommand };
272
- //# sourceMappingURL=askCli-Dtxxwl28.js.map
272
+ //# sourceMappingURL=askCli-D4czi-_j.js.map
@@ -1,5 +1,5 @@
1
1
  import { t as agentYesHome } from "./agentYesHome-JmJC28YX.js";
2
- import { ot as resolveOne } from "./subcommands-BEaUJBT2.js";
2
+ import { ot as resolveOne } from "./subcommands-CE5QJHvX.js";
3
3
  import { a as mintCapability, o as parseExpires } from "./callbackCore-Deve5pv3.js";
4
4
  import { chmodSync, readFileSync, renameSync, writeFileSync } from "node:fs";
5
5
  import path from "node:path";
@@ -72,7 +72,7 @@ async function resolveBase(flag) {
72
72
  if (flag) return flag;
73
73
  if (process.env.AGENT_YES_CALLBACK_BASE) return process.env.AGENT_YES_CALLBACK_BASE;
74
74
  try {
75
- const { resolveLocalServeUrl } = await import("./serve-DRUfCtkt.js");
75
+ const { resolveLocalServeUrl } = await import("./serve-DkwZLz0s.js");
76
76
  const url = await resolveLocalServeUrl();
77
77
  if (url) return url;
78
78
  } catch {}
@@ -187,4 +187,4 @@ async function cmdCallback(rest) {
187
187
 
188
188
  //#endregion
189
189
  export { loadOrCreateCallbackSecret as i, isCallbackRevoked as n, loadCallbackSecretReadOnly as r, cmdCallback as t };
190
- //# sourceMappingURL=callback-turLEkYO.js.map
190
+ //# sourceMappingURL=callback--2XpYCAY.js.map
@@ -5,13 +5,13 @@ import "./pidStore-DUXifdBr.js";
5
5
  import "./messageLog-Dq_ka-Bt.js";
6
6
  import "./e2e-BdLf8DvY.js";
7
7
  import "./configShared-De4bR5hH.js";
8
- import "./subcommands-BEaUJBT2.js";
8
+ import "./subcommands-CE5QJHvX.js";
9
9
  import "./webrtcLink-DcvacEci.js";
10
10
  import "./remotes-BsMGvAay.js";
11
11
  import "./roomReplyAlias-B-v76TA8.js";
12
12
  import "./notifyStore-DIfkfKB2.js";
13
13
  import "./senderAncestry-CVHeKk1Y.js";
14
14
  import "./callbackCore-Deve5pv3.js";
15
- import { i as loadOrCreateCallbackSecret, n as isCallbackRevoked, r as loadCallbackSecretReadOnly, t as cmdCallback } from "./callback-turLEkYO.js";
15
+ import { i as loadOrCreateCallbackSecret, n as isCallbackRevoked, r as loadCallbackSecretReadOnly, t as cmdCallback } from "./callback--2XpYCAY.js";
16
16
 
17
17
  export { cmdCallback };
package/dist/cli.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env bun
2
2
  import { t as invokedCliName } from "./invokedCli-zdFbz1ST.js";
3
3
  import { n as logger } from "./logger-CDIsZ-Pp.js";
4
- import { a as versionString, r as displayVersion, t as checkAndAutoUpdate } from "./versionChecker-D2r5fiHj.js";
5
- import { m as getRustBinary } from "./rustBinary-DcMdwutV.js";
4
+ import { a as versionString, r as displayVersion, t as checkAndAutoUpdate } from "./versionChecker-Ccww1lqR.js";
5
+ import { h as getRustBinary } from "./rustBinary-DzcwVevc.js";
6
6
  import { statSync } from "node:fs";
7
7
  import { isAbsolute } from "node:path";
8
8
  import { argv } from "process";
@@ -378,7 +378,7 @@ function buildRustArgs(argv, cliFromScript, supportedClis) {
378
378
  const rawArg = process.argv[2];
379
379
  const managerCommands = !invokedCliName(process.argv);
380
380
  const isHelpFlag = rawArg === "-h" || rawArg === "--help";
381
- const { isSubcommand, runSubcommand, cmdHelp, isUnknownManagerToken, isBareManagerInvocation } = await import("./subcommands-5Hfj3FRI.js");
381
+ const { isSubcommand, runSubcommand, cmdHelp, isUnknownManagerToken, isBareManagerInvocation } = await import("./subcommands-DABBFDHL.js");
382
382
  if (isHelpFlag && process.argv.length === 3) {
383
383
  await cmdHelp(managerCommands);
384
384
  process.exit(0);
@@ -392,7 +392,7 @@ function buildRustArgs(argv, cliFromScript, supportedClis) {
392
392
  process.exit(code ?? 0);
393
393
  }
394
394
  {
395
- const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-BtuN8Jno.js");
395
+ const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-BTELZ21y.js");
396
396
  if (isUnknownManagerToken(rawArg, managerCommands, SUPPORTED_CLIS)) {
397
397
  process.stderr.write(`ay: unknown subcommand or CLI '${rawArg}'.\n See 'ay help' for subcommands. To run an agent, name a CLI:\n 'ay <cli> …' (e.g. 'ay claude …') or 'ay --cli <cli> …'.\n`);
398
398
  process.exit(1);
@@ -464,7 +464,7 @@ if (config.useRust) {
464
464
  process.exit(1);
465
465
  }
466
466
  if (rustBinary) {
467
- const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-BtuN8Jno.js");
467
+ const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-BTELZ21y.js");
468
468
  const rustArgs = buildRustArgs(process.argv, config.cli, SUPPORTED_CLIS);
469
469
  if (config.verbose) {
470
470
  console.log(`[rust] Using binary: ${rustBinary}`);
@@ -5,7 +5,7 @@ import "./pidStore-DUXifdBr.js";
5
5
  import "./messageLog-Dq_ka-Bt.js";
6
6
  import "./e2e-BdLf8DvY.js";
7
7
  import "./configShared-De4bR5hH.js";
8
- import { Dt as buildAgentForest, G as listRecords, Ot as flattenForest, y as deriveLiveState } from "./subcommands-BEaUJBT2.js";
8
+ import { Dt as buildAgentForest, G as listRecords, Ot as flattenForest, y as deriveLiveState } from "./subcommands-CE5QJHvX.js";
9
9
  import "./webrtcLink-DcvacEci.js";
10
10
  import "./remotes-BsMGvAay.js";
11
11
  import "./roomReplyAlias-B-v76TA8.js";
@@ -332,4 +332,4 @@ function readPpidSync(pid) {
332
332
 
333
333
  //#endregion
334
334
  export { cmdPs };
335
- //# sourceMappingURL=cmdPs-DuLjljRT.js.map
335
+ //# sourceMappingURL=cmdPs-CTsV34p6.js.map
@@ -1,3 +1,3 @@
1
- import { a as safeBranch, i as readGitBranch, n as localHost, o as safeToken, r as localUser, s as tildify, t as formatIdentity } from "./identity-Ckav3-Up.js";
1
+ import { a as safeBranch, i as readGitBranch, n as localHost, o as safeToken, r as localUser, s as tildify, t as formatIdentity } from "./identity-puvd7hVQ.js";
2
2
 
3
3
  export { formatIdentity };
@@ -7,11 +7,11 @@ import { homedir, hostname, userInfo } from "node:os";
7
7
  * The standardized agent identity string:
8
8
  *
9
9
  * <username>@<hostname>:<path>:<branch>#<pid>
10
- * e.g. sno@Mac:~/ws/symval/symval/tree/crm:main#30402
10
+ * Example: alice@host:~/work/org/repo:main#1111
11
11
  *
12
12
  * One line answers "who is this agent" across every surface that names one —
13
13
  * the `ay send` envelope header, `ay whoami`, logs. The branch segment usually
14
- * carries the lane name for free (worktree checkouts like `crm-yamamoto-wifi`
14
+ * carries the lane name for free (worktree checkouts like `feature/example`
15
15
  * or `fix/t173-tone-core` name their purpose), which is why there is no
16
16
  * separate role concept.
17
17
  *
@@ -106,4 +106,4 @@ function formatIdentity(parts) {
106
106
 
107
107
  //#endregion
108
108
  export { safeBranch as a, readGitBranch as i, localHost as n, safeToken as o, localUser as r, tildify as s, formatIdentity as t };
109
- //# sourceMappingURL=identity-Ckav3-Up.js.map
109
+ //# sourceMappingURL=identity-puvd7hVQ.js.map
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import "./logger-CDIsZ-Pp.js";
2
- import "./versionChecker-D2r5fiHj.js";
3
- import { a as hasTodoStore, i as answerAsk, l as AgentContext, n as agentYes, o as listAsks, r as config, s as listAsksForProject, t as CLIS_CONFIG } from "./ts-HJEVAXyh.js";
2
+ import "./versionChecker-Ccww1lqR.js";
3
+ import { a as hasTodoStore, i as answerAsk, l as AgentContext, n as agentYes, o as listAsks, r as config, s as listAsksForProject, t as CLIS_CONFIG } from "./ts-DJ6zhsLK.js";
4
4
  import { a as renderTree, c as describeBlock, i as renderDigest, l as monitorHint, o as unblockedTasks, r as openBlockers, t as reconcileTodos, u as removeControlCharacters } from "./todoAutomation-CKlrxuZv.js";
5
5
  import "./JsonlStore-CB_0sfdT.js";
6
6
  import "./globalPidIndex-C6p_AY4D.js";
@@ -5,7 +5,7 @@ import "./pidStore-DUXifdBr.js";
5
5
  import "./messageLog-Dq_ka-Bt.js";
6
6
  import "./e2e-BdLf8DvY.js";
7
7
  import "./configShared-De4bR5hH.js";
8
- import { G as listRecords, I as isPidAlive, rt as renderLogTailLines, y as deriveLiveState } from "./subcommands-BEaUJBT2.js";
8
+ import { G as listRecords, I as isPidAlive, rt as renderLogTailLines, y as deriveLiveState } from "./subcommands-CE5QJHvX.js";
9
9
  import "./webrtcLink-DcvacEci.js";
10
10
  import "./remotes-BsMGvAay.js";
11
11
  import "./roomReplyAlias-B-v76TA8.js";
@@ -881,4 +881,4 @@ async function ensureDaemon() {
881
881
 
882
882
  //#endregion
883
883
  export { daemonStatus, ensureDaemon, requestDaemonStop, runDaemon };
884
- //# sourceMappingURL=notifyDaemon-Du7zud2V.js.map
884
+ //# sourceMappingURL=notifyDaemon-CoPXYE9P.js.map
@@ -338,7 +338,7 @@ async function isParentWatching(parentWrapperPid, parentAgentPid, selfAgentPid,
338
338
  logger.debug("[parent-ping] watcher lookup failed:", error);
339
339
  }
340
340
  try {
341
- const { lastReadAt, READ_WINDOW_MS } = await import("./subcommands-5Hfj3FRI.js");
341
+ const { lastReadAt, READ_WINDOW_MS } = await import("./subcommands-DABBFDHL.js");
342
342
  const last = await lastReadAt(`agent:${parentAgentPid}`, selfAgentPid);
343
343
  if (last !== null && now - last <= READ_WINDOW_MS) return true;
344
344
  } catch (error) {
@@ -466,4 +466,4 @@ function startParentPingLoop(opts) {
466
466
 
467
467
  //#endregion
468
468
  export { startParentPingLoop };
469
- //# sourceMappingURL=parentPingLoop-DevcqVfR.js.map
469
+ //# sourceMappingURL=parentPingLoop-DV_QBhM6.js.map
@@ -0,0 +1,4 @@
1
+ import "./versionChecker-Ccww1lqR.js";
2
+ import { a as ensureExecutable, c as findRustBinary, d as gcOldBinaryDirs, f as getBinDir, g as hasValidMacSignature, h as getRustBinary, i as ensureAyrsBinary, l as findSpawnHiddenLauncher, m as getDownloadUrl, n as devBuildInfo, o as extractZipWindows, p as getBinaryName, r as downloadBinary, s as findAyrsBinary, t as chmodExtractedBinaries, u as findTrayLauncher } from "./rustBinary-DzcwVevc.js";
3
+
4
+ export { ensureAyrsBinary, findAyrsBinary, gcOldBinaryDirs };
@@ -1,4 +1,4 @@
1
- import { i as getInstalledPackage, n as compareVersions } from "./versionChecker-D2r5fiHj.js";
1
+ import { i as getInstalledPackage, n as compareVersions } from "./versionChecker-Ccww1lqR.js";
2
2
  import { execFileSync } from "child_process";
3
3
  import { accessSync, chmodSync, constants, existsSync, mkdirSync, readdirSync, rmSync, statSync, unlinkSync } from "fs";
4
4
  import { chmod, copyFile } from "fs/promises";
@@ -226,6 +226,61 @@ function getDownloadUrl(version = "latest") {
226
226
  return `https://github.com/snomiao/agent-yes/releases/download/v${version}/${binaryName}${ext}`;
227
227
  }
228
228
  /**
229
+ * Extract a release .zip on Windows.
230
+ *
231
+ * Prefers the bsdtar that ships in System32 (Windows 10 1803+), which reads
232
+ * zips natively. Falls back to Windows PowerShell's Expand-Archive with
233
+ * PSModulePath cleared: when `ay` runs from a PowerShell 7 session the
234
+ * inherited PSModulePath makes powershell.exe 5.1 load PS7's Archive module,
235
+ * whose Expand-Archive throws "ExtractToDirectory ... argument count 3" and
236
+ * extracts nothing (while still exiting 0).
237
+ */
238
+ async function extractZipWindows(zipPath, destDir, tarExe = path.join(process.env.SystemRoot || process.env.windir || "C:\\Windows", "System32", "tar.exe")) {
239
+ const run = async (cmd, env) => {
240
+ const proc = Bun.spawn(cmd, {
241
+ cwd: destDir,
242
+ env,
243
+ stdio: [
244
+ "ignore",
245
+ "pipe",
246
+ "pipe"
247
+ ]
248
+ });
249
+ const [code, stderr] = await Promise.all([proc.exited, new Response(proc.stderr).text()]);
250
+ return {
251
+ code,
252
+ stderr: stderr.trim()
253
+ };
254
+ };
255
+ const errors = [];
256
+ if (existsSync(tarExe)) try {
257
+ const r = await run([
258
+ tarExe,
259
+ "-xf",
260
+ zipPath,
261
+ "-C",
262
+ destDir
263
+ ]);
264
+ if (r.code === 0) return;
265
+ errors.push(`tar exited ${r.code}: ${r.stderr}`);
266
+ } catch (err) {
267
+ errors.push(`tar: ${err instanceof Error ? err.message : String(err)}`);
268
+ }
269
+ const env = { ...process.env };
270
+ for (const k of Object.keys(env)) if (k.toLowerCase() === "psmodulepath") delete env[k];
271
+ const quote = (p) => `'${p.replace(/'/g, "''")}'`;
272
+ const r = await run([
273
+ "powershell",
274
+ "-NoProfile",
275
+ "-NonInteractive",
276
+ "-Command",
277
+ `$ErrorActionPreference='Stop'; Expand-Archive -LiteralPath ${quote(zipPath)} -DestinationPath ${quote(destDir)} -Force`
278
+ ], env);
279
+ if (r.code === 0) return;
280
+ errors.push(`Expand-Archive exited ${r.code}: ${r.stderr}`);
281
+ throw new Error(`Failed to extract ${zipPath}:\n${errors.join("\n")}`);
282
+ }
283
+ /**
229
284
  * Download and extract the binary
230
285
  */
231
286
  async function downloadBinary(verbose = false) {
@@ -240,18 +295,7 @@ async function downloadBinary(verbose = false) {
240
295
  if (process.platform === "win32") {
241
296
  const tempZipPath = path.join(binDir, "temp.zip");
242
297
  await Bun.write(tempZipPath, await response.arrayBuffer());
243
- await Bun.spawn([
244
- "powershell",
245
- "-Command",
246
- `Expand-Archive -Path '${tempZipPath}' -DestinationPath '${binDir}' -Force`
247
- ], {
248
- cwd: binDir,
249
- stdio: [
250
- "ignore",
251
- "pipe",
252
- "pipe"
253
- ]
254
- }).exited;
298
+ await extractZipWindows(tempZipPath, binDir);
255
299
  try {
256
300
  unlinkSync(tempZipPath);
257
301
  } catch {}
@@ -293,6 +337,7 @@ async function downloadBinary(verbose = false) {
293
337
  await chmodExtractedBinaries(binDir);
294
338
  await chmod(binaryPath, 493);
295
339
  }
340
+ if (!existsSync(binaryPath)) throw new Error(`Downloaded ${url} but ${binaryPath} is missing after extraction`);
296
341
  if (verbose) console.log(`[rust] Binary downloaded to: ${binaryPath}`);
297
342
  return binaryPath;
298
343
  }
@@ -434,5 +479,5 @@ async function getRustBinary(options = {}) {
434
479
  }
435
480
 
436
481
  //#endregion
437
- export { ensureExecutable as a, findSpawnHiddenLauncher as c, getBinDir as d, getBinaryName as f, hasValidMacSignature as h, ensureAyrsBinary as i, findTrayLauncher as l, getRustBinary as m, devBuildInfo as n, findAyrsBinary as o, getDownloadUrl as p, downloadBinary as r, findRustBinary as s, chmodExtractedBinaries as t, gcOldBinaryDirs as u };
438
- //# sourceMappingURL=rustBinary-DcMdwutV.js.map
482
+ export { ensureExecutable as a, findRustBinary as c, gcOldBinaryDirs as d, getBinDir as f, hasValidMacSignature as g, getRustBinary as h, ensureAyrsBinary as i, findSpawnHiddenLauncher as l, getDownloadUrl as m, devBuildInfo as n, extractZipWindows as o, getBinaryName as p, downloadBinary as r, findAyrsBinary as s, chmodExtractedBinaries as t, findTrayLauncher as u };
483
+ //# sourceMappingURL=rustBinary-DzcwVevc.js.map
@@ -1,13 +1,13 @@
1
1
  import "./logger-CDIsZ-Pp.js";
2
- import "./versionChecker-D2r5fiHj.js";
3
- import "./ts-HJEVAXyh.js";
2
+ import "./versionChecker-Ccww1lqR.js";
3
+ import "./ts-DJ6zhsLK.js";
4
4
  import "./todoAutomation-CKlrxuZv.js";
5
5
  import "./JsonlStore-CB_0sfdT.js";
6
6
  import "./globalPidIndex-C6p_AY4D.js";
7
7
  import "./pidStore-DUXifdBr.js";
8
8
  import "./messageLog-Dq_ka-Bt.js";
9
9
  import "./todoStore-msRCEUi1.js";
10
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-xz97HGFk.js";
10
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-DQnzXb7B.js";
11
11
  import { n as liveEnv, t as ensureNodeRuntime } from "./nodeRuntime-DGMQRTGT.js";
12
12
  import { t as ensureBootAutostart } from "./oxmgrService-DlYHmqyI.js";
13
13
  import { f as resolveSpawnCwd } from "./workspaceConfig-DBgsu81B.js";
@@ -125,4 +125,4 @@ async function cmdSchedule(rest) {
125
125
 
126
126
  //#endregion
127
127
  export { cmdSchedule };
128
- //# sourceMappingURL=schedule-GTAtx9pc.js.map
128
+ //# sourceMappingURL=schedule-Cc5v2hHB.js.map
@@ -1,7 +1,7 @@
1
1
  import "./logger-CDIsZ-Pp.js";
2
- import { i as getInstalledPackage } from "./versionChecker-D2r5fiHj.js";
3
- import { c as findSpawnHiddenLauncher } from "./rustBinary-DcMdwutV.js";
4
- import { c as permissionBadge, i as answerAsk, o as listAsks, u as CLAUDE_SESSION_PIN_ENV } from "./ts-HJEVAXyh.js";
2
+ import { i as getInstalledPackage } from "./versionChecker-Ccww1lqR.js";
3
+ import { l as findSpawnHiddenLauncher } from "./rustBinary-DzcwVevc.js";
4
+ import { c as permissionBadge, i as answerAsk, o as listAsks, u as CLAUDE_SESSION_PIN_ENV } from "./ts-DJ6zhsLK.js";
5
5
  import { t as agentYesHome$1 } from "./agentYesHome-JmJC28YX.js";
6
6
  import { u as removeControlCharacters } from "./todoAutomation-CKlrxuZv.js";
7
7
  import "./JsonlStore-CB_0sfdT.js";
@@ -11,21 +11,21 @@ import { r as recordInbox, s as isTerminalReply } from "./messageLog-Dq_ka-Bt.js
11
11
  import "./todoStore-msRCEUi1.js";
12
12
  import "./e2e-BdLf8DvY.js";
13
13
  import "./configShared-De4bR5hH.js";
14
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-xz97HGFk.js";
15
- import { $ as readNotes, Ct as withIpcLock, D as extractNeedsInput, Et as TYPING_BADGE, G as listRecords, H as isUserTyping, L as isSlashCommand, O as extractTaskCounts, Q as readLogForRender, St as resolveWorkDir, T as extractBadges, Tt as shouldFramePaste, at as renderRawLogLines, b as deriveLiveStatus, et as readPtysize, g as controlCodeFromName, it as renderRawLog, nt as recentReadEdges, ot as resolveOne, p as cliDefaults, pt as snapshotStatus, rt as renderLogTailLines, tt as recentMessageEdges, wt as framePaste, xt as writeToIpc } from "./subcommands-BEaUJBT2.js";
14
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-DQnzXb7B.js";
15
+ import { $ as readNotes, Ct as withIpcLock, D as extractNeedsInput, Et as TYPING_BADGE, G as listRecords, H as isUserTyping, L as isSlashCommand, O as extractTaskCounts, Q as readLogForRender, St as resolveWorkDir, T as extractBadges, Tt as shouldFramePaste, at as renderRawLogLines, b as deriveLiveStatus, et as readPtysize, g as controlCodeFromName, it as renderRawLog, nt as recentReadEdges, ot as resolveOne, p as cliDefaults, pt as snapshotStatus, rt as renderLogTailLines, tt as recentMessageEdges, wt as framePaste, xt as writeToIpc } from "./subcommands-CE5QJHvX.js";
16
16
  import { i as isWebrtcSpec, o as toWebrtcUrl } from "./webrtcLink-DcvacEci.js";
17
17
  import "./remotes-BsMGvAay.js";
18
18
  import "./roomReplyAlias-B-v76TA8.js";
19
19
  import { c as isTransientLockMkdirError } from "./notifyStore-DIfkfKB2.js";
20
20
  import "./senderAncestry-CVHeKk1Y.js";
21
21
  import { i as frameVisitorMessage, s as verifyCapability, t as MAX_CALLBACK_MSG_BYTES } from "./callbackCore-Deve5pv3.js";
22
- import { n as isCallbackRevoked, r as loadCallbackSecretReadOnly } from "./callback-turLEkYO.js";
22
+ import { n as isCallbackRevoked, r as loadCallbackSecretReadOnly } from "./callback--2XpYCAY.js";
23
23
  import { n as sampleTrees } from "./procStats-DwTxj3rs.js";
24
24
  import { n as liveEnv, t as ensureNodeRuntime } from "./nodeRuntime-DGMQRTGT.js";
25
25
  import { a as getProvisionRoot, d as isProvisionAllowed, f as resolveSpawnCwd, i as getProvisionHook, l as hasProvisionHook, o as getSpawnHook, t as allowsSkipPermissions, u as hasSpawnHook } from "./workspaceConfig-DBgsu81B.js";
26
- import { i as importProvisionModule } from "./ws-PYHbe3A1.js";
26
+ import { i as importProvisionModule } from "./ws-C7EUYis6.js";
27
27
  import { r as spawnRejectionReason } from "./spawnGate-3YSXiRFS.js";
28
- import { i as launchTray } from "./trayApp-C9bZt7ff.js";
28
+ import { i as launchTray } from "./trayApp-BVTKPDB5.js";
29
29
  import { existsSync, realpathSync, renameSync, watch, writeFileSync } from "node:fs";
30
30
  import yargs from "yargs";
31
31
  import { appendFile, mkdir, open, readFile, readdir, rename, rm, stat, unlink, writeFile } from "fs/promises";
@@ -1347,7 +1347,7 @@ async function warnStrayServeProcesses() {
1347
1347
  }
1348
1348
  async function daemonShareRuntime(args) {
1349
1349
  const { daemonShareRuntime: decide } = await import("./serveRust-BfWkeL6T.js");
1350
- const { findAyrsBinary } = await import("./rustBinary-H4aw9Spj.js");
1350
+ const { findAyrsBinary } = await import("./rustBinary-CPHKqwXS.js");
1351
1351
  return decide(args, () => !!findAyrsBinary());
1352
1352
  }
1353
1353
  function explicitWebrtcUrl(args) {
@@ -1645,7 +1645,7 @@ async function cmdServeStatus(args) {
1645
1645
  const token = await loadTokenReadOnly();
1646
1646
  const daemonArgs = mgr ? await readDaemonServeArgs(mgr) : null;
1647
1647
  const installed = daemonArgs !== null;
1648
- const { daemonShareLink, foregroundAyrsShareLink } = await import("./shareCmd-DBLlNKvE.js");
1648
+ const { daemonShareLink, foregroundAyrsShareLink } = await import("./shareCmd-CaFVrCyX.js");
1649
1649
  const shareLink = (installed ? await daemonShareLink(daemonArgs) : await foregroundAyrsShareLink()) ?? await readShareLink();
1650
1650
  const running = installed ? await readDaemonRunning(mgr) : false;
1651
1651
  const a = daemonArgs ?? [];
@@ -1779,14 +1779,14 @@ Options:
1779
1779
  const { planRustServe, SERVE_SUBCOMMANDS } = await import("./serveRust-BfWkeL6T.js");
1780
1780
  const plan = planRustServe(rest);
1781
1781
  if (plan.kind === "rust-only") {
1782
- const { ensureAyrsBinary } = await import("./rustBinary-H4aw9Spj.js");
1782
+ const { ensureAyrsBinary } = await import("./rustBinary-CPHKqwXS.js");
1783
1783
  const ayrs = await ensureAyrsBinary();
1784
1784
  if (ayrs) return runAyrsServe(ayrs, plan.argv);
1785
1785
  process.stderr.write(`ay serve: ${plan.feature} needs the Rust daemon (ayrs), which was not found (bun run build:rs, or reinstall)\n`);
1786
1786
  return 1;
1787
1787
  }
1788
1788
  if (plan.kind === "rust") {
1789
- const { ensureAyrsBinary } = await import("./rustBinary-H4aw9Spj.js");
1789
+ const { ensureAyrsBinary } = await import("./rustBinary-CPHKqwXS.js");
1790
1790
  const ayrs = await ensureAyrsBinary();
1791
1791
  if (ayrs) return runAyrsServe(ayrs, plan.argv);
1792
1792
  process.stderr.write("ay serve: ayrs binary not found — running the TypeScript server (bun run build:rs, or reinstall, to get the Rust daemon)\n");
@@ -2778,7 +2778,7 @@ Options:
2778
2778
  }
2779
2779
  });
2780
2780
  if (req.method === "GET" && p === "/api/ws") {
2781
- const ws = await import("./ws-BJQOtqWN.js");
2781
+ const ws = await import("./ws-BVYuH1sE.js");
2782
2782
  try {
2783
2783
  await ws.loadProvision();
2784
2784
  } catch (e) {
@@ -2798,7 +2798,7 @@ Options:
2798
2798
  if (req.method === "GET" && p === "/api/ws/status") {
2799
2799
  const dirRaw = url.searchParams.get("path");
2800
2800
  if (!dirRaw) return new Response("missing ?path=<workspace dir>", { status: 400 });
2801
- const ws = await import("./ws-BJQOtqWN.js");
2801
+ const ws = await import("./ws-BVYuH1sE.js");
2802
2802
  let prov;
2803
2803
  try {
2804
2804
  prov = await ws.loadProvision();
@@ -2820,7 +2820,7 @@ Options:
2820
2820
  }
2821
2821
  }
2822
2822
  if (req.method === "GET" && p === "/api/ws/repos") {
2823
- const ws = await import("./ws-BJQOtqWN.js");
2823
+ const ws = await import("./ws-BVYuH1sE.js");
2824
2824
  try {
2825
2825
  await ws.loadProvision();
2826
2826
  } catch (e) {
@@ -2901,7 +2901,7 @@ Options:
2901
2901
  const m = /^([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)$/.exec(repoParam);
2902
2902
  if (!m || m[1] === "." || m[1] === ".." || m[2] === "." || m[2] === "..") return new Response("missing/invalid ?repo=<owner>/<repo>", { status: 400 });
2903
2903
  const [, owner, repo] = m;
2904
- const ws = await import("./ws-BJQOtqWN.js");
2904
+ const ws = await import("./ws-BVYuH1sE.js");
2905
2905
  let prov;
2906
2906
  try {
2907
2907
  prov = await ws.loadProvision();
@@ -3812,7 +3812,7 @@ Options:
3812
3812
  const perm = body.perm ?? "r";
3813
3813
  if (perm !== "r" && perm !== "rw") return new Response(`invalid perm ${perm} (want r or rw)`, { status: 400 });
3814
3814
  try {
3815
- const { createScopedShare } = await import("./agentShare-Bx13a3Zs.js");
3815
+ const { createScopedShare } = await import("./agentShare-lQDp74LV.js");
3816
3816
  const share = await createScopedShare({
3817
3817
  agent: body.agent,
3818
3818
  perm,
@@ -3827,12 +3827,12 @@ Options:
3827
3827
  }
3828
3828
  }
3829
3829
  if (req.method === "GET" && p === "/api/shares") {
3830
- const { listShares } = await import("./agentShare-Bx13a3Zs.js");
3830
+ const { listShares } = await import("./agentShare-lQDp74LV.js");
3831
3831
  return Response.json(listShares());
3832
3832
  }
3833
3833
  const revokeM = /^\/api\/share\/([^/]+)$/.exec(p);
3834
3834
  if (req.method === "DELETE" && revokeM) {
3835
- const { revokeShare } = await import("./agentShare-Bx13a3Zs.js");
3835
+ const { revokeShare } = await import("./agentShare-lQDp74LV.js");
3836
3836
  const ok = revokeShare(decodeURIComponent(revokeM[1]));
3837
3837
  return new Response(ok ? "revoked" : "no such share", { status: ok ? 200 : 404 });
3838
3838
  }
@@ -4144,7 +4144,7 @@ Options:
4144
4144
  const shutdown = (resolve) => {
4145
4145
  if (heartbeat) clearInterval(heartbeat);
4146
4146
  closeShare?.();
4147
- import("./agentShare-Bx13a3Zs.js").then((m) => m.revokeAllShares()).catch(() => {});
4147
+ import("./agentShare-lQDp74LV.js").then((m) => m.revokeAllShares()).catch(() => {});
4148
4148
  server?.stop();
4149
4149
  Promise.resolve(releaseHostLock?.()).catch(() => {}).then(resolve);
4150
4150
  };
@@ -4157,4 +4157,4 @@ Options:
4157
4157
 
4158
4158
  //#endregion
4159
4159
  export { cmdServe, inspectServeDaemon, loadTokenReadOnly, mintScopedTermToken, resolveDaemonHttpBase, resolveLocalServeUrl };
4160
- //# sourceMappingURL=serve-DRUfCtkt.js.map
4160
+ //# sourceMappingURL=serve-DkwZLz0s.js.map
@@ -97,7 +97,7 @@ async function cmdSetup(rest) {
97
97
  } catch {}
98
98
  if (noShare) return 0;
99
99
  process.stdout.write(`\nsharing this machine to agent-yes.com…\n`);
100
- const { cmdServe } = await import("./serve-DRUfCtkt.js");
100
+ const { cmdServe } = await import("./serve-DkwZLz0s.js");
101
101
  return cmdServe([
102
102
  "install",
103
103
  "--share",
@@ -107,4 +107,4 @@ async function cmdSetup(rest) {
107
107
 
108
108
  //#endregion
109
109
  export { cmdSetup };
110
- //# sourceMappingURL=setup-Bb0VJTJV.js.map
110
+ //# sourceMappingURL=setup-CZPOcZ77.js.map
@@ -244,7 +244,7 @@ Options:
244
244
  --port N HTTP port (default: ${DEFAULT_SHARE_PORT}, or the daemon's)\n --path /ay tailscale mount path (default: ${DEFAULT_TS_PATH})\n -y, --yes approve the shown commands without prompting\n --json print {mode, url} as JSON\n\nThe URL carries this host's serve token: whoever holds it can read and steer\nevery agent here. Rotate: rm ~/.agent-yes/.serve-token && ay serve install\n`;
245
245
  async function shareRuntimeOf(args) {
246
246
  const { daemonShareRuntime } = await import("./serveRust-BfWkeL6T.js");
247
- const { findAyrsBinary } = await import("./rustBinary-H4aw9Spj.js");
247
+ const { findAyrsBinary } = await import("./rustBinary-CPHKqwXS.js");
248
248
  return daemonShareRuntime(args ?? [], () => !!findAyrsBinary());
249
249
  }
250
250
  async function daemonShareLink(args) {
@@ -260,7 +260,7 @@ async function daemonShareLink(args) {
260
260
  async function foregroundAyrsShareLink() {
261
261
  const { readShareRoom, shareLinkFromRoomUrl } = await import("./share-_TPYAGWC.js");
262
262
  const { parseWebrtcLink } = await import("./webrtcLink-WxS1nTIs.js");
263
- const { isPidAlive } = await import("./subcommands-5Hfj3FRI.js");
263
+ const { isPidAlive } = await import("./subcommands-DABBFDHL.js");
264
264
  const { agentYesHome } = await import("./agentYesHome-CYNNNP71.js");
265
265
  const { readFile } = await import("fs/promises");
266
266
  const path = await import("path");
@@ -276,7 +276,7 @@ async function foregroundAyrsShareLink() {
276
276
  }
277
277
  }
278
278
  async function cmdShareStatus(mount) {
279
- const { inspectServeDaemon } = await import("./serve-DRUfCtkt.js");
279
+ const { inspectServeDaemon } = await import("./serve-DkwZLz0s.js");
280
280
  const [d, ts] = await Promise.all([inspectServeDaemon(), detectTailscale()]);
281
281
  const line = (k, v) => process.stdout.write(`${k.padEnd(11)}${v}\n`);
282
282
  if (d.args === null) {
@@ -323,7 +323,7 @@ async function cmdShare(rest) {
323
323
  process.stderr.write(`ay share: unknown mode '${mode}' — one of ${SHARE_MODES.join(", ")}\n`);
324
324
  return 1;
325
325
  }
326
- const { inspectServeDaemon, cmdServe } = await import("./serve-DRUfCtkt.js");
326
+ const { inspectServeDaemon, cmdServe } = await import("./serve-DkwZLz0s.js");
327
327
  const [daemon, ts] = await Promise.all([inspectServeDaemon(), detectTailscale()]);
328
328
  const lanIp = pickLanIp(networkInterfaces());
329
329
  if (!mode) {
@@ -448,4 +448,4 @@ async function cmdShare(rest) {
448
448
 
449
449
  //#endregion
450
450
  export { cmdShare, daemonShareLink, foregroundAyrsShareLink };
451
- //# sourceMappingURL=shareCmd-DBLlNKvE.js.map
451
+ //# sourceMappingURL=shareCmd-CaFVrCyX.js.map
@@ -4,7 +4,7 @@ import { c as updateGlobalPidStatus, o as readGlobalPids, r as getGlobalPidIndex
4
4
  import { t as PidStore } from "./pidStore-DUXifdBr.js";
5
5
  import { a as recordOutbox, i as recordMessage, n as readMailbox, o as senderLabel, t as partyMatches } from "./messageLog-Dq_ka-Bt.js";
6
6
  import { t as loadSharedCliDefaults } from "./configShared-De4bR5hH.js";
7
- import { n as localHost, r as localUser, t as formatIdentity } from "./identity-Ckav3-Up.js";
7
+ import { n as localHost, r as localUser, t as formatIdentity } from "./identity-puvd7hVQ.js";
8
8
  import { i as isWebrtcSpec } from "./webrtcLink-DcvacEci.js";
9
9
  import { l as readRemotes, u as resolveRemoteSpec } from "./remotes-BsMGvAay.js";
10
10
  import { n as hostedRoomMember, r as roomAliasPlaceholder } from "./roomReplyAlias-B-v76TA8.js";
@@ -786,11 +786,10 @@ function jsonRemote(snap, now) {
786
786
  * config someone must REMEMBER to re-add is a worse failure than a slow list.
787
787
  * So the entry stays, and we stop paying for it every time.
788
788
  *
789
- * WHY EXPONENTIAL AND NOT φ: the operator's φ-backoff rule (golden ratio, no
790
- * 2x) is a symval/symval convention — its AGENTS.md, its helpers. agent-yes is a
791
- * general tool in snomiao/ and that rule does not reach it. This repo already
792
- * has one backoff shape, `ts/autoRetry.ts` (base × 2ⁿ, capped, mirrored in
793
- * rs/src/context.rs), and one repo with two backoff shapes is its own defect.
789
+ * WHY EXPONENTIAL AND NOT φ: this CLI follows its repository-local retry rule,
790
+ * documented in AGENTS.md and helper code. It has one backoff shape,
791
+ * `ts/autoRetry.ts` (base × 2ⁿ, capped, mirrored in `rs/src/context.rs`);
792
+ * two backoff shapes in one repository would be a defect.
794
793
  * So this mirrors autoRetry deliberately rather than importing a foreign
795
794
  * convention or inventing a third.
796
795
  */
@@ -2042,7 +2041,7 @@ function isBareManagerInvocation(argv, managerCommands) {
2042
2041
  * The CLI ends with `process.exit()`, which DISCARDS bytes still sitting in the
2043
2042
  * pipe buffer. Writing to a file completes synchronously so this never showed
2044
2043
  * there, but any consumer that PIPES us silently lost everything past 64KiB.
2045
- * Measured on `ay ls --json` with a large fleet (symval CTO, 2026-08-05):
2044
+ * Measured on `ay ls --json` with a representative fleet (2026-08-05):
2046
2045
  *
2047
2046
  * ay ls --json > file 118055 bytes, valid JSON
2048
2047
  * ay ls --json | consumer 65536 bytes, cut mid-multibyte — will not parse
@@ -2071,7 +2070,7 @@ async function runSubcommand(argv) {
2071
2070
  switch (sub) {
2072
2071
  case "ls":
2073
2072
  case "list": return await cmdLs(rest);
2074
- case "ps": return await (await import("./cmdPs-DuLjljRT.js")).cmdPs(rest);
2073
+ case "ps": return await (await import("./cmdPs-CTsV34p6.js")).cmdPs(rest);
2075
2074
  case "status": return await cmdStatus(rest);
2076
2075
  case "whoami": return await cmdWhoami(rest);
2077
2076
  case "result": return await cmdResult(rest);
@@ -2099,7 +2098,7 @@ async function runSubcommand(argv) {
2099
2098
  case "note": return await cmdNote(rest);
2100
2099
  case "ask":
2101
2100
  case "answer": {
2102
- const { runAskSubcommand, runAnswerSubcommand } = await import("./askCli-Dtxxwl28.js");
2101
+ const { runAskSubcommand, runAnswerSubcommand } = await import("./askCli-D4czi-_j.js");
2103
2102
  const deps = {
2104
2103
  resolveAgent: (keyword) => resolveOne(keyword, {
2105
2104
  all: true,
@@ -2122,31 +2121,31 @@ async function runSubcommand(argv) {
2122
2121
  return cmdCh(rest);
2123
2122
  }
2124
2123
  case "term": {
2125
- const { cmdTerm } = await import("./terminal-Cjl0C7Ya.js");
2124
+ const { cmdTerm } = await import("./terminal-BmL1frIq.js");
2126
2125
  return cmdTerm(rest);
2127
2126
  }
2128
2127
  case "widget": {
2129
- const { cmdWidget } = await import("./widget-DEzS79sn.js");
2128
+ const { cmdWidget } = await import("./widget-J1iMwvNM.js");
2130
2129
  return cmdWidget(rest);
2131
2130
  }
2132
2131
  case "mint": {
2133
- const { cmdMint } = await import("./widget-DEzS79sn.js");
2132
+ const { cmdMint } = await import("./widget-J1iMwvNM.js");
2134
2133
  return cmdMint(rest);
2135
2134
  }
2136
2135
  case "serve": {
2137
- const { cmdServe } = await import("./serve-DRUfCtkt.js");
2136
+ const { cmdServe } = await import("./serve-DkwZLz0s.js");
2138
2137
  return cmdServe(rest);
2139
2138
  }
2140
2139
  case "tray": {
2141
- const { cmdTray } = await import("./trayApp-BWLgy2u_.js");
2140
+ const { cmdTray } = await import("./trayApp-lzLjlztu.js");
2142
2141
  return cmdTray(rest);
2143
2142
  }
2144
2143
  case "setup": {
2145
- const { cmdSetup } = await import("./setup-Bb0VJTJV.js");
2144
+ const { cmdSetup } = await import("./setup-CZPOcZ77.js");
2146
2145
  return cmdSetup(rest);
2147
2146
  }
2148
2147
  case "ws": {
2149
- const { cmdWs } = await import("./ws-BJQOtqWN.js");
2148
+ const { cmdWs } = await import("./ws-BVYuH1sE.js");
2150
2149
  return cmdWs(rest);
2151
2150
  }
2152
2151
  case "schedules":
@@ -2159,7 +2158,7 @@ async function runSubcommand(argv) {
2159
2158
  return cmdCron(rest);
2160
2159
  }
2161
2160
  case "schedule": {
2162
- const { cmdSchedule } = await import("./schedule-GTAtx9pc.js");
2161
+ const { cmdSchedule } = await import("./schedule-Cc5v2hHB.js");
2163
2162
  return cmdSchedule(rest);
2164
2163
  }
2165
2164
  case "remote": {
@@ -2167,7 +2166,7 @@ async function runSubcommand(argv) {
2167
2166
  return cmdRemote(rest);
2168
2167
  }
2169
2168
  case "share": {
2170
- const { cmdShare } = await import("./shareCmd-DBLlNKvE.js");
2169
+ const { cmdShare } = await import("./shareCmd-CaFVrCyX.js");
2171
2170
  return cmdShare(rest);
2172
2171
  }
2173
2172
  case "connect": {
@@ -2179,7 +2178,7 @@ async function runSubcommand(argv) {
2179
2178
  return cmdExpose(rest);
2180
2179
  }
2181
2180
  case "callback": {
2182
- const { cmdCallback } = await import("./callback-CSseYNlQ.js");
2181
+ const { cmdCallback } = await import("./callback-0mssVwk7.js");
2183
2182
  return cmdCallback(rest);
2184
2183
  }
2185
2184
  case "reap":
@@ -2190,7 +2189,7 @@ async function runSubcommand(argv) {
2190
2189
  return await cmdDsh(rest);
2191
2190
  }
2192
2191
  case "gc": {
2193
- const { gcOldBinaryDirs } = await import("./rustBinary-H4aw9Spj.js");
2192
+ const { gcOldBinaryDirs } = await import("./rustBinary-CPHKqwXS.js");
2194
2193
  const { gcLogs } = await import("./globalPidIndex-DmDCB_X7.js");
2195
2194
  const bins = gcOldBinaryDirs();
2196
2195
  const logs = await gcLogs();
@@ -6342,7 +6341,7 @@ async function cmdAttach(rest) {
6342
6341
  const winsizeDir = path.join(ayHome, "winsize");
6343
6342
  await mkdir(winsizeDir, { recursive: true });
6344
6343
  const winsizePath = path.join(winsizeDir, String(record.pid));
6345
- const { resolveDaemonHttpBase, loadTokenReadOnly } = await import("./serve-DRUfCtkt.js");
6344
+ const { resolveDaemonHttpBase, loadTokenReadOnly } = await import("./serve-DkwZLz0s.js");
6346
6345
  const daemonBase = await resolveDaemonHttpBase().catch(() => null);
6347
6346
  const daemonToken = daemonBase ? await loadTokenReadOnly().catch(() => null) ?? "" : "";
6348
6347
  const capViewer = `attach:${process.pid}`;
@@ -7091,7 +7090,7 @@ async function cmdNotify(rest) {
7091
7090
  }
7092
7091
  const ensure = async () => {
7093
7092
  if (!argv["ensure-daemon"]) return;
7094
- const { ensureDaemon } = await import("./notifyDaemon-Du7zud2V.js");
7093
+ const { ensureDaemon } = await import("./notifyDaemon-CoPXYE9P.js");
7095
7094
  await ensureDaemon().catch(() => null);
7096
7095
  };
7097
7096
  await heartbeatWatcher(parent, selfStartedAt);
@@ -7165,7 +7164,7 @@ async function cmdNotifyCursor(args) {
7165
7164
  }
7166
7165
  async function cmdNotifyd(rest) {
7167
7166
  const sub = rest[0] ?? "status";
7168
- const daemon = await import("./notifyDaemon-Du7zud2V.js");
7167
+ const daemon = await import("./notifyDaemon-CoPXYE9P.js");
7169
7168
  switch (sub) {
7170
7169
  case "run": return daemon.runDaemon();
7171
7170
  case "once": return daemon.runDaemon({ once: true });
@@ -7192,4 +7191,4 @@ async function cmdNotifyd(rest) {
7192
7191
 
7193
7192
  //#endregion
7194
7193
  export { readNotes as $, inspectSubmission as A, isUnknownManagerToken as B, envelopeAttribution as C, withIpcLock as Ct, extractNeedsInput as D, buildAgentForest as Dt, extractMenu as E, TYPING_BADGE as Et, isExitRequest as F, listRecords as G, isUserTyping as H, isPidAlive as I, ownedCollapsedPaste as J, matchKeyword as K, isSlashCommand as L, isAgentIdShaped as M, isAgentStuck as N, extractTaskCounts as O, flattenForest as Ot, isBareManagerInvocation as P, readLogForRender as Q, isSubcommand as R, enableRenderDiskCache as S, resolveWorkDir as St, extractBadges as T, shouldFramePaste as Tt, lastReadAt as U, isUnreachableWriteErrno as V, lastStdinAt as W, readAgentPtysize as X, probeStdinReachable as Y, readComposerState as Z, cursorAbs as _, submitStableDraft as _t, READ_PAGE_DEFAULT as a, renderRawLogLines as at, deriveLiveStatus as b, writeKeysPaced as bt, SEND_EXIT_QUEUED as c, resolveResumeArgs as ct, backoffWhileTyping as d, saveRenderDisk as dt, readPtysize as et, buildEnvelope as f, sendPayloadCapError as ft, controlCodeFromName as g, submitAndConfirm as gt, confirmStdinUnreachable as h, stopTipForCli as ht, MAX_RENDER_BYTES as i, renderRawLog as it, interruptSendTarget as j, finalizedLines as k, SEND_EXIT_UNREACHABLE as l, restartHintLines as lt, cmdHelp as m, stdinActivityPath as mt, DRAFT_STABLE_WAITS_MS as n, recentReadEdges as nt, READ_WINDOW_MS as o, resolveOne as ot, cliDefaults as p, snapshotStatus as pt, menuSelectKeys as q, GRACEFUL_EXIT_COMMANDS as r, renderLogTailLines as rt, SEND_BODY_MAX_CHARS as s, resolveReadWindow as st, COMPOSER_WINDOWS as t, recentMessageEdges as tt, TYPING_WINDOW_MS as u, runSubcommand as ut, cwdLabel as v, suggestAgents as vt, envelopeCostFor as w, framePaste as wt, drainerLauncher as x, writeToIpc as xt, deriveLiveState as y, waitForLogQuiet as yt, isSubmitCode as z };
7195
- //# sourceMappingURL=subcommands-BEaUJBT2.js.map
7194
+ //# sourceMappingURL=subcommands-CE5QJHvX.js.map
@@ -5,7 +5,7 @@ import "./pidStore-DUXifdBr.js";
5
5
  import "./messageLog-Dq_ka-Bt.js";
6
6
  import "./e2e-BdLf8DvY.js";
7
7
  import "./configShared-De4bR5hH.js";
8
- import { $ as readNotes, A as inspectSubmission, B as isUnknownManagerToken, C as envelopeAttribution, D as extractNeedsInput, E as extractMenu, F as isExitRequest, G as listRecords, H as isUserTyping, I as isPidAlive, J as ownedCollapsedPaste, K as matchKeyword, L as isSlashCommand, M as isAgentIdShaped, N as isAgentStuck, O as extractTaskCounts, P as isBareManagerInvocation, Q as readLogForRender, R as isSubcommand, S as enableRenderDiskCache, T as extractBadges, U as lastReadAt, V as isUnreachableWriteErrno, W as lastStdinAt, X as readAgentPtysize, Y as probeStdinReachable, Z as readComposerState, _ as cursorAbs, _t as submitStableDraft, a as READ_PAGE_DEFAULT, at as renderRawLogLines, b as deriveLiveStatus, bt as writeKeysPaced, c as SEND_EXIT_QUEUED, ct as resolveResumeArgs, d as backoffWhileTyping, dt as saveRenderDisk, et as readPtysize, f as buildEnvelope, ft as sendPayloadCapError, g as controlCodeFromName, gt as submitAndConfirm, h as confirmStdinUnreachable, ht as stopTipForCli, i as MAX_RENDER_BYTES, it as renderRawLog, j as interruptSendTarget, k as finalizedLines, l as SEND_EXIT_UNREACHABLE, lt as restartHintLines, m as cmdHelp, mt as stdinActivityPath, n as DRAFT_STABLE_WAITS_MS, nt as recentReadEdges, o as READ_WINDOW_MS, ot as resolveOne, p as cliDefaults, pt as snapshotStatus, q as menuSelectKeys, r as GRACEFUL_EXIT_COMMANDS, rt as renderLogTailLines, s as SEND_BODY_MAX_CHARS, st as resolveReadWindow, t as COMPOSER_WINDOWS, tt as recentMessageEdges, u as TYPING_WINDOW_MS, ut as runSubcommand, v as cwdLabel, vt as suggestAgents, w as envelopeCostFor, x as drainerLauncher, xt as writeToIpc, y as deriveLiveState, yt as waitForLogQuiet, z as isSubmitCode } from "./subcommands-BEaUJBT2.js";
8
+ import { $ as readNotes, A as inspectSubmission, B as isUnknownManagerToken, C as envelopeAttribution, D as extractNeedsInput, E as extractMenu, F as isExitRequest, G as listRecords, H as isUserTyping, I as isPidAlive, J as ownedCollapsedPaste, K as matchKeyword, L as isSlashCommand, M as isAgentIdShaped, N as isAgentStuck, O as extractTaskCounts, P as isBareManagerInvocation, Q as readLogForRender, R as isSubcommand, S as enableRenderDiskCache, T as extractBadges, U as lastReadAt, V as isUnreachableWriteErrno, W as lastStdinAt, X as readAgentPtysize, Y as probeStdinReachable, Z as readComposerState, _ as cursorAbs, _t as submitStableDraft, a as READ_PAGE_DEFAULT, at as renderRawLogLines, b as deriveLiveStatus, bt as writeKeysPaced, c as SEND_EXIT_QUEUED, ct as resolveResumeArgs, d as backoffWhileTyping, dt as saveRenderDisk, et as readPtysize, f as buildEnvelope, ft as sendPayloadCapError, g as controlCodeFromName, gt as submitAndConfirm, h as confirmStdinUnreachable, ht as stopTipForCli, i as MAX_RENDER_BYTES, it as renderRawLog, j as interruptSendTarget, k as finalizedLines, l as SEND_EXIT_UNREACHABLE, lt as restartHintLines, m as cmdHelp, mt as stdinActivityPath, n as DRAFT_STABLE_WAITS_MS, nt as recentReadEdges, o as READ_WINDOW_MS, ot as resolveOne, p as cliDefaults, pt as snapshotStatus, q as menuSelectKeys, r as GRACEFUL_EXIT_COMMANDS, rt as renderLogTailLines, s as SEND_BODY_MAX_CHARS, st as resolveReadWindow, t as COMPOSER_WINDOWS, tt as recentMessageEdges, u as TYPING_WINDOW_MS, ut as runSubcommand, v as cwdLabel, vt as suggestAgents, w as envelopeCostFor, x as drainerLauncher, xt as writeToIpc, y as deriveLiveState, yt as waitForLogQuiet, z as isSubmitCode } from "./subcommands-CE5QJHvX.js";
9
9
  import "./webrtcLink-DcvacEci.js";
10
10
  import "./remotes-BsMGvAay.js";
11
11
  import "./roomReplyAlias-B-v76TA8.js";
@@ -98,7 +98,7 @@ async function cmdTermMint(args) {
98
98
  if (flags.ro && flags.interactive) throw new Error("--ro and --interactive are mutually exclusive");
99
99
  const ttlSec = parseTtlSec(typeof flags.ttl === "string" ? flags.ttl : "15m");
100
100
  const canSend = flags.interactive === true;
101
- const { mintScopedTermToken } = await import("./serve-DRUfCtkt.js");
101
+ const { mintScopedTermToken } = await import("./serve-DkwZLz0s.js");
102
102
  const r = await mintScopedTermToken(pid, {
103
103
  ttlSec,
104
104
  canSend
@@ -135,4 +135,4 @@ async function cmdTerm(args) {
135
135
 
136
136
  //#endregion
137
137
  export { cmdTerm };
138
- //# sourceMappingURL=terminal-Cjl0C7Ya.js.map
138
+ //# sourceMappingURL=terminal-BmL1frIq.js.map
@@ -1,4 +1,4 @@
1
- import { l as findTrayLauncher } from "./rustBinary-DcMdwutV.js";
1
+ import { u as findTrayLauncher } from "./rustBinary-DzcwVevc.js";
2
2
  import { t as agentYesHome } from "./agentYesHome-JmJC28YX.js";
3
3
  import { existsSync } from "node:fs";
4
4
  import path from "node:path";
@@ -97,4 +97,4 @@ async function cmdTray(args) {
97
97
 
98
98
  //#endregion
99
99
  export { trayHiddenMarker as a, launchTray as i, hasDesktop as n, isTrayHidden as r, cmdTray as t };
100
- //# sourceMappingURL=trayApp-C9bZt7ff.js.map
100
+ //# sourceMappingURL=trayApp-BVTKPDB5.js.map
@@ -0,0 +1,5 @@
1
+ import "./versionChecker-Ccww1lqR.js";
2
+ import "./rustBinary-DzcwVevc.js";
3
+ import { a as trayHiddenMarker, i as launchTray, n as hasDesktop, r as isTrayHidden, t as cmdTray } from "./trayApp-BVTKPDB5.js";
4
+
5
+ export { cmdTray };
@@ -1,6 +1,6 @@
1
1
  import { n as __esmMin, r as __exportAll } from "./chunk-cZBX9HZv.js";
2
2
  import { n as logger, t as addTransport } from "./logger-CDIsZ-Pp.js";
3
- import { i as getInstalledPackage } from "./versionChecker-D2r5fiHj.js";
3
+ import { i as getInstalledPackage } from "./versionChecker-Ccww1lqR.js";
4
4
  import { t as agentYesHome } from "./agentYesHome-JmJC28YX.js";
5
5
  import { u as removeControlCharacters } from "./todoAutomation-CKlrxuZv.js";
6
6
  import { i as shouldUseLock, r as releaseLock, t as acquireLock } from "./runningLock-DMznYh45.js";
@@ -1676,7 +1676,7 @@ async function agentYes({ cli, cliArgs = [], skipPermissions = false, prompt, ro
1676
1676
  const spawner = await resolveSpawner(inheritedParentPid);
1677
1677
  if (spawner) {
1678
1678
  const { buildInitMsg } = await import("./initMsg-GPU52N-j.js");
1679
- const { formatIdentity } = await import("./identity-C0MxfwI2.js");
1679
+ const { formatIdentity } = await import("./identity-D3hr59eC.js");
1680
1680
  const identity = formatIdentity({
1681
1681
  cwd: spawner.cwd,
1682
1682
  pid: spawner.pid
@@ -2155,7 +2155,7 @@ async function agentYes({ cli, cliArgs = [], skipPermissions = false, prompt, ro
2155
2155
  }, 100);
2156
2156
  const cleanupHeartbeat = () => clearInterval(heartbeatInterval);
2157
2157
  shell.onExit(cleanupHeartbeat);
2158
- const { startParentPingLoop } = await import("./parentPingLoop-DevcqVfR.js");
2158
+ const { startParentPingLoop } = await import("./parentPingLoop-DV_QBhM6.js");
2159
2159
  const parentPingLoop = startParentPingLoop({
2160
2160
  parentPid,
2161
2161
  selfWrapperPid: process.pid,
@@ -2418,4 +2418,4 @@ function sleep(ms) {
2418
2418
 
2419
2419
  //#endregion
2420
2420
  export { hasTodoStore as a, permissionBadge as c, answerAsk as i, AgentContext as l, agentYes as n, listAsks as o, config as r, listAsksForProject as s, CLIS_CONFIG as t, CLAUDE_SESSION_PIN_ENV as u };
2421
- //# sourceMappingURL=ts-HJEVAXyh.js.map
2421
+ //# sourceMappingURL=ts-DJ6zhsLK.js.map
@@ -7,7 +7,7 @@ import { fileURLToPath } from "url";
7
7
 
8
8
  //#region package.json
9
9
  var name = "agent-yes";
10
- var version = "1.305.0";
10
+ var version = "1.306.1-beta.816.1";
11
11
 
12
12
  //#endregion
13
13
  //#region ts/versionChecker.ts
@@ -285,4 +285,4 @@ async function displayVersion() {
285
285
 
286
286
  //#endregion
287
287
  export { versionString as a, getInstalledPackage as i, compareVersions as n, displayVersion as r, checkAndAutoUpdate as t };
288
- //# sourceMappingURL=versionChecker-D2r5fiHj.js.map
288
+ //# sourceMappingURL=versionChecker-Ccww1lqR.js.map
@@ -28,7 +28,7 @@ function parseFlags(args, known) {
28
28
  }
29
29
  /** Resolve the local daemon base URL + token (flags override discovery). */
30
30
  async function daemonTarget(flags) {
31
- const { resolveDaemonHttpBase, loadTokenReadOnly } = await import("./serve-DRUfCtkt.js");
31
+ const { resolveDaemonHttpBase, loadTokenReadOnly } = await import("./serve-DkwZLz0s.js");
32
32
  const base = typeof flags.base === "string" ? flags.base : await resolveDaemonHttpBase();
33
33
  if (!base) throw new Error("no running ay serve daemon found — start `ay serve` or pass --base <url> (e.g. http://127.0.0.1:PORT)");
34
34
  const token = typeof flags.token === "string" ? flags.token : await loadTokenReadOnly() ?? "";
@@ -186,7 +186,7 @@ async function cmdMint(args) {
186
186
  const bad = caps.filter((c) => !KNOWN_CAPS.has(c));
187
187
  if (bad.length) throw new Error(`unknown cap(s): ${bad.join(", ")} (valid: ${[...KNOWN_CAPS].join(", ")})`);
188
188
  const ttlSec = parseTtlSec(typeof flags.ttl === "string" ? flags.ttl : "15m");
189
- const { mintScopedTermToken } = await import("./serve-DRUfCtkt.js");
189
+ const { mintScopedTermToken } = await import("./serve-DkwZLz0s.js");
190
190
  const r = await mintScopedTermToken(target, {
191
191
  ttlSec,
192
192
  caps
@@ -202,4 +202,4 @@ async function cmdMint(args) {
202
202
 
203
203
  //#endregion
204
204
  export { cmdMint, cmdWidget };
205
- //# sourceMappingURL=widget-DEzS79sn.js.map
205
+ //# sourceMappingURL=widget-J1iMwvNM.js.map
@@ -5,12 +5,12 @@ import "./pidStore-DUXifdBr.js";
5
5
  import "./messageLog-Dq_ka-Bt.js";
6
6
  import "./e2e-BdLf8DvY.js";
7
7
  import "./configShared-De4bR5hH.js";
8
- import "./subcommands-BEaUJBT2.js";
8
+ import "./subcommands-CE5QJHvX.js";
9
9
  import "./webrtcLink-DcvacEci.js";
10
10
  import "./remotes-BsMGvAay.js";
11
11
  import "./roomReplyAlias-B-v76TA8.js";
12
12
  import "./notifyStore-DIfkfKB2.js";
13
13
  import "./senderAncestry-CVHeKk1Y.js";
14
- import { a as isPathInside, c as walkWorkspaces, i as importProvisionModule, l as workspaceStatus, n as cmdWs, o as loadProvision, r as collectWorkspaces, s as resolveOperand, t as WS_JSON_SCHEMA } from "./ws-PYHbe3A1.js";
14
+ import { a as isPathInside, c as walkWorkspaces, i as importProvisionModule, l as workspaceStatus, n as cmdWs, o as loadProvision, r as collectWorkspaces, s as resolveOperand, t as WS_JSON_SCHEMA } from "./ws-C7EUYis6.js";
15
15
 
16
16
  export { WS_JSON_SCHEMA, cmdWs, collectWorkspaces, isPathInside, loadProvision, walkWorkspaces, workspaceStatus };
@@ -1,4 +1,4 @@
1
- import { G as listRecords } from "./subcommands-BEaUJBT2.js";
1
+ import { G as listRecords } from "./subcommands-CE5QJHvX.js";
2
2
  import { a as getProvisionRoot } from "./workspaceConfig-DBgsu81B.js";
3
3
  import { existsSync } from "fs";
4
4
  import { lstat, opendir } from "fs/promises";
@@ -424,4 +424,4 @@ async function cmdWs(args) {
424
424
 
425
425
  //#endregion
426
426
  export { isPathInside as a, walkWorkspaces as c, importProvisionModule as i, workspaceStatus as l, cmdWs as n, loadProvision as o, collectWorkspaces as r, resolveOperand as s, WS_JSON_SCHEMA as t };
427
- //# sourceMappingURL=ws-PYHbe3A1.js.map
427
+ //# sourceMappingURL=ws-C7EUYis6.js.map
package/lab/ui/index.html CHANGED
@@ -7,6 +7,8 @@
7
7
  content="width=device-width, initial-scale=1, viewport-fit=cover, interactive-widget=resizes-content"
8
8
  />
9
9
  <title>agent-yes · console</title>
10
+ <link rel="stylesheet" href="/auth/profile.css" />
11
+ <script type="module" src="/auth/profile.js"></script>
10
12
  <!-- PWA: installable console under /w/ (manifest scope is /w/). The service
11
13
  worker is network-first so it never serves a stale wire protocol — the
12
14
  cache is only an offline-launch fallback. -->
@@ -2229,6 +2231,7 @@
2229
2231
  <span id="count" class="count"></span>
2230
2232
  </span>
2231
2233
  <span class="metaright">
2234
+ <span data-ay-account></span>
2232
2235
  <span class="viewmenu">
2233
2236
  <button
2234
2237
  id="viewmenubtn"
@@ -14,6 +14,8 @@
14
14
  })();
15
15
  </script>
16
16
  <title>agent-yes — drive any AI coding CLI on autopilot</title>
17
+ <link rel="stylesheet" href="/auth/profile.css" />
18
+ <script type="module" src="/auth/profile.js"></script>
17
19
  <meta
18
20
  name="description"
19
21
  content="agent-yes wraps Claude, Codex, Copilot and more, auto-answering their prompts so they run unattended — and ay serve streams a live, end-to-end-encrypted console to your browser."
@@ -275,6 +277,7 @@
275
277
  <a href="/architecture.html">Architecture</a>
276
278
  <a href="https://lab.agent-yes.com/">Lab</a>
277
279
  <a href="https://github.com/snomiao/agent-yes">GitHub</a>
280
+ <span data-ay-account style="margin-left: 18px"></span>
278
281
  </nav>
279
282
  </header>
280
283
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-yes",
3
- "version": "1.305.0",
3
+ "version": "1.306.1-beta.816.1",
4
4
  "description": "A wrapper tool that automates interactions with various AI CLI tools by automatically handling common prompts and responses.",
5
5
  "keywords": [
6
6
  "ai",
@@ -194,12 +194,14 @@
194
194
  "test:coverage": "vitest run --coverage",
195
195
  "test:ui": "vitest run --config tests/ui-test/vitest.config.ts",
196
196
  "test:ui-dom": "vitest run --config tests/ui-dom/vitest.config.ts",
197
+ "test:auth": "bun test tests/auth/backend.bun.spec.ts",
197
198
  "test:theme": "node tests/ui-test/theme.e2e.mjs"
198
199
  },
199
200
  "dependencies": {
200
201
  "@snomiao/bun-pty": "^0.3.4",
201
202
  "@snomiao/ws-provision": "^0.1.0",
202
203
  "@xterm/headless": "^6.0.0",
204
+ "better-auth": "1.7.25",
203
205
  "bun-pty": "^0.4.8",
204
206
  "execa": "^9.6.1",
205
207
  "from-node-stream": "^0.2.0",
package/ts/identity.ts CHANGED
@@ -2,11 +2,11 @@
2
2
  * The standardized agent identity string:
3
3
  *
4
4
  * <username>@<hostname>:<path>:<branch>#<pid>
5
- * e.g. sno@Mac:~/ws/symval/symval/tree/crm:main#30402
5
+ * Example: alice@host:~/work/org/repo:main#1111
6
6
  *
7
7
  * One line answers "who is this agent" across every surface that names one —
8
8
  * the `ay send` envelope header, `ay whoami`, logs. The branch segment usually
9
- * carries the lane name for free (worktree checkouts like `crm-yamamoto-wifi`
9
+ * carries the lane name for free (worktree checkouts like `feature/example`
10
10
  * or `fix/t173-tone-core` name their purpose), which is why there is no
11
11
  * separate role concept.
12
12
  *
@@ -16,11 +16,10 @@ import path from "path";
16
16
  * config someone must REMEMBER to re-add is a worse failure than a slow list.
17
17
  * So the entry stays, and we stop paying for it every time.
18
18
  *
19
- * WHY EXPONENTIAL AND NOT φ: the operator's φ-backoff rule (golden ratio, no
20
- * 2x) is a symval/symval convention — its AGENTS.md, its helpers. agent-yes is a
21
- * general tool in snomiao/ and that rule does not reach it. This repo already
22
- * has one backoff shape, `ts/autoRetry.ts` (base × 2ⁿ, capped, mirrored in
23
- * rs/src/context.rs), and one repo with two backoff shapes is its own defect.
19
+ * WHY EXPONENTIAL AND NOT φ: this CLI follows its repository-local retry rule,
20
+ * documented in AGENTS.md and helper code. It has one backoff shape,
21
+ * `ts/autoRetry.ts` (base × 2ⁿ, capped, mirrored in `rs/src/context.rs`);
22
+ * two backoff shapes in one repository would be a defect.
24
23
  * So this mirrors autoRetry deliberately rather than importing a foreign
25
24
  * convention or inventing a third.
26
25
  */
@@ -2,7 +2,12 @@ import { afterAll, beforeAll, describe, expect, it } from "bun:test";
2
2
  import { existsSync, mkdirSync, mkdtempSync, rmSync, statSync, writeFileSync } from "node:fs";
3
3
  import os from "node:os";
4
4
  import path from "node:path";
5
- import { chmodExtractedBinaries, ensureExecutable, gcOldBinaryDirs } from "./rustBinary.ts";
5
+ import {
6
+ chmodExtractedBinaries,
7
+ ensureExecutable,
8
+ extractZipWindows,
9
+ gcOldBinaryDirs,
10
+ } from "./rustBinary.ts";
6
11
  import { _setInstalledPackageForTesting } from "./versionChecker.ts";
7
12
 
8
13
  // Startup GC for the versioned binary download cache (PERFORMANCE-EVENT
@@ -116,3 +121,60 @@ describe("ensureExecutable", () => {
116
121
  }
117
122
  });
118
123
  });
124
+
125
+ // Windows release bundles are .zip. Run from a PowerShell 7 session, the
126
+ // inherited PSModulePath made powershell.exe 5.1 load PS7's Archive module,
127
+ // whose Expand-Archive threw and extracted nothing while exiting 0 — so the
128
+ // download "succeeded" and the spawn then died with "Rust binary not found".
129
+ describe.skipIf(process.platform !== "win32")("extractZipWindows", () => {
130
+ const sysRoot = process.env.SystemRoot || String.raw`C:\Windows`;
131
+ const tarExe = path.join(sysRoot, "System32", "tar.exe");
132
+
133
+ function makeZip(dir: string): string {
134
+ const src = path.join(dir, "src");
135
+ mkdirSync(src, { recursive: true });
136
+ writeFileSync(path.join(src, "agent-yes-win32-x64.exe"), "bin");
137
+ writeFileSync(path.join(src, "ayrs.exe"), "ayrs");
138
+ const zip = path.join(dir, "bundle.zip");
139
+ const r = Bun.spawnSync([tarExe, "-a", "-cf", zip, "-C", src, "."]);
140
+ expect(r.exitCode).toBe(0);
141
+ return zip;
142
+ }
143
+
144
+ const poisonedModulePath = [
145
+ String.raw`C:\Program Files\PowerShell\7\Modules`,
146
+ String.raw`C:\Windows\system32\WindowsPowerShell\v1.0\Modules`,
147
+ ].join(";");
148
+
149
+ for (const via of ["tar", "Expand-Archive fallback"] as const) {
150
+ it(`extracts every file via ${via} despite a PS7 PSModulePath`, async () => {
151
+ const dir = mkdtempSync(path.join(os.tmpdir(), "ay-zip-"));
152
+ const prev = process.env.PSModulePath;
153
+ try {
154
+ const zip = makeZip(dir);
155
+ const out = path.join(dir, "out");
156
+ mkdirSync(out);
157
+ process.env.PSModulePath = poisonedModulePath;
158
+ // A tar.exe that doesn't exist forces the Expand-Archive fallback.
159
+ await extractZipWindows(zip, out, via === "tar" ? undefined : path.join(dir, "no-tar.exe"));
160
+ expect(existsSync(path.join(out, "agent-yes-win32-x64.exe"))).toBe(true);
161
+ expect(existsSync(path.join(out, "ayrs.exe"))).toBe(true);
162
+ } finally {
163
+ if (prev === undefined) delete process.env.PSModulePath;
164
+ else process.env.PSModulePath = prev;
165
+ rmSync(dir, { recursive: true, force: true });
166
+ }
167
+ });
168
+ }
169
+
170
+ it("throws instead of returning silently on a corrupt zip", async () => {
171
+ const dir = mkdtempSync(path.join(os.tmpdir(), "ay-zip-"));
172
+ try {
173
+ const zip = path.join(dir, "bad.zip");
174
+ writeFileSync(zip, "not a zip");
175
+ await expect(extractZipWindows(zip, dir)).rejects.toThrow(/Failed to extract/);
176
+ } finally {
177
+ rmSync(dir, { recursive: true, force: true });
178
+ }
179
+ });
180
+ });
package/ts/rustBinary.ts CHANGED
@@ -327,6 +327,61 @@ export function getDownloadUrl(version = "latest"): string {
327
327
  return `https://github.com/snomiao/agent-yes/releases/download/v${version}/${binaryName}${ext}`;
328
328
  }
329
329
 
330
+ /**
331
+ * Extract a release .zip on Windows.
332
+ *
333
+ * Prefers the bsdtar that ships in System32 (Windows 10 1803+), which reads
334
+ * zips natively. Falls back to Windows PowerShell's Expand-Archive with
335
+ * PSModulePath cleared: when `ay` runs from a PowerShell 7 session the
336
+ * inherited PSModulePath makes powershell.exe 5.1 load PS7's Archive module,
337
+ * whose Expand-Archive throws "ExtractToDirectory ... argument count 3" and
338
+ * extracts nothing (while still exiting 0).
339
+ */
340
+ export async function extractZipWindows(
341
+ zipPath: string,
342
+ destDir: string,
343
+ // Overridable so tests can exercise the Expand-Archive fallback.
344
+ tarExe = path.join(
345
+ process.env.SystemRoot || process.env.windir || "C:\\Windows",
346
+ "System32",
347
+ "tar.exe",
348
+ ),
349
+ ): Promise<void> {
350
+ const run = async (cmd: string[], env?: Record<string, string | undefined>) => {
351
+ const proc = Bun.spawn(cmd, { cwd: destDir, env, stdio: ["ignore", "pipe", "pipe"] });
352
+ const [code, stderr] = await Promise.all([proc.exited, new Response(proc.stderr).text()]);
353
+ return { code, stderr: stderr.trim() };
354
+ };
355
+ const errors: string[] = [];
356
+
357
+ if (existsSync(tarExe)) {
358
+ try {
359
+ const r = await run([tarExe, "-xf", zipPath, "-C", destDir]);
360
+ if (r.code === 0) return;
361
+ errors.push(`tar exited ${r.code}: ${r.stderr}`);
362
+ } catch (err) {
363
+ errors.push(`tar: ${err instanceof Error ? err.message : String(err)}`);
364
+ }
365
+ }
366
+
367
+ const env: Record<string, string | undefined> = { ...process.env };
368
+ for (const k of Object.keys(env)) if (k.toLowerCase() === "psmodulepath") delete env[k];
369
+ const quote = (p: string) => `'${p.replace(/'/g, "''")}'`;
370
+ const r = await run(
371
+ [
372
+ "powershell",
373
+ "-NoProfile",
374
+ "-NonInteractive",
375
+ "-Command",
376
+ `$ErrorActionPreference='Stop'; Expand-Archive -LiteralPath ${quote(zipPath)} -DestinationPath ${quote(destDir)} -Force`,
377
+ ],
378
+ env,
379
+ );
380
+ if (r.code === 0) return;
381
+ errors.push(`Expand-Archive exited ${r.code}: ${r.stderr}`);
382
+ throw new Error(`Failed to extract ${zipPath}:\n${errors.join("\n")}`);
383
+ }
384
+
330
385
  /**
331
386
  * Download and extract the binary
332
387
  */
@@ -360,16 +415,7 @@ export async function downloadBinary(verbose = false): Promise<string> {
360
415
  const tempZipPath = path.join(binDir, "temp.zip");
361
416
  await Bun.write(tempZipPath, await response.arrayBuffer());
362
417
 
363
- // Use PowerShell to extract zip
364
- const proc = Bun.spawn(
365
- [
366
- "powershell",
367
- "-Command",
368
- `Expand-Archive -Path '${tempZipPath}' -DestinationPath '${binDir}' -Force`,
369
- ],
370
- { cwd: binDir, stdio: ["ignore", "pipe", "pipe"] },
371
- );
372
- await proc.exited;
418
+ await extractZipWindows(tempZipPath, binDir);
373
419
 
374
420
  // Clean up
375
421
  try {
@@ -413,6 +459,13 @@ export async function downloadBinary(verbose = false): Promise<string> {
413
459
  await chmod(binaryPath, 0o755);
414
460
  }
415
461
 
462
+ // Every extractor above can fail quietly (non-zero exit, error only on
463
+ // stderr). Never hand back a path that isn't there — the caller would spawn
464
+ // it and die with a misleading "Rust binary not found".
465
+ if (!existsSync(binaryPath)) {
466
+ throw new Error(`Downloaded ${url} but ${binaryPath} is missing after extraction`);
467
+ }
468
+
416
469
  if (verbose) {
417
470
  console.log(`[rust] Binary downloaded to: ${binaryPath}`);
418
471
  }
package/ts/subcommands.ts CHANGED
@@ -1031,7 +1031,7 @@ export function isBareManagerInvocation(argv: string[], managerCommands: boolean
1031
1031
  * The CLI ends with `process.exit()`, which DISCARDS bytes still sitting in the
1032
1032
  * pipe buffer. Writing to a file completes synchronously so this never showed
1033
1033
  * there, but any consumer that PIPES us silently lost everything past 64KiB.
1034
- * Measured on `ay ls --json` with a large fleet (symval CTO, 2026-08-05):
1034
+ * Measured on `ay ls --json` with a representative fleet (2026-08-05):
1035
1035
  *
1036
1036
  * ay ls --json > file 118055 bytes, valid JSON
1037
1037
  * ay ls --json | consumer 65536 bytes, cut mid-multibyte — will not parse
@@ -1,4 +0,0 @@
1
- import "./versionChecker-D2r5fiHj.js";
2
- import { a as ensureExecutable, c as findSpawnHiddenLauncher, d as getBinDir, f as getBinaryName, h as hasValidMacSignature, i as ensureAyrsBinary, l as findTrayLauncher, m as getRustBinary, n as devBuildInfo, o as findAyrsBinary, p as getDownloadUrl, r as downloadBinary, s as findRustBinary, t as chmodExtractedBinaries, u as gcOldBinaryDirs } from "./rustBinary-DcMdwutV.js";
3
-
4
- export { ensureAyrsBinary, findAyrsBinary, gcOldBinaryDirs };
@@ -1,5 +0,0 @@
1
- import "./versionChecker-D2r5fiHj.js";
2
- import "./rustBinary-DcMdwutV.js";
3
- import { a as trayHiddenMarker, i as launchTray, n as hasDesktop, r as isTrayHidden, t as cmdTray } from "./trayApp-C9bZt7ff.js";
4
-
5
- export { cmdTray };