agent-yes 1.60.5 → 1.60.6

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, unlink, writeFile as writeFile$1 } from "fs/promises";
12
+ import { appendFile, mkdir as mkdir$1, readFile as readFile$1, readdir, rename, 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";
@@ -560,24 +560,25 @@ var JsonlStore = class {
560
560
  * Acquires lock.
561
561
  */
562
562
  async compact() {
563
- await this.withLock(async () => {
564
- const lines = Array.from(this.docs.values()).map((doc) => {
565
- const { _id, $$deleted, ...rest } = doc;
566
- return JSON.stringify({
567
- _id,
568
- ...rest
569
- });
570
- }).join("\n");
571
- const content = lines ? lines + "\n" : "";
572
- await writeFile$1(this.tempPath, content);
573
- const fd = openSync(this.tempPath, "r");
574
- fsyncSync(fd);
575
- closeSync(fd);
576
- if (process.platform === "win32") try {
577
- await unlink(this.filePath);
578
- } catch {}
579
- await rename(this.tempPath, this.filePath);
580
- });
563
+ const lines = Array.from(this.docs.values()).map((doc) => {
564
+ const { _id, $$deleted, ...rest } = doc;
565
+ return JSON.stringify({
566
+ _id,
567
+ ...rest
568
+ });
569
+ }).join("\n");
570
+ const content = lines ? lines + "\n" : "";
571
+ try {
572
+ await this.withLock(async () => {
573
+ await writeFile$1(this.tempPath, content);
574
+ const fd = openSync(this.tempPath, "r");
575
+ fsyncSync(fd);
576
+ closeSync(fd);
577
+ await rename(this.tempPath, this.filePath);
578
+ });
579
+ } catch {
580
+ await writeFile$1(this.filePath, content);
581
+ }
581
582
  }
582
583
  async withLock(fn) {
583
584
  const dir = path.dirname(this.filePath);
@@ -905,7 +906,7 @@ function tryCatch(catchFn, fn) {
905
906
  //#endregion
906
907
  //#region package.json
907
908
  var name = "agent-yes";
908
- var version = "1.60.5";
909
+ var version = "1.60.6";
909
910
 
910
911
  //#endregion
911
912
  //#region ts/pty-fix.ts
@@ -1952,4 +1953,4 @@ const SUPPORTED_CLIS = Object.keys(CLIS_CONFIG);
1952
1953
 
1953
1954
  //#endregion
1954
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 };
1955
- //# sourceMappingURL=SUPPORTED_CLIS-Dn3ATPWW.js.map
1956
+ //# sourceMappingURL=SUPPORTED_CLIS--w_SPLyp.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-Dn3ATPWW.js";
2
+ import { c as PidStore, o as name, s as version, t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS--w_SPLyp.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, unlink } from "fs/promises";
12
+ import { chmod, copyFile, rename } 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-Dn3ATPWW.js";
1
+ import { a as AgentContext, i as config, l as removeControlCharacters, n as CLIS_CONFIG, r as agentYes } from "./SUPPORTED_CLIS--w_SPLyp.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.5",
3
+ "version": "1.60.6",
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
@@ -167,29 +167,29 @@ export class JsonlStore<T extends Record<string, any> = Record<string, any>> {
167
167
  * Acquires lock.
168
168
  */
169
169
  async compact(): Promise<void> {
170
- await this.withLock(async () => {
171
- const lines = Array.from(this.docs.values())
172
- .map((doc) => {
173
- const { _id, $$deleted, ...rest } = doc;
174
- return JSON.stringify({ _id, ...rest });
175
- })
176
- .join("\n");
177
- const content = lines ? lines + "\n" : "";
178
-
179
- // Write to temp file
180
- await writeFile(this.tempPath, content);
181
- // fsync temp file
182
- const fd = openSync(this.tempPath, "r");
183
- fsyncSync(fd);
184
- closeSync(fd);
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
- }
191
- await rename(this.tempPath, this.filePath);
192
- });
170
+ const lines = Array.from(this.docs.values())
171
+ .map((doc) => {
172
+ const { _id, $$deleted, ...rest } = doc;
173
+ return JSON.stringify({ _id, ...rest });
174
+ })
175
+ .join("\n");
176
+ const content = lines ? lines + "\n" : "";
177
+
178
+ try {
179
+ await this.withLock(async () => {
180
+ // Write to temp file
181
+ await writeFile(this.tempPath, content);
182
+ // fsync temp file
183
+ const fd = openSync(this.tempPath, "r");
184
+ fsyncSync(fd);
185
+ closeSync(fd);
186
+ // Atomic rename
187
+ await rename(this.tempPath, this.filePath);
188
+ });
189
+ } catch {
190
+ // Fallback: direct overwrite (e.g. rename fails on Windows, or lock unavailable)
191
+ await writeFile(this.filePath, content);
192
+ }
193
193
  }
194
194
 
195
195
  private async withLock<R>(fn: () => Promise<R>): Promise<R> {