claude-yes 1.31.1 → 1.32.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/README.md +225 -21
- package/dist/agent-yes.js +2 -0
- package/dist/amp-yes.js +2 -0
- package/dist/auggie-yes.js +2 -0
- package/dist/claude-yes.js +2 -20432
- package/dist/cli.js +18341 -10955
- package/dist/cli.js.map +141 -150
- package/dist/codex-yes.js +2 -20432
- package/dist/copilot-yes.js +2 -20432
- package/dist/cursor-yes.js +2 -20432
- package/dist/gemini-yes.js +2 -20432
- package/dist/grok-yes.js +2 -20432
- package/dist/index.js +16258 -13586
- package/dist/index.js.map +176 -191
- package/dist/qwen-yes.js +2 -20432
- package/package.json +95 -84
- package/ts/ReadyManager.spec.ts +10 -10
- package/ts/ReadyManager.ts +1 -1
- package/ts/SUPPORTED_CLIS.ts +4 -0
- package/ts/catcher.spec.ts +69 -70
- package/ts/cli-idle.spec.ts +8 -8
- package/ts/cli.ts +18 -26
- package/ts/defineConfig.ts +4 -4
- package/ts/idleWaiter.spec.ts +9 -9
- package/ts/index.ts +474 -233
- package/ts/logger.ts +22 -0
- package/ts/parseCliArgs.spec.ts +146 -147
- package/ts/parseCliArgs.ts +127 -59
- package/ts/postbuild.ts +29 -15
- package/ts/pty-fix.ts +155 -0
- package/ts/pty.ts +19 -0
- package/ts/removeControlCharacters.spec.ts +37 -38
- package/ts/removeControlCharacters.ts +2 -1
- package/ts/runningLock.spec.ts +119 -125
- package/ts/runningLock.ts +44 -55
- package/ts/session-integration.spec.ts +34 -42
- package/ts/utils.spec.ts +35 -35
- package/ts/utils.ts +7 -7
- package/ts/codex-resume.spec.ts +0 -239
- package/ts/codexSessionManager.spec.ts +0 -51
- package/ts/codexSessionManager.test.ts +0 -259
- package/ts/codexSessionManager.ts +0 -312
- package/ts/yesLog.spec.ts +0 -74
- package/ts/yesLog.ts +0 -27
package/ts/cli.ts
CHANGED
|
@@ -1,40 +1,32 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
2
|
-
import
|
|
3
|
-
import cliYesConfig from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const hasNodePty = !!(await import('node-pty').catch(() => null));
|
|
7
|
-
if (!globalThis.Bun && !hasNodePty) {
|
|
8
|
-
// run with same arguments in Bun if not already
|
|
9
|
-
console.log('No node-pty installed. Re-running with Bun...', process.argv);
|
|
10
|
-
(await import('child_process')).spawnSync(
|
|
11
|
-
'node_modules/.bin/bun',
|
|
12
|
-
[process.argv[1]!, '--', ...process.argv.slice(2)],
|
|
13
|
-
{ stdio: 'inherit' },
|
|
14
|
-
);
|
|
15
|
-
process.exit(0);
|
|
16
|
-
}
|
|
17
|
-
// check and fix bun-pty on some systems
|
|
18
|
-
if (globalThis.Bun) console.log('Bun detected, using bun-pty');
|
|
19
|
-
// await import("./fix-pty.js")
|
|
20
|
-
|
|
21
|
-
// console.log('Running', process.argv);
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
import { argv } from "process";
|
|
3
|
+
import cliYesConfig from "../agent-yes.config.ts";
|
|
4
|
+
import { parseCliArgs } from "./parseCliArgs.ts";
|
|
5
|
+
import { logger } from "./logger.ts";
|
|
22
6
|
|
|
23
7
|
// Import the CLI module
|
|
24
|
-
const { default: cliYes, parseCliArgs } = await import('./');
|
|
25
8
|
|
|
26
9
|
// Parse CLI arguments
|
|
27
10
|
const config = parseCliArgs(process.argv);
|
|
28
11
|
|
|
29
12
|
// Validate CLI name
|
|
30
|
-
if (!config.cli)
|
|
31
|
-
|
|
13
|
+
if (!config.cli) {
|
|
14
|
+
logger.error(process.argv);
|
|
15
|
+
logger.error("Error: No CLI name provided.");
|
|
16
|
+
throw new Error(
|
|
17
|
+
`missing cli def, available clis: ${Object.keys((await cliYesConfig).clis).join(", ")}`,
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// console.log(`Using CLI: ${config.cli}`);
|
|
32
22
|
|
|
33
23
|
if (config.verbose) {
|
|
34
|
-
process.env.VERBOSE =
|
|
24
|
+
process.env.VERBOSE = "true"; // enable verbose logging in yesLog.ts
|
|
35
25
|
console.log(config);
|
|
26
|
+
console.log(argv);
|
|
36
27
|
}
|
|
37
28
|
|
|
29
|
+
const { default: cliYes } = await import("./index.ts");
|
|
38
30
|
const { exitCode } = await cliYes(config);
|
|
39
|
-
|
|
31
|
+
console.log("exiting process");
|
|
40
32
|
process.exit(exitCode ?? 1);
|
package/ts/defineConfig.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { AgentCliConfig,
|
|
1
|
+
import type { AgentCliConfig, AgentYesConfig } from "./index.ts";
|
|
2
2
|
|
|
3
3
|
type Awaitable<T> = T | Promise<T>;
|
|
4
|
-
export async function defineCliYesConfig<T extends
|
|
4
|
+
export async function defineCliYesConfig<T extends AgentYesConfig>(
|
|
5
5
|
cfg: Awaitable<T> | ((original: T) => Awaitable<T>),
|
|
6
6
|
) {
|
|
7
|
-
if (typeof cfg ===
|
|
7
|
+
if (typeof cfg === "function") cfg = await cfg({ clis: {} } as T);
|
|
8
8
|
|
|
9
|
-
return cfg as unknown as {
|
|
9
|
+
return cfg as unknown as Omit<AgentYesConfig, "clis"> & {
|
|
10
10
|
clis: Record<string, AgentCliConfig>;
|
|
11
11
|
};
|
|
12
12
|
}
|
package/ts/idleWaiter.spec.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { describe, expect, it } from
|
|
2
|
-
import { IdleWaiter } from
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { IdleWaiter } from "./idleWaiter";
|
|
3
3
|
|
|
4
|
-
describe(
|
|
5
|
-
it(
|
|
4
|
+
describe("IdleWaiter", () => {
|
|
5
|
+
it("should initialize with current time", () => {
|
|
6
6
|
const waiter = new IdleWaiter();
|
|
7
7
|
expect(waiter.lastActivityTime).toBeCloseTo(Date.now(), -2);
|
|
8
8
|
});
|
|
9
9
|
|
|
10
|
-
it(
|
|
10
|
+
it("should update lastActivityTime when ping is called", () => {
|
|
11
11
|
const waiter = new IdleWaiter();
|
|
12
12
|
const initialTime = waiter.lastActivityTime;
|
|
13
13
|
|
|
@@ -21,12 +21,12 @@ describe('IdleWaiter', () => {
|
|
|
21
21
|
expect(waiter.lastActivityTime).toBeGreaterThan(initialTime);
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
it(
|
|
24
|
+
it("should return this when ping is called for chaining", () => {
|
|
25
25
|
const waiter = new IdleWaiter();
|
|
26
26
|
expect(waiter.ping()).toBe(waiter);
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
it(
|
|
29
|
+
it("should resolve wait immediately when already idle", async () => {
|
|
30
30
|
const waiter = new IdleWaiter();
|
|
31
31
|
|
|
32
32
|
// Wait enough time to be considered idle
|
|
@@ -40,14 +40,14 @@ describe('IdleWaiter', () => {
|
|
|
40
40
|
await expect(waitPromise).resolves.toBeUndefined();
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
-
it(
|
|
43
|
+
it("should respect custom check interval", () => {
|
|
44
44
|
const waiter = new IdleWaiter();
|
|
45
45
|
waiter.checkInterval = 200;
|
|
46
46
|
|
|
47
47
|
expect(waiter.checkInterval).toBe(200);
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
-
it(
|
|
50
|
+
it("should have ping method that chains", () => {
|
|
51
51
|
const waiter = new IdleWaiter();
|
|
52
52
|
const result = waiter.ping().ping().ping();
|
|
53
53
|
expect(result).toBe(waiter);
|