agent-yes 1.62.1 → 1.62.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.
@@ -798,11 +798,11 @@ async function sendEnter(context, waitms = 1e3) {
798
798
  context.shell.write("\r");
799
799
  logger.debug(`enterSent| idleWaiter.wait(${String(waitms)}) took ${String(et - st)}ms`);
800
800
  await Promise.race([context.nextStdout.wait(), new Promise((resolve) => setTimeout(() => {
801
- if (!context.nextStdout.ready) context.shell.write("\r");
801
+ if (!context.nextStdout.isReady) context.shell.write("\r");
802
802
  resolve();
803
803
  }, 1e3))]);
804
804
  await Promise.race([context.nextStdout.wait(), new Promise((resolve) => setTimeout(() => {
805
- if (!context.nextStdout.ready) context.shell.write("\r");
805
+ if (!context.nextStdout.isReady) context.shell.write("\r");
806
806
  resolve();
807
807
  }, 3e3))]);
808
808
  }
@@ -819,7 +819,10 @@ async function sendMessage(context, message, { waitForReady = true } = {}) {
819
819
  context.shell.write(message);
820
820
  context.idleWaiter.ping();
821
821
  logger.debug(`waiting next stdout|${message}`);
822
- await context.nextStdout.wait();
822
+ await Promise.race([context.nextStdout.wait(), new Promise((resolve) => setTimeout(() => {
823
+ logger.warn(`nextStdout.wait() timed out after 30s for message: ${message}`);
824
+ resolve();
825
+ }, 3e4))]);
823
826
  logger.debug(`sending enter`);
824
827
  await sendEnter(context, 1e3);
825
828
  logger.debug(`sent enter`);
@@ -904,7 +907,7 @@ function tryCatch(catchFn, fn) {
904
907
  //#endregion
905
908
  //#region package.json
906
909
  var name = "agent-yes";
907
- var version = "1.62.1";
910
+ var version = "1.62.2";
908
911
 
909
912
  //#endregion
910
913
  //#region ts/pty-fix.ts
@@ -1777,7 +1780,7 @@ async function agentYes({ cli, cliArgs = [], prompt, robust = true, cwd, env, ex
1777
1780
  cancel(_reason) {
1778
1781
  process.stdin.pause();
1779
1782
  }
1780
- });
1783
+ }, { highWaterMark: 16 });
1781
1784
  let aborted = false;
1782
1785
  await sflow(stdinStream).map((buffer) => {
1783
1786
  const str = buffer.toString();
@@ -1950,4 +1953,4 @@ const SUPPORTED_CLIS = Object.keys(CLIS_CONFIG);
1950
1953
 
1951
1954
  //#endregion
1952
1955
  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 };
1953
- //# sourceMappingURL=SUPPORTED_CLIS-BWhzaf_k.js.map
1956
+ //# sourceMappingURL=SUPPORTED_CLIS-CxaWfAAA.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-BWhzaf_k.js";
2
+ import { c as PidStore, o as name, s as version, t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-CxaWfAAA.js";
3
3
  import { t as logger } from "./logger-CX77vJDA.js";
4
4
  import { argv } from "process";
5
5
  import { spawn } from "child_process";
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-BWhzaf_k.js";
1
+ import { a as AgentContext, i as config, l as removeControlCharacters, n as CLIS_CONFIG, r as agentYes } from "./SUPPORTED_CLIS-CxaWfAAA.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.62.1",
3
+ "version": "1.62.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/index.ts CHANGED
@@ -687,52 +687,55 @@ export default async function agentYes({
687
687
  // CRITICAL FIX: fromReadable() from 'from-node-stream' doesn't work properly with stdin
688
688
  // because it doesn't handle Node.js stream modes correctly. We create a custom ReadableStream
689
689
  // that properly manages stdin's flowing mode and event listeners.
690
- const stdinStream = new ReadableStream<Buffer>({
691
- start(controller) {
692
- // Set up stdin in flowing mode so 'data' events fire
693
- process.stdin.resume();
694
-
695
- let closed = false;
696
-
697
- // Handle data events
698
- const dataHandler = (chunk: Buffer) => {
699
- try {
700
- controller.enqueue(chunk);
701
- } catch {
702
- // Ignore enqueue errors (stream may be closed)
703
- }
704
- };
690
+ const stdinStream = new ReadableStream<Buffer>(
691
+ {
692
+ start(controller) {
693
+ // Set up stdin in flowing mode so 'data' events fire
694
+ process.stdin.resume();
695
+
696
+ let closed = false;
697
+
698
+ // Handle data events
699
+ const dataHandler = (chunk: Buffer) => {
700
+ try {
701
+ controller.enqueue(chunk);
702
+ } catch {
703
+ // Ignore enqueue errors (stream may be closed)
704
+ }
705
+ };
705
706
 
706
- // Handle end/close - both events can fire, so track state
707
- const endHandler = () => {
708
- if (closed) return;
709
- closed = true;
710
- try {
711
- controller.close();
712
- } catch {
713
- // Ignore close errors (already closed)
714
- }
715
- };
707
+ // Handle end/close - both events can fire, so track state
708
+ const endHandler = () => {
709
+ if (closed) return;
710
+ closed = true;
711
+ try {
712
+ controller.close();
713
+ } catch {
714
+ // Ignore close errors (already closed)
715
+ }
716
+ };
716
717
 
717
- const errorHandler = (err: Error) => {
718
- if (closed) return;
719
- closed = true;
720
- try {
721
- controller.error(err);
722
- } catch {
723
- // Ignore error after close
724
- }
725
- };
718
+ const errorHandler = (err: Error) => {
719
+ if (closed) return;
720
+ closed = true;
721
+ try {
722
+ controller.error(err);
723
+ } catch {
724
+ // Ignore error after close
725
+ }
726
+ };
726
727
 
727
- process.stdin.on("data", dataHandler);
728
- process.stdin.on("end", endHandler);
729
- process.stdin.on("close", endHandler);
730
- process.stdin.on("error", errorHandler);
728
+ process.stdin.on("data", dataHandler);
729
+ process.stdin.on("end", endHandler);
730
+ process.stdin.on("close", endHandler);
731
+ process.stdin.on("error", errorHandler);
732
+ },
733
+ cancel(_reason) {
734
+ process.stdin.pause();
735
+ },
731
736
  },
732
- cancel(_reason) {
733
- process.stdin.pause();
734
- },
735
- });
737
+ { highWaterMark: 16 },
738
+ );
736
739
 
737
740
  let aborted = false;
738
741
  await sflow(stdinStream)