agent-yes 1.60.4 → 1.60.5

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.
@@ -9,7 +9,7 @@ import path$1 from "node:path";
9
9
  import winston from "winston";
10
10
  import { execaCommandSync, parseCommandString } from "execa";
11
11
  import { fromWritable } from "from-node-stream";
12
- import { appendFile, mkdir as mkdir$1, readFile as readFile$1, readdir, rename, writeFile as writeFile$1 } from "fs/promises";
12
+ import { appendFile, mkdir as mkdir$1, readFile as readFile$1, readdir, rename, unlink, writeFile as writeFile$1 } from "fs/promises";
13
13
  import DIE from "phpdie";
14
14
  import sflow from "sflow";
15
15
  import { TerminalRenderStream } from "terminal-render";
@@ -573,6 +573,9 @@ var JsonlStore = class {
573
573
  const fd = openSync(this.tempPath, "r");
574
574
  fsyncSync(fd);
575
575
  closeSync(fd);
576
+ if (process.platform === "win32") try {
577
+ await unlink(this.filePath);
578
+ } catch {}
576
579
  await rename(this.tempPath, this.filePath);
577
580
  });
578
581
  }
@@ -902,7 +905,7 @@ function tryCatch(catchFn, fn) {
902
905
  //#endregion
903
906
  //#region package.json
904
907
  var name = "agent-yes";
905
- var version = "1.60.4";
908
+ var version = "1.60.5";
906
909
 
907
910
  //#endregion
908
911
  //#region ts/pty-fix.ts
@@ -1949,4 +1952,4 @@ const SUPPORTED_CLIS = Object.keys(CLIS_CONFIG);
1949
1952
 
1950
1953
  //#endregion
1951
1954
  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 };
1952
- //# sourceMappingURL=SUPPORTED_CLIS-CsIeXGPS.js.map
1955
+ //# sourceMappingURL=SUPPORTED_CLIS-Dn3ATPWW.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-CsIeXGPS.js";
2
+ import { c as PidStore, o as name, s as version, t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-Dn3ATPWW.js";
3
3
  import "./agent-yes.config-B-sre0vp.js";
4
4
  import { t as logger } from "./logger-CY9ormLF.js";
5
5
  import { argv } from "process";
@@ -9,7 +9,7 @@ import path from "path";
9
9
  import ms from "ms";
10
10
  import yargs from "yargs";
11
11
  import { hideBin } from "yargs/helpers";
12
- import { chmod, copyFile, rename } from "fs/promises";
12
+ import { chmod, copyFile, rename, unlink } from "fs/promises";
13
13
 
14
14
  //#region ts/parseCliArgs.ts
15
15
  /**
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-CsIeXGPS.js";
1
+ import { a as AgentContext, i as config, l as removeControlCharacters, n as CLIS_CONFIG, r as agentYes } from "./SUPPORTED_CLIS-Dn3ATPWW.js";
2
2
  import "./logger-CY9ormLF.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.60.4",
3
+ "version": "1.60.5",
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/JsonlStore.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { appendFile, mkdir, readFile, rename, writeFile } from "fs/promises";
1
+ import { appendFile, mkdir, readFile, rename, unlink, writeFile } from "fs/promises";
2
2
  import { existsSync } from "fs";
3
3
  import { fsyncSync, openSync, closeSync } from "fs";
4
4
  import path from "path";
@@ -182,7 +182,12 @@ export class JsonlStore<T extends Record<string, any> = Record<string, any>> {
182
182
  const fd = openSync(this.tempPath, "r");
183
183
  fsyncSync(fd);
184
184
  closeSync(fd);
185
- // Atomic rename
185
+ // Atomic rename (on Windows, rename may fail if target exists — unlink first)
186
+ if (process.platform === "win32") {
187
+ try {
188
+ await unlink(this.filePath);
189
+ } catch {}
190
+ }
186
191
  await rename(this.tempPath, this.filePath);
187
192
  });
188
193
  }
@@ -3,7 +3,10 @@ import { PidStore } from "./pidStore";
3
3
  import { rm, readFile } from "fs/promises";
4
4
  import path from "path";
5
5
 
6
- const TEST_DIR = "/tmp/pidstore-test-" + process.pid;
6
+ const isWindows = process.platform === "win32";
7
+ const TEST_DIR = isWindows
8
+ ? path.join(process.env.TEMP || "C:\\Temp", "pidstore-test-" + process.pid)
9
+ : "/tmp/pidstore-test-" + process.pid;
7
10
 
8
11
  describe("PidStore", () => {
9
12
  let store: PidStore;
@@ -84,7 +87,11 @@ describe("PidStore", () => {
84
87
  });
85
88
 
86
89
  expect(rec.logFile).toContain("42.log");
87
- expect(rec.fifoFile).toContain("42.stdin");
90
+ if (isWindows) {
91
+ expect(rec.fifoFile).toContain("agent-yes-42");
92
+ } else {
93
+ expect(rec.fifoFile).toContain("42.stdin");
94
+ }
88
95
  });
89
96
  });
90
97
 
@@ -158,7 +165,11 @@ describe("PidStore", () => {
158
165
 
159
166
  const fifo = await PidStore.findActiveFifo(fifoTestDir);
160
167
  expect(fifo).toBeTypeOf("string");
161
- expect(fifo!).toContain(`${process.pid}.stdin`);
168
+ if (isWindows) {
169
+ expect(fifo!).toContain(`agent-yes-${process.pid}`);
170
+ } else {
171
+ expect(fifo!).toContain(`${process.pid}.stdin`);
172
+ }
162
173
 
163
174
  await rm(fifoTestDir, { recursive: true, force: true });
164
175
  });
@@ -189,14 +200,18 @@ describe("PidStore", () => {
189
200
 
190
201
  it("getFifoPath should return correct path", () => {
191
202
  const fifo = store.getFifoPath(42);
192
- expect(fifo).toBe(path.resolve(TEST_DIR, ".agent-yes", "fifo", "42.stdin"));
203
+ if (isWindows) {
204
+ expect(fifo).toBe(`\\\\.\\pipe\\agent-yes-42`);
205
+ } else {
206
+ expect(fifo).toBe(path.resolve(TEST_DIR, ".agent-yes", "fifo", "42.stdin"));
207
+ }
193
208
  });
194
209
  });
195
210
 
196
211
  describe("gitignore", () => {
197
212
  it("should create .gitignore in store dir", async () => {
198
213
  const gitignorePath = path.join(TEST_DIR, ".agent-yes", ".gitignore");
199
- const content = await Bun.file(gitignorePath).text();
214
+ const content = await readFile(gitignorePath, "utf-8");
200
215
  expect(content).toContain("*.jsonl");
201
216
  expect(content).toContain("logs/");
202
217
  });