claude-yes 1.75.0 → 1.75.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.
- package/dist/SUPPORTED_CLIS-CqAT1Zud.js +11 -0
- package/dist/cli.js +4 -4
- package/dist/{globalPidIndex-DNEh8a_O.js → globalPidIndex-BHCkWll6.js} +20 -9
- package/dist/index.js +3 -3
- package/dist/{package-CE0J-uFT.js → package-DRIilF5m.js} +2 -2
- package/dist/pidStore-CF54dFqr.js +5 -0
- package/dist/{pidStore-CHLHMBEM.js → pidStore-CYmzzaQQ.js} +2 -2
- package/dist/{subcommands-DpOqSs-b.js → subcommands-NWIZy8od.js} +2 -2
- package/dist/{ts-D_iRstH9.js → ts-DfT_yx7e.js} +3 -3
- package/package.json +1 -1
- package/ts/globalPidIndex.ts +21 -9
- package/ts/pidStore.spec.ts +12 -0
- package/dist/SUPPORTED_CLIS-Dzf60ENT.js +0 -11
- package/dist/pidStore-DR1yPY3t.js +0 -5
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { t as CLIS_CONFIG } from "./ts-DfT_yx7e.js";
|
|
2
|
+
import "./logger-B9h0djqx.js";
|
|
3
|
+
import "./pidStore-CYmzzaQQ.js";
|
|
4
|
+
import "./globalPidIndex-BHCkWll6.js";
|
|
5
|
+
|
|
6
|
+
//#region ts/SUPPORTED_CLIS.ts
|
|
7
|
+
const SUPPORTED_CLIS = Object.keys(CLIS_CONFIG);
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { SUPPORTED_CLIS };
|
|
11
|
+
//# sourceMappingURL=SUPPORTED_CLIS-CqAT1Zud.js.map
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
import { n as logger } from "./logger-B9h0djqx.js";
|
|
3
|
-
import { n as version, t as name } from "./package-
|
|
3
|
+
import { n as version, t as name } from "./package-DRIilF5m.js";
|
|
4
4
|
import { argv } from "process";
|
|
5
5
|
import { execFileSync, spawn } from "child_process";
|
|
6
6
|
import ms from "ms";
|
|
@@ -635,7 +635,7 @@ function buildRustArgs(argv, cliFromScript, supportedClis) {
|
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
637
|
{
|
|
638
|
-
const { isSubcommand, runSubcommand } = await import("./subcommands-
|
|
638
|
+
const { isSubcommand, runSubcommand } = await import("./subcommands-NWIZy8od.js");
|
|
639
639
|
if (isSubcommand(process.argv[2])) {
|
|
640
640
|
const code = await runSubcommand(process.argv);
|
|
641
641
|
process.exit(code ?? 0);
|
|
@@ -664,7 +664,7 @@ if (config.useRust) {
|
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
666
|
if (rustBinary) {
|
|
667
|
-
const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-
|
|
667
|
+
const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-CqAT1Zud.js");
|
|
668
668
|
const rustArgs = buildRustArgs(process.argv, config.cli, SUPPORTED_CLIS);
|
|
669
669
|
if (config.verbose) {
|
|
670
670
|
console.log(`[rust] Using binary: ${rustBinary}`);
|
|
@@ -694,7 +694,7 @@ if (config.showVersion) {
|
|
|
694
694
|
process.exit(0);
|
|
695
695
|
}
|
|
696
696
|
if (config.appendPrompt) {
|
|
697
|
-
const { PidStore } = await import("./pidStore-
|
|
697
|
+
const { PidStore } = await import("./pidStore-CF54dFqr.js");
|
|
698
698
|
const ipcPath = await PidStore.findActiveFifo(process.cwd());
|
|
699
699
|
if (!ipcPath) {
|
|
700
700
|
console.error("No active agent with IPC found in current directory.");
|
|
@@ -5,17 +5,28 @@ import path from "path";
|
|
|
5
5
|
import { lock } from "proper-lockfile";
|
|
6
6
|
|
|
7
7
|
//#region ts/globalPidIndex.ts
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Resolved at call time (not module load time) so tests and other callers
|
|
10
|
+
* can override via $AGENT_YES_HOME without juggling module-cache resets.
|
|
11
|
+
* Falls back to `~/.agent-yes` for normal user runs.
|
|
12
|
+
*/
|
|
13
|
+
function resolveGlobalDir() {
|
|
14
|
+
return process.env.AGENT_YES_HOME ?? path.join(homedir(), ".agent-yes");
|
|
15
|
+
}
|
|
16
|
+
function resolveGlobalFile() {
|
|
17
|
+
return path.join(resolveGlobalDir(), "pids.jsonl");
|
|
18
|
+
}
|
|
10
19
|
async function ensureDir() {
|
|
11
|
-
await mkdir(
|
|
20
|
+
await mkdir(resolveGlobalDir(), { recursive: true });
|
|
12
21
|
}
|
|
13
22
|
async function withLock(fn) {
|
|
14
23
|
await ensureDir();
|
|
24
|
+
const file = resolveGlobalFile();
|
|
25
|
+
const dir = resolveGlobalDir();
|
|
15
26
|
let release;
|
|
16
27
|
try {
|
|
17
|
-
release = await lock(
|
|
18
|
-
lockfilePath:
|
|
28
|
+
release = await lock(dir, {
|
|
29
|
+
lockfilePath: file + ".lock",
|
|
19
30
|
retries: {
|
|
20
31
|
retries: 5,
|
|
21
32
|
minTimeout: 50,
|
|
@@ -31,7 +42,7 @@ async function withLock(fn) {
|
|
|
31
42
|
async function appendGlobalPid(record) {
|
|
32
43
|
try {
|
|
33
44
|
await withLock(async () => {
|
|
34
|
-
await appendFile(
|
|
45
|
+
await appendFile(resolveGlobalFile(), JSON.stringify(record) + "\n");
|
|
35
46
|
});
|
|
36
47
|
} catch (error) {
|
|
37
48
|
logger.debug("[globalPidIndex] append failed:", error);
|
|
@@ -47,7 +58,7 @@ async function updateGlobalPidStatus(pid, patch) {
|
|
|
47
58
|
...existing,
|
|
48
59
|
...patch
|
|
49
60
|
};
|
|
50
|
-
await appendFile(
|
|
61
|
+
await appendFile(resolveGlobalFile(), JSON.stringify(merged) + "\n");
|
|
51
62
|
});
|
|
52
63
|
} catch (error) {
|
|
53
64
|
logger.debug("[globalPidIndex] updateStatus failed:", error);
|
|
@@ -59,7 +70,7 @@ async function updateGlobalPidStatus(pid, patch) {
|
|
|
59
70
|
async function readGlobalPidsRaw() {
|
|
60
71
|
let raw;
|
|
61
72
|
try {
|
|
62
|
-
raw = await readFile(
|
|
73
|
+
raw = await readFile(resolveGlobalFile(), "utf-8");
|
|
63
74
|
} catch (err) {
|
|
64
75
|
if (err.code === "ENOENT") return [];
|
|
65
76
|
throw err;
|
|
@@ -100,4 +111,4 @@ function isProcessAlive(pid) {
|
|
|
100
111
|
|
|
101
112
|
//#endregion
|
|
102
113
|
export { readGlobalPids as n, updateGlobalPidStatus as r, appendGlobalPid as t };
|
|
103
|
-
//# sourceMappingURL=globalPidIndex-
|
|
114
|
+
//# sourceMappingURL=globalPidIndex-BHCkWll6.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as removeControlCharacters, i as AgentContext, n as agentYes, r as config, t as CLIS_CONFIG } from "./ts-
|
|
1
|
+
import { a as removeControlCharacters, i as AgentContext, n as agentYes, r as config, t as CLIS_CONFIG } from "./ts-DfT_yx7e.js";
|
|
2
2
|
import "./logger-B9h0djqx.js";
|
|
3
|
-
import "./pidStore-
|
|
4
|
-
import "./globalPidIndex-
|
|
3
|
+
import "./pidStore-CYmzzaQQ.js";
|
|
4
|
+
import "./globalPidIndex-BHCkWll6.js";
|
|
5
5
|
|
|
6
6
|
export { AgentContext, CLIS_CONFIG, config, agentYes as default, removeControlCharacters };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as logger } from "./logger-B9h0djqx.js";
|
|
2
|
-
import { r as updateGlobalPidStatus, t as appendGlobalPid } from "./globalPidIndex-
|
|
2
|
+
import { r as updateGlobalPidStatus, t as appendGlobalPid } from "./globalPidIndex-BHCkWll6.js";
|
|
3
3
|
import { closeSync, existsSync, fsyncSync, openSync } from "fs";
|
|
4
4
|
import { appendFile, mkdir, readFile, rename, writeFile } from "fs/promises";
|
|
5
5
|
import path from "path";
|
|
@@ -337,4 +337,4 @@ pid-db/
|
|
|
337
337
|
|
|
338
338
|
//#endregion
|
|
339
339
|
export { PidStore as t };
|
|
340
|
-
//# sourceMappingURL=pidStore-
|
|
340
|
+
//# sourceMappingURL=pidStore-CYmzzaQQ.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./logger-B9h0djqx.js";
|
|
2
|
-
import { n as readGlobalPids } from "./globalPidIndex-
|
|
2
|
+
import { n as readGlobalPids } from "./globalPidIndex-BHCkWll6.js";
|
|
3
3
|
import { readFile, stat } from "fs/promises";
|
|
4
4
|
import { homedir } from "os";
|
|
5
5
|
import path from "path";
|
|
@@ -388,4 +388,4 @@ async function writeToIpc(ipcPath, payload) {
|
|
|
388
388
|
|
|
389
389
|
//#endregion
|
|
390
390
|
export { isSubcommand, runSubcommand };
|
|
391
|
-
//# sourceMappingURL=subcommands-
|
|
391
|
+
//# sourceMappingURL=subcommands-NWIZy8od.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as logger, t as addTransport } from "./logger-B9h0djqx.js";
|
|
2
|
-
import { n as version } from "./package-
|
|
2
|
+
import { n as version } from "./package-DRIilF5m.js";
|
|
3
3
|
import { i as shouldUseLock, r as releaseLock, t as acquireLock } from "./runningLock-DQWJSptq.js";
|
|
4
|
-
import { t as PidStore } from "./pidStore-
|
|
4
|
+
import { t as PidStore } from "./pidStore-CYmzzaQQ.js";
|
|
5
5
|
import { arch, platform } from "process";
|
|
6
6
|
import { execSync } from "child_process";
|
|
7
7
|
import { closeSync, constants, createReadStream, existsSync, mkdirSync, openSync } from "fs";
|
|
@@ -1679,4 +1679,4 @@ function sleep(ms) {
|
|
|
1679
1679
|
|
|
1680
1680
|
//#endregion
|
|
1681
1681
|
export { removeControlCharacters as a, AgentContext as i, agentYes as n, config as r, CLIS_CONFIG as t };
|
|
1682
|
-
//# sourceMappingURL=ts-
|
|
1682
|
+
//# sourceMappingURL=ts-DfT_yx7e.js.map
|
package/package.json
CHANGED
package/ts/globalPidIndex.ts
CHANGED
|
@@ -38,23 +38,35 @@ export interface GlobalPidRecord {
|
|
|
38
38
|
started_at: number;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Resolved at call time (not module load time) so tests and other callers
|
|
43
|
+
* can override via $AGENT_YES_HOME without juggling module-cache resets.
|
|
44
|
+
* Falls back to `~/.agent-yes` for normal user runs.
|
|
45
|
+
*/
|
|
46
|
+
function resolveGlobalDir(): string {
|
|
47
|
+
return process.env.AGENT_YES_HOME ?? path.join(homedir(), ".agent-yes");
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function resolveGlobalFile(): string {
|
|
51
|
+
return path.join(resolveGlobalDir(), "pids.jsonl");
|
|
52
|
+
}
|
|
43
53
|
|
|
44
54
|
export function getGlobalPidIndexPath(): string {
|
|
45
|
-
return
|
|
55
|
+
return resolveGlobalFile();
|
|
46
56
|
}
|
|
47
57
|
|
|
48
58
|
async function ensureDir() {
|
|
49
|
-
await mkdir(
|
|
59
|
+
await mkdir(resolveGlobalDir(), { recursive: true });
|
|
50
60
|
}
|
|
51
61
|
|
|
52
62
|
async function withLock<R>(fn: () => Promise<R>): Promise<R> {
|
|
53
63
|
await ensureDir();
|
|
64
|
+
const file = resolveGlobalFile();
|
|
65
|
+
const dir = resolveGlobalDir();
|
|
54
66
|
let release: (() => Promise<void>) | undefined;
|
|
55
67
|
try {
|
|
56
|
-
release = await lock(
|
|
57
|
-
lockfilePath:
|
|
68
|
+
release = await lock(dir, {
|
|
69
|
+
lockfilePath: file + ".lock",
|
|
58
70
|
retries: { retries: 5, minTimeout: 50, maxTimeout: 500 },
|
|
59
71
|
});
|
|
60
72
|
return await fn();
|
|
@@ -67,7 +79,7 @@ async function withLock<R>(fn: () => Promise<R>): Promise<R> {
|
|
|
67
79
|
export async function appendGlobalPid(record: GlobalPidRecord): Promise<void> {
|
|
68
80
|
try {
|
|
69
81
|
await withLock(async () => {
|
|
70
|
-
await appendFile(
|
|
82
|
+
await appendFile(resolveGlobalFile(), JSON.stringify(record) + "\n");
|
|
71
83
|
});
|
|
72
84
|
} catch (error) {
|
|
73
85
|
logger.debug("[globalPidIndex] append failed:", error);
|
|
@@ -85,7 +97,7 @@ export async function updateGlobalPidStatus(
|
|
|
85
97
|
const existing = current.find((r) => r.pid === pid);
|
|
86
98
|
if (!existing) return; // unknown pid — nothing to update
|
|
87
99
|
const merged: GlobalPidRecord = { ...existing, ...patch };
|
|
88
|
-
await appendFile(
|
|
100
|
+
await appendFile(resolveGlobalFile(), JSON.stringify(merged) + "\n");
|
|
89
101
|
});
|
|
90
102
|
} catch (error) {
|
|
91
103
|
logger.debug("[globalPidIndex] updateStatus failed:", error);
|
|
@@ -98,7 +110,7 @@ export async function updateGlobalPidStatus(
|
|
|
98
110
|
async function readGlobalPidsRaw(): Promise<GlobalPidRecord[]> {
|
|
99
111
|
let raw: string;
|
|
100
112
|
try {
|
|
101
|
-
raw = await readFile(
|
|
113
|
+
raw = await readFile(resolveGlobalFile(), "utf-8");
|
|
102
114
|
} catch (err: any) {
|
|
103
115
|
if (err.code === "ENOENT") return [];
|
|
104
116
|
throw err;
|
package/ts/pidStore.spec.ts
CHANGED
|
@@ -10,6 +10,11 @@ const TEST_DIR = isWindows
|
|
|
10
10
|
|
|
11
11
|
describe("PidStore", () => {
|
|
12
12
|
let store: PidStore;
|
|
13
|
+
// Isolate the cross-runtime global pid index too — without this, the
|
|
14
|
+
// synthetic pid=12345 records leak into the user's real
|
|
15
|
+
// ~/.agent-yes/pids.jsonl via the mirror writer wired into PidStore.
|
|
16
|
+
const GLOBAL_TEST_DIR = path.join(TEST_DIR, "global");
|
|
17
|
+
let originalAgentYesHome: string | undefined;
|
|
13
18
|
|
|
14
19
|
beforeEach(async () => {
|
|
15
20
|
try {
|
|
@@ -17,12 +22,19 @@ describe("PidStore", () => {
|
|
|
17
22
|
} catch {
|
|
18
23
|
// ignore cleanup failures (e.g. Windows lock files from previous test)
|
|
19
24
|
}
|
|
25
|
+
originalAgentYesHome = process.env.AGENT_YES_HOME;
|
|
26
|
+
process.env.AGENT_YES_HOME = GLOBAL_TEST_DIR;
|
|
20
27
|
store = new PidStore(TEST_DIR);
|
|
21
28
|
await store.init();
|
|
22
29
|
});
|
|
23
30
|
|
|
24
31
|
afterEach(async () => {
|
|
25
32
|
await store.close();
|
|
33
|
+
if (originalAgentYesHome === undefined) {
|
|
34
|
+
delete process.env.AGENT_YES_HOME;
|
|
35
|
+
} else {
|
|
36
|
+
process.env.AGENT_YES_HOME = originalAgentYesHome;
|
|
37
|
+
}
|
|
26
38
|
try {
|
|
27
39
|
await rm(TEST_DIR, { recursive: true, force: true });
|
|
28
40
|
} catch {
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { t as CLIS_CONFIG } from "./ts-D_iRstH9.js";
|
|
2
|
-
import "./logger-B9h0djqx.js";
|
|
3
|
-
import "./pidStore-CHLHMBEM.js";
|
|
4
|
-
import "./globalPidIndex-DNEh8a_O.js";
|
|
5
|
-
|
|
6
|
-
//#region ts/SUPPORTED_CLIS.ts
|
|
7
|
-
const SUPPORTED_CLIS = Object.keys(CLIS_CONFIG);
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
10
|
-
export { SUPPORTED_CLIS };
|
|
11
|
-
//# sourceMappingURL=SUPPORTED_CLIS-Dzf60ENT.js.map
|