agent-yes 1.304.0 → 1.304.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/default.config.yaml +6 -0
  2. package/dist/{SUPPORTED_CLIS-C_1IiOj3.js → SUPPORTED_CLIS-D1BObsKi.js} +2 -2
  3. package/dist/{SUPPORTED_CLIS-Do3GHAY1.js → SUPPORTED_CLIS-R2KdLsVb.js} +3 -3
  4. package/dist/{agentShare-BvpEm-Fr.js → agentShare-pQedI_ay.js} +2 -2
  5. package/dist/{callback-BiSUhjw7.js → callback-Bd_uX6c9.js} +3 -3
  6. package/dist/{callback-SqLD2mMX.js → callback-WJ1STnzc.js} +2 -2
  7. package/dist/cli.js +5 -5
  8. package/dist/{cmdPs-DBt23Qz0.js → cmdPs-Bzld9JDB.js} +2 -2
  9. package/dist/index.js +2 -2
  10. package/dist/{notifyDaemon-DkUB7GV2.js → notifyDaemon-D_fT6Xht.js} +2 -2
  11. package/dist/{parentPingLoop-DDO592Wh.js → parentPingLoop-CVqnIzti.js} +2 -2
  12. package/dist/{rustBinary-BrJ2p8wy.js → rustBinary-AJOmpsZY.js} +2 -2
  13. package/dist/{rustBinary-vpfpWj1q.js → rustBinary-BEUXAC5F.js} +2 -2
  14. package/dist/{schedule-Bzjhl6-h.js → schedule-CeSvliXR.js} +4 -4
  15. package/dist/{serve-XwFYE0cE.js → serve-Dn24AExp.js} +21 -21
  16. package/dist/{setup-D4-s2VZw.js → setup-onxpwXOt.js} +2 -2
  17. package/dist/{shareCmd-DUBsVI3e.js → shareCmd-Bfxkzdm6.js} +5 -5
  18. package/dist/{subcommands-B7YZJL8n.js → subcommands--RGuFC68.js} +123 -29
  19. package/dist/{subcommands-BZPxFgkT.js → subcommands-B-VG0io0.js} +1 -1
  20. package/dist/{terminal-13cGj3h6.js → terminal-Jsj7SgxD.js} +2 -2
  21. package/dist/trayApp-Bngl2X4e.js +5 -0
  22. package/dist/{trayApp-5_OlvQcz.js → trayApp-lEZ-Wa4D.js} +2 -2
  23. package/dist/{ts-njuddXQz.js → ts-DLPvUXQS.js} +3 -3
  24. package/dist/{versionChecker-BJycAanp.js → versionChecker-Dtj0d8dY.js} +2 -2
  25. package/dist/{widget-DmRwOlco.js → widget-CyoP4Stv.js} +3 -3
  26. package/dist/{ws-ByO6JO6m.js → ws-CDZj5r8l.js} +2 -2
  27. package/dist/{ws-D0-Jg88z.js → ws-DtFNNKlC.js} +2 -2
  28. package/package.json +1 -1
  29. package/ts/composerGuard.edges.spec.ts +2 -0
  30. package/ts/composerGuard.spec.ts +51 -0
  31. package/ts/composerGuard.ts +44 -3
  32. package/ts/configShared.spec.ts +9 -0
  33. package/ts/subcommands.spec.ts +100 -0
  34. package/ts/subcommands.ts +108 -9
  35. package/dist/trayApp-DkAPo0m6.js +0 -5
@@ -1102,6 +1102,23 @@ function composerPromptRow(texts, cli) {
1102
1102
  return texts.findLastIndex((t) => re.test(t));
1103
1103
  }
1104
1104
  /**
1105
+ * The nonce of an `ay send` envelope sitting whole in the input box — its
1106
+ * `<ay-msg NONCE …` header on the prompt row and its `</ay-msg NONCE>` closer as
1107
+ * the last text above the footer — or null. That is ay's own message whose Enter
1108
+ * was swallowed, not someone's draft, however many rows it spans.
1109
+ */
1110
+ function ownEnvelopeNonce(texts, cli) {
1111
+ const prompt = composerPromptRow(texts, cli);
1112
+ if (prompt < 0) return null;
1113
+ const nonce = /^<ay-msg ([0-9a-f]{8}) /.exec(stripPromptGlyph(texts[prompt], cli))?.[1];
1114
+ if (!nonce) return null;
1115
+ const close = texts.findLastIndex((t, i) => i > prompt && t.trim() === `</ay-msg ${nonce}>`);
1116
+ if (close < 0) return null;
1117
+ const below = texts.slice(close + 1).filter((t) => t.trim());
1118
+ if (below.length > MAX_ROWS_BELOW_AGY_BOX || below.some((t) => promptRe(cli).test(t))) return null;
1119
+ return nonce;
1120
+ }
1121
+ /**
1105
1122
  * Is Claude Code's composer box the bottom of the screen: a rule directly above a
1106
1123
  * prompt row, at most a few draft rows (none of them another prompt) up to the
1107
1124
  * rule or footer that closes the box, and below that nothing but a few footer
@@ -1119,14 +1136,20 @@ function composerBoxed(texts, cli, needRule = true) {
1119
1136
  const nonBlank = (rows) => rows.filter((t) => t.trim());
1120
1137
  const close = texts.findIndex((t, i) => i > prompt && isComposerChrome(t));
1121
1138
  if (close < 0) return false;
1139
+ const agy = cli === "agy";
1140
+ if (agy && !SEPARATOR_RE.test(texts[close])) return false;
1122
1141
  const inside = nonBlank(texts.slice(prompt + 1, close));
1123
1142
  const below = nonBlank(texts.slice(close + 1));
1124
- return inside.length <= MAX_DRAFT_ROWS && below.length <= MAX_ROWS_BELOW_BOX && ![...inside, ...below].some((t) => promptRe(cli).test(t));
1143
+ return inside.length <= MAX_DRAFT_ROWS && below.length <= (agy ? MAX_ROWS_BELOW_AGY_BOX : MAX_ROWS_BELOW_BOX) && ![...inside, ...below].some((t) => promptRe(cli).test(t));
1125
1144
  }
1126
1145
  /** Draft rows under the prompt row, before the box is read as stale (see above). */
1127
1146
  const MAX_DRAFT_ROWS = 8;
1128
1147
  /** Footer rows Claude Code draws under its composer box (mode, hints, agents, notices). */
1129
1148
  const MAX_ROWS_BELOW_BOX = 4;
1149
+ /** agy: its task list (up to ~5 rows and a "↓ N more" row), a rule, the footer. */
1150
+ const MAX_ROWS_BELOW_AGY_BOX = 10;
1151
+ /** CLIs whose composer box has a rule above its prompt row (composerBoxed's needRule). */
1152
+ const BOXED_COMPOSER_CLIS = new Set(["claude", "agy"]);
1130
1153
  /**
1131
1154
  * Is this row composer chrome (a rule or a Claude/Codex footer) — the end of the
1132
1155
  * input? Pass the row's `cells` when known: the loose footer match then also
@@ -1161,6 +1184,7 @@ function classifyComposer(rows, cli) {
1161
1184
  kind: "unknown",
1162
1185
  reason: "no prompt row on screen"
1163
1186
  };
1187
+ const agyGhost = cli === "agy";
1164
1188
  let real = 0;
1165
1189
  let ghost = false;
1166
1190
  for (let i = prompt; i < rows.length; i++) {
@@ -1178,7 +1202,7 @@ function classifyComposer(rows, cli) {
1178
1202
  for (const c of cells) {
1179
1203
  if (!c.ch.trim() || c.ch === "\xA0") continue;
1180
1204
  if (c.inverse) continue;
1181
- if (c.dim) ghost = true;
1205
+ if (c.dim || c.gray && agyGhost) ghost = true;
1182
1206
  else real++;
1183
1207
  }
1184
1208
  }
@@ -1218,7 +1242,8 @@ function rowsFromXterm(term, n, fromContent = false) {
1218
1242
  ch: c.getChars() || " ",
1219
1243
  dim: c.isDim() !== 0,
1220
1244
  inverse: c.isInverse() !== 0,
1221
- colored: !c.isFgDefault()
1245
+ colored: !c.isFgDefault(),
1246
+ gray: c.isFgPalette() && c.getFgColor() === 8
1222
1247
  });
1223
1248
  }
1224
1249
  rows.push({
@@ -1780,6 +1805,7 @@ const SUBCOMMANDS = new Set([
1780
1805
  "history",
1781
1806
  "send",
1782
1807
  "send-drain",
1808
+ "submit",
1783
1809
  "msgs",
1784
1810
  "key",
1785
1811
  "select",
@@ -2045,7 +2071,7 @@ async function runSubcommand(argv) {
2045
2071
  switch (sub) {
2046
2072
  case "ls":
2047
2073
  case "list": return await cmdLs(rest);
2048
- case "ps": return await (await import("./cmdPs-DBt23Qz0.js")).cmdPs(rest);
2074
+ case "ps": return await (await import("./cmdPs-Bzld9JDB.js")).cmdPs(rest);
2049
2075
  case "status": return await cmdStatus(rest);
2050
2076
  case "whoami": return await cmdWhoami(rest);
2051
2077
  case "result": return await cmdResult(rest);
@@ -2059,6 +2085,7 @@ async function runSubcommand(argv) {
2059
2085
  case "history": return await (await import("./hist-DY16wm7g.js")).cmdHist(rest);
2060
2086
  case "send": return await cmdSend(rest);
2061
2087
  case "send-drain": return await cmdSendDrain(rest);
2088
+ case "submit": return await cmdSubmit(rest);
2062
2089
  case "ls-refresh": return await cmdLsRefresh(rest);
2063
2090
  case "msgs": return await cmdMsgs(rest);
2064
2091
  case "key": return await cmdKey(rest);
@@ -2095,31 +2122,31 @@ async function runSubcommand(argv) {
2095
2122
  return cmdCh(rest);
2096
2123
  }
2097
2124
  case "term": {
2098
- const { cmdTerm } = await import("./terminal-13cGj3h6.js");
2125
+ const { cmdTerm } = await import("./terminal-Jsj7SgxD.js");
2099
2126
  return cmdTerm(rest);
2100
2127
  }
2101
2128
  case "widget": {
2102
- const { cmdWidget } = await import("./widget-DmRwOlco.js");
2129
+ const { cmdWidget } = await import("./widget-CyoP4Stv.js");
2103
2130
  return cmdWidget(rest);
2104
2131
  }
2105
2132
  case "mint": {
2106
- const { cmdMint } = await import("./widget-DmRwOlco.js");
2133
+ const { cmdMint } = await import("./widget-CyoP4Stv.js");
2107
2134
  return cmdMint(rest);
2108
2135
  }
2109
2136
  case "serve": {
2110
- const { cmdServe } = await import("./serve-XwFYE0cE.js");
2137
+ const { cmdServe } = await import("./serve-Dn24AExp.js");
2111
2138
  return cmdServe(rest);
2112
2139
  }
2113
2140
  case "tray": {
2114
- const { cmdTray } = await import("./trayApp-DkAPo0m6.js");
2141
+ const { cmdTray } = await import("./trayApp-Bngl2X4e.js");
2115
2142
  return cmdTray(rest);
2116
2143
  }
2117
2144
  case "setup": {
2118
- const { cmdSetup } = await import("./setup-D4-s2VZw.js");
2145
+ const { cmdSetup } = await import("./setup-onxpwXOt.js");
2119
2146
  return cmdSetup(rest);
2120
2147
  }
2121
2148
  case "ws": {
2122
- const { cmdWs } = await import("./ws-D0-Jg88z.js");
2149
+ const { cmdWs } = await import("./ws-DtFNNKlC.js");
2123
2150
  return cmdWs(rest);
2124
2151
  }
2125
2152
  case "schedules":
@@ -2132,7 +2159,7 @@ async function runSubcommand(argv) {
2132
2159
  return cmdCron(rest);
2133
2160
  }
2134
2161
  case "schedule": {
2135
- const { cmdSchedule } = await import("./schedule-Bzjhl6-h.js");
2162
+ const { cmdSchedule } = await import("./schedule-CeSvliXR.js");
2136
2163
  return cmdSchedule(rest);
2137
2164
  }
2138
2165
  case "remote": {
@@ -2140,7 +2167,7 @@ async function runSubcommand(argv) {
2140
2167
  return cmdRemote(rest);
2141
2168
  }
2142
2169
  case "share": {
2143
- const { cmdShare } = await import("./shareCmd-DUBsVI3e.js");
2170
+ const { cmdShare } = await import("./shareCmd-Bfxkzdm6.js");
2144
2171
  return cmdShare(rest);
2145
2172
  }
2146
2173
  case "connect": {
@@ -2152,7 +2179,7 @@ async function runSubcommand(argv) {
2152
2179
  return cmdExpose(rest);
2153
2180
  }
2154
2181
  case "callback": {
2155
- const { cmdCallback } = await import("./callback-SqLD2mMX.js");
2182
+ const { cmdCallback } = await import("./callback-WJ1STnzc.js");
2156
2183
  return cmdCallback(rest);
2157
2184
  }
2158
2185
  case "reap":
@@ -2163,7 +2190,7 @@ async function runSubcommand(argv) {
2163
2190
  return await cmdDsh(rest);
2164
2191
  }
2165
2192
  case "gc": {
2166
- const { gcOldBinaryDirs } = await import("./rustBinary-vpfpWj1q.js");
2193
+ const { gcOldBinaryDirs } = await import("./rustBinary-BEUXAC5F.js");
2167
2194
  const { gcLogs } = await import("./globalPidIndex-uoz8Esqz.js");
2168
2195
  const bins = gcOldBinaryDirs();
2169
2196
  const logs = await gcLogs();
@@ -2231,7 +2258,7 @@ async function cmdHelp(managerCommands = true) {
2231
2258
  const killAliasNote = managerCommands ? `` : ` (\`ay kill\` only — \`cy kill …\` is a prompt)\n`;
2232
2259
  const self = process.env.AGENT_YES_PID ? await resolveSender() : null;
2233
2260
  const agentSection = self ? await buildAgentContextSection(self) : "";
2234
- process.stdout.write(agentSection + "ay - agent-yes CLI\n\nManagement:\n ay ls [keyword] list running agents (remotes from cache, refreshed\n [--waitFor=all|local|<alias>] in the background; --waitFor blocks for fresh rows)\n ay ps [keyword] per-agent CPU/RSS, rolled up over each\n agent's whole process tree, + box vitals\n ay tail [-f] [-n N] <keyword> last N lines (96), -f to follow\n ay tail <keyword> --until TEXT block until TEXT is printed, then exit 0\n [--timeout 10m] [-q] [--regex] (1 = agent exited without it, 2 = no match,\n [--fail-on TEXT] [--count N] 3 = --fail-on hit first)\n ay read <keyword> [page opts] paginate: --last/--head N, --range A:B,\n --before-line L [--limit N]\n" + readAliasNote + " ay cat <keyword> full log\n ay head <keyword> first N lines\n ay hist [-n 6] [--all] [--json] past agent conversations (claude/codex\n transcripts, incl. exited sessions);\n this cwd unless --all\n ay send <keyword> <msg> send a message (keyword '.' = agent in this cwd)\n ay msgs [keyword] [--in|--out] inter-agent message log (sent + received)\n ay ch mk|join|send|read|tail <topic> local-first E2E channels: AI ↔ humans on a topic (ay ch help)\n ay term embed <pid> <script> to embed a live read-only agent terminal in a page (ay term help)\n ay widget ls | read selection|dom read an opted-in page widget's context (selection/DOM) (ay widget help)\n ay mint <target> --caps ... mint a scoped, short-TTL capability token (embeddable in a page)\n ay key <keyword> <key...> send raw keystrokes (down/up/enter/esc/…) — drives menus\n ay select <keyword> <N> pick option N of a needs_input selection menu\n ay attach <keyword> interactive attach (detach: Ctrl-\\)\n ay stop <keyword> graceful shutdown (/exit for claude/codex)\n ay exit <keyword> [reason] graceful shutdown, recording who/why (= 'ay send <kw> exit')\n ay restart <keyword> [--fresh] stop (if live) + relaunch resuming the session; --fresh replays the prompt\n ay kill <pid> [--dry-run] SIGKILL an agent + its process group, like the console's\n Kill (exact pid from ay ls; never the calling shell)\n" + killAliasNote + " ay status <keyword> agent status snapshot\n ay notify watch --unread get notified when sub-agents finish/stuck/crash (writes to inbox)\n ay whoami [--json] (inside an agent) your own registry identity + reply address\n ay result <keyword> [--wait] pull an agent's structured result envelope\n ay result set '<json>' (inside an agent) deposit your result envelope\n ay reap kill process groups leaked by dead agents\n ay gc reclaim old-version binary cache dirs + stale session logs\n ay dsh-legacy [args...] launch the DeepSeek Harness terminal client (dsh-tui)\n" + wsLines + "\nRemote:\n" + setupLine + " ay share [local|lan|tailscale|webrtc] share this machine: one URL for web console + CLI\n ay connect <share-url> [alias] save another machine's share URL as a remote\n" + shareAliasNote + " ay schedule <when> <cli> -- <msg> run an agent on a schedule (HH:MM or cron)\n ay serve [--port N] start HTTP API server (prints token)\n ay serve status show serve daemon/server status\n ay remote add <alias> http://<token>@<host>:<port>\n ay remote ls / rm <alias> manage saved remotes\n ay expose <port> share localhost:<port> at https://<id>.agent-yes.com (private link)\n ay callback --expires 7d mint an embeddable message-me widget for one agent\n ay ls <token>@<host>:<port> connect inline (no alias needed)\n ay send <token>@<host>:<port>:<kw> <msg>\n\nRun an agent (naming a CLI is what launches one — bare 'ay' shows this help):\n ay <claude|codex|...> [options] -- [prompt]\n ay claude -- \"fix the bug in auth.ts\"\n ay --detach claude -- \"…\" start it in the background and return at once\n (e.g. over ssh); prints its pid + how to drive it\n cy [options] -- [prompt] shortcut for 'ay claude' (bare 'cy' starts claude)\n ay claude --help full agent-runner options\n\nLabs (examples at https://github.com/snomiao/agent-yes/tree/main/lab):\n local-role-play/ designer + builder on one machine\n http-remote/ ay serve remote access demo\n p2p-pairing/ libp2p P2P (needs: cargo build --features swarm)\n");
2261
+ process.stdout.write(agentSection + "ay - agent-yes CLI\n\nManagement:\n ay ls [keyword] list running agents (remotes from cache, refreshed\n [--waitFor=all|local|<alias>] in the background; --waitFor blocks for fresh rows)\n ay ps [keyword] per-agent CPU/RSS, rolled up over each\n agent's whole process tree, + box vitals\n ay tail [-f] [-n N] <keyword> last N lines (96), -f to follow\n ay tail <keyword> --until TEXT block until TEXT is printed, then exit 0\n [--timeout 10m] [-q] [--regex] (1 = agent exited without it, 2 = no match,\n [--fail-on TEXT] [--count N] 3 = --fail-on hit first)\n ay read <keyword> [page opts] paginate: --last/--head N, --range A:B,\n --before-line L [--limit N]\n" + readAliasNote + " ay cat <keyword> full log\n ay head <keyword> first N lines\n ay hist [-n 6] [--all] [--json] past agent conversations (claude/codex\n transcripts, incl. exited sessions);\n this cwd unless --all\n ay send <keyword> <msg> send a message (keyword '.' = agent in this cwd)\n ay msgs [keyword] [--in|--out] inter-agent message log (sent + received)\n ay ch mk|join|send|read|tail <topic> local-first E2E channels: AI ↔ humans on a topic (ay ch help)\n ay term embed <pid> <script> to embed a live read-only agent terminal in a page (ay term help)\n ay widget ls | read selection|dom read an opted-in page widget's context (selection/DOM) (ay widget help)\n ay mint <target> --caps ... mint a scoped, short-TTL capability token (embeddable in a page)\n ay key <keyword> <key...> send raw keystrokes (down/up/enter/esc/…) — drives menus\n ay submit <keyword> press Enter on text left in its input box\n ay select <keyword> <N> pick option N of a needs_input selection menu\n ay attach <keyword> interactive attach (detach: Ctrl-\\)\n ay stop <keyword> graceful shutdown (/exit for claude/codex)\n ay exit <keyword> [reason] graceful shutdown, recording who/why (= 'ay send <kw> exit')\n ay restart <keyword> [--fresh] stop (if live) + relaunch resuming the session; --fresh replays the prompt\n ay kill <pid> [--dry-run] SIGKILL an agent + its process group, like the console's\n Kill (exact pid from ay ls; never the calling shell)\n" + killAliasNote + " ay status <keyword> agent status snapshot\n ay notify watch --unread get notified when sub-agents finish/stuck/crash (writes to inbox)\n ay whoami [--json] (inside an agent) your own registry identity + reply address\n ay result <keyword> [--wait] pull an agent's structured result envelope\n ay result set '<json>' (inside an agent) deposit your result envelope\n ay reap kill process groups leaked by dead agents\n ay gc reclaim old-version binary cache dirs + stale session logs\n ay dsh-legacy [args...] launch the DeepSeek Harness terminal client (dsh-tui)\n" + wsLines + "\nRemote:\n" + setupLine + " ay share [local|lan|tailscale|webrtc] share this machine: one URL for web console + CLI\n ay connect <share-url> [alias] save another machine's share URL as a remote\n" + shareAliasNote + " ay schedule <when> <cli> -- <msg> run an agent on a schedule (HH:MM or cron)\n ay serve [--port N] start HTTP API server (prints token)\n ay serve status show serve daemon/server status\n ay remote add <alias> http://<token>@<host>:<port>\n ay remote ls / rm <alias> manage saved remotes\n ay expose <port> share localhost:<port> at https://<id>.agent-yes.com (private link)\n ay callback --expires 7d mint an embeddable message-me widget for one agent\n ay ls <token>@<host>:<port> connect inline (no alias needed)\n ay send <token>@<host>:<port>:<kw> <msg>\n\nRun an agent (naming a CLI is what launches one — bare 'ay' shows this help):\n ay <claude|codex|...> [options] -- [prompt]\n ay claude -- \"fix the bug in auth.ts\"\n ay --detach claude -- \"…\" start it in the background and return at once\n (e.g. over ssh); prints its pid + how to drive it\n cy [options] -- [prompt] shortcut for 'ay claude' (bare 'cy' starts claude)\n ay claude --help full agent-runner options\n\nLabs (examples at https://github.com/snomiao/agent-yes/tree/main/lab):\n local-role-play/ designer + builder on one machine\n http-remote/ ay serve remote access demo\n p2p-pairing/ libp2p P2P (needs: cargo build --features swarm)\n");
2235
2262
  return 0;
2236
2263
  }
2237
2264
  /** Looks like an agent_id (12 hex, or a longer injected one) rather than a word. */
@@ -4592,7 +4619,7 @@ function dropComposerTerm(logPath) {
4592
4619
  }
4593
4620
  /**
4594
4621
  * The bottom 40 rows of a log as the composer check sees them: rendered from
4595
- * the 32 KB tail and, for Claude, from further back until its composer box is
4622
+ * the 32 KB tail and, for Claude and agy, from further back until its composer box is
4596
4623
  * on screen (see COMPOSER_WINDOWS). Keeps per-cell attributes. Null for an
4597
4624
  * empty log; throws when the log cannot be read or rendered.
4598
4625
  */
@@ -4600,7 +4627,7 @@ async function renderComposerRows(record, windows = COMPOSER_WINDOWS, fromConten
4600
4627
  const logPath = record.log_file;
4601
4628
  const geom = await readAgentPtysize(record) ?? void 0;
4602
4629
  const key = `${geom?.cols}x${geom?.rows}:${record.cli}:${windows.join()}`;
4603
- const claude = record.cli === "claude";
4630
+ const ruled = BOXED_COMPOSER_CLIS.has(record.cli);
4604
4631
  try {
4605
4632
  const { size } = await stat(logPath);
4606
4633
  if (size === 0) return null;
@@ -4619,7 +4646,7 @@ async function renderComposerRows(record, windows = COMPOSER_WINDOWS, fromConten
4619
4646
  }
4620
4647
  rows = rowsFromXterm(ct.term, 40, fromContent);
4621
4648
  next = ct.whole ? windows.length : ct.window + 1;
4622
- if (composerBoxed(rows.map((r) => r.text), record.cli, claude)) next = windows.length;
4649
+ if (composerBoxed(rows.map((r) => r.text), record.cli, ruled)) next = windows.length;
4623
4650
  }
4624
4651
  for (let w = next; w < windows.length; w++) {
4625
4652
  const from = Math.max(0, size - windows[w]);
@@ -4641,7 +4668,7 @@ async function renderComposerRows(record, windows = COMPOSER_WINDOWS, fromConten
4641
4668
  });
4642
4669
  if (composerTerms.size > COMPOSER_TERMS_MAX) dropComposerTerm(composerTerms.keys().next().value);
4643
4670
  rows = rowsFromXterm(term, 40, fromContent);
4644
- if (from === 0 || composerBoxed(rows.map((r) => r.text), record.cli, claude)) break;
4671
+ if (from === 0 || composerBoxed(rows.map((r) => r.text), record.cli, ruled)) break;
4645
4672
  }
4646
4673
  return rows ?? [];
4647
4674
  } catch (e) {
@@ -4661,7 +4688,7 @@ async function readComposerState(record, windows = COMPOSER_WINDOWS) {
4661
4688
  kind: "unknown",
4662
4689
  reason: "no log file recorded"
4663
4690
  };
4664
- const claude = record.cli === "claude";
4691
+ const ruled = BOXED_COMPOSER_CLIS.has(record.cli);
4665
4692
  try {
4666
4693
  const rows = await renderComposerRows({
4667
4694
  ...record,
@@ -4672,7 +4699,12 @@ async function readComposerState(record, windows = COMPOSER_WINDOWS) {
4672
4699
  reason: "log unreadable or empty"
4673
4700
  };
4674
4701
  const state = classifyComposer(rows, record.cli);
4675
- if (state.kind === "draft" && !composerBoxed(rows.map((r) => r.text), record.cli, claude)) return {
4702
+ const own = state.kind === "draft" ? ownEnvelopeNonce(rows.map((r) => r.text), record.cli) : null;
4703
+ if (state.kind === "draft" && own) return {
4704
+ ...state,
4705
+ own
4706
+ };
4707
+ if (state.kind === "draft" && !composerBoxed(rows.map((r) => r.text), record.cli, ruled)) return {
4676
4708
  kind: "hidden",
4677
4709
  reason: "its input box is not on screen"
4678
4710
  };
@@ -4709,13 +4741,22 @@ async function composerFingerprint(record) {
4709
4741
  * (1, 2, 4, 8 s): nobody is typing, so submit it with Enter and report true once
4710
4742
  * the box reads empty again. Only a draft: a menu or yes/no prompt is a question
4711
4743
  * agent-yes deliberately does not answer. Any change, or a box that never clears,
4712
- * returns false and the caller parks the message as before.
4744
+ * returns false and the caller parks the message as before. An `ay send`
4745
+ * envelope whose Enter was swallowed (ownEnvelopeNonce) is submitted at once; a
4746
+ * "hidden" box (a draft taller than the box check allows) after twice the wait,
4747
+ * unless the screen shows a menu or dialog.
4713
4748
  */
4714
4749
  async function submitStableDraft(record, waits = DRAFT_STABLE_WAITS_MS, sleep = (ms) => new Promise((r) => setTimeout(r, ms))) {
4715
- if ((await readComposerState(record)).kind !== "draft") return false;
4750
+ const state = await readComposerState(record);
4751
+ if (state.kind !== "draft" && state.kind !== "hidden") return false;
4752
+ if (state.kind === "hidden") {
4753
+ if (!record.log_file || await extractNeedsInput(record.log_file, record.cli)) return false;
4754
+ }
4716
4755
  const base = await composerFingerprint(record);
4717
4756
  if (base === null) return false;
4718
- for (const ms of waits) {
4757
+ const total = waits.reduce((a, b) => a + b, 0);
4758
+ const plan = state.kind === "draft" && state.own ? [] : state.kind === "hidden" ? [...waits, total] : waits;
4759
+ for (const ms of plan) {
4719
4760
  await sleep(ms);
4720
4761
  if (await composerFingerprint(record) !== base) return false;
4721
4762
  }
@@ -5760,6 +5801,59 @@ async function recordKeyEvent(sender, record, kind, body) {
5760
5801
  wrapped: false
5761
5802
  });
5762
5803
  }
5804
+ /**
5805
+ * `ay submit <keyword>`: press Enter on whatever sits in the target's input box —
5806
+ * typically an `ay send` whose Enter was swallowed, holding every later message
5807
+ * in the queue. Does nothing to an empty box or a screen without one (a menu is
5808
+ * answered with `ay key`/`ay select`, not Enter).
5809
+ */
5810
+ async function cmdSubmit(rest) {
5811
+ const argv = await yargs(rest).usage("Usage: ay submit <keyword> [options]\n\nPress Enter on the text left in a live agent's input box, e.g. an `ay send`\nwhose Enter was swallowed and that is now holding later messages in the\nqueue. Leaves an empty box and any menu or dialog alone.").option("all", {
5812
+ type: "boolean",
5813
+ default: false,
5814
+ description: "Include exited agents"
5815
+ }).option("latest", {
5816
+ type: "boolean",
5817
+ default: false,
5818
+ description: "Use most recent match"
5819
+ }).option("cwd", {
5820
+ type: "string",
5821
+ description: "Restrict to agents under this dir"
5822
+ }).option("force", {
5823
+ type: "boolean",
5824
+ default: false,
5825
+ description: "Skip the recency/self-send guard (also: AGENT_YES_FORCE_SEND=1)"
5826
+ }).help(false).version(false).exitProcess(false).parseAsync();
5827
+ const keyword = argv._[0] !== void 0 ? String(argv._[0]) : void 0;
5828
+ if (!keyword) throw new Error("usage: ay submit <keyword>");
5829
+ const record = await resolveWritableAgent(keyword, {
5830
+ all: argv.all,
5831
+ active: false,
5832
+ json: false,
5833
+ latest: argv.latest,
5834
+ cwdScope: typeof argv.cwd === "string" ? path.resolve(argv.cwd) : null
5835
+ });
5836
+ const sender = await enforceSendGuards(record, Boolean(argv.force) || process.env.AGENT_YES_FORCE_SEND === "1");
5837
+ const before = await readComposerState(record);
5838
+ if (before.kind !== "draft" && before.kind !== "hidden") {
5839
+ process.stdout.write(`nothing to submit in pid ${record.pid} (${record.cli}): ${before.kind === "empty" ? "its input box is empty" : before.reason}\n`);
5840
+ return 0;
5841
+ }
5842
+ await withIpcLock(record.pid, () => writeToIpc(record.fifo_file, "\r"), (why) => process.stderr.write(`warning: ay submit writing pid ${record.pid} without the input lock (${why})\n`));
5843
+ await recordKeyEvent(sender, record, "key", "enter");
5844
+ let after = before;
5845
+ for (let i = 0; i < 6 && after.kind !== "empty"; i++) {
5846
+ await new Promise((r) => setTimeout(r, 500));
5847
+ after = await readComposerState(record);
5848
+ }
5849
+ if ((await listPending(record.pid)).length) await ensureSendDrainer(record.pid);
5850
+ if (after.kind === "empty") {
5851
+ process.stdout.write(`submitted pid ${record.pid} (${record.cli})'s input box\n`);
5852
+ return 0;
5853
+ }
5854
+ process.stdout.write(`pressed Enter on pid ${record.pid} (${record.cli}), but its input box still reads ${after.kind} — check: ay tail ${record.pid}\n`);
5855
+ return 1;
5856
+ }
5763
5857
  async function cmdKey(rest) {
5764
5858
  const argv = await yargs(rest).usage("Usage: ay key <keyword> <key...> [options]\n\nSend raw named keystrokes to a live agent's TUI — no message framing, no\nauto-Enter. Drives selection menus and other interactive prompts that a\nplain `ay send` (text + Enter) can't. Keys are paced so the CLI registers\neach as a discrete event, not a paste.\n\nKeys: up down left right enter esc tab space backspace delete home end\n pageup pagedown ctrl-c ctrl-d ctrl-y raw:0xNN\n\nExamples:\n ay key 1234 down down enter # move the menu cursor down twice, confirm\n ay key 1234 esc # dismiss a menu\n ay key 1234 raw:0x1b # a literal ESC byte").option("pace", {
5765
5859
  type: "number",
@@ -6177,7 +6271,7 @@ async function cmdAttach(rest) {
6177
6271
  const winsizeDir = path.join(ayHome, "winsize");
6178
6272
  await mkdir(winsizeDir, { recursive: true });
6179
6273
  const winsizePath = path.join(winsizeDir, String(record.pid));
6180
- const { resolveDaemonHttpBase, loadTokenReadOnly } = await import("./serve-XwFYE0cE.js");
6274
+ const { resolveDaemonHttpBase, loadTokenReadOnly } = await import("./serve-Dn24AExp.js");
6181
6275
  const daemonBase = await resolveDaemonHttpBase().catch(() => null);
6182
6276
  const daemonToken = daemonBase ? await loadTokenReadOnly().catch(() => null) ?? "" : "";
6183
6277
  const capViewer = `attach:${process.pid}`;
@@ -6926,7 +7020,7 @@ async function cmdNotify(rest) {
6926
7020
  }
6927
7021
  const ensure = async () => {
6928
7022
  if (!argv["ensure-daemon"]) return;
6929
- const { ensureDaemon } = await import("./notifyDaemon-DkUB7GV2.js");
7023
+ const { ensureDaemon } = await import("./notifyDaemon-D_fT6Xht.js");
6930
7024
  await ensureDaemon().catch(() => null);
6931
7025
  };
6932
7026
  await heartbeatWatcher(parent, selfStartedAt);
@@ -7000,7 +7094,7 @@ async function cmdNotifyCursor(args) {
7000
7094
  }
7001
7095
  async function cmdNotifyd(rest) {
7002
7096
  const sub = rest[0] ?? "status";
7003
- const daemon = await import("./notifyDaemon-DkUB7GV2.js");
7097
+ const daemon = await import("./notifyDaemon-D_fT6Xht.js");
7004
7098
  switch (sub) {
7005
7099
  case "run": return daemon.runDaemon();
7006
7100
  case "once": return daemon.runDaemon({ once: true });
@@ -7027,4 +7121,4 @@ async function cmdNotifyd(rest) {
7027
7121
 
7028
7122
  //#endregion
7029
7123
  export { readNotes as $, inspectSubmission as A, isUnknownManagerToken as B, envelopeAttribution as C, framePaste as Ct, extractNeedsInput as D, flattenForest as Dt, extractMenu as E, buildAgentForest as Et, isExitRequest as F, listRecords as G, isUserTyping as H, isPidAlive as I, ownedCollapsedPaste as J, matchKeyword as K, isSlashCommand as L, isAgentIdShaped as M, isAgentStuck as N, extractTaskCounts as O, isBareManagerInvocation as P, readLogForRender as Q, isSubcommand as R, enableRenderDiskCache as S, withIpcLock as St, extractBadges as T, TYPING_BADGE as Tt, lastReadAt as U, isUnreachableWriteErrno as V, lastStdinAt as W, readAgentPtysize as X, probeStdinReachable as Y, readComposerState as Z, cursorAbs as _, submitStableDraft as _t, READ_PAGE_DEFAULT as a, renderRawLogLines as at, deriveLiveStatus as b, writeKeysPaced as bt, SEND_EXIT_QUEUED as c, resolveResumeArgs as ct, backoffWhileTyping as d, saveRenderDisk as dt, readPtysize as et, buildEnvelope as f, sendPayloadCapError as ft, controlCodeFromName as g, submitAndConfirm as gt, confirmStdinUnreachable as h, stopTipForCli as ht, MAX_RENDER_BYTES as i, renderRawLog as it, interruptSendTarget as j, finalizedLines as k, SEND_EXIT_UNREACHABLE as l, restartHintLines as lt, cmdHelp as m, stdinActivityPath as mt, DRAFT_STABLE_WAITS_MS as n, recentReadEdges as nt, READ_WINDOW_MS as o, resolveOne as ot, cliDefaults as p, snapshotStatus as pt, menuSelectKeys as q, GRACEFUL_EXIT_COMMANDS as r, renderLogTailLines as rt, SEND_BODY_MAX_CHARS as s, resolveReadWindow as st, COMPOSER_WINDOWS as t, recentMessageEdges as tt, TYPING_WINDOW_MS as u, runSubcommand as ut, cwdLabel as v, suggestAgents as vt, envelopeCostFor as w, shouldFramePaste as wt, drainerLauncher as x, writeToIpc as xt, deriveLiveState as y, waitForLogQuiet as yt, isSubmitCode as z };
7030
- //# sourceMappingURL=subcommands-B7YZJL8n.js.map
7124
+ //# sourceMappingURL=subcommands--RGuFC68.js.map
@@ -5,7 +5,7 @@ import "./pidStore-C50VPk3E.js";
5
5
  import "./messageLog-Dq_ka-Bt.js";
6
6
  import "./e2e-BdLf8DvY.js";
7
7
  import "./configShared-De4bR5hH.js";
8
- import { $ as readNotes, A as inspectSubmission, B as isUnknownManagerToken, C as envelopeAttribution, D as extractNeedsInput, E as extractMenu, F as isExitRequest, G as listRecords, H as isUserTyping, I as isPidAlive, J as ownedCollapsedPaste, K as matchKeyword, L as isSlashCommand, M as isAgentIdShaped, N as isAgentStuck, O as extractTaskCounts, P as isBareManagerInvocation, Q as readLogForRender, R as isSubcommand, S as enableRenderDiskCache, T as extractBadges, U as lastReadAt, V as isUnreachableWriteErrno, W as lastStdinAt, X as readAgentPtysize, Y as probeStdinReachable, Z as readComposerState, _ as cursorAbs, _t as submitStableDraft, a as READ_PAGE_DEFAULT, at as renderRawLogLines, b as deriveLiveStatus, bt as writeKeysPaced, c as SEND_EXIT_QUEUED, ct as resolveResumeArgs, d as backoffWhileTyping, dt as saveRenderDisk, et as readPtysize, f as buildEnvelope, ft as sendPayloadCapError, g as controlCodeFromName, gt as submitAndConfirm, h as confirmStdinUnreachable, ht as stopTipForCli, i as MAX_RENDER_BYTES, it as renderRawLog, j as interruptSendTarget, k as finalizedLines, l as SEND_EXIT_UNREACHABLE, lt as restartHintLines, m as cmdHelp, mt as stdinActivityPath, n as DRAFT_STABLE_WAITS_MS, nt as recentReadEdges, o as READ_WINDOW_MS, ot as resolveOne, p as cliDefaults, pt as snapshotStatus, q as menuSelectKeys, r as GRACEFUL_EXIT_COMMANDS, rt as renderLogTailLines, s as SEND_BODY_MAX_CHARS, st as resolveReadWindow, t as COMPOSER_WINDOWS, tt as recentMessageEdges, u as TYPING_WINDOW_MS, ut as runSubcommand, v as cwdLabel, vt as suggestAgents, w as envelopeCostFor, x as drainerLauncher, xt as writeToIpc, y as deriveLiveState, yt as waitForLogQuiet, z as isSubmitCode } from "./subcommands-B7YZJL8n.js";
8
+ import { $ as readNotes, A as inspectSubmission, B as isUnknownManagerToken, C as envelopeAttribution, D as extractNeedsInput, E as extractMenu, F as isExitRequest, G as listRecords, H as isUserTyping, I as isPidAlive, J as ownedCollapsedPaste, K as matchKeyword, L as isSlashCommand, M as isAgentIdShaped, N as isAgentStuck, O as extractTaskCounts, P as isBareManagerInvocation, Q as readLogForRender, R as isSubcommand, S as enableRenderDiskCache, T as extractBadges, U as lastReadAt, V as isUnreachableWriteErrno, W as lastStdinAt, X as readAgentPtysize, Y as probeStdinReachable, Z as readComposerState, _ as cursorAbs, _t as submitStableDraft, a as READ_PAGE_DEFAULT, at as renderRawLogLines, b as deriveLiveStatus, bt as writeKeysPaced, c as SEND_EXIT_QUEUED, ct as resolveResumeArgs, d as backoffWhileTyping, dt as saveRenderDisk, et as readPtysize, f as buildEnvelope, ft as sendPayloadCapError, g as controlCodeFromName, gt as submitAndConfirm, h as confirmStdinUnreachable, ht as stopTipForCli, i as MAX_RENDER_BYTES, it as renderRawLog, j as interruptSendTarget, k as finalizedLines, l as SEND_EXIT_UNREACHABLE, lt as restartHintLines, m as cmdHelp, mt as stdinActivityPath, n as DRAFT_STABLE_WAITS_MS, nt as recentReadEdges, o as READ_WINDOW_MS, ot as resolveOne, p as cliDefaults, pt as snapshotStatus, q as menuSelectKeys, r as GRACEFUL_EXIT_COMMANDS, rt as renderLogTailLines, s as SEND_BODY_MAX_CHARS, st as resolveReadWindow, t as COMPOSER_WINDOWS, tt as recentMessageEdges, u as TYPING_WINDOW_MS, ut as runSubcommand, v as cwdLabel, vt as suggestAgents, w as envelopeCostFor, x as drainerLauncher, xt as writeToIpc, y as deriveLiveState, yt as waitForLogQuiet, z as isSubmitCode } from "./subcommands--RGuFC68.js";
9
9
  import "./webrtcLink-DcvacEci.js";
10
10
  import "./remotes-BsMGvAay.js";
11
11
  import "./roomReplyAlias-B-v76TA8.js";
@@ -98,7 +98,7 @@ async function cmdTermMint(args) {
98
98
  if (flags.ro && flags.interactive) throw new Error("--ro and --interactive are mutually exclusive");
99
99
  const ttlSec = parseTtlSec(typeof flags.ttl === "string" ? flags.ttl : "15m");
100
100
  const canSend = flags.interactive === true;
101
- const { mintScopedTermToken } = await import("./serve-XwFYE0cE.js");
101
+ const { mintScopedTermToken } = await import("./serve-Dn24AExp.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-13cGj3h6.js.map
138
+ //# sourceMappingURL=terminal-Jsj7SgxD.js.map
@@ -0,0 +1,5 @@
1
+ import "./versionChecker-Dtj0d8dY.js";
2
+ import "./rustBinary-AJOmpsZY.js";
3
+ import { a as trayHiddenMarker, i as launchTray, n as hasDesktop, r as isTrayHidden, t as cmdTray } from "./trayApp-lEZ-Wa4D.js";
4
+
5
+ export { cmdTray };
@@ -1,4 +1,4 @@
1
- import { l as findTrayLauncher } from "./rustBinary-BrJ2p8wy.js";
1
+ import { l as findTrayLauncher } from "./rustBinary-AJOmpsZY.js";
2
2
  import { t as agentYesHome } from "./agentYesHome-JmJC28YX.js";
3
3
  import { existsSync } from "node:fs";
4
4
  import path from "node:path";
@@ -97,4 +97,4 @@ async function cmdTray(args) {
97
97
 
98
98
  //#endregion
99
99
  export { trayHiddenMarker as a, launchTray as i, hasDesktop as n, isTrayHidden as r, cmdTray as t };
100
- //# sourceMappingURL=trayApp-5_OlvQcz.js.map
100
+ //# sourceMappingURL=trayApp-lEZ-Wa4D.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 { i as getInstalledPackage } from "./versionChecker-BJycAanp.js";
3
+ import { i as getInstalledPackage } from "./versionChecker-Dtj0d8dY.js";
4
4
  import { t as agentYesHome } from "./agentYesHome-JmJC28YX.js";
5
5
  import { u as removeControlCharacters } from "./todoAutomation-CKlrxuZv.js";
6
6
  import { i as shouldUseLock, r as releaseLock, t as acquireLock } from "./runningLock-DMznYh45.js";
@@ -2155,7 +2155,7 @@ async function agentYes({ cli, cliArgs = [], skipPermissions = false, prompt, ro
2155
2155
  }, 100);
2156
2156
  const cleanupHeartbeat = () => clearInterval(heartbeatInterval);
2157
2157
  shell.onExit(cleanupHeartbeat);
2158
- const { startParentPingLoop } = await import("./parentPingLoop-DDO592Wh.js");
2158
+ const { startParentPingLoop } = await import("./parentPingLoop-CVqnIzti.js");
2159
2159
  const parentPingLoop = startParentPingLoop({
2160
2160
  parentPid,
2161
2161
  selfWrapperPid: process.pid,
@@ -2418,4 +2418,4 @@ function sleep(ms) {
2418
2418
 
2419
2419
  //#endregion
2420
2420
  export { hasTodoStore as a, permissionBadge as c, answerAsk as i, AgentContext as l, agentYes as n, listAsks as o, config as r, listAsksForProject as s, CLIS_CONFIG as t, CLAUDE_SESSION_PIN_ENV as u };
2421
- //# sourceMappingURL=ts-njuddXQz.js.map
2421
+ //# sourceMappingURL=ts-DLPvUXQS.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.304.0";
10
+ var version = "1.304.1";
11
11
 
12
12
  //#endregion
13
13
  //#region ts/versionChecker.ts
@@ -285,4 +285,4 @@ async function displayVersion() {
285
285
 
286
286
  //#endregion
287
287
  export { versionString as a, getInstalledPackage as i, compareVersions as n, displayVersion as r, checkAndAutoUpdate as t };
288
- //# sourceMappingURL=versionChecker-BJycAanp.js.map
288
+ //# sourceMappingURL=versionChecker-Dtj0d8dY.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-XwFYE0cE.js");
31
+ const { resolveDaemonHttpBase, loadTokenReadOnly } = await import("./serve-Dn24AExp.js");
32
32
  const base = typeof flags.base === "string" ? flags.base : await resolveDaemonHttpBase();
33
33
  if (!base) throw new Error("no running ay serve daemon found — start `ay serve` or pass --base <url> (e.g. http://127.0.0.1:PORT)");
34
34
  const token = typeof flags.token === "string" ? flags.token : await loadTokenReadOnly() ?? "";
@@ -186,7 +186,7 @@ async function cmdMint(args) {
186
186
  const bad = caps.filter((c) => !KNOWN_CAPS.has(c));
187
187
  if (bad.length) throw new Error(`unknown cap(s): ${bad.join(", ")} (valid: ${[...KNOWN_CAPS].join(", ")})`);
188
188
  const ttlSec = parseTtlSec(typeof flags.ttl === "string" ? flags.ttl : "15m");
189
- const { mintScopedTermToken } = await import("./serve-XwFYE0cE.js");
189
+ const { mintScopedTermToken } = await import("./serve-Dn24AExp.js");
190
190
  const r = await mintScopedTermToken(target, {
191
191
  ttlSec,
192
192
  caps
@@ -202,4 +202,4 @@ async function cmdMint(args) {
202
202
 
203
203
  //#endregion
204
204
  export { cmdMint, cmdWidget };
205
- //# sourceMappingURL=widget-DmRwOlco.js.map
205
+ //# sourceMappingURL=widget-CyoP4Stv.js.map
@@ -1,4 +1,4 @@
1
- import { G as listRecords } from "./subcommands-B7YZJL8n.js";
1
+ import { G as listRecords } from "./subcommands--RGuFC68.js";
2
2
  import { a as getProvisionRoot } from "./workspaceConfig-DBgsu81B.js";
3
3
  import { existsSync } from "fs";
4
4
  import { lstat, opendir } from "fs/promises";
@@ -424,4 +424,4 @@ async function cmdWs(args) {
424
424
 
425
425
  //#endregion
426
426
  export { isPathInside as a, walkWorkspaces as c, importProvisionModule as i, workspaceStatus as l, cmdWs as n, loadProvision as o, collectWorkspaces as r, resolveOperand as s, WS_JSON_SCHEMA as t };
427
- //# sourceMappingURL=ws-ByO6JO6m.js.map
427
+ //# sourceMappingURL=ws-CDZj5r8l.js.map
@@ -5,12 +5,12 @@ import "./pidStore-C50VPk3E.js";
5
5
  import "./messageLog-Dq_ka-Bt.js";
6
6
  import "./e2e-BdLf8DvY.js";
7
7
  import "./configShared-De4bR5hH.js";
8
- import "./subcommands-B7YZJL8n.js";
8
+ import "./subcommands--RGuFC68.js";
9
9
  import "./webrtcLink-DcvacEci.js";
10
10
  import "./remotes-BsMGvAay.js";
11
11
  import "./roomReplyAlias-B-v76TA8.js";
12
12
  import "./notifyStore-DIfkfKB2.js";
13
13
  import "./senderAncestry-CVHeKk1Y.js";
14
- import { a as isPathInside, c as walkWorkspaces, i as importProvisionModule, l as workspaceStatus, n as cmdWs, o as loadProvision, r as collectWorkspaces, s as resolveOperand, t as WS_JSON_SCHEMA } from "./ws-ByO6JO6m.js";
14
+ import { a as isPathInside, c as walkWorkspaces, i as importProvisionModule, l as workspaceStatus, n as cmdWs, o as loadProvision, r as collectWorkspaces, s as resolveOperand, t as WS_JSON_SCHEMA } from "./ws-CDZj5r8l.js";
15
15
 
16
16
  export { WS_JSON_SCHEMA, cmdWs, collectWorkspaces, isPathInside, loadProvision, walkWorkspaces, workspaceStatus };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-yes",
3
- "version": "1.304.0",
3
+ "version": "1.304.1",
4
4
  "description": "A wrapper tool that automates interactions with various AI CLI tools by automatically handling common prompts and responses.",
5
5
  "keywords": [
6
6
  "ai",
@@ -49,6 +49,8 @@ describe("composer and pending-input recovery edges", () => {
49
49
  isDim: () => 0,
50
50
  isInverse: () => 0,
51
51
  isFgDefault: () => true,
52
+ isFgPalette: () => false,
53
+ getFgColor: () => 0,
52
54
  });
53
55
  const line = {
54
56
  length: 4,
@@ -7,6 +7,7 @@ import {
7
7
  claimPending,
8
8
  classifyComposer,
9
9
  composerBoxed,
10
+ ownEnvelopeNonce,
10
11
  DUPLICATE_WINDOW_MS,
11
12
  enqueuePending,
12
13
  findRecentDuplicate,
@@ -31,6 +32,31 @@ async function classify(frame: string, cols = 60, cli?: string) {
31
32
 
32
33
  const box = (inner: string) => `history\r\n${RULE}\r\n❯ ${inner}\x1b[0m\r\n${RULE}\r\n${FOOTER}`;
33
34
 
35
+ describe("ownEnvelopeNonce", () => {
36
+ const head =
37
+ '› <ay-msg 1a2b3c4d from claude alice@box:/repo/alpha:main#1111 — reply: ay send 1111 "...">';
38
+ const lines = Array.from({ length: 20 }, (_, i) => ` - note ${i}`);
39
+ const footer = ["", " gpt-x default · ~/repo", " ? for shortcuts"];
40
+ it("finds an ay envelope left whole in the box, however tall", () => {
41
+ expect(ownEnvelopeNonce([head, ...lines, " </ay-msg 1a2b3c4d>", ...footer], "codex")).toBe(
42
+ "1a2b3c4d",
43
+ );
44
+ });
45
+ it("is null for a typed draft, a half-pasted envelope, or a foreign closer", () => {
46
+ expect(ownEnvelopeNonce(["› btw how", ...footer], "codex")).toBeNull();
47
+ expect(ownEnvelopeNonce([head, ...lines, ...footer], "codex")).toBeNull();
48
+ expect(
49
+ ownEnvelopeNonce([head, ...lines, " </ay-msg 99999999>", ...footer], "codex"),
50
+ ).toBeNull();
51
+ });
52
+ it("is null when the closer is followed by more than a footer", () => {
53
+ const after = Array.from({ length: 12 }, (_, i) => ` typed ${i}`);
54
+ expect(
55
+ ownEnvelopeNonce([head, " </ay-msg 1a2b3c4d>", ...after, ...footer], "codex"),
56
+ ).toBeNull();
57
+ });
58
+ });
59
+
34
60
  describe("composerBoxed without a rule (Codex)", () => {
35
61
  const live = ["› hello", "", " gpt-x default · ~/repo", " ? for shortcuts"];
36
62
  it("accepts a prompt row followed by Codex's footer", () => {
@@ -198,6 +224,10 @@ describe("agy's ASCII `>` prompt", () => {
198
224
  expect(await classify(agyBox(""), 60, "agy")).toEqual({ kind: "empty", ghost: false });
199
225
  });
200
226
 
227
+ it("reads agy's gray mode notice in an empty box as ghost text, not a draft", async () => {
228
+ const notice = " \x1b[90mAuto mode: edits & safe commands auto-approved\x1b[0m";
229
+ expect(await classify(agyBox(notice), 60, "agy")).toEqual({ kind: "empty", ghost: true });
230
+ });
201
231
  it("reads typed text in agy's box as a draft", async () => {
202
232
  expect(await classify(agyBox(" hi"), 60, "agy")).toEqual({ kind: "draft", chars: 2 });
203
233
  });
@@ -207,6 +237,27 @@ describe("agy's ASCII `>` prompt", () => {
207
237
  expect(composerBoxed(["history", RULE, "> quoted", RULE, "? for shortcuts"])).toBe(false);
208
238
  expect(composerBoxed(["history", RULE, ">", RULE, "? for shortcuts"], "agy")).toBe(true);
209
239
  });
240
+
241
+ // agy draws each past user turn as a rule over a `> …` row, the same shape as
242
+ // its input row, and puts a task list and a second rule under its box.
243
+ const TASKS = [
244
+ " ● [10:00:00] build",
245
+ " ● [10:01:00] test",
246
+ " ↓ 3 more",
247
+ RULE,
248
+ "? for shortcuts",
249
+ ];
250
+ const turn = [RULE, "> old question", "", " old answer"];
251
+
252
+ it("finds agy's live box under a transcript of past turns", () => {
253
+ expect(composerBoxed([...turn, "", RULE, ">", RULE, ...TASKS], "agy")).toBe(true);
254
+ expect(composerBoxed([...turn, "", RULE, "> btw how", RULE, ...TASKS], "agy")).toBe(true);
255
+ });
256
+
257
+ it("does not take a past agy turn for the box when the box is off screen", () => {
258
+ // A partial redraw left only the transcript, the task list and the footer.
259
+ expect(composerBoxed([...turn, "", ...TASKS.filter((t) => t !== RULE)], "agy")).toBe(false);
260
+ });
210
261
  });
211
262
 
212
263
  describe("pending queue", () => {