claude-yes 1.72.1 → 1.72.2
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.
|
@@ -815,7 +815,7 @@ function tryCatch(catchFn, fn) {
|
|
|
815
815
|
//#endregion
|
|
816
816
|
//#region package.json
|
|
817
817
|
var name = "agent-yes";
|
|
818
|
-
var version = "1.72.
|
|
818
|
+
var version = "1.72.2";
|
|
819
819
|
|
|
820
820
|
//#endregion
|
|
821
821
|
//#region ts/pty-fix.ts
|
|
@@ -1895,4 +1895,4 @@ const SUPPORTED_CLIS = Object.keys(CLIS_CONFIG);
|
|
|
1895
1895
|
|
|
1896
1896
|
//#endregion
|
|
1897
1897
|
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 };
|
|
1898
|
-
//# sourceMappingURL=SUPPORTED_CLIS-
|
|
1898
|
+
//# sourceMappingURL=SUPPORTED_CLIS-D9eEHdvo.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-D9eEHdvo.js";
|
|
3
3
|
import { t as logger } from "./logger-CX77vJDA.js";
|
|
4
4
|
import { argv } from "process";
|
|
5
5
|
import { spawn } from "child_process";
|
|
@@ -481,12 +481,12 @@ function buildRustArgs(argv, cliFromScript, supportedClis) {
|
|
|
481
481
|
const updateCheckPromise = checkAndAutoUpdate();
|
|
482
482
|
const config = parseCliArgs(process.argv);
|
|
483
483
|
if (config.tray) {
|
|
484
|
-
const { startTray } = await import("./tray-
|
|
484
|
+
const { startTray } = await import("./tray-CPpdxTV-.js");
|
|
485
485
|
await startTray();
|
|
486
486
|
await new Promise(() => {});
|
|
487
487
|
}
|
|
488
488
|
{
|
|
489
|
-
const { ensureTray } = await import("./tray-
|
|
489
|
+
const { ensureTray } = await import("./tray-CPpdxTV-.js");
|
|
490
490
|
ensureTray();
|
|
491
491
|
}
|
|
492
492
|
if (config.useRust) {
|
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-D9eEHdvo.js";
|
|
2
2
|
import "./logger-CX77vJDA.js";
|
|
3
3
|
|
|
4
4
|
export { AgentContext, CLIS_CONFIG, config, agentYes as default, removeControlCharacters };
|
|
@@ -6,7 +6,6 @@ import { existsSync } from "fs";
|
|
|
6
6
|
|
|
7
7
|
//#region ts/tray.ts
|
|
8
8
|
const POLL_INTERVAL = 2e3;
|
|
9
|
-
const IDLE_EXIT_POLLS = 15;
|
|
10
9
|
const getTrayDir = () => path.join(process.env.CLAUDE_YES_HOME || homedir(), ".claude-yes");
|
|
11
10
|
const getTrayPidFile = () => path.join(getTrayDir(), "tray.pid");
|
|
12
11
|
const ICON_BASE64 = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAjklEQVQ4T2NkoBAwUqifgWoGMDIyNjAyMv5nYGBYQMgVjMgCQM0LGBkZHYDYAY8BDUBxByB2wGcAyAUOQOwAxPYMDAyOeCzAbwBIMyMjowNQsz0ely8ACjng8wJeA0CaGRgY7IHYAZ8hQHEHfF7AawBYMwODPZABRHsBpwEgzUDN9kDsgM8lQHEHfC4gJhwAAM3hMBGq3cNNAAAAAElFTkSuQmCC";
|
|
@@ -153,17 +152,9 @@ async function startTray() {
|
|
|
153
152
|
if (action.item.title === "Quit Tray") cleanup();
|
|
154
153
|
});
|
|
155
154
|
let lastCount = count;
|
|
156
|
-
let idlePolls = count === 0 ? 1 : 0;
|
|
157
155
|
intervalId = setInterval(async () => {
|
|
158
156
|
try {
|
|
159
157
|
const { count: newCount, tasks: newTasks } = await getRunningAgentCount();
|
|
160
|
-
if (newCount === 0) {
|
|
161
|
-
idlePolls++;
|
|
162
|
-
if (idlePolls >= IDLE_EXIT_POLLS) {
|
|
163
|
-
cleanup();
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
} else idlePolls = 0;
|
|
167
158
|
if (newCount !== lastCount) {
|
|
168
159
|
lastCount = newCount;
|
|
169
160
|
systray.sendAction({
|
|
@@ -184,4 +175,4 @@ async function startTray() {
|
|
|
184
175
|
|
|
185
176
|
//#endregion
|
|
186
177
|
export { ensureTray, startTray };
|
|
187
|
-
//# sourceMappingURL=tray-
|
|
178
|
+
//# sourceMappingURL=tray-CPpdxTV-.js.map
|
package/package.json
CHANGED
package/ts/tray.spec.ts
CHANGED
|
@@ -215,62 +215,6 @@ describe("tray", () => {
|
|
|
215
215
|
Object.defineProperty(process, "platform", { value: originalPlatform });
|
|
216
216
|
});
|
|
217
217
|
|
|
218
|
-
it("should auto-exit after ~30s with 0 agents", async () => {
|
|
219
|
-
const originalPlatform = process.platform;
|
|
220
|
-
Object.defineProperty(process, "platform", { value: "darwin" });
|
|
221
|
-
vi.useFakeTimers();
|
|
222
|
-
const mockExit = vi.spyOn(process, "exit").mockImplementation(() => undefined as never);
|
|
223
|
-
|
|
224
|
-
const { startTray } = await import("./tray.ts");
|
|
225
|
-
await startTray();
|
|
226
|
-
|
|
227
|
-
// Keep returning 0 agents for 15 polls (IDLE_EXIT_POLLS)
|
|
228
|
-
mockGetRunningAgentCount.mockResolvedValue({ count: 0, tasks: [] });
|
|
229
|
-
|
|
230
|
-
// Advance 15 * 2s = 30s
|
|
231
|
-
await vi.advanceTimersByTimeAsync(15 * 2100);
|
|
232
|
-
|
|
233
|
-
expect(mockSysTray.instance.kill).toHaveBeenCalledWith(false);
|
|
234
|
-
await vi.waitFor(() => expect(mockExit).toHaveBeenCalledWith(0));
|
|
235
|
-
|
|
236
|
-
mockExit.mockRestore();
|
|
237
|
-
vi.useRealTimers();
|
|
238
|
-
Object.defineProperty(process, "platform", { value: originalPlatform });
|
|
239
|
-
});
|
|
240
|
-
|
|
241
|
-
it("should reset idle counter when agents appear", async () => {
|
|
242
|
-
const originalPlatform = process.platform;
|
|
243
|
-
Object.defineProperty(process, "platform", { value: "darwin" });
|
|
244
|
-
vi.useFakeTimers();
|
|
245
|
-
const mockExit = vi.spyOn(process, "exit").mockImplementation(() => undefined as never);
|
|
246
|
-
|
|
247
|
-
const { startTray } = await import("./tray.ts");
|
|
248
|
-
await startTray();
|
|
249
|
-
|
|
250
|
-
// 10 polls at 0 agents
|
|
251
|
-
mockGetRunningAgentCount.mockResolvedValue({ count: 0, tasks: [] });
|
|
252
|
-
await vi.advanceTimersByTimeAsync(10 * 2100);
|
|
253
|
-
|
|
254
|
-
// Then an agent appears — resets idle counter
|
|
255
|
-
mockGetRunningAgentCount.mockResolvedValue({
|
|
256
|
-
count: 1,
|
|
257
|
-
tasks: [
|
|
258
|
-
{ pid: 1, cwd: "/a", task: "t", status: "running" as const, startedAt: 0, lockedAt: 0 },
|
|
259
|
-
],
|
|
260
|
-
});
|
|
261
|
-
await vi.advanceTimersByTimeAsync(2100);
|
|
262
|
-
|
|
263
|
-
// Then 10 more polls at 0 — should NOT exit yet (need 15 consecutive)
|
|
264
|
-
mockGetRunningAgentCount.mockResolvedValue({ count: 0, tasks: [] });
|
|
265
|
-
await vi.advanceTimersByTimeAsync(10 * 2100);
|
|
266
|
-
|
|
267
|
-
expect(mockExit).not.toHaveBeenCalled();
|
|
268
|
-
|
|
269
|
-
mockExit.mockRestore();
|
|
270
|
-
vi.useRealTimers();
|
|
271
|
-
Object.defineProperty(process, "platform", { value: originalPlatform });
|
|
272
|
-
});
|
|
273
|
-
|
|
274
218
|
it("should work on Windows", async () => {
|
|
275
219
|
const originalPlatform = process.platform;
|
|
276
220
|
Object.defineProperty(process, "platform", { value: "win32" });
|
package/ts/tray.ts
CHANGED
|
@@ -5,7 +5,6 @@ import path from "path";
|
|
|
5
5
|
import { getRunningAgentCount, type Task } from "./runningLock.ts";
|
|
6
6
|
|
|
7
7
|
const POLL_INTERVAL = 2000;
|
|
8
|
-
const IDLE_EXIT_POLLS = 15; // Exit after 15 polls (~30s) with 0 agents
|
|
9
8
|
|
|
10
9
|
const getTrayDir = () => path.join(process.env.CLAUDE_YES_HOME || homedir(), ".claude-yes");
|
|
11
10
|
const getTrayPidFile = () => path.join(getTrayDir(), "tray.pid");
|
|
@@ -177,21 +176,10 @@ export async function startTray(): Promise<void> {
|
|
|
177
176
|
|
|
178
177
|
// Poll and update, auto-exit after ~30s idle (0 agents)
|
|
179
178
|
let lastCount = count;
|
|
180
|
-
let idlePolls = count === 0 ? 1 : 0;
|
|
181
179
|
intervalId = setInterval(async () => {
|
|
182
180
|
try {
|
|
183
181
|
const { count: newCount, tasks: newTasks } = await getRunningAgentCount();
|
|
184
182
|
|
|
185
|
-
if (newCount === 0) {
|
|
186
|
-
idlePolls++;
|
|
187
|
-
if (idlePolls >= IDLE_EXIT_POLLS) {
|
|
188
|
-
cleanup();
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
} else {
|
|
192
|
-
idlePolls = 0;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
183
|
if (newCount !== lastCount) {
|
|
196
184
|
lastCount = newCount;
|
|
197
185
|
|