agent-yes 1.238.1 → 1.238.2

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,8 +1,8 @@
1
- import { t as CLIS_CONFIG } from "./ts-BQpyYSlD.js";
1
+ import { t as CLIS_CONFIG } from "./ts-Cnhsw8GN.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-Bu2lWzhc.js.map
8
+ //# sourceMappingURL=SUPPORTED_CLIS-C2CFOND-.js.map
@@ -1,11 +1,11 @@
1
1
  import "./logger-CDIsZ-Pp.js";
2
- import "./versionChecker-DOnKQuqO.js";
3
- import "./ts-BQpyYSlD.js";
2
+ import "./versionChecker-CBzYImFt.js";
3
+ import "./ts-Cnhsw8GN.js";
4
4
  import "./todoAutomation-Buo457VO.js";
5
5
  import "./JsonlStore-CPGIR0Wy.js";
6
6
  import "./globalPidIndex-D9DOSd-c.js";
7
7
  import "./pidStore-6EZd5DUv.js";
8
8
  import "./messageLog-C-YIzhRj.js";
9
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-Bu2lWzhc.js";
9
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-C2CFOND-.js";
10
10
 
11
11
  export { SUPPORTED_CLIS };
@@ -3,7 +3,7 @@ import "./globalPidIndex-D9DOSd-c.js";
3
3
  import "./messageLog-C-YIzhRj.js";
4
4
  import "./e2e-CEIdJGZ7.js";
5
5
  import "./configShared-9wVlbPyC.js";
6
- import { N as resolveOne } from "./subcommands-B8I4Wykx.js";
6
+ import { P as resolveOne } from "./subcommands-CuvZqZTM.js";
7
7
  import "./webrtcLink-VQhWmKOw.js";
8
8
  import "./remotes-Bem6WIyU.js";
9
9
  import { a as startShare } from "./share-B9u8-I3y.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-mmHPVsnQ.js.map
232
+ //# sourceMappingURL=agentShare-CyDqjBM_.js.map
@@ -3,10 +3,10 @@ import "./globalPidIndex-D9DOSd-c.js";
3
3
  import "./messageLog-C-YIzhRj.js";
4
4
  import "./e2e-CEIdJGZ7.js";
5
5
  import "./configShared-9wVlbPyC.js";
6
- import "./subcommands-B8I4Wykx.js";
6
+ import "./subcommands-CuvZqZTM.js";
7
7
  import "./webrtcLink-VQhWmKOw.js";
8
8
  import "./remotes-Bem6WIyU.js";
9
9
  import "./callbackCore-DAYcemCC.js";
10
- import { i as loadOrCreateCallbackSecret, n as isCallbackRevoked, r as loadCallbackSecretReadOnly, t as cmdCallback } from "./callback-oLtnAuCg.js";
10
+ import { i as loadOrCreateCallbackSecret, n as isCallbackRevoked, r as loadCallbackSecretReadOnly, t as cmdCallback } from "./callback-D-kUTlR6.js";
11
11
 
12
12
  export { cmdCallback };
@@ -1,5 +1,5 @@
1
1
  import { t as agentYesHome } from "./agentYesHome-CtmsY6I-.js";
2
- import { N as resolveOne } from "./subcommands-B8I4Wykx.js";
2
+ import { P as resolveOne } from "./subcommands-CuvZqZTM.js";
3
3
  import { a as mintCapability, o as parseExpires } from "./callbackCore-DAYcemCC.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-BD_hbsek.js");
75
+ const { resolveLocalServeUrl } = await import("./serve-CuMtnSLs.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-oLtnAuCg.js.map
190
+ //# sourceMappingURL=callback-D-kUTlR6.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-DOnKQuqO.js";
5
- import { n as getRustBinary } from "./rustBinary-CZv3VsiT.js";
4
+ import { i as versionString, n as displayVersion, t as checkAndAutoUpdate } from "./versionChecker-CBzYImFt.js";
5
+ import { n as getRustBinary } from "./rustBinary-CCi6Sqh5.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-0-Yj64oi.js");
288
+ const { isSubcommand, runSubcommand, cmdHelp, isUnknownManagerToken } = await import("./subcommands-z2YriUNK.js");
289
289
  if (isHelpFlag && process.argv.length === 3) {
290
290
  await cmdHelp(managerCommands);
291
291
  process.exit(0);
@@ -294,6 +294,13 @@ function buildRustArgs(argv, cliFromScript, supportedClis) {
294
294
  const code = await runSubcommand(process.argv);
295
295
  process.exit(code ?? 0);
296
296
  }
297
+ {
298
+ const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-DmflHNKL.js");
299
+ if (isUnknownManagerToken(rawArg, managerCommands, SUPPORTED_CLIS)) {
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
+ process.exit(1);
302
+ }
303
+ }
297
304
  }
298
305
  {
299
306
  const { detectCwdDeprecation, SUPPRESS_CWD_WARN_ENV } = await import("./cwdDeprecation-Cd8Ykm2t.js");
@@ -339,7 +346,7 @@ if (config.useRust) {
339
346
  }
340
347
  }
341
348
  if (rustBinary) {
342
- const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-DT0abWhE.js");
349
+ const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-DmflHNKL.js");
343
350
  const rustArgs = buildRustArgs(process.argv, config.cli, SUPPORTED_CLIS);
344
351
  if (config.verbose) {
345
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-DOnKQuqO.js";
3
- import { a as hasTodoStore, c as AgentContext, i as answerAsk, n as agentYes, o as listAsks, r as config, s as listAsksForProject, t as CLIS_CONFIG } from "./ts-BQpyYSlD.js";
2
+ import "./versionChecker-CBzYImFt.js";
3
+ import { a as hasTodoStore, c as AgentContext, i as answerAsk, n as agentYes, o as listAsks, r as config, s as listAsksForProject, t as CLIS_CONFIG } from "./ts-Cnhsw8GN.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-Buo457VO.js";
5
5
  import "./JsonlStore-CPGIR0Wy.js";
6
6
  import "./globalPidIndex-D9DOSd-c.js";
@@ -3,7 +3,7 @@ import "./globalPidIndex-D9DOSd-c.js";
3
3
  import "./messageLog-C-YIzhRj.js";
4
4
  import "./e2e-CEIdJGZ7.js";
5
5
  import "./configShared-9wVlbPyC.js";
6
- 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-B8I4Wykx.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-CuvZqZTM.js";
7
7
  import "./webrtcLink-VQhWmKOw.js";
8
8
  import "./remotes-Bem6WIyU.js";
9
9
  import { mkdir, readFile, rename, rm, stat, writeFile } from "fs/promises";
@@ -589,4 +589,4 @@ async function ensureDaemon() {
589
589
 
590
590
  //#endregion
591
591
  export { daemonStatus, ensureDaemon, requestDaemonStop, runDaemon };
592
- //# sourceMappingURL=notifyDaemon-DnLTIw8s.js.map
592
+ //# sourceMappingURL=notifyDaemon-BjyUCpbx.js.map
@@ -1,4 +1,4 @@
1
- import { r as getInstalledPackage } from "./versionChecker-DOnKQuqO.js";
1
+ import { r as getInstalledPackage } from "./versionChecker-CBzYImFt.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-CZv3VsiT.js.map
228
+ //# sourceMappingURL=rustBinary-CCi6Sqh5.js.map
@@ -1,12 +1,12 @@
1
1
  import "./logger-CDIsZ-Pp.js";
2
- import "./versionChecker-DOnKQuqO.js";
3
- import "./ts-BQpyYSlD.js";
2
+ import "./versionChecker-CBzYImFt.js";
3
+ import "./ts-Cnhsw8GN.js";
4
4
  import "./todoAutomation-Buo457VO.js";
5
5
  import "./JsonlStore-CPGIR0Wy.js";
6
6
  import "./globalPidIndex-D9DOSd-c.js";
7
7
  import "./pidStore-6EZd5DUv.js";
8
8
  import "./messageLog-C-YIzhRj.js";
9
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-Bu2lWzhc.js";
9
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-C2CFOND-.js";
10
10
  import { d as resolveSpawnCwd } from "./workspaceConfig-B7HaQ-MI.js";
11
11
  import { n as liveEnv, t as ensureNodeRuntime } from "./nodeRuntime-Bf88NPqj.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-Vce114TJ.js.map
156
+ //# sourceMappingURL=schedule-CHSe24Je.js.map
@@ -1,7 +1,7 @@
1
1
  import "./logger-CDIsZ-Pp.js";
2
- import { r as getInstalledPackage } from "./versionChecker-DOnKQuqO.js";
3
- import { t as findSpawnHiddenLauncher } from "./rustBinary-CZv3VsiT.js";
4
- import { i as answerAsk, l as CLAUDE_SESSION_PIN_ENV, o as listAsks } from "./ts-BQpyYSlD.js";
2
+ import { r as getInstalledPackage } from "./versionChecker-CBzYImFt.js";
3
+ import { t as findSpawnHiddenLauncher } from "./rustBinary-CCi6Sqh5.js";
4
+ import { i as answerAsk, l as CLAUDE_SESSION_PIN_ENV, o as listAsks } from "./ts-Cnhsw8GN.js";
5
5
  import { t as agentYesHome$1 } from "./agentYesHome-CtmsY6I-.js";
6
6
  import { x as removeControlCharacters } from "./todoAutomation-Buo457VO.js";
7
7
  import "./JsonlStore-CPGIR0Wy.js";
@@ -11,12 +11,12 @@ import { r as recordInbox } from "./messageLog-C-YIzhRj.js";
11
11
  import { t as pgidForWrapper } from "./reaper-DP49VCKx.js";
12
12
  import "./e2e-CEIdJGZ7.js";
13
13
  import "./configShared-9wVlbPyC.js";
14
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-Bu2lWzhc.js";
15
- 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-B8I4Wykx.js";
14
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-C2CFOND-.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-CuvZqZTM.js";
16
16
  import "./webrtcLink-VQhWmKOw.js";
17
17
  import "./remotes-Bem6WIyU.js";
18
18
  import { i as frameVisitorMessage, s as verifyCapability, t as MAX_CALLBACK_MSG_BYTES } from "./callbackCore-DAYcemCC.js";
19
- import { n as isCallbackRevoked, r as loadCallbackSecretReadOnly } from "./callback-oLtnAuCg.js";
19
+ import { n as isCallbackRevoked, r as loadCallbackSecretReadOnly } from "./callback-D-kUTlR6.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-B7HaQ-MI.js";
21
21
  import { n as liveEnv, t as ensureNodeRuntime } from "./nodeRuntime-Bf88NPqj.js";
22
22
  import { r as spawnRejectionReason } from "./spawnGate-Bo_LFgt9.js";
@@ -2246,7 +2246,7 @@ Options:
2246
2246
  }
2247
2247
  });
2248
2248
  if (req.method === "GET" && p === "/api/ws") {
2249
- const ws = await import("./ws-f01kHd5z.js");
2249
+ const ws = await import("./ws-53rrEEbz.js");
2250
2250
  try {
2251
2251
  await ws.loadProvision();
2252
2252
  } catch (e) {
@@ -2266,7 +2266,7 @@ Options:
2266
2266
  if (req.method === "GET" && p === "/api/ws/status") {
2267
2267
  const dirRaw = url.searchParams.get("path");
2268
2268
  if (!dirRaw) return new Response("missing ?path=<workspace dir>", { status: 400 });
2269
- const ws = await import("./ws-f01kHd5z.js");
2269
+ const ws = await import("./ws-53rrEEbz.js");
2270
2270
  let prov;
2271
2271
  try {
2272
2272
  prov = await ws.loadProvision();
@@ -2988,7 +2988,7 @@ Options:
2988
2988
  const perm = body.perm ?? "r";
2989
2989
  if (perm !== "r" && perm !== "rw") return new Response(`invalid perm ${perm} (want r or rw)`, { status: 400 });
2990
2990
  try {
2991
- const { createScopedShare } = await import("./agentShare-mmHPVsnQ.js");
2991
+ const { createScopedShare } = await import("./agentShare-CyDqjBM_.js");
2992
2992
  const share = await createScopedShare({
2993
2993
  agent: body.agent,
2994
2994
  perm,
@@ -3003,12 +3003,12 @@ Options:
3003
3003
  }
3004
3004
  }
3005
3005
  if (req.method === "GET" && p === "/api/shares") {
3006
- const { listShares } = await import("./agentShare-mmHPVsnQ.js");
3006
+ const { listShares } = await import("./agentShare-CyDqjBM_.js");
3007
3007
  return Response.json(listShares());
3008
3008
  }
3009
3009
  const revokeM = /^\/api\/share\/([^/]+)$/.exec(p);
3010
3010
  if (req.method === "DELETE" && revokeM) {
3011
- const { revokeShare } = await import("./agentShare-mmHPVsnQ.js");
3011
+ const { revokeShare } = await import("./agentShare-CyDqjBM_.js");
3012
3012
  const ok = revokeShare(decodeURIComponent(revokeM[1]));
3013
3013
  return new Response(ok ? "revoked" : "no such share", { status: ok ? 200 : 404 });
3014
3014
  }
@@ -3310,7 +3310,7 @@ Options:
3310
3310
  const shutdown = (resolve) => {
3311
3311
  if (heartbeat) clearInterval(heartbeat);
3312
3312
  closeShare?.();
3313
- import("./agentShare-mmHPVsnQ.js").then((m) => m.revokeAllShares()).catch(() => {});
3313
+ import("./agentShare-CyDqjBM_.js").then((m) => m.revokeAllShares()).catch(() => {});
3314
3314
  server?.stop();
3315
3315
  Promise.resolve(releaseHostLock?.()).catch(() => {}).then(resolve);
3316
3316
  };
@@ -3323,4 +3323,4 @@ Options:
3323
3323
 
3324
3324
  //#endregion
3325
3325
  export { cmdServe, loadTokenReadOnly, mintScopedTermToken, resolveDaemonHttpBase, resolveLocalServeUrl };
3326
- //# sourceMappingURL=serve-BD_hbsek.js.map
3326
+ //# sourceMappingURL=serve-CuMtnSLs.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-BD_hbsek.js");
35
+ const { cmdServe } = await import("./serve-CuMtnSLs.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-D26oT9jg.js.map
45
+ //# sourceMappingURL=setup-wPtsNZZ5.js.map
@@ -1212,6 +1212,20 @@ function isSubcommand(name, managerCommands = true) {
1212
1212
  return SUBCOMMANDS.has(name) || managerCommands && MANAGER_SUBCOMMANDS.has(name);
1213
1213
  }
1214
1214
  /**
1215
+ * Footgun guard for the MANAGER entry (`ay`/`agent-yes`): true when the first arg
1216
+ * is a bare word (not a flag) that is neither a subcommand nor a known CLI — a
1217
+ * typo, or a newer subcommand run on an older build. The caller should error
1218
+ * rather than silently spawn an agent with the word as a prompt (taku 2026-07-26:
1219
+ * bare `ay <prompt>` is too dangerous; a spawn must name a CLI — `ay <cli> …` or
1220
+ * `--cli`). Never fires for cli-bound aliases (cy/claude-yes/…), where the first
1221
+ * word is legitimately the prompt, nor for flags or an empty invocation.
1222
+ */
1223
+ function isUnknownManagerToken(rawArg, managerCommands, supportedClis) {
1224
+ if (!managerCommands || !rawArg || rawArg.startsWith("-")) return false;
1225
+ if (isSubcommand(rawArg, managerCommands)) return false;
1226
+ return !supportedClis.includes(rawArg);
1227
+ }
1228
+ /**
1215
1229
  * Top-level entry. Returns the desired process exit code, or null if argv
1216
1230
  * is not a subcommand invocation.
1217
1231
  */
@@ -1253,31 +1267,31 @@ async function runSubcommand(argv) {
1253
1267
  return cmdCh(rest);
1254
1268
  }
1255
1269
  case "term": {
1256
- const { cmdTerm } = await import("./terminal-ByvAvbpu.js");
1270
+ const { cmdTerm } = await import("./terminal-CBbBQMcT.js");
1257
1271
  return cmdTerm(rest);
1258
1272
  }
1259
1273
  case "widget": {
1260
- const { cmdWidget } = await import("./widget-DF2p2P0s.js");
1274
+ const { cmdWidget } = await import("./widget-j4TWqwpU.js");
1261
1275
  return cmdWidget(rest);
1262
1276
  }
1263
1277
  case "mint": {
1264
- const { cmdMint } = await import("./widget-DF2p2P0s.js");
1278
+ const { cmdMint } = await import("./widget-j4TWqwpU.js");
1265
1279
  return cmdMint(rest);
1266
1280
  }
1267
1281
  case "serve": {
1268
- const { cmdServe } = await import("./serve-BD_hbsek.js");
1282
+ const { cmdServe } = await import("./serve-CuMtnSLs.js");
1269
1283
  return cmdServe(rest);
1270
1284
  }
1271
1285
  case "setup": {
1272
- const { cmdSetup } = await import("./setup-D26oT9jg.js");
1286
+ const { cmdSetup } = await import("./setup-wPtsNZZ5.js");
1273
1287
  return cmdSetup(rest);
1274
1288
  }
1275
1289
  case "ws": {
1276
- const { cmdWs } = await import("./ws-f01kHd5z.js");
1290
+ const { cmdWs } = await import("./ws-53rrEEbz.js");
1277
1291
  return cmdWs(rest);
1278
1292
  }
1279
1293
  case "schedule": {
1280
- const { cmdSchedule } = await import("./schedule-Vce114TJ.js");
1294
+ const { cmdSchedule } = await import("./schedule-CHSe24Je.js");
1281
1295
  return cmdSchedule(rest);
1282
1296
  }
1283
1297
  case "remote": {
@@ -1289,7 +1303,7 @@ async function runSubcommand(argv) {
1289
1303
  return cmdExpose(rest);
1290
1304
  }
1291
1305
  case "callback": {
1292
- const { cmdCallback } = await import("./callback-CNkRhvP-.js");
1306
+ const { cmdCallback } = await import("./callback-Bb5dBd02.js");
1293
1307
  return cmdCallback(rest);
1294
1308
  }
1295
1309
  case "reap":
@@ -4327,7 +4341,7 @@ async function cmdNotify(rest) {
4327
4341
  }
4328
4342
  const ensure = async () => {
4329
4343
  if (!argv["ensure-daemon"]) return;
4330
- const { ensureDaemon } = await import("./notifyDaemon-DnLTIw8s.js");
4344
+ const { ensureDaemon } = await import("./notifyDaemon-BjyUCpbx.js");
4331
4345
  await ensureDaemon().catch(() => null);
4332
4346
  };
4333
4347
  await heartbeatWatcher(parent, selfStartedAt);
@@ -4401,7 +4415,7 @@ async function cmdNotifyCursor(args) {
4401
4415
  }
4402
4416
  async function cmdNotifyd(rest) {
4403
4417
  const sub = rest[0] ?? "status";
4404
- const daemon = await import("./notifyDaemon-DnLTIw8s.js");
4418
+ const daemon = await import("./notifyDaemon-BjyUCpbx.js");
4405
4419
  switch (sub) {
4406
4420
  case "run": return daemon.runDaemon();
4407
4421
  case "once": return daemon.runDaemon({ once: true });
@@ -4427,5 +4441,5 @@ async function cmdNotifyd(rest) {
4427
4441
  }
4428
4442
 
4429
4443
  //#endregion
4430
- 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 };
4431
- //# sourceMappingURL=subcommands-B8I4Wykx.js.map
4444
+ 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 };
4445
+ //# sourceMappingURL=subcommands-CuvZqZTM.js.map
@@ -0,0 +1,10 @@
1
+ import "./logger-CDIsZ-Pp.js";
2
+ import "./globalPidIndex-D9DOSd-c.js";
3
+ import "./messageLog-C-YIzhRj.js";
4
+ import "./e2e-CEIdJGZ7.js";
5
+ import "./configShared-9wVlbPyC.js";
6
+ import { A as recentReadEdges, B as stdinActivityPath, C as listRecords, D as readNotes, E as readAgentPtysize, F as resolveReadWindow, G as writeToIpc, H as submitAndConfirm, I as resolveResumeArgs, L as restartHintLines, M as renderRawLog, N as renderRawLogLines, O as readPtysize, P as resolveOne, R as runSubcommand, S as lastStdinAt, T as menuSelectKeys, U as waitForLogQuiet, V as stopTipForCli, W as writeKeysPaced, _ as isPidAlive, a as cmdHelp, b as isUnknownManagerToken, c as deriveLiveState, d as extractMenu, f as extractNeedsInput, g as isExitRequest, h as isAgentStuck, i as backoffWhileTyping, j as renderLogTailLines, k as recentMessageEdges, 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 matchKeyword, x as isUserTyping, y as isSubcommand, z as snapshotStatus } from "./subcommands-CuvZqZTM.js";
7
+ import "./webrtcLink-VQhWmKOw.js";
8
+ import "./remotes-Bem6WIyU.js";
9
+
10
+ export { cmdHelp, isSubcommand, isUnknownManagerToken, runSubcommand };
@@ -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-BD_hbsek.js");
101
+ const { mintScopedTermToken } = await import("./serve-CuMtnSLs.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-ByvAvbpu.js.map
138
+ //# sourceMappingURL=terminal-CBbBQMcT.js.map
@@ -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 { r as getInstalledPackage } from "./versionChecker-DOnKQuqO.js";
3
+ import { r as getInstalledPackage } from "./versionChecker-CBzYImFt.js";
4
4
  import { t as agentYesHome } from "./agentYesHome-CtmsY6I-.js";
5
5
  import { d as openStore, p as LIFECYCLES, x as removeControlCharacters } from "./todoAutomation-Buo457VO.js";
6
6
  import { i as shouldUseLock, r as releaseLock, t as acquireLock } from "./runningLock-DBoONoM-.js";
@@ -2027,4 +2027,4 @@ function sleep(ms) {
2027
2027
 
2028
2028
  //#endregion
2029
2029
  export { hasTodoStore as a, AgentContext as c, answerAsk as i, CLAUDE_SESSION_PIN_ENV as l, agentYes as n, listAsks as o, config as r, listAsksForProject as s, CLIS_CONFIG as t };
2030
- //# sourceMappingURL=ts-BQpyYSlD.js.map
2030
+ //# sourceMappingURL=ts-Cnhsw8GN.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.238.1";
10
+ var version = "1.238.2";
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-DOnKQuqO.js.map
218
+ //# sourceMappingURL=versionChecker-CBzYImFt.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-BD_hbsek.js");
31
+ const { resolveDaemonHttpBase, loadTokenReadOnly } = await import("./serve-CuMtnSLs.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() ?? "";
@@ -153,7 +153,7 @@ async function cmdMint(args) {
153
153
  const bad = caps.filter((c) => !KNOWN_CAPS.has(c));
154
154
  if (bad.length) throw new Error(`unknown cap(s): ${bad.join(", ")} (valid: ${[...KNOWN_CAPS].join(", ")})`);
155
155
  const ttlSec = parseTtlSec(typeof flags.ttl === "string" ? flags.ttl : "15m");
156
- const { mintScopedTermToken } = await import("./serve-BD_hbsek.js");
156
+ const { mintScopedTermToken } = await import("./serve-CuMtnSLs.js");
157
157
  const r = await mintScopedTermToken(target, {
158
158
  ttlSec,
159
159
  caps
@@ -169,4 +169,4 @@ async function cmdMint(args) {
169
169
 
170
170
  //#endregion
171
171
  export { cmdMint, cmdWidget };
172
- //# sourceMappingURL=widget-DF2p2P0s.js.map
172
+ //# sourceMappingURL=widget-j4TWqwpU.js.map
@@ -3,7 +3,7 @@ import "./globalPidIndex-D9DOSd-c.js";
3
3
  import "./messageLog-C-YIzhRj.js";
4
4
  import "./e2e-CEIdJGZ7.js";
5
5
  import "./configShared-9wVlbPyC.js";
6
- import { S as listRecords } from "./subcommands-B8I4Wykx.js";
6
+ import { C as listRecords } from "./subcommands-CuvZqZTM.js";
7
7
  import "./webrtcLink-VQhWmKOw.js";
8
8
  import "./remotes-Bem6WIyU.js";
9
9
  import { i as getProvisionRoot } from "./workspaceConfig-B7HaQ-MI.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-f01kHd5z.js.map
421
+ //# sourceMappingURL=ws-53rrEEbz.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-yes",
3
- "version": "1.238.1",
3
+ "version": "1.238.2",
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",
package/ts/cli.ts CHANGED
@@ -28,7 +28,9 @@ import { buildRustArgs } from "./buildRustArgs.ts";
28
28
  const managerCommands = !invokedCliName(process.argv);
29
29
  // Intercept bare -h/--help so we show TS subcommands, not just Rust agent-runner options.
30
30
  const isHelpFlag = rawArg === "-h" || rawArg === "--help";
31
- const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands.ts");
31
+ const { isSubcommand, runSubcommand, cmdHelp, isUnknownManagerToken } = await import(
32
+ "./subcommands.ts"
33
+ );
32
34
  if (isHelpFlag && process.argv.length === 3) {
33
35
  await cmdHelp(managerCommands);
34
36
  process.exit(0);
@@ -37,6 +39,21 @@ import { buildRustArgs } from "./buildRustArgs.ts";
37
39
  const code = await runSubcommand(process.argv);
38
40
  process.exit(code ?? 0);
39
41
  }
42
+ // Footgun guard: on the manager entry, a bare first word that is neither a
43
+ // subcommand nor a known CLI is a typo or a newer subcommand on an older build
44
+ // — error instead of silently spawning an agent with it as the prompt (taku
45
+ // 2026-07-26). A spawn must name a CLI: `ay <cli> …` or `ay --cli <cli> …`.
46
+ {
47
+ const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS.ts");
48
+ if (isUnknownManagerToken(rawArg, managerCommands, SUPPORTED_CLIS)) {
49
+ process.stderr.write(
50
+ `ay: unknown subcommand or CLI '${rawArg}'.\n` +
51
+ ` See 'ay help' for subcommands. To run an agent, name a CLI:\n` +
52
+ ` 'ay <cli> …' (e.g. 'ay claude …') or 'ay --cli <cli> …'.\n`,
53
+ );
54
+ process.exit(1);
55
+ }
56
+ }
40
57
  }
41
58
 
42
59
  // Deprecation: `--cwd <dir>` on an agent run. Runs AFTER the subcommand fast
@@ -113,6 +113,29 @@ describe("subcommands.isSubcommand", () => {
113
113
  });
114
114
  });
115
115
 
116
+ describe("subcommands.isUnknownManagerToken (footgun guard)", () => {
117
+ const CLIS = ["claude", "codex", "gemini"];
118
+ it("flags a bare non-cli non-subcommand word on the manager entry", async () => {
119
+ const { isUnknownManagerToken } = await loadModule();
120
+ // `ay frobnicate` / a newer subcommand on an older build — neither a
121
+ // subcommand nor a CLI here → error (rather than spawn it as a prompt).
122
+ expect(isUnknownManagerToken("frobnicate", true, CLIS)).toBe(true);
123
+ expect(isUnknownManagerToken("xyzzy", true, CLIS)).toBe(true);
124
+ });
125
+ it("allows a known CLI, a subcommand, a flag, and empty", async () => {
126
+ const { isUnknownManagerToken } = await loadModule();
127
+ expect(isUnknownManagerToken("claude", true, CLIS)).toBe(false); // `ay claude …`
128
+ expect(isUnknownManagerToken("ls", true, CLIS)).toBe(false); // subcommand
129
+ expect(isUnknownManagerToken("--cli", true, CLIS)).toBe(false); // flag → explicit spawn
130
+ expect(isUnknownManagerToken(undefined, true, CLIS)).toBe(false); // bare `ay`
131
+ });
132
+ it("never fires for a cli-bound alias (first word is the prompt)", async () => {
133
+ const { isUnknownManagerToken } = await loadModule();
134
+ // `cy widget ls` → managerCommands=false → "widget ls" is a prompt to claude.
135
+ expect(isUnknownManagerToken("widget", false, CLIS)).toBe(false);
136
+ });
137
+ });
138
+
116
139
  describe("subcommands.cmdHelp", () => {
117
140
  const capture = async (managerCommands?: boolean) => {
118
141
  const { cmdHelp } = await loadModule();
package/ts/subcommands.ts CHANGED
@@ -425,6 +425,25 @@ export function isSubcommand(name: string | undefined, managerCommands = true):
425
425
  return SUBCOMMANDS.has(name) || (managerCommands && MANAGER_SUBCOMMANDS.has(name));
426
426
  }
427
427
 
428
+ /**
429
+ * Footgun guard for the MANAGER entry (`ay`/`agent-yes`): true when the first arg
430
+ * is a bare word (not a flag) that is neither a subcommand nor a known CLI — a
431
+ * typo, or a newer subcommand run on an older build. The caller should error
432
+ * rather than silently spawn an agent with the word as a prompt (taku 2026-07-26:
433
+ * bare `ay <prompt>` is too dangerous; a spawn must name a CLI — `ay <cli> …` or
434
+ * `--cli`). Never fires for cli-bound aliases (cy/claude-yes/…), where the first
435
+ * word is legitimately the prompt, nor for flags or an empty invocation.
436
+ */
437
+ export function isUnknownManagerToken(
438
+ rawArg: string | undefined,
439
+ managerCommands: boolean,
440
+ supportedClis: readonly string[],
441
+ ): boolean {
442
+ if (!managerCommands || !rawArg || rawArg.startsWith("-")) return false;
443
+ if (isSubcommand(rawArg, managerCommands)) return false;
444
+ return !supportedClis.includes(rawArg);
445
+ }
446
+
428
447
  /**
429
448
  * Top-level entry. Returns the desired process exit code, or null if argv
430
449
  * is not a subcommand invocation.
@@ -1,10 +0,0 @@
1
- import "./logger-CDIsZ-Pp.js";
2
- import "./globalPidIndex-D9DOSd-c.js";
3
- import "./messageLog-C-YIzhRj.js";
4
- import "./e2e-CEIdJGZ7.js";
5
- import "./configShared-9wVlbPyC.js";
6
- 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-B8I4Wykx.js";
7
- import "./webrtcLink-VQhWmKOw.js";
8
- import "./remotes-Bem6WIyU.js";
9
-
10
- export { cmdHelp, isSubcommand, runSubcommand };