agent-yes 1.62.0 → 1.62.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.
@@ -10,7 +10,7 @@ import sflow from "sflow";
10
10
  import { TerminalRenderStream } from "terminal-render";
11
11
  import { homedir } from "os";
12
12
  import winston from "winston";
13
- import { closeSync, existsSync, fsyncSync, openSync } from "fs";
13
+ import { closeSync, existsSync, fsyncSync, mkdirSync, openSync } from "fs";
14
14
  import { lock } from "proper-lockfile";
15
15
  import { execSync as execSync$1 } from "node:child_process";
16
16
  import { fileURLToPath } from "url";
@@ -904,7 +904,7 @@ function tryCatch(catchFn, fn) {
904
904
  //#endregion
905
905
  //#region package.json
906
906
  var name = "agent-yes";
907
- var version = "1.62.0";
907
+ var version = "1.62.1";
908
908
 
909
909
  //#endregion
910
910
  //#region ts/pty-fix.ts
@@ -1069,7 +1069,7 @@ function isCommandNotFoundError(e) {
1069
1069
  * ```
1070
1070
  */
1071
1071
  function spawnAgent(options) {
1072
- const { cli, cliConf, cliArgs, verbose: _verbose, install, ptyOptions } = options;
1072
+ const { cli, cliConf, cliArgs, install, ptyOptions } = options;
1073
1073
  const spawn = () => {
1074
1074
  let [bin, ...args] = [...parseCommandString(cliConf?.binary || cli), ...cliArgs];
1075
1075
  logger.debug(`Spawning ${bin} with args: ${JSON.stringify(args)}`);
@@ -1077,7 +1077,7 @@ function spawnAgent(options) {
1077
1077
  logger.info(`[${cli}-yes] Spawned ${bin} with PID ${spawned.pid} (agent-yes v${version})`);
1078
1078
  return spawned;
1079
1079
  };
1080
- return tryCatch((error, _attempts, spawn, ...args) => {
1080
+ return tryCatch((error, attempts, spawn, ...args) => {
1081
1081
  logger.error(`Fatal: Failed to start ${cli}.`);
1082
1082
  const isNotFound = isCommandNotFoundError(error);
1083
1083
  if (cliConf?.install && isNotFound) {
@@ -1864,7 +1864,6 @@ async function agentYes({ cli, cliArgs = [], prompt, robust = true, cwd, env, ex
1864
1864
  }).by(function consoleResponder(e) {
1865
1865
  let lastRendered = "";
1866
1866
  return e.forEach((chunk) => {
1867
- terminalRender.write(chunk);
1868
1867
  if (chunk.includes("\x1B[c") || chunk.includes("\x1B[0c")) {
1869
1868
  shell.write("\x1B[?1;2c");
1870
1869
  if (verbose) logger.debug("device|respond DA: VT100 with Advanced Video Option");
@@ -1951,4 +1950,4 @@ const SUPPORTED_CLIS = Object.keys(CLIS_CONFIG);
1951
1950
 
1952
1951
  //#endregion
1953
1952
  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 };
1954
- //# sourceMappingURL=SUPPORTED_CLIS-4TAXzvkb.js.map
1953
+ //# sourceMappingURL=SUPPORTED_CLIS-BWhzaf_k.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-4TAXzvkb.js";
2
+ import { c as PidStore, o as name, s as version, t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BWhzaf_k.js";
3
3
  import { t as logger } from "./logger-CX77vJDA.js";
4
4
  import { argv } from "process";
5
5
  import { spawn } from "child_process";
@@ -271,7 +271,6 @@ function getBinDir() {
271
271
  */
272
272
  function findRustBinary(verbose = false) {
273
273
  const binaryName = getBinaryName();
274
- binaryName.replace(/\.exe$/, "");
275
274
  const searchPaths = [
276
275
  path.join(getBinDir(), binaryName),
277
276
  path.resolve(import.meta.dirname ?? import.meta.dir, "../rs/target/release/agent-yes"),
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-4TAXzvkb.js";
1
+ import { a as AgentContext, i as config, l as removeControlCharacters, n as CLIS_CONFIG, r as agentYes } from "./SUPPORTED_CLIS-BWhzaf_k.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.0",
3
+ "version": "1.62.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",
package/ts/index.ts CHANGED
@@ -14,7 +14,8 @@ import pty, { ptyPackage } from "./pty.ts";
14
14
  import { removeControlCharacters } from "./removeControlCharacters.ts";
15
15
  import { acquireLock, releaseLock, shouldUseLock } from "./runningLock.ts";
16
16
  import { logger } from "./logger.ts";
17
- // import { createFifoStream } from "./beta/fifo.ts";
17
+ // oxlint-disable-next-line no-unused-vars -- kept for FIFO re-enable (see TODO at index.ts:833)
18
+ import { createFifoStream } from "./beta/fifo.ts";
18
19
  import { PidStore } from "./pidStore.ts";
19
20
  import { SUPPORTED_CLIS } from "./SUPPORTED_CLIS.ts";
20
21
  import { sendEnter, sendMessage } from "./core/messaging.ts";
@@ -26,10 +27,8 @@ import {
26
27
  } from "./core/logging.ts";
27
28
  import { spawnAgent } from "./core/spawner.ts";
28
29
  import { AgentContext } from "./core/context.ts";
29
- // import { createAutoResponseHandler } from "./core/responders.ts";
30
30
  import { createTerminatorStream } from "./core/streamHelpers.ts";
31
31
  import { globalAgentRegistry } from "./agentRegistry.ts";
32
- // import { ReadyManager } from "./ReadyManager.ts";
33
32
  import { notifyWebhook } from "./webhookNotifier.ts";
34
33
 
35
34
  export { removeControlCharacters };
@@ -802,7 +801,7 @@ export default async function agentYes({
802
801
  // Only check for /auto if line is short enough
803
802
  if (line.length <= 20) {
804
803
  const cleanLine = line
805
- // oxlint-disable-next-line no-control-regex
804
+ // oxlint-disable-next-line no-control-regex -- intentional: strip ANSI/control chars
806
805
  .replace(/[\x00-\x1f]|\x1b\[[0-9;]*[A-Za-z]|\[[A-Z]/g, "")
807
806
  .trim();
808
807
  if (cleanLine === "/auto") {
@@ -894,8 +893,10 @@ export default async function agentYes({
894
893
  let lastRendered = "";
895
894
  return e
896
895
  .forEach((chunk) => {
897
- // Render terminal output for log file
898
- terminalRender.write(chunk);
896
+ // NOTE: terminalRender is already updated by terminalStream.writable.write() in onData()
897
+ // (terminal-render v1.5+ calls renderer.write() as a side effect of the writable).
898
+ // Calling terminalRender.write(chunk) here again would double-process every chunk,
899
+ // corrupting cursor state and breaking all pattern matching.
899
900
  // ============ HANDLE special control sequences
900
901
  // Handle Device Attributes query (DA) - ESC[c or ESC[0c
901
902
  // This must be handled regardless of TTY status
@@ -2,8 +2,6 @@ import ms from "ms";
2
2
  import yargs from "yargs";
3
3
  import { hideBin } from "yargs/helpers";
4
4
  import { SUPPORTED_CLIS } from "./SUPPORTED_CLIS.ts";
5
-
6
- // const pkg = await JSON.parse(await readFile(path.resolve((import.meta.dir) + "/../package.json"), 'utf8'))
7
5
  /**
8
6
  * Parse CLI arguments the same way cli.ts does
9
7
  * This is a test helper that mirrors the parsing logic in cli.ts
package/ts/rustBinary.ts CHANGED
@@ -60,7 +60,6 @@ export function getBinDir(): string {
60
60
  */
61
61
  export function findRustBinary(verbose = false): string | undefined {
62
62
  const binaryName = getBinaryName();
63
- const _baseName = binaryName.replace(/\.exe$/, "");
64
63
 
65
64
  const searchPaths = [
66
65
  // 1. Check in npm package bin directory