agent-yes 1.227.0 → 1.228.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
- import "./ts-CT75CpeM.js";
1
+ import "./ts-Cl3CmLH9.js";
2
2
  import "./logger-CDIsZ-Pp.js";
3
- import "./versionChecker-Bd09mqkZ.js";
3
+ import "./versionChecker-Dhjyjxs_.js";
4
4
  import "./JsonlStore-Bm5Nj6v_.js";
5
5
  import "./globalPidIndex-CoNr7tS8.js";
6
6
  import "./pidStore-DCqpU_bI.js";
7
7
  import "./messageLog-Bb_Ie3Ck.js";
8
8
  import "./todoAutomation-Cwnh4aWo.js";
9
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-CFd1V2O5.js";
9
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-C5d64Xqj.js";
10
10
 
11
11
  export { SUPPORTED_CLIS };
@@ -1,8 +1,8 @@
1
- import { t as CLIS_CONFIG } from "./ts-CT75CpeM.js";
1
+ import { t as CLIS_CONFIG } from "./ts-Cl3CmLH9.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-CFd1V2O5.js.map
8
+ //# sourceMappingURL=SUPPORTED_CLIS-C5d64Xqj.js.map
@@ -2,7 +2,7 @@ import "./logger-CDIsZ-Pp.js";
2
2
  import "./globalPidIndex-CoNr7tS8.js";
3
3
  import "./messageLog-Bb_Ie3Ck.js";
4
4
  import "./configShared-YKfS6NMe.js";
5
- import { N as resolveOne } from "./subcommands-FTkZkqKy.js";
5
+ import { N as resolveOne } from "./subcommands-DSyCT0vl.js";
6
6
  import "./e2e-DB7BDdEA.js";
7
7
  import "./webrtcLink-CjckgIZe.js";
8
8
  import "./remotes-ZqD0FHl_.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-C_rydTfo.js.map
232
+ //# sourceMappingURL=agentShare-CpglhRYb.js.map
@@ -2,11 +2,11 @@ import "./logger-CDIsZ-Pp.js";
2
2
  import "./globalPidIndex-CoNr7tS8.js";
3
3
  import "./messageLog-Bb_Ie3Ck.js";
4
4
  import "./configShared-YKfS6NMe.js";
5
- import "./subcommands-FTkZkqKy.js";
5
+ import "./subcommands-DSyCT0vl.js";
6
6
  import "./e2e-DB7BDdEA.js";
7
7
  import "./webrtcLink-CjckgIZe.js";
8
8
  import "./remotes-ZqD0FHl_.js";
9
9
  import "./callbackCore-BlNdDILy.js";
10
- import { i as loadOrCreateCallbackSecret, n as isCallbackRevoked, r as loadCallbackSecretReadOnly, t as cmdCallback } from "./callback-BV3AhWeB.js";
10
+ import { i as loadOrCreateCallbackSecret, n as isCallbackRevoked, r as loadCallbackSecretReadOnly, t as cmdCallback } from "./callback-CCEQtwXX.js";
11
11
 
12
12
  export { cmdCallback };
@@ -1,5 +1,5 @@
1
1
  import { t as agentYesHome } from "./agentYesHome-CtHb5b71.js";
2
- import { N as resolveOne } from "./subcommands-FTkZkqKy.js";
2
+ import { N as resolveOne } from "./subcommands-DSyCT0vl.js";
3
3
  import { a as mintCapability, o as parseExpires } from "./callbackCore-BlNdDILy.js";
4
4
  import { randomBytes } from "node:crypto";
5
5
  import { mkdir, readFile, writeFile } from "node:fs/promises";
@@ -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-C2KCUxTP.js");
75
+ const { resolveLocalServeUrl } = await import("./serve-DwF03sgB.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-BV3AhWeB.js.map
190
+ //# sourceMappingURL=callback-CCEQtwXX.js.map
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-Bd09mqkZ.js";
5
- import { n as getRustBinary } from "./rustBinary-DHgMI1uK.js";
4
+ import { i as versionString, n as displayVersion, t as checkAndAutoUpdate } from "./versionChecker-Dhjyjxs_.js";
5
+ import { n as getRustBinary } from "./rustBinary-B8IcqSw1.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 } = await import("./subcommands-CsVEI376.js");
288
+ const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands-UseeaeYM.js");
289
289
  if (isHelpFlag && process.argv.length === 3) {
290
290
  await cmdHelp(managerCommands);
291
291
  process.exit(0);
@@ -331,7 +331,7 @@ if (config.useRust) {
331
331
  }
332
332
  }
333
333
  if (rustBinary) {
334
- const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-CJiLdm01.js");
334
+ const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-Bfresz1n.js");
335
335
  const rustArgs = buildRustArgs(process.argv, config.cli, SUPPORTED_CLIS);
336
336
  if (config.verbose) {
337
337
  console.log(`[rust] Using binary: ${rustBinary}`);
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { i as AgentContext, n as agentYes, o as removeControlCharacters, r as config, t as CLIS_CONFIG } from "./ts-CT75CpeM.js";
1
+ import { i as AgentContext, n as agentYes, o as removeControlCharacters, r as config, t as CLIS_CONFIG } from "./ts-Cl3CmLH9.js";
2
2
  import "./logger-CDIsZ-Pp.js";
3
- import "./versionChecker-Bd09mqkZ.js";
3
+ import "./versionChecker-Dhjyjxs_.js";
4
4
  import "./JsonlStore-Bm5Nj6v_.js";
5
5
  import "./globalPidIndex-CoNr7tS8.js";
6
6
  import "./pidStore-DCqpU_bI.js";
@@ -2,7 +2,7 @@ import { n as logger } from "./logger-CDIsZ-Pp.js";
2
2
  import "./globalPidIndex-CoNr7tS8.js";
3
3
  import "./messageLog-Bb_Ie3Ck.js";
4
4
  import "./configShared-YKfS6NMe.js";
5
- import { $ as daemonLockDir, A as renderLogTailLines, G as appendEvent, K as gcInboxes, Q as shouldStealLock, S as listRecords, X as liveWatchers, Y as listInboxParents, Z as readInbox, _ as isPidAlive, c as deriveLiveState, et as daemonLockOwnerPath, q as hostId, tt as notifyDir } from "./subcommands-FTkZkqKy.js";
5
+ import { $ as daemonLockDir, A as renderLogTailLines, G as appendEvent, K as gcInboxes, Q as shouldStealLock, S as listRecords, X as liveWatchers, Y as listInboxParents, Z as readInbox, _ as isPidAlive, c as deriveLiveState, et as daemonLockOwnerPath, q as hostId, tt as notifyDir } from "./subcommands-DSyCT0vl.js";
6
6
  import "./e2e-DB7BDdEA.js";
7
7
  import "./webrtcLink-CjckgIZe.js";
8
8
  import "./remotes-ZqD0FHl_.js";
@@ -589,4 +589,4 @@ async function ensureDaemon() {
589
589
 
590
590
  //#endregion
591
591
  export { daemonStatus, ensureDaemon, requestDaemonStop, runDaemon };
592
- //# sourceMappingURL=notifyDaemon-CyLvaAwc.js.map
592
+ //# sourceMappingURL=notifyDaemon-CfQN5blR.js.map
@@ -1,4 +1,4 @@
1
- import { r as getInstalledPackage } from "./versionChecker-Bd09mqkZ.js";
1
+ import { r as getInstalledPackage } from "./versionChecker-Dhjyjxs_.js";
2
2
  import { execFileSync } from "child_process";
3
3
  import { existsSync, mkdirSync, unlinkSync } from "fs";
4
4
  import { chmod, copyFile } from "fs/promises";
@@ -225,4 +225,4 @@ async function getRustBinary(options = {}) {
225
225
 
226
226
  //#endregion
227
227
  export { getRustBinary as n, findSpawnHiddenLauncher as t };
228
- //# sourceMappingURL=rustBinary-DHgMI1uK.js.map
228
+ //# sourceMappingURL=rustBinary-B8IcqSw1.js.map
@@ -1,12 +1,12 @@
1
- import "./ts-CT75CpeM.js";
1
+ import "./ts-Cl3CmLH9.js";
2
2
  import "./logger-CDIsZ-Pp.js";
3
- import "./versionChecker-Bd09mqkZ.js";
3
+ import "./versionChecker-Dhjyjxs_.js";
4
4
  import "./JsonlStore-Bm5Nj6v_.js";
5
5
  import "./globalPidIndex-CoNr7tS8.js";
6
6
  import "./pidStore-DCqpU_bI.js";
7
7
  import "./messageLog-Bb_Ie3Ck.js";
8
8
  import "./todoAutomation-Cwnh4aWo.js";
9
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-CFd1V2O5.js";
9
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-C5d64Xqj.js";
10
10
  import { d as resolveSpawnCwd } from "./workspaceConfig-De5tgjeO.js";
11
11
  import { n as liveEnv, t as ensureNodeRuntime } from "./nodeRuntime-CgXWHe9p.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-0p4V_khb.js.map
156
+ //# sourceMappingURL=schedule-B-RjgOOR.js.map
@@ -1,7 +1,7 @@
1
- import { a as CLAUDE_SESSION_PIN_ENV } from "./ts-CT75CpeM.js";
1
+ import { a as CLAUDE_SESSION_PIN_ENV } from "./ts-Cl3CmLH9.js";
2
2
  import "./logger-CDIsZ-Pp.js";
3
- import { r as getInstalledPackage } from "./versionChecker-Bd09mqkZ.js";
4
- import { t as findSpawnHiddenLauncher } from "./rustBinary-DHgMI1uK.js";
3
+ import { r as getInstalledPackage } from "./versionChecker-Dhjyjxs_.js";
4
+ import { t as findSpawnHiddenLauncher } from "./rustBinary-B8IcqSw1.js";
5
5
  import { t as agentYesHome$1 } from "./agentYesHome-CtHb5b71.js";
6
6
  import "./JsonlStore-Bm5Nj6v_.js";
7
7
  import { a as updateGlobalPidStatus } from "./globalPidIndex-CoNr7tS8.js";
@@ -10,13 +10,13 @@ import { r as recordInbox } from "./messageLog-Bb_Ie3Ck.js";
10
10
  import { t as pgidForWrapper } from "./reaper-BNKvujYy.js";
11
11
  import "./todoAutomation-Cwnh4aWo.js";
12
12
  import "./configShared-YKfS6NMe.js";
13
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-CFd1V2O5.js";
14
- import { A as renderLogTailLines, D as readPtysize, E as readNotes, J as isTransientLockMkdirError, M as renderRawLogLines, N as resolveOne, O as recentMessageEdges, R as snapshotStatus, S as listRecords, W as writeToIpc, b as isUserTyping, f as extractNeedsInput, j as renderRawLog, k as recentReadEdges, l as deriveLiveStatus, nt as TYPING_BADGE, o as controlCodeFromName, p as extractTaskCounts, u as extractBadges } from "./subcommands-FTkZkqKy.js";
13
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-C5d64Xqj.js";
14
+ import { A as renderLogTailLines, D as readPtysize, E as readNotes, J as isTransientLockMkdirError, M as renderRawLogLines, N as resolveOne, O as recentMessageEdges, R as snapshotStatus, S as listRecords, W as writeToIpc, b as isUserTyping, f as extractNeedsInput, j as renderRawLog, k as recentReadEdges, l as deriveLiveStatus, nt as TYPING_BADGE, o as controlCodeFromName, p as extractTaskCounts, u as extractBadges } from "./subcommands-DSyCT0vl.js";
15
15
  import "./e2e-DB7BDdEA.js";
16
16
  import "./webrtcLink-CjckgIZe.js";
17
17
  import "./remotes-ZqD0FHl_.js";
18
18
  import { i as frameVisitorMessage, s as verifyCapability, t as MAX_CALLBACK_MSG_BYTES } from "./callbackCore-BlNdDILy.js";
19
- import { n as isCallbackRevoked, r as loadCallbackSecretReadOnly } from "./callback-BV3AhWeB.js";
19
+ import { n as isCallbackRevoked, r as loadCallbackSecretReadOnly } from "./callback-CCEQtwXX.js";
20
20
  import { a as getSpawnHook, c as hasProvisionHook, d as resolveSpawnCwd, i as getProvisionRoot, l as hasSpawnHook, r as getProvisionHook, u as isProvisionAllowed } from "./workspaceConfig-De5tgjeO.js";
21
21
  import { n as liveEnv, t as ensureNodeRuntime } from "./nodeRuntime-CgXWHe9p.js";
22
22
  import { r as spawnRejectionReason } from "./spawnGate-CeFYH-Ib.js";
@@ -1992,7 +1992,7 @@ Options:
1992
1992
  }
1993
1993
  });
1994
1994
  if (req.method === "GET" && p === "/api/ws") {
1995
- const ws = await import("./ws-B4zHUwc6.js");
1995
+ const ws = await import("./ws-Dw2fGxTI.js");
1996
1996
  try {
1997
1997
  await ws.loadProvision();
1998
1998
  } catch (e) {
@@ -2012,7 +2012,7 @@ Options:
2012
2012
  if (req.method === "GET" && p === "/api/ws/status") {
2013
2013
  const dirRaw = url.searchParams.get("path");
2014
2014
  if (!dirRaw) return new Response("missing ?path=<workspace dir>", { status: 400 });
2015
- const ws = await import("./ws-B4zHUwc6.js");
2015
+ const ws = await import("./ws-Dw2fGxTI.js");
2016
2016
  let prov;
2017
2017
  try {
2018
2018
  prov = await ws.loadProvision();
@@ -2601,7 +2601,7 @@ Options:
2601
2601
  const perm = body.perm ?? "r";
2602
2602
  if (perm !== "r" && perm !== "rw") return new Response(`invalid perm ${perm} (want r or rw)`, { status: 400 });
2603
2603
  try {
2604
- const { createScopedShare } = await import("./agentShare-C_rydTfo.js");
2604
+ const { createScopedShare } = await import("./agentShare-CpglhRYb.js");
2605
2605
  const share = await createScopedShare({
2606
2606
  agent: body.agent,
2607
2607
  perm,
@@ -2616,12 +2616,12 @@ Options:
2616
2616
  }
2617
2617
  }
2618
2618
  if (req.method === "GET" && p === "/api/shares") {
2619
- const { listShares } = await import("./agentShare-C_rydTfo.js");
2619
+ const { listShares } = await import("./agentShare-CpglhRYb.js");
2620
2620
  return Response.json(listShares());
2621
2621
  }
2622
2622
  const revokeM = /^\/api\/share\/([^/]+)$/.exec(p);
2623
2623
  if (req.method === "DELETE" && revokeM) {
2624
- const { revokeShare } = await import("./agentShare-C_rydTfo.js");
2624
+ const { revokeShare } = await import("./agentShare-CpglhRYb.js");
2625
2625
  const ok = revokeShare(decodeURIComponent(revokeM[1]));
2626
2626
  return new Response(ok ? "revoked" : "no such share", { status: ok ? 200 : 404 });
2627
2627
  }
@@ -2923,7 +2923,7 @@ Options:
2923
2923
  const shutdown = (resolve) => {
2924
2924
  if (heartbeat) clearInterval(heartbeat);
2925
2925
  closeShare?.();
2926
- import("./agentShare-C_rydTfo.js").then((m) => m.revokeAllShares()).catch(() => {});
2926
+ import("./agentShare-CpglhRYb.js").then((m) => m.revokeAllShares()).catch(() => {});
2927
2927
  server?.stop();
2928
2928
  Promise.resolve(releaseHostLock?.()).catch(() => {}).then(resolve);
2929
2929
  };
@@ -2936,4 +2936,4 @@ Options:
2936
2936
 
2937
2937
  //#endregion
2938
2938
  export { cmdServe, resolveLocalServeUrl };
2939
- //# sourceMappingURL=serve-C2KCUxTP.js.map
2939
+ //# sourceMappingURL=serve-DwF03sgB.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-C2KCUxTP.js");
35
+ const { cmdServe } = await import("./serve-DwF03sgB.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-CCKS4rtW.js.map
45
+ //# sourceMappingURL=setup-cZFxfS89.js.map
@@ -1243,19 +1243,19 @@ async function runSubcommand(argv) {
1243
1243
  return runTodoSubcommand(rest);
1244
1244
  }
1245
1245
  case "serve": {
1246
- const { cmdServe } = await import("./serve-C2KCUxTP.js");
1246
+ const { cmdServe } = await import("./serve-DwF03sgB.js");
1247
1247
  return cmdServe(rest);
1248
1248
  }
1249
1249
  case "setup": {
1250
- const { cmdSetup } = await import("./setup-CCKS4rtW.js");
1250
+ const { cmdSetup } = await import("./setup-cZFxfS89.js");
1251
1251
  return cmdSetup(rest);
1252
1252
  }
1253
1253
  case "ws": {
1254
- const { cmdWs } = await import("./ws-B4zHUwc6.js");
1254
+ const { cmdWs } = await import("./ws-Dw2fGxTI.js");
1255
1255
  return cmdWs(rest);
1256
1256
  }
1257
1257
  case "schedule": {
1258
- const { cmdSchedule } = await import("./schedule-0p4V_khb.js");
1258
+ const { cmdSchedule } = await import("./schedule-B-RjgOOR.js");
1259
1259
  return cmdSchedule(rest);
1260
1260
  }
1261
1261
  case "remote": {
@@ -1267,7 +1267,7 @@ async function runSubcommand(argv) {
1267
1267
  return cmdExpose(rest);
1268
1268
  }
1269
1269
  case "callback": {
1270
- const { cmdCallback } = await import("./callback-BgWZmpqC.js");
1270
+ const { cmdCallback } = await import("./callback-B3N2VJ1i.js");
1271
1271
  return cmdCallback(rest);
1272
1272
  }
1273
1273
  case "reap":
@@ -4305,7 +4305,7 @@ async function cmdNotify(rest) {
4305
4305
  }
4306
4306
  const ensure = async () => {
4307
4307
  if (!argv["ensure-daemon"]) return;
4308
- const { ensureDaemon } = await import("./notifyDaemon-CyLvaAwc.js");
4308
+ const { ensureDaemon } = await import("./notifyDaemon-CfQN5blR.js");
4309
4309
  await ensureDaemon().catch(() => null);
4310
4310
  };
4311
4311
  await heartbeatWatcher(parent, selfStartedAt);
@@ -4379,7 +4379,7 @@ async function cmdNotifyCursor(args) {
4379
4379
  }
4380
4380
  async function cmdNotifyd(rest) {
4381
4381
  const sub = rest[0] ?? "status";
4382
- const daemon = await import("./notifyDaemon-CyLvaAwc.js");
4382
+ const daemon = await import("./notifyDaemon-CfQN5blR.js");
4383
4383
  switch (sub) {
4384
4384
  case "run": return daemon.runDaemon();
4385
4385
  case "once": return daemon.runDaemon({ once: true });
@@ -4406,4 +4406,4 @@ async function cmdNotifyd(rest) {
4406
4406
 
4407
4407
  //#endregion
4408
4408
  export { daemonLockDir as $, renderLogTailLines as A, stopTipForCli as B, matchKeyword as C, readPtysize as D, readNotes as E, resolveResumeArgs as F, appendEvent as G, waitForLogQuiet as H, restartHintLines as I, isTransientLockMkdirError as J, gcInboxes as K, runSubcommand as L, renderRawLogLines as M, resolveOne as N, recentMessageEdges as O, resolveReadWindow as P, shouldStealLock as Q, snapshotStatus as R, listRecords as S, readAgentPtysize as T, writeKeysPaced as U, submitAndConfirm as V, writeToIpc as W, liveWatchers as X, listInboxParents as Y, readInbox as Z, isPidAlive as _, cmdHelp as a, isUserTyping as b, deriveLiveState as c, extractMenu as d, daemonLockOwnerPath as et, extractNeedsInput as f, isExitRequest as g, isAgentStuck as h, backoffWhileTyping as i, renderRawLog as j, recentReadEdges as k, deriveLiveStatus as l, finalizedLines as m, READ_PAGE_DEFAULT as n, TYPING_BADGE as nt, controlCodeFromName as o, extractTaskCounts as p, hostId as q, TYPING_WINDOW_MS as r, cursorAbs as s, GRACEFUL_EXIT_COMMANDS as t, notifyDir as tt, extractBadges as u, isSlashCommand as v, menuSelectKeys as w, lastStdinAt as x, isSubcommand as y, stdinActivityPath as z };
4409
- //# sourceMappingURL=subcommands-FTkZkqKy.js.map
4409
+ //# sourceMappingURL=subcommands-DSyCT0vl.js.map
@@ -2,7 +2,7 @@ import "./logger-CDIsZ-Pp.js";
2
2
  import "./globalPidIndex-CoNr7tS8.js";
3
3
  import "./messageLog-Bb_Ie3Ck.js";
4
4
  import "./configShared-YKfS6NMe.js";
5
- import { A as renderLogTailLines, B as stopTipForCli, C as matchKeyword, D as readPtysize, E as readNotes, F as resolveResumeArgs, H as waitForLogQuiet, I as restartHintLines, L as runSubcommand, M as renderRawLogLines, N as resolveOne, O as recentMessageEdges, P as resolveReadWindow, R as snapshotStatus, S as listRecords, T as readAgentPtysize, U as writeKeysPaced, V as submitAndConfirm, W as writeToIpc, _ as isPidAlive, a as cmdHelp, b as isUserTyping, c as deriveLiveState, d as extractMenu, f as extractNeedsInput, g as isExitRequest, h as isAgentStuck, i as backoffWhileTyping, j as renderRawLog, k as recentReadEdges, l as deriveLiveStatus, m as finalizedLines, n as READ_PAGE_DEFAULT, o as controlCodeFromName, p as extractTaskCounts, r as TYPING_WINDOW_MS, s as cursorAbs, t as GRACEFUL_EXIT_COMMANDS, u as extractBadges, v as isSlashCommand, w as menuSelectKeys, x as lastStdinAt, y as isSubcommand, z as stdinActivityPath } from "./subcommands-FTkZkqKy.js";
5
+ import { A as renderLogTailLines, B as stopTipForCli, C as matchKeyword, D as readPtysize, E as readNotes, F as resolveResumeArgs, H as waitForLogQuiet, I as restartHintLines, L as runSubcommand, M as renderRawLogLines, N as resolveOne, O as recentMessageEdges, P as resolveReadWindow, R as snapshotStatus, S as listRecords, T as readAgentPtysize, U as writeKeysPaced, V as submitAndConfirm, W as writeToIpc, _ as isPidAlive, a as cmdHelp, b as isUserTyping, c as deriveLiveState, d as extractMenu, f as extractNeedsInput, g as isExitRequest, h as isAgentStuck, i as backoffWhileTyping, j as renderRawLog, k as recentReadEdges, l as deriveLiveStatus, m as finalizedLines, n as READ_PAGE_DEFAULT, o as controlCodeFromName, p as extractTaskCounts, r as TYPING_WINDOW_MS, s as cursorAbs, t as GRACEFUL_EXIT_COMMANDS, u as extractBadges, v as isSlashCommand, w as menuSelectKeys, x as lastStdinAt, y as isSubcommand, z as stdinActivityPath } from "./subcommands-DSyCT0vl.js";
6
6
  import "./e2e-DB7BDdEA.js";
7
7
  import "./webrtcLink-CjckgIZe.js";
8
8
  import "./remotes-ZqD0FHl_.js";
@@ -1,5 +1,5 @@
1
1
  import { n as logger, t as addTransport } from "./logger-CDIsZ-Pp.js";
2
- import { r as getInstalledPackage } from "./versionChecker-Bd09mqkZ.js";
2
+ import { r as getInstalledPackage } from "./versionChecker-Dhjyjxs_.js";
3
3
  import { t as agentYesHome } from "./agentYesHome-CtHb5b71.js";
4
4
  import { i as shouldUseLock, r as releaseLock, t as acquireLock } from "./runningLock-CNMl13dC.js";
5
5
  import { i as readGlobalPids } from "./globalPidIndex-CoNr7tS8.js";
@@ -735,6 +735,47 @@ function tryCatch(catchFn, fn) {
735
735
  };
736
736
  }
737
737
 
738
+ //#endregion
739
+ //#region ts/agentNice.ts
740
+ /**
741
+ * Scheduler policy: agent CLIs run at a positive nice so they YIELD CPU to the
742
+ * interactive `ay serve` daemon (which stays at nice 0) under host load. This is
743
+ * why the web console (/w/) lags while the local terminal stays smooth: every
744
+ * byte for /w/ flows through the single `ay serve` event loop, which competes
745
+ * with N busy agent CLIs for CPU. We deprioritize the agents rather than raise
746
+ * serve because RAISING priority (negative nice) needs CAP_SYS_NICE, which is
747
+ * dropped in many containers (e.g. this one) — LOWERING priority is always
748
+ * allowed for your own processes, so this is portable.
749
+ *
750
+ * The value applies to the freshly-spawned CLI child; its threads and descendant
751
+ * processes inherit it. Standalone `ay claude` with no contention is unaffected
752
+ * (nice only matters when CPU is scarce).
753
+ *
754
+ * Configure with AGENT_YES_AGENT_NICE: an integer 0..19. Default 5. 0 disables.
755
+ * Mirrored in the Rust runtime (rs/src/pty_spawner.rs) — keep them in sync.
756
+ */
757
+ const DEFAULT_AGENT_NICE = 5;
758
+ /** Parse AGENT_YES_AGENT_NICE → a clamped positive nice (0..19). 0 = disabled. */
759
+ function agentNiceValue(env = process.env) {
760
+ const raw = env.AGENT_YES_AGENT_NICE;
761
+ if (raw === void 0 || raw === "") return DEFAULT_AGENT_NICE;
762
+ const n = Number(raw);
763
+ if (!Number.isFinite(n)) return DEFAULT_AGENT_NICE;
764
+ return Math.max(0, Math.min(19, Math.trunc(n)));
765
+ }
766
+ /**
767
+ * Best-effort: deprioritize a freshly-spawned agent process to the configured
768
+ * nice. Swallows all errors — a scheduling hint must never break a spawn (and on
769
+ * a platform/where setpriority is unavailable it simply no-ops).
770
+ */
771
+ async function applyAgentNice(pid, env = process.env) {
772
+ const nice = agentNiceValue(env);
773
+ if (nice <= 0) return;
774
+ try {
775
+ (await import("os")).setPriority(pid, nice);
776
+ } catch {}
777
+ }
778
+
738
779
  //#endregion
739
780
  //#region ts/pty-fix.ts
740
781
  var pty_fix_exports = /* @__PURE__ */ __exportAll({});
@@ -904,6 +945,7 @@ function spawnAgent(options) {
904
945
  logger.debug(`Spawning ${bin} with args: ${JSON.stringify(args)}`);
905
946
  const spawned = pty_default.spawn(bin, args, ptyOptions);
906
947
  logger.info(`[${cli}-yes] Spawned ${bin} with PID ${spawned.pid} (agent-yes v${getInstalledPackage().version})`);
948
+ applyAgentNice(spawned.pid);
907
949
  return spawned;
908
950
  };
909
951
  return tryCatch((error, attempts, spawn, ...args) => {
@@ -1919,4 +1961,4 @@ function sleep(ms) {
1919
1961
 
1920
1962
  //#endregion
1921
1963
  export { CLAUDE_SESSION_PIN_ENV as a, AgentContext as i, agentYes as n, removeControlCharacters as o, config as r, CLIS_CONFIG as t };
1922
- //# sourceMappingURL=ts-CT75CpeM.js.map
1964
+ //# sourceMappingURL=ts-Cl3CmLH9.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.227.0";
10
+ var version = "1.228.0";
11
11
 
12
12
  //#endregion
13
13
  //#region ts/versionChecker.ts
@@ -215,4 +215,4 @@ async function displayVersion() {
215
215
 
216
216
  //#endregion
217
217
  export { versionString as i, displayVersion as n, getInstalledPackage as r, checkAndAutoUpdate as t };
218
- //# sourceMappingURL=versionChecker-Bd09mqkZ.js.map
218
+ //# sourceMappingURL=versionChecker-Dhjyjxs_.js.map
@@ -2,7 +2,7 @@ import "./logger-CDIsZ-Pp.js";
2
2
  import "./globalPidIndex-CoNr7tS8.js";
3
3
  import "./messageLog-Bb_Ie3Ck.js";
4
4
  import "./configShared-YKfS6NMe.js";
5
- import { S as listRecords } from "./subcommands-FTkZkqKy.js";
5
+ import { S as listRecords } from "./subcommands-DSyCT0vl.js";
6
6
  import "./e2e-DB7BDdEA.js";
7
7
  import "./webrtcLink-CjckgIZe.js";
8
8
  import "./remotes-ZqD0FHl_.js";
@@ -418,4 +418,4 @@ async function cmdWs(args) {
418
418
 
419
419
  //#endregion
420
420
  export { WS_JSON_SCHEMA, cmdWs, collectWorkspaces, isPathInside, loadProvision, workspaceStatus };
421
- //# sourceMappingURL=ws-B4zHUwc6.js.map
421
+ //# sourceMappingURL=ws-Dw2fGxTI.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-yes",
3
- "version": "1.227.0",
3
+ "version": "1.228.0",
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",
@@ -0,0 +1,24 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { agentNiceValue } from "./agentNice.ts";
3
+
4
+ describe("agentNice.agentNiceValue", () => {
5
+ it("defaults to 5 when unset or empty", () => {
6
+ expect(agentNiceValue({})).toBe(5);
7
+ expect(agentNiceValue({ AGENT_YES_AGENT_NICE: "" })).toBe(5);
8
+ });
9
+
10
+ it("honors a valid positive value", () => {
11
+ expect(agentNiceValue({ AGENT_YES_AGENT_NICE: "10" })).toBe(10);
12
+ expect(agentNiceValue({ AGENT_YES_AGENT_NICE: "0" })).toBe(0); // 0 = disabled
13
+ });
14
+
15
+ it("clamps into the 0..19 nice range (never elevates)", () => {
16
+ expect(agentNiceValue({ AGENT_YES_AGENT_NICE: "-5" })).toBe(0); // no negative (needs CAP_SYS_NICE)
17
+ expect(agentNiceValue({ AGENT_YES_AGENT_NICE: "40" })).toBe(19);
18
+ });
19
+
20
+ it("falls back to the default on garbage", () => {
21
+ expect(agentNiceValue({ AGENT_YES_AGENT_NICE: "abc" })).toBe(5);
22
+ expect(agentNiceValue({ AGENT_YES_AGENT_NICE: "3.9" })).toBe(3); // truncates
23
+ });
24
+ });
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Scheduler policy: agent CLIs run at a positive nice so they YIELD CPU to the
3
+ * interactive `ay serve` daemon (which stays at nice 0) under host load. This is
4
+ * why the web console (/w/) lags while the local terminal stays smooth: every
5
+ * byte for /w/ flows through the single `ay serve` event loop, which competes
6
+ * with N busy agent CLIs for CPU. We deprioritize the agents rather than raise
7
+ * serve because RAISING priority (negative nice) needs CAP_SYS_NICE, which is
8
+ * dropped in many containers (e.g. this one) — LOWERING priority is always
9
+ * allowed for your own processes, so this is portable.
10
+ *
11
+ * The value applies to the freshly-spawned CLI child; its threads and descendant
12
+ * processes inherit it. Standalone `ay claude` with no contention is unaffected
13
+ * (nice only matters when CPU is scarce).
14
+ *
15
+ * Configure with AGENT_YES_AGENT_NICE: an integer 0..19. Default 5. 0 disables.
16
+ * Mirrored in the Rust runtime (rs/src/pty_spawner.rs) — keep them in sync.
17
+ */
18
+
19
+ const DEFAULT_AGENT_NICE = 5;
20
+
21
+ /** Parse AGENT_YES_AGENT_NICE → a clamped positive nice (0..19). 0 = disabled. */
22
+ export function agentNiceValue(env: NodeJS.ProcessEnv = process.env): number {
23
+ const raw = env.AGENT_YES_AGENT_NICE;
24
+ if (raw === undefined || raw === "") return DEFAULT_AGENT_NICE;
25
+ const n = Number(raw);
26
+ if (!Number.isFinite(n)) return DEFAULT_AGENT_NICE;
27
+ // Positive-only: we never elevate (negative needs CAP_SYS_NICE and would fight
28
+ // the daemon). Clamp into the standard nice range.
29
+ return Math.max(0, Math.min(19, Math.trunc(n)));
30
+ }
31
+
32
+ /**
33
+ * Best-effort: deprioritize a freshly-spawned agent process to the configured
34
+ * nice. Swallows all errors — a scheduling hint must never break a spawn (and on
35
+ * a platform/where setpriority is unavailable it simply no-ops).
36
+ */
37
+ export async function applyAgentNice(
38
+ pid: number,
39
+ env: NodeJS.ProcessEnv = process.env,
40
+ ): Promise<void> {
41
+ const nice = agentNiceValue(env);
42
+ if (nice <= 0) return;
43
+ try {
44
+ const os = await import("os");
45
+ os.setPriority(pid, nice);
46
+ } catch {
47
+ /* setpriority unavailable / raced with exit — ignore */
48
+ }
49
+ }