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,
|
|
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
|
-
|
|
564
|
-
const
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
await
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
await
|
|
578
|
-
}
|
|
579
|
-
|
|
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.
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
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
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
await
|
|
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> {
|