agent-yes 1.63.0 → 1.64.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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Agent-Yes! for Claude/Codex/Gemini/Cursor/Copilot/Qwen/Auggie
2
2
 
3
- A wrapper tool that automates interactions with various AI CLI tools by automatically handling common prompts and responses. Originally designed for Claude CLI, now supports multiple AI coding assistants.
3
+ A wrapper tool that automates interactions with various AI CLI tools by automatically handling common prompts and responses. Originally designed for Claude CLI, now supports multiple AI coding assistants. Rewritten in Rust for improved performance and reliability.
4
4
 
5
5
  ⚠️ **Important Security Warning**: Only run this on trusted repositories. This tool automatically responds to prompts and can execute commands without user confirmation. Be aware of potential prompt injection attacks where malicious code or instructions could be embedded in files or user inputs to manipulate the automated responses.
6
6
 
@@ -950,19 +950,13 @@ var ReadyManager = class {
950
950
  async function sendEnter(context, waitms = 1e3) {
951
951
  const st = Date.now();
952
952
  await context.idleWaiter.wait(waitms);
953
- const et = Date.now();
954
- logger.debug(`sendingEnter| idleWaiter.wait(${String(waitms)}) took ${String(et - st)}ms`);
953
+ logger.debug(`sendEnter| idleWait took ${String(Date.now() - st)}ms`);
955
954
  context.nextStdout.unready();
956
955
  context.shell.write("\r");
957
- logger.debug(`enterSent| idleWaiter.wait(${String(waitms)}) took ${String(et - st)}ms`);
958
- await Promise.race([context.nextStdout.wait(), new Promise((resolve) => setTimeout(() => {
959
- if (!context.nextStdout.isReady) context.shell.write("\r");
960
- resolve();
961
- }, 1e3))]);
962
- await Promise.race([context.nextStdout.wait(), new Promise((resolve) => setTimeout(() => {
956
+ for (const ms of [1e3, 3e3]) await Promise.race([context.nextStdout.wait(), new Promise((resolve) => setTimeout(() => {
963
957
  if (!context.nextStdout.isReady) context.shell.write("\r");
964
958
  resolve();
965
- }, 3e3))]);
959
+ }, ms))]);
966
960
  }
967
961
  /**
968
962
  * Send a message to the shell
@@ -1065,7 +1059,7 @@ function tryCatch(catchFn, fn) {
1065
1059
  //#endregion
1066
1060
  //#region package.json
1067
1061
  var name = "agent-yes";
1068
- var version = "1.63.0";
1062
+ var version = "1.64.0";
1069
1063
 
1070
1064
  //#endregion
1071
1065
  //#region ts/pty-fix.ts
@@ -1642,6 +1636,12 @@ async function agentYes({ cli, cliArgs = [], prompt, robust = true, cwd, env, ex
1642
1636
  install,
1643
1637
  ptyOptions
1644
1638
  });
1639
+ function onData(data) {
1640
+ const currentPid = shell.pid;
1641
+ outputWriter.write(data);
1642
+ globalAgentRegistry.appendStdout(currentPid, data);
1643
+ }
1644
+ shell.onData(onData);
1645
1645
  try {
1646
1646
  await pidStore.registerProcess({
1647
1647
  pid: shell.pid,
@@ -1689,12 +1689,6 @@ async function agentYes({ cli, cliArgs = [], prompt, robust = true, cwd, env, ex
1689
1689
  if (!ctx.stdinFirstReady.isReady) ctx.stdinFirstReady.ready();
1690
1690
  });
1691
1691
  const pendingExitCode = Promise.withResolvers();
1692
- function onData(data) {
1693
- const currentPid = shell.pid;
1694
- outputWriter.write(data);
1695
- globalAgentRegistry.appendStdout(currentPid, data);
1696
- }
1697
- shell.onData(onData);
1698
1692
  shell.onExit(async function onExit({ exitCode }) {
1699
1693
  const exitedPid = shell.pid;
1700
1694
  globalAgentRegistry.unregister(exitedPid);
@@ -2118,4 +2112,4 @@ const SUPPORTED_CLIS = Object.keys(CLIS_CONFIG);
2118
2112
 
2119
2113
  //#endregion
2120
2114
  export { AgentContext as a, PidStore as c, config as i, removeControlCharacters as l, CLIS_CONFIG as n, name as o, agentYes as r, version as s, SUPPORTED_CLIS as t };
2121
- //# sourceMappingURL=SUPPORTED_CLIS-BFlBIzu3.js.map
2115
+ //# sourceMappingURL=SUPPORTED_CLIS-DXou-_yV.js.map
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bun
2
- import { c as PidStore, o as name, s as version, t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BFlBIzu3.js";
2
+ import { c as PidStore, o as name, s as version, t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-DXou-_yV.js";
3
3
  import { t as logger } from "./logger-CX77vJDA.js";
4
4
  import { argv } from "process";
5
5
  import { spawn } from "child_process";
@@ -85,8 +85,8 @@ function parseCliArgs(argv) {
85
85
  default: "yes"
86
86
  }).option("rust", {
87
87
  type: "boolean",
88
- description: "Use the Rust implementation instead of TypeScript",
89
- default: false
88
+ description: "Use the Rust implementation (enabled by default, use --no-rust for TypeScript)",
89
+ default: true
90
90
  }).option("swarm", {
91
91
  type: "string",
92
92
  description: `Enable swarm mode for multi-agent P2P networking (requires --rust).
@@ -271,10 +271,11 @@ function getBinDir() {
271
271
  */
272
272
  function findRustBinary(verbose = false) {
273
273
  const binaryName = getBinaryName();
274
+ const ext = process.platform === "win32" ? ".exe" : "";
274
275
  const searchPaths = [
276
+ path.resolve(import.meta.dirname ?? import.meta.dir, `../rs/target/release/agent-yes${ext}`),
277
+ path.resolve(import.meta.dirname ?? import.meta.dir, `../rs/target/debug/agent-yes${ext}`),
275
278
  path.join(getBinDir(), binaryName),
276
- path.resolve(import.meta.dirname ?? import.meta.dir, "../rs/target/release/agent-yes"),
277
- path.resolve(import.meta.dirname ?? import.meta.dir, "../rs/target/debug/agent-yes"),
278
279
  path.join(getBinDir(), binaryName)
279
280
  ];
280
281
  if (verbose) {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as AgentContext, i as config, l as removeControlCharacters, n as CLIS_CONFIG, r as agentYes } from "./SUPPORTED_CLIS-BFlBIzu3.js";
1
+ import { a as AgentContext, i as config, l as removeControlCharacters, n as CLIS_CONFIG, r as agentYes } from "./SUPPORTED_CLIS-DXou-_yV.js";
2
2
  import "./logger-CX77vJDA.js";
3
3
 
4
4
  export { AgentContext, CLIS_CONFIG, config, agentYes as default, removeControlCharacters };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-yes",
3
- "version": "1.63.0",
3
+ "version": "1.64.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",
package/ts/index.ts CHANGED
@@ -327,6 +327,15 @@ export default async function agentYes({
327
327
  ptyOptions,
328
328
  });
329
329
 
330
+ // Attach data handler IMMEDIATELY after spawn to avoid losing early PTY output.
331
+ // node-pty emits 'data' events eagerly — if no listener is attached, events are lost.
332
+ function onData(data: string) {
333
+ const currentPid = shell.pid;
334
+ outputWriter.write(data);
335
+ globalAgentRegistry.appendStdout(currentPid, data);
336
+ }
337
+ shell.onData(onData);
338
+
330
339
  // Register process in pidStore (non-blocking - failures should not prevent agent from running)
331
340
  try {
332
341
  await pidStore.registerProcess({ pid: shell.pid, cli, args: cliArgs, prompt, cwd: workingDir });
@@ -386,16 +395,6 @@ export default async function agentYes({
386
395
 
387
396
  const pendingExitCode = Promise.withResolvers<number | null>();
388
397
 
389
- function onData(data: string) {
390
- const currentPid = shell.pid; // Capture PID before any potential shell reassignment
391
- // Write eagerly — TerminalRenderStream never exerts backpressure,
392
- // so the PTY is always drained and the child process never blocks.
393
- outputWriter.write(data);
394
- // append to agent registry for MCP server
395
- globalAgentRegistry.appendStdout(currentPid, data);
396
- }
397
-
398
- shell.onData(onData);
399
398
  shell.onExit(async function onExit({ exitCode }) {
400
399
  const exitedPid = shell.pid; // Capture PID immediately before any shell reassignment
401
400
  // Unregister from agent registry
@@ -121,8 +121,8 @@ export function parseCliArgs(argv: string[]) {
121
121
  })
122
122
  .option("rust", {
123
123
  type: "boolean",
124
- description: "Use the Rust implementation instead of TypeScript",
125
- default: false,
124
+ description: "Use the Rust implementation (enabled by default, use --no-rust for TypeScript)",
125
+ default: true,
126
126
  })
127
127
  .option("swarm", {
128
128
  type: "string",
package/ts/rustBinary.ts CHANGED
@@ -61,13 +61,14 @@ export function getBinDir(): string {
61
61
  export function findRustBinary(verbose = false): string | undefined {
62
62
  const binaryName = getBinaryName();
63
63
 
64
+ const ext = process.platform === "win32" ? ".exe" : "";
64
65
  const searchPaths = [
65
- // 1. Check in npm package bin directory
66
- path.join(getBinDir(), binaryName),
66
+ // 1. Check relative to this script (in the repo during development)
67
+ path.resolve(import.meta.dirname ?? import.meta.dir, `../rs/target/release/agent-yes${ext}`),
68
+ path.resolve(import.meta.dirname ?? import.meta.dir, `../rs/target/debug/agent-yes${ext}`),
67
69
 
68
- // 2. Check relative to this script (in the repo during development)
69
- path.resolve(import.meta.dirname ?? import.meta.dir, "../rs/target/release/agent-yes"),
70
- path.resolve(import.meta.dirname ?? import.meta.dir, "../rs/target/debug/agent-yes"),
70
+ // 2. Check in npm package bin directory
71
+ path.join(getBinDir(), binaryName),
71
72
 
72
73
  // 3. Check in user's cache directory
73
74
  path.join(getBinDir(), binaryName),