agent-yes 1.257.0 → 1.258.0-beta.615.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 (35) hide show
  1. package/dist/{SUPPORTED_CLIS-BPPX9iGs.js → SUPPORTED_CLIS-BcF2EBxN.js} +2 -2
  2. package/dist/{SUPPORTED_CLIS-BNRnFFc2.js → SUPPORTED_CLIS-pefvIQrJ.js} +3 -3
  3. package/dist/{agentShare-aCSONMZp.js → agentShare-oOnj-v8A.js} +2 -2
  4. package/dist/{callback-CpGhgUwm.js → callback-BketOHRL.js} +3 -3
  5. package/dist/{callback-CzYsRWjX.js → callback-BqUp2zps.js} +2 -2
  6. package/dist/cli.js +5 -5
  7. package/dist/index.js +2 -2
  8. package/dist/{notifyDaemon-Cvnvfqw8.js → notifyDaemon-DJX5vJlf.js} +2 -2
  9. package/dist/{rustBinary-DWzZGM4A.js → rustBinary-uKF0M80f.js} +2 -2
  10. package/dist/{schedule-ChwwFCgQ.js → schedule-CmWMvKjk.js} +4 -4
  11. package/dist/{serve-DQPkrKcN.js → serve-Bi-rK4OP.js} +16 -16
  12. package/dist/{setup-uZqYF0KT.js → setup-DRV5DTmr.js} +2 -2
  13. package/dist/subcommands-Ck2PM8sv.js +10 -0
  14. package/dist/{subcommands-B04Jcb4a.js → subcommands-DD97DaSn.js} +69 -26
  15. package/dist/{terminal-sCD-7D_2.js → terminal-CMbUP_g2.js} +2 -2
  16. package/dist/{trayApp-CCN3zyo7.js → trayApp-B6bLQTFw.js} +2 -2
  17. package/dist/trayApp-BswEKIoK.js +5 -0
  18. package/dist/{ts-Ct3yd-1m.js → ts--fmzLwj7.js} +29 -4
  19. package/dist/{versionChecker-bcw3nJay.js → versionChecker-2v7LcqTp.js} +2 -2
  20. package/dist/{widget-B7NK6egy.js → widget-CJn9iNA7.js} +3 -3
  21. package/dist/{ws-BkOJQeeZ.js → ws-B3tYpYTK.js} +2 -2
  22. package/dist/{ws-BlISbGY8.js → ws-C-4UthLV.js} +2 -2
  23. package/lab/ui/console-logic.js +6 -3
  24. package/lab/ui/index.html +39 -62
  25. package/package.json +1 -1
  26. package/ts/index.ts +42 -2
  27. package/ts/needsInput.spec.ts +38 -0
  28. package/ts/needsInput.ts +7 -3
  29. package/ts/serve.ts +2 -1
  30. package/ts/subcommands.spec.ts +26 -0
  31. package/ts/subcommands.ts +63 -6
  32. package/ts/todoParse.spec.ts +30 -0
  33. package/ts/todoParse.ts +19 -5
  34. package/dist/subcommands-dNgWfaKE.js +0 -10
  35. package/dist/trayApp-HLGzyGrP.js +0 -5
@@ -1,8 +1,8 @@
1
- import { t as CLIS_CONFIG } from "./ts-Ct3yd-1m.js";
1
+ import { t as CLIS_CONFIG } from "./ts--fmzLwj7.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-BPPX9iGs.js.map
8
+ //# sourceMappingURL=SUPPORTED_CLIS-BcF2EBxN.js.map
@@ -1,11 +1,11 @@
1
1
  import "./logger-CDIsZ-Pp.js";
2
- import "./versionChecker-bcw3nJay.js";
3
- import "./ts-Ct3yd-1m.js";
2
+ import "./versionChecker-2v7LcqTp.js";
3
+ import "./ts--fmzLwj7.js";
4
4
  import "./todoAutomation-BQRW614S.js";
5
5
  import "./JsonlStore-CPGIR0Wy.js";
6
6
  import "./globalPidIndex-Dq4KY2IV.js";
7
7
  import "./pidStore-Cmcc8Oej.js";
8
8
  import "./messageLog-BYFwioFY.js";
9
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BPPX9iGs.js";
9
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BcF2EBxN.js";
10
10
 
11
11
  export { SUPPORTED_CLIS };
@@ -3,7 +3,7 @@ import "./globalPidIndex-Dq4KY2IV.js";
3
3
  import "./messageLog-BYFwioFY.js";
4
4
  import "./e2e-CUMZC53I.js";
5
5
  import "./configShared-DtHMBCl7.js";
6
- import { P as resolveOne } from "./subcommands-B04Jcb4a.js";
6
+ import { I as resolveOne } from "./subcommands-DD97DaSn.js";
7
7
  import "./webrtcLink-CS4D-3G1.js";
8
8
  import "./remotes-Dy4Rg8Yp.js";
9
9
  import { a as startShare } from "./share-B-e_9WBx.js";
@@ -229,4 +229,4 @@ function transformEvent(rawEvent, agentId, forwarded) {
229
229
 
230
230
  //#endregion
231
231
  export { createScopedShare, listShares, revokeAllShares, revokeShare };
232
- //# sourceMappingURL=agentShare-aCSONMZp.js.map
232
+ //# sourceMappingURL=agentShare-oOnj-v8A.js.map
@@ -1,5 +1,5 @@
1
1
  import { t as agentYesHome } from "./agentYesHome-CtmsY6I-.js";
2
- import { P as resolveOne } from "./subcommands-B04Jcb4a.js";
2
+ import { I as resolveOne } from "./subcommands-DD97DaSn.js";
3
3
  import { a as mintCapability, o as parseExpires } from "./callbackCore-Cg3Ye0ZS.js";
4
4
  import { randomBytes } from "node:crypto";
5
5
  import { chmodSync, readFileSync, renameSync, writeFileSync } from "node:fs";
@@ -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-DQPkrKcN.js");
75
+ const { resolveLocalServeUrl } = await import("./serve-Bi-rK4OP.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-CpGhgUwm.js.map
190
+ //# sourceMappingURL=callback-BketOHRL.js.map
@@ -3,10 +3,10 @@ import "./globalPidIndex-Dq4KY2IV.js";
3
3
  import "./messageLog-BYFwioFY.js";
4
4
  import "./e2e-CUMZC53I.js";
5
5
  import "./configShared-DtHMBCl7.js";
6
- import "./subcommands-B04Jcb4a.js";
6
+ import "./subcommands-DD97DaSn.js";
7
7
  import "./webrtcLink-CS4D-3G1.js";
8
8
  import "./remotes-Dy4Rg8Yp.js";
9
9
  import "./callbackCore-Cg3Ye0ZS.js";
10
- import { i as loadOrCreateCallbackSecret, n as isCallbackRevoked, r as loadCallbackSecretReadOnly, t as cmdCallback } from "./callback-CpGhgUwm.js";
10
+ import { i as loadOrCreateCallbackSecret, n as isCallbackRevoked, r as loadCallbackSecretReadOnly, t as cmdCallback } from "./callback-BketOHRL.js";
11
11
 
12
12
  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-uqM2YYA7.js";
3
3
  import { n as logger } from "./logger-CDIsZ-Pp.js";
4
- import { i as versionString, n as displayVersion, t as checkAndAutoUpdate } from "./versionChecker-bcw3nJay.js";
5
- import { r as getRustBinary } from "./rustBinary-DWzZGM4A.js";
4
+ import { i as versionString, n as displayVersion, t as checkAndAutoUpdate } from "./versionChecker-2v7LcqTp.js";
5
+ import { r as getRustBinary } from "./rustBinary-uKF0M80f.js";
6
6
  import { argv } from "process";
7
7
  import { spawn } from "child_process";
8
8
  import ms from "ms";
@@ -285,7 +285,7 @@ function buildRustArgs(argv, cliFromScript, supportedClis) {
285
285
  const rawArg = process.argv[2];
286
286
  const managerCommands = !invokedCliName(process.argv);
287
287
  const isHelpFlag = rawArg === "-h" || rawArg === "--help";
288
- const { isSubcommand, runSubcommand, cmdHelp, isUnknownManagerToken } = await import("./subcommands-dNgWfaKE.js");
288
+ const { isSubcommand, runSubcommand, cmdHelp, isUnknownManagerToken } = await import("./subcommands-Ck2PM8sv.js");
289
289
  if (isHelpFlag && process.argv.length === 3) {
290
290
  await cmdHelp(managerCommands);
291
291
  process.exit(0);
@@ -295,7 +295,7 @@ function buildRustArgs(argv, cliFromScript, supportedClis) {
295
295
  process.exit(code ?? 0);
296
296
  }
297
297
  {
298
- const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-BNRnFFc2.js");
298
+ const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-pefvIQrJ.js");
299
299
  if (isUnknownManagerToken(rawArg, managerCommands, SUPPORTED_CLIS)) {
300
300
  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`);
301
301
  process.exit(1);
@@ -346,7 +346,7 @@ if (config.useRust) {
346
346
  }
347
347
  }
348
348
  if (rustBinary) {
349
- const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-BNRnFFc2.js");
349
+ const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-pefvIQrJ.js");
350
350
  const rustArgs = buildRustArgs(process.argv, config.cli, SUPPORTED_CLIS);
351
351
  if (config.verbose) {
352
352
  console.log(`[rust] Using binary: ${rustBinary}`);
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import "./logger-CDIsZ-Pp.js";
2
- import "./versionChecker-bcw3nJay.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-Ct3yd-1m.js";
2
+ import "./versionChecker-2v7LcqTp.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--fmzLwj7.js";
4
4
  import { _ as isKnownKind, a as renderTree, b as statesOf, c as monitorHint, d as openStore, f as DONE_STATE, g as initialState, h as canTransition, i as renderDigest, l as CycleError, m as ORPHANED_STATE, o as unblockedTasks, p as LIFECYCLES, r as openBlockers, s as describeBlock, t as reconcileTodos, u as TodoStore, v as nextStates, x as removeControlCharacters, y as requiredGate } from "./todoAutomation-BQRW614S.js";
5
5
  import "./JsonlStore-CPGIR0Wy.js";
6
6
  import "./globalPidIndex-Dq4KY2IV.js";
@@ -3,7 +3,7 @@ import "./globalPidIndex-Dq4KY2IV.js";
3
3
  import "./messageLog-BYFwioFY.js";
4
4
  import "./e2e-CUMZC53I.js";
5
5
  import "./configShared-DtHMBCl7.js";
6
- import { $ as shouldStealLock, C as listRecords, J as hostId, K as appendEvent, Q as readInbox, X as listInboxParents, Z as liveWatchers, _ as isPidAlive, c as deriveLiveState, et as daemonLockDir, j as renderLogTailLines, nt as notifyDir, q as gcInboxes, tt as daemonLockOwnerPath } from "./subcommands-B04Jcb4a.js";
6
+ import { $ as liveWatchers, J as appendEvent, N as renderLogTailLines, Q as listInboxParents, X as hostId, Y as gcInboxes, et as readInbox, it as notifyDir, l as deriveLiveState, nt as daemonLockDir, rt as daemonLockOwnerPath, tt as shouldStealLock, v as isPidAlive, w as listRecords } from "./subcommands-DD97DaSn.js";
7
7
  import "./webrtcLink-CS4D-3G1.js";
8
8
  import "./remotes-Dy4Rg8Yp.js";
9
9
  import { mkdir, readFile, rename, rm, stat, writeFile } from "fs/promises";
@@ -836,4 +836,4 @@ async function ensureDaemon() {
836
836
 
837
837
  //#endregion
838
838
  export { daemonStatus, ensureDaemon, requestDaemonStop, runDaemon };
839
- //# sourceMappingURL=notifyDaemon-Cvnvfqw8.js.map
839
+ //# sourceMappingURL=notifyDaemon-DJX5vJlf.js.map
@@ -1,4 +1,4 @@
1
- import { r as getInstalledPackage } from "./versionChecker-bcw3nJay.js";
1
+ import { r as getInstalledPackage } from "./versionChecker-2v7LcqTp.js";
2
2
  import { execFileSync } from "child_process";
3
3
  import { existsSync, mkdirSync, unlinkSync } from "fs";
4
4
  import { chmod, copyFile } from "fs/promises";
@@ -243,4 +243,4 @@ async function getRustBinary(options = {}) {
243
243
 
244
244
  //#endregion
245
245
  export { findTrayLauncher as n, getRustBinary as r, findSpawnHiddenLauncher as t };
246
- //# sourceMappingURL=rustBinary-DWzZGM4A.js.map
246
+ //# sourceMappingURL=rustBinary-uKF0M80f.js.map
@@ -1,12 +1,12 @@
1
1
  import "./logger-CDIsZ-Pp.js";
2
- import "./versionChecker-bcw3nJay.js";
3
- import "./ts-Ct3yd-1m.js";
2
+ import "./versionChecker-2v7LcqTp.js";
3
+ import "./ts--fmzLwj7.js";
4
4
  import "./todoAutomation-BQRW614S.js";
5
5
  import "./JsonlStore-CPGIR0Wy.js";
6
6
  import "./globalPidIndex-Dq4KY2IV.js";
7
7
  import "./pidStore-Cmcc8Oej.js";
8
8
  import "./messageLog-BYFwioFY.js";
9
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BPPX9iGs.js";
9
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BcF2EBxN.js";
10
10
  import { f as resolveSpawnCwd } from "./workspaceConfig-Bxuk_MOq.js";
11
11
  import { n as liveEnv, t as ensureNodeRuntime } from "./nodeRuntime-vhOBffJ3.js";
12
12
  import { createHash } from "node:crypto";
@@ -153,4 +153,4 @@ async function cmdSchedule(rest) {
153
153
 
154
154
  //#endregion
155
155
  export { cmdSchedule };
156
- //# sourceMappingURL=schedule-ChwwFCgQ.js.map
156
+ //# sourceMappingURL=schedule-CmWMvKjk.js.map
@@ -1,7 +1,7 @@
1
1
  import "./logger-CDIsZ-Pp.js";
2
- import { r as getInstalledPackage } from "./versionChecker-bcw3nJay.js";
3
- import { t as findSpawnHiddenLauncher } from "./rustBinary-DWzZGM4A.js";
4
- import { c as permissionBadge, i as answerAsk, o as listAsks, u as CLAUDE_SESSION_PIN_ENV } from "./ts-Ct3yd-1m.js";
2
+ import { r as getInstalledPackage } from "./versionChecker-2v7LcqTp.js";
3
+ import { t as findSpawnHiddenLauncher } from "./rustBinary-uKF0M80f.js";
4
+ import { c as permissionBadge, i as answerAsk, o as listAsks, u as CLAUDE_SESSION_PIN_ENV } from "./ts--fmzLwj7.js";
5
5
  import { t as agentYesHome$1 } from "./agentYesHome-CtmsY6I-.js";
6
6
  import { x as removeControlCharacters } from "./todoAutomation-BQRW614S.js";
7
7
  import "./JsonlStore-CPGIR0Wy.js";
@@ -11,17 +11,17 @@ import { r as recordInbox } from "./messageLog-BYFwioFY.js";
11
11
  import { t as pgidForWrapper } from "./reaper-C4BvNylH.js";
12
12
  import "./e2e-CUMZC53I.js";
13
13
  import "./configShared-DtHMBCl7.js";
14
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BPPX9iGs.js";
15
- import { A as recentReadEdges, C as listRecords, D as readNotes, G as writeToIpc, M as renderRawLog, N as renderRawLogLines, O as readPtysize, P as resolveOne, Y as isTransientLockMkdirError, f as extractNeedsInput, j as renderLogTailLines, k as recentMessageEdges, l as deriveLiveStatus, o as controlCodeFromName, p as extractTaskCounts, rt as TYPING_BADGE, u as extractBadges, x as isUserTyping, z as snapshotStatus } from "./subcommands-B04Jcb4a.js";
14
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BcF2EBxN.js";
15
+ import { A as readPtysize, F as renderRawLogLines, I as resolveOne, M as recentReadEdges, N as renderLogTailLines, O as readLogForRender, P as renderRawLog, S as isUserTyping, V as snapshotStatus, Z as isTransientLockMkdirError, at as TYPING_BADGE, d as extractBadges, j as recentMessageEdges, k as readNotes, m as extractTaskCounts, p as extractNeedsInput, q as writeToIpc, s as controlCodeFromName, u as deriveLiveStatus, w as listRecords } from "./subcommands-DD97DaSn.js";
16
16
  import "./webrtcLink-CS4D-3G1.js";
17
17
  import "./remotes-Dy4Rg8Yp.js";
18
18
  import { i as frameVisitorMessage, s as verifyCapability, t as MAX_CALLBACK_MSG_BYTES } from "./callbackCore-Cg3Ye0ZS.js";
19
- import { n as isCallbackRevoked, r as loadCallbackSecretReadOnly } from "./callback-CpGhgUwm.js";
19
+ import { n as isCallbackRevoked, r as loadCallbackSecretReadOnly } from "./callback-BketOHRL.js";
20
20
  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-Bxuk_MOq.js";
21
21
  import { n as liveEnv, t as ensureNodeRuntime } from "./nodeRuntime-vhOBffJ3.js";
22
- import { i as importProvisionModule } from "./ws-BlISbGY8.js";
22
+ import { i as importProvisionModule } from "./ws-C-4UthLV.js";
23
23
  import { r as spawnRejectionReason } from "./spawnGate-D0E1uRP7.js";
24
- import { i as launchTray } from "./trayApp-CCN3zyo7.js";
24
+ import { i as launchTray } from "./trayApp-B6bLQTFw.js";
25
25
  import yargs from "yargs";
26
26
  import { appendFile, mkdir, open, readFile, readdir, rename, rm, stat, unlink, writeFile } from "fs/promises";
27
27
  import { arch, cpus, freemem, homedir, hostname, loadavg, platform, totalmem, uptime, userInfo } from "os";
@@ -2368,7 +2368,7 @@ Options:
2368
2368
  }
2369
2369
  });
2370
2370
  if (req.method === "GET" && p === "/api/ws") {
2371
- const ws = await import("./ws-BkOJQeeZ.js");
2371
+ const ws = await import("./ws-B3tYpYTK.js");
2372
2372
  try {
2373
2373
  await ws.loadProvision();
2374
2374
  } catch (e) {
@@ -2388,7 +2388,7 @@ Options:
2388
2388
  if (req.method === "GET" && p === "/api/ws/status") {
2389
2389
  const dirRaw = url.searchParams.get("path");
2390
2390
  if (!dirRaw) return new Response("missing ?path=<workspace dir>", { status: 400 });
2391
- const ws = await import("./ws-BkOJQeeZ.js");
2391
+ const ws = await import("./ws-B3tYpYTK.js");
2392
2392
  let prov;
2393
2393
  try {
2394
2394
  prov = await ws.loadProvision();
@@ -2431,7 +2431,7 @@ Options:
2431
2431
  try {
2432
2432
  const record = await resolveOne(keyword, defaultOpts());
2433
2433
  if (!record.log_file) return new Response(`pid ${record.pid}: no log_file`, { status: 404 });
2434
- const buf = await readFile(record.log_file);
2434
+ const buf = await readLogForRender(record.log_file);
2435
2435
  const size = await readPtysize(record.pid);
2436
2436
  const text = await renderRawLog(buf, {
2437
2437
  mode,
@@ -3145,7 +3145,7 @@ Options:
3145
3145
  const perm = body.perm ?? "r";
3146
3146
  if (perm !== "r" && perm !== "rw") return new Response(`invalid perm ${perm} (want r or rw)`, { status: 400 });
3147
3147
  try {
3148
- const { createScopedShare } = await import("./agentShare-aCSONMZp.js");
3148
+ const { createScopedShare } = await import("./agentShare-oOnj-v8A.js");
3149
3149
  const share = await createScopedShare({
3150
3150
  agent: body.agent,
3151
3151
  perm,
@@ -3160,12 +3160,12 @@ Options:
3160
3160
  }
3161
3161
  }
3162
3162
  if (req.method === "GET" && p === "/api/shares") {
3163
- const { listShares } = await import("./agentShare-aCSONMZp.js");
3163
+ const { listShares } = await import("./agentShare-oOnj-v8A.js");
3164
3164
  return Response.json(listShares());
3165
3165
  }
3166
3166
  const revokeM = /^\/api\/share\/([^/]+)$/.exec(p);
3167
3167
  if (req.method === "DELETE" && revokeM) {
3168
- const { revokeShare } = await import("./agentShare-aCSONMZp.js");
3168
+ const { revokeShare } = await import("./agentShare-oOnj-v8A.js");
3169
3169
  const ok = revokeShare(decodeURIComponent(revokeM[1]));
3170
3170
  return new Response(ok ? "revoked" : "no such share", { status: ok ? 200 : 404 });
3171
3171
  }
@@ -3467,7 +3467,7 @@ Options:
3467
3467
  const shutdown = (resolve) => {
3468
3468
  if (heartbeat) clearInterval(heartbeat);
3469
3469
  closeShare?.();
3470
- import("./agentShare-aCSONMZp.js").then((m) => m.revokeAllShares()).catch(() => {});
3470
+ import("./agentShare-oOnj-v8A.js").then((m) => m.revokeAllShares()).catch(() => {});
3471
3471
  server?.stop();
3472
3472
  Promise.resolve(releaseHostLock?.()).catch(() => {}).then(resolve);
3473
3473
  };
@@ -3480,4 +3480,4 @@ Options:
3480
3480
 
3481
3481
  //#endregion
3482
3482
  export { cmdServe, loadTokenReadOnly, mintScopedTermToken, resolveDaemonHttpBase, resolveLocalServeUrl };
3483
- //# sourceMappingURL=serve-DQPkrKcN.js.map
3483
+ //# sourceMappingURL=serve-Bi-rK4OP.js.map
@@ -32,7 +32,7 @@ async function cmdSetup(rest) {
32
32
  if (!existsSync(abs)) process.stderr.write(` note: that directory doesn't exist yet — create it, or agents spawned there will fail\n`);
33
33
  if (noShare) return 0;
34
34
  process.stdout.write(`\nsharing this machine to agent-yes.com…\n`);
35
- const { cmdServe } = await import("./serve-DQPkrKcN.js");
35
+ const { cmdServe } = await import("./serve-Bi-rK4OP.js");
36
36
  return cmdServe([
37
37
  "install",
38
38
  "--share",
@@ -42,4 +42,4 @@ async function cmdSetup(rest) {
42
42
 
43
43
  //#endregion
44
44
  export { cmdSetup };
45
- //# sourceMappingURL=setup-uZqYF0KT.js.map
45
+ //# sourceMappingURL=setup-DRV5DTmr.js.map
@@ -0,0 +1,10 @@
1
+ import "./logger-CDIsZ-Pp.js";
2
+ import "./globalPidIndex-Dq4KY2IV.js";
3
+ import "./messageLog-BYFwioFY.js";
4
+ import "./e2e-CUMZC53I.js";
5
+ import "./configShared-DtHMBCl7.js";
6
+ import { A as readPtysize, B as runSubcommand, C as lastStdinAt, D as readAgentPtysize, E as menuSelectKeys, F as renderRawLogLines, G as waitForLogQuiet, H as stdinActivityPath, I as resolveOne, K as writeKeysPaced, L as resolveReadWindow, M as recentReadEdges, N as renderLogTailLines, O as readLogForRender, P as renderRawLog, R as resolveResumeArgs, S as isUserTyping, T as matchKeyword, U as stopTipForCli, V as snapshotStatus, W as submitAndConfirm, _ as isExitRequest, a as backoffWhileTyping, b as isSubcommand, c as cursorAbs, d as extractBadges, f as extractMenu, g as isAgentStuck, h as finalizedLines, i as TYPING_WINDOW_MS, j as recentMessageEdges, k as readNotes, l as deriveLiveState, m as extractTaskCounts, n as MAX_RENDER_BYTES, o as cmdHelp, p as extractNeedsInput, q as writeToIpc, r as READ_PAGE_DEFAULT, s as controlCodeFromName, t as GRACEFUL_EXIT_COMMANDS, u as deriveLiveStatus, v as isPidAlive, w as listRecords, x as isUnknownManagerToken, y as isSlashCommand, z as restartHintLines } from "./subcommands-DD97DaSn.js";
7
+ import "./webrtcLink-CS4D-3G1.js";
8
+ import "./remotes-Dy4Rg8Yp.js";
9
+
10
+ export { cmdHelp, isSubcommand, isUnknownManagerToken, runSubcommand };
@@ -120,15 +120,19 @@ function markerOf(line) {
120
120
  if (PENDING.has(ch)) return "pending";
121
121
  return null;
122
122
  }
123
+ function isBareAnchor(line) {
124
+ const s = line.trim();
125
+ return s.startsWith(ANCHOR) && s.slice(1).trim() === "";
126
+ }
123
127
  /**
124
128
  * Find the MOST RECENT confidently-detected todo block in the rendered lines and
125
129
  * return its {done, total}. Returns null when none qualifies (caller omits the
126
130
  * badge entirely — never shows "0/0").
127
131
  *
128
132
  * A block is a maximal run of consecutive marker lines. It only counts when it
129
- * is anchored — the `⎿` glyph appears on the run's first line or the line
130
- * directly above it — and has ≥2 marker lines. The last qualifying block wins,
131
- * since the agent's current todo state is the one drawn most recently.
133
+ * is anchored — the `⎿` glyph sits on the run's FIRST line, or a bare `⎿` sits on
134
+ * the line directly above it — and has ≥2 marker lines. The last qualifying block
135
+ * wins, since the agent's current todo state is the one drawn most recently.
132
136
  */
133
137
  function parseTaskCounts(lines) {
134
138
  let best = null;
@@ -139,7 +143,7 @@ function parseTaskCounts(lines) {
139
143
  i++;
140
144
  continue;
141
145
  }
142
- let hasAnchor = i > 0 && lines[i - 1].includes(ANCHOR);
146
+ let hasAnchor = i > 0 && isBareAnchor(lines[i - 1]);
143
147
  const counts = {
144
148
  done: 0,
145
149
  inprogress: 0,
@@ -149,7 +153,7 @@ function parseTaskCounts(lines) {
149
153
  for (; j < n; j++) {
150
154
  const mk = markerOf(lines[j]);
151
155
  if (mk === null) break;
152
- if (lines[j].includes(ANCHOR)) hasAnchor = true;
156
+ if (j === i && lines[j].includes(ANCHOR)) hasAnchor = true;
153
157
  counts[mk]++;
154
158
  }
155
159
  const total = counts.done + counts.inprogress + counts.pending;
@@ -277,7 +281,7 @@ function classifyNeedsInput(lines, cfg) {
277
281
  const end = Math.min(lines.length, last + 6);
278
282
  return { question: lines.slice(start, end).map((l) => l.trim()).filter((l) => l && !isChromeLine(l)).join(" • ").slice(0, 400) };
279
283
  }
280
- const OPTION_LINE = /^[\s❯›>▶◉○●·*-]*?(\d+)\.\s/;
284
+ const OPTION_LINE = /^[\s❯›>▶◉○●·│*-]*?(\d+)\.\s/;
281
285
  /**
282
286
  * Parse the selection menu a `needs_input` agent is parked on into a cursor
283
287
  * position + the available option numbers, so a caller can compute how far the
@@ -1394,35 +1398,35 @@ async function runSubcommand(argv) {
1394
1398
  return cmdCh(rest);
1395
1399
  }
1396
1400
  case "term": {
1397
- const { cmdTerm } = await import("./terminal-sCD-7D_2.js");
1401
+ const { cmdTerm } = await import("./terminal-CMbUP_g2.js");
1398
1402
  return cmdTerm(rest);
1399
1403
  }
1400
1404
  case "widget": {
1401
- const { cmdWidget } = await import("./widget-B7NK6egy.js");
1405
+ const { cmdWidget } = await import("./widget-CJn9iNA7.js");
1402
1406
  return cmdWidget(rest);
1403
1407
  }
1404
1408
  case "mint": {
1405
- const { cmdMint } = await import("./widget-B7NK6egy.js");
1409
+ const { cmdMint } = await import("./widget-CJn9iNA7.js");
1406
1410
  return cmdMint(rest);
1407
1411
  }
1408
1412
  case "serve": {
1409
- const { cmdServe } = await import("./serve-DQPkrKcN.js");
1413
+ const { cmdServe } = await import("./serve-Bi-rK4OP.js");
1410
1414
  return cmdServe(rest);
1411
1415
  }
1412
1416
  case "tray": {
1413
- const { cmdTray } = await import("./trayApp-HLGzyGrP.js");
1417
+ const { cmdTray } = await import("./trayApp-BswEKIoK.js");
1414
1418
  return cmdTray(rest);
1415
1419
  }
1416
1420
  case "setup": {
1417
- const { cmdSetup } = await import("./setup-uZqYF0KT.js");
1421
+ const { cmdSetup } = await import("./setup-DRV5DTmr.js");
1418
1422
  return cmdSetup(rest);
1419
1423
  }
1420
1424
  case "ws": {
1421
- const { cmdWs } = await import("./ws-BkOJQeeZ.js");
1425
+ const { cmdWs } = await import("./ws-B3tYpYTK.js");
1422
1426
  return cmdWs(rest);
1423
1427
  }
1424
1428
  case "schedule": {
1425
- const { cmdSchedule } = await import("./schedule-ChwwFCgQ.js");
1429
+ const { cmdSchedule } = await import("./schedule-CmWMvKjk.js");
1426
1430
  return cmdSchedule(rest);
1427
1431
  }
1428
1432
  case "remote": {
@@ -1434,7 +1438,7 @@ async function runSubcommand(argv) {
1434
1438
  return cmdExpose(rest);
1435
1439
  }
1436
1440
  case "callback": {
1437
- const { cmdCallback } = await import("./callback-CzYsRWjX.js");
1441
+ const { cmdCallback } = await import("./callback-BqUp2zps.js");
1438
1442
  return cmdCallback(rest);
1439
1443
  }
1440
1444
  case "reap":
@@ -2452,7 +2456,7 @@ async function cmdRead(rest, { mode }) {
2452
2456
  throw new Error(`pid ${record.pid}: log file not found at ${logPath}`);
2453
2457
  }
2454
2458
  if (!stats.isFile()) throw new Error(`pid ${record.pid}: log path is not a file: ${logPath}`);
2455
- const buf = await readFile(logPath);
2459
+ const buf = await readLogForRender(logPath);
2456
2460
  const size = await readAgentPtysize(record);
2457
2461
  const noteLabel = (await readNotes()).get(record.pid);
2458
2462
  const header = noteLabel ? `[pid ${record.pid} ${shortenPath(record.cwd)} * ${noteLabel}]` : `[pid ${record.pid} ${shortenPath(record.cwd)}]`;
@@ -2467,7 +2471,7 @@ async function cmdRead(rest, { mode }) {
2467
2471
  process.stdout.write(rendered);
2468
2472
  if (!rendered.endsWith("\n")) process.stdout.write("\n");
2469
2473
  setInterval(() => void recordRead(reader.key, record.pid), 3e4).unref?.();
2470
- return plain ? followPlainLocal(logPath, buf) : followRawLocal(logPath, buf);
2474
+ return plain ? followPlainLocal(logPath, buf, stats.size) : followRawLocal(logPath, buf, stats.size);
2471
2475
  }
2472
2476
  const allLines = await renderRawLogLines(buf, {
2473
2477
  cols: size?.cols,
@@ -2585,11 +2589,11 @@ async function watchAppend(logPath, startOffset, onChunk, onStop) {
2585
2589
  * sequences stripped. Mirrors the historical behaviour, plus prompt signal /
2586
2590
  * pipe-close handling.
2587
2591
  */
2588
- async function followRawLocal(logPath, buf) {
2592
+ async function followRawLocal(logPath, buf, startOffset = buf.length) {
2589
2593
  process.stderr.write(`following... (Ctrl-C to stop)\n`);
2590
2594
  const ansiRe = /\x1b\[[0-?]*[ -/]*[@-~]|\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)|\x1b[@-Z\\-_]/g;
2591
2595
  const ctrlRe = /[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g;
2592
- await watchAppend(logPath, buf.length, (chunk) => {
2596
+ await watchAppend(logPath, startOffset, (chunk) => {
2593
2597
  const text = new TextDecoder().decode(chunk).replace(ansiRe, "").replace(ctrlRe, "");
2594
2598
  if (text.trim()) process.stdout.write(text.trimStart());
2595
2599
  }, () => {});
@@ -2623,7 +2627,7 @@ function finalizedLines(term, fromAbs) {
2623
2627
  * settled, so the output is clean, newline-terminated, line-buffered text a
2624
2628
  * script can read. On stop, flush the line the cursor is still sitting on.
2625
2629
  */
2626
- async function followPlainLocal(logPath, buf) {
2630
+ async function followPlainLocal(logPath, buf, startOffset = buf.length) {
2627
2631
  process.stderr.write(`following... (plain; Ctrl-C / SIGTERM to stop)\n`);
2628
2632
  const { Terminal } = await import("@xterm/headless");
2629
2633
  const term = new Terminal({
@@ -2643,7 +2647,7 @@ async function followPlainLocal(logPath, buf) {
2643
2647
  for (const line of finalizedLines(term, emitted)) process.stdout.write(line + "\n");
2644
2648
  emitted = cursorAbs(term);
2645
2649
  };
2646
- await watchAppend(logPath, buf.length, async (chunk) => {
2650
+ await watchAppend(logPath, startOffset, async (chunk) => {
2647
2651
  await feed(chunk);
2648
2652
  flushCommitted();
2649
2653
  }, () => {
@@ -2686,6 +2690,45 @@ async function readAgentPtysize(record) {
2686
2690
  return null;
2687
2691
  }
2688
2692
  /**
2693
+ * Cap on how many trailing bytes of a raw PTY log we read before rendering.
2694
+ *
2695
+ * `renderRawLogLines` replays the bytes through an xterm with a fixed 50000-line
2696
+ * scrollback, so output older than the last ~50k lines is evicted from the result
2697
+ * no matter how much we read. A runaway CLI/TUI capture can reach ~1GB; slurping
2698
+ * the whole file only to throw ~all of it away is a large memory + CPU spike (a
2699
+ * ~1GB Buffer plus a full-stream vterm replay per request). 64 MiB comfortably
2700
+ * overflows the scrollback for any realistic terminal stream, so an oversized log
2701
+ * renders to the SAME lines while the allocation stays bounded.
2702
+ */
2703
+ const MAX_RENDER_BYTES = 64 * 1024 * 1024;
2704
+ /**
2705
+ * Read a raw PTY log for full-buffer rendering, capped to the trailing
2706
+ * MAX_RENDER_BYTES. Files at or below the cap are read whole (byte-identical to a
2707
+ * plain readFile); larger files return only their tail window. This is the same
2708
+ * tail-window tradeoff `renderLogTailLines` already makes at 32KB, just larger —
2709
+ * the window's first line may be a partial (garbled) render, but it sits at the
2710
+ * scrollback-eviction boundary, ~50k lines above any tail/head/normal view.
2711
+ *
2712
+ * NOTE: the returned buffer is a rendering substrate only; its length is NOT the
2713
+ * file's byte length. Follow/watch callers must seek from the real file size
2714
+ * (`stat().size`), never from this buffer's length.
2715
+ */
2716
+ async function readLogForRender(logPath, maxBytes = MAX_RENDER_BYTES) {
2717
+ const fh = await open(logPath, "r");
2718
+ try {
2719
+ const { size } = await fh.stat();
2720
+ if (size <= maxBytes) {
2721
+ const data = await fh.readFile();
2722
+ return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
2723
+ }
2724
+ const tmp = Buffer.allocUnsafe(maxBytes);
2725
+ const { bytesRead } = await fh.read(tmp, 0, maxBytes, size - maxBytes);
2726
+ return new Uint8Array(tmp.buffer, tmp.byteOffset, bytesRead);
2727
+ } finally {
2728
+ await fh.close();
2729
+ }
2730
+ }
2731
+ /**
2689
2732
  * Feed the raw PTY bytes through @xterm/headless and emit plain text.
2690
2733
  * Same approach as koho's renderTerminalBuffer + agent-yes's XtermProxy.
2691
2734
  */
@@ -3844,7 +3887,7 @@ async function cmdAttach(rest) {
3844
3887
  const winsizeDir = path.join(ayHome, "winsize");
3845
3888
  await mkdir(winsizeDir, { recursive: true });
3846
3889
  const winsizePath = path.join(winsizeDir, String(record.pid));
3847
- const { resolveDaemonHttpBase, loadTokenReadOnly } = await import("./serve-DQPkrKcN.js");
3890
+ const { resolveDaemonHttpBase, loadTokenReadOnly } = await import("./serve-Bi-rK4OP.js");
3848
3891
  const daemonBase = await resolveDaemonHttpBase().catch(() => null);
3849
3892
  const daemonToken = daemonBase ? await loadTokenReadOnly().catch(() => null) ?? "" : "";
3850
3893
  const capViewer = `attach:${process.pid}`;
@@ -4554,7 +4597,7 @@ async function cmdNotify(rest) {
4554
4597
  }
4555
4598
  const ensure = async () => {
4556
4599
  if (!argv["ensure-daemon"]) return;
4557
- const { ensureDaemon } = await import("./notifyDaemon-Cvnvfqw8.js");
4600
+ const { ensureDaemon } = await import("./notifyDaemon-DJX5vJlf.js");
4558
4601
  await ensureDaemon().catch(() => null);
4559
4602
  };
4560
4603
  await heartbeatWatcher(parent, selfStartedAt);
@@ -4628,7 +4671,7 @@ async function cmdNotifyCursor(args) {
4628
4671
  }
4629
4672
  async function cmdNotifyd(rest) {
4630
4673
  const sub = rest[0] ?? "status";
4631
- const daemon = await import("./notifyDaemon-Cvnvfqw8.js");
4674
+ const daemon = await import("./notifyDaemon-DJX5vJlf.js");
4632
4675
  switch (sub) {
4633
4676
  case "run": return daemon.runDaemon();
4634
4677
  case "once": return daemon.runDaemon({ once: true });
@@ -4654,5 +4697,5 @@ async function cmdNotifyd(rest) {
4654
4697
  }
4655
4698
 
4656
4699
  //#endregion
4657
- export { shouldStealLock as $, recentReadEdges as A, stdinActivityPath as B, listRecords as C, readNotes as D, readAgentPtysize as E, resolveReadWindow as F, writeToIpc as G, submitAndConfirm as H, resolveResumeArgs as I, hostId as J, appendEvent as K, restartHintLines as L, renderRawLog as M, renderRawLogLines as N, readPtysize as O, resolveOne as P, readInbox as Q, runSubcommand as R, lastStdinAt as S, menuSelectKeys as T, waitForLogQuiet as U, stopTipForCli as V, writeKeysPaced as W, listInboxParents as X, isTransientLockMkdirError as Y, liveWatchers as Z, isPidAlive as _, cmdHelp as a, isUnknownManagerToken as b, deriveLiveState as c, extractMenu as d, daemonLockDir as et, extractNeedsInput as f, isExitRequest as g, isAgentStuck as h, backoffWhileTyping as i, renderLogTailLines as j, recentMessageEdges as k, deriveLiveStatus as l, finalizedLines as m, READ_PAGE_DEFAULT as n, notifyDir as nt, controlCodeFromName as o, extractTaskCounts as p, gcInboxes as q, TYPING_WINDOW_MS as r, TYPING_BADGE as rt, cursorAbs as s, GRACEFUL_EXIT_COMMANDS as t, daemonLockOwnerPath as tt, extractBadges as u, isSlashCommand as v, matchKeyword as w, isUserTyping as x, isSubcommand as y, snapshotStatus as z };
4658
- //# sourceMappingURL=subcommands-B04Jcb4a.js.map
4700
+ export { liveWatchers as $, readPtysize as A, runSubcommand as B, lastStdinAt as C, readAgentPtysize as D, menuSelectKeys as E, renderRawLogLines as F, waitForLogQuiet as G, stdinActivityPath as H, resolveOne as I, appendEvent as J, writeKeysPaced as K, resolveReadWindow as L, recentReadEdges as M, renderLogTailLines as N, readLogForRender as O, renderRawLog as P, listInboxParents as Q, resolveResumeArgs as R, isUserTyping as S, matchKeyword as T, stopTipForCli as U, snapshotStatus as V, submitAndConfirm as W, hostId as X, gcInboxes as Y, isTransientLockMkdirError as Z, isExitRequest as _, backoffWhileTyping as a, TYPING_BADGE as at, isSubcommand as b, cursorAbs as c, extractBadges as d, readInbox as et, extractMenu as f, isAgentStuck as g, finalizedLines as h, TYPING_WINDOW_MS as i, notifyDir as it, recentMessageEdges as j, readNotes as k, deriveLiveState as l, extractTaskCounts as m, MAX_RENDER_BYTES as n, daemonLockDir as nt, cmdHelp as o, extractNeedsInput as p, writeToIpc as q, READ_PAGE_DEFAULT as r, daemonLockOwnerPath as rt, controlCodeFromName as s, GRACEFUL_EXIT_COMMANDS as t, shouldStealLock as tt, deriveLiveStatus as u, isPidAlive as v, listRecords as w, isUnknownManagerToken as x, isSlashCommand as y, restartHintLines as z };
4701
+ //# sourceMappingURL=subcommands-DD97DaSn.js.map
@@ -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-DQPkrKcN.js");
101
+ const { mintScopedTermToken } = await import("./serve-Bi-rK4OP.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-sCD-7D_2.js.map
138
+ //# sourceMappingURL=terminal-CMbUP_g2.js.map
@@ -1,4 +1,4 @@
1
- import { n as findTrayLauncher } from "./rustBinary-DWzZGM4A.js";
1
+ import { n as findTrayLauncher } from "./rustBinary-uKF0M80f.js";
2
2
  import { t as agentYesHome } from "./agentYesHome-CtmsY6I-.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-CCN3zyo7.js.map
100
+ //# sourceMappingURL=trayApp-B6bLQTFw.js.map
@@ -0,0 +1,5 @@
1
+ import "./versionChecker-2v7LcqTp.js";
2
+ import "./rustBinary-uKF0M80f.js";
3
+ import { a as trayHiddenMarker, i as launchTray, n as hasDesktop, r as isTrayHidden, t as cmdTray } from "./trayApp-B6bLQTFw.js";
4
+
5
+ export { cmdTray };