agent-yes 1.31.41 → 1.32.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.
- package/README.md +1 -1
- package/dist/cli.js +1052 -4707
- package/dist/index.js +980 -4640
- package/package.json +33 -32
- package/ts/SUPPORTED_CLIS.ts +1 -2
- package/ts/cli.ts +4 -2
- package/ts/index.ts +9 -7
- package/ts/logger.ts +6 -1
- package/ts/parseCliArgs.ts +7 -5
- package/ts/postbuild.ts +6 -3
- package/ts/pty.ts +10 -9
- package/dist/cli.js.map +0 -483
- package/dist/index.js.map +0 -435
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-yes",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.32.2",
|
|
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",
|
|
@@ -28,11 +28,24 @@
|
|
|
28
28
|
"type": "git",
|
|
29
29
|
"url": "git+https://github.com/snomiao/agent-yes.git"
|
|
30
30
|
},
|
|
31
|
+
"bin": {
|
|
32
|
+
"agent-yes": "./dist/agent-yes.js",
|
|
33
|
+
"amp-yes": "./dist/amp-yes.js",
|
|
34
|
+
"auggie-yes": "./dist/auggie-yes.js",
|
|
35
|
+
"claude-yes": "./dist/claude-yes.js",
|
|
36
|
+
"codex-yes": "./dist/codex-yes.js",
|
|
37
|
+
"copilot-yes": "./dist/copilot-yes.js",
|
|
38
|
+
"cursor-yes": "./dist/cursor-yes.js",
|
|
39
|
+
"gemini-yes": "./dist/gemini-yes.js",
|
|
40
|
+
"grok-yes": "./dist/grok-yes.js",
|
|
41
|
+
"qwen-yes": "./dist/qwen-yes.js"
|
|
42
|
+
},
|
|
31
43
|
"directories": {
|
|
32
44
|
"doc": "docs"
|
|
33
45
|
},
|
|
34
46
|
"files": [
|
|
35
|
-
"dist",
|
|
47
|
+
"dist/**/*.js",
|
|
48
|
+
"!dist/**/*.map",
|
|
36
49
|
"scripts",
|
|
37
50
|
"ts/*.ts"
|
|
38
51
|
],
|
|
@@ -60,47 +73,47 @@
|
|
|
60
73
|
"test": "bun test --coverage"
|
|
61
74
|
},
|
|
62
75
|
"dependencies": {
|
|
63
|
-
"@anthropic-ai/sdk": "^0.71.2",
|
|
64
76
|
"@snomiao/bun-pty": "^0.3.4",
|
|
65
77
|
"bun-pty": "^0.4.8",
|
|
78
|
+
"from-node-stream": "^0.1.2"
|
|
79
|
+
},
|
|
80
|
+
"devDependencies": {
|
|
81
|
+
"@anthropic-ai/sdk": "^0.71.2",
|
|
66
82
|
"cpu-wait": "^0.0.10",
|
|
67
|
-
"execa": "^9.6.
|
|
68
|
-
"from-node-stream": "^0.1.2",
|
|
83
|
+
"execa": "^9.6.1",
|
|
69
84
|
"ink": "^6.6.0",
|
|
70
85
|
"ms": "^2.1.3",
|
|
71
86
|
"openai": "^6.16.0",
|
|
72
|
-
"p-map": "^7.0.
|
|
87
|
+
"p-map": "^7.0.4",
|
|
73
88
|
"phpdie": "^1.7.0",
|
|
74
|
-
"rambda": "^
|
|
75
|
-
"sflow": "^1.
|
|
89
|
+
"rambda": "^11.0.1",
|
|
90
|
+
"sflow": "^1.27.0",
|
|
76
91
|
"strip-ansi-control-characters": "^2.0.0",
|
|
77
92
|
"terminal-render": "^1.2.2",
|
|
78
93
|
"tsa-composer": "^3.0.3",
|
|
79
94
|
"winston": "^3.19.0",
|
|
80
|
-
"yargs": "^18.0.0"
|
|
81
|
-
},
|
|
82
|
-
"devDependencies": {
|
|
95
|
+
"yargs": "^18.0.0",
|
|
83
96
|
"@semantic-release/changelog": "^6.0.3",
|
|
84
97
|
"@semantic-release/exec": "^7.1.0",
|
|
85
98
|
"@semantic-release/git": "^10.0.1",
|
|
86
99
|
"@semantic-release/release-notes-generator": "^14.1.0",
|
|
87
|
-
"@types/bun": "^1.
|
|
100
|
+
"@types/bun": "^1.3.6",
|
|
88
101
|
"@types/jest": "^30.0.0",
|
|
89
102
|
"@types/ms": "^2.1.0",
|
|
90
|
-
"@types/node": "^25.0.
|
|
91
|
-
"@types/yargs": "^17.0.
|
|
103
|
+
"@types/node": "^25.0.10",
|
|
104
|
+
"@types/yargs": "^17.0.35",
|
|
92
105
|
"husky": "^9.1.7",
|
|
93
|
-
"lint-staged": "^16.
|
|
106
|
+
"lint-staged": "^16.2.7",
|
|
94
107
|
"node-pty": "^1.1.0",
|
|
95
|
-
"oxfmt": "^0.
|
|
96
|
-
"oxlint": "^1.
|
|
97
|
-
"semantic-release": "^
|
|
108
|
+
"oxfmt": "^0.26.0",
|
|
109
|
+
"oxlint": "^1.41.0",
|
|
110
|
+
"semantic-release": "^25.0.2",
|
|
98
111
|
"standard-version": "^9.5.0",
|
|
99
|
-
"vitest": "^
|
|
112
|
+
"vitest": "^4.0.17"
|
|
100
113
|
},
|
|
101
114
|
"peerDependencies": {
|
|
102
115
|
"node-pty": "latest",
|
|
103
|
-
"typescript": "^5.
|
|
116
|
+
"typescript": "^5.9.3"
|
|
104
117
|
},
|
|
105
118
|
"peerDependenciesMeta": {
|
|
106
119
|
"node-pty": {
|
|
@@ -129,17 +142,5 @@
|
|
|
129
142
|
"@semantic-release/git",
|
|
130
143
|
"@semantic-release/github"
|
|
131
144
|
]
|
|
132
|
-
},
|
|
133
|
-
"bin": {
|
|
134
|
-
"qwen-yes": "./dist/qwen-yes.js",
|
|
135
|
-
"grok-yes": "./dist/grok-yes.js",
|
|
136
|
-
"claude-yes": "./dist/claude-yes.js",
|
|
137
|
-
"gemini-yes": "./dist/gemini-yes.js",
|
|
138
|
-
"codex-yes": "./dist/codex-yes.js",
|
|
139
|
-
"copilot-yes": "./dist/copilot-yes.js",
|
|
140
|
-
"cursor-yes": "./dist/cursor-yes.js",
|
|
141
|
-
"auggie-yes": "./dist/auggie-yes.js",
|
|
142
|
-
"agent-yes": "./dist/agent-yes.js",
|
|
143
|
-
"amp-yes": "./dist/amp-yes.js"
|
|
144
145
|
}
|
|
145
146
|
}
|
package/ts/SUPPORTED_CLIS.ts
CHANGED
package/ts/cli.ts
CHANGED
|
@@ -11,9 +11,11 @@ const config = parseCliArgs(process.argv);
|
|
|
11
11
|
|
|
12
12
|
// Validate CLI name
|
|
13
13
|
if (!config.cli) {
|
|
14
|
-
logger.error(process.argv)
|
|
14
|
+
logger.error(process.argv);
|
|
15
15
|
logger.error("Error: No CLI name provided.");
|
|
16
|
-
throw new Error(
|
|
16
|
+
throw new Error(
|
|
17
|
+
`missing cli def, available clis: ${Object.keys((await cliYesConfig).clis).join(", ")}`,
|
|
18
|
+
);
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
// console.log(`Using CLI: ${config.cli}`);
|
package/ts/index.ts
CHANGED
|
@@ -196,18 +196,20 @@ export default async function agentYes({
|
|
|
196
196
|
const debuggingLogsPath =
|
|
197
197
|
config.logsDir && path.resolve(config.logsDir, `${cli}-yes-${datetime}.debug.log`);
|
|
198
198
|
|
|
199
|
-
// add
|
|
200
|
-
if (debuggingLogsPath)
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
199
|
+
// add
|
|
200
|
+
if (debuggingLogsPath)
|
|
201
|
+
logger.add(
|
|
202
|
+
new winston.transports.File({
|
|
203
|
+
filename: debuggingLogsPath,
|
|
204
|
+
level: "debug",
|
|
205
|
+
}),
|
|
206
|
+
);
|
|
204
207
|
|
|
205
208
|
// Detect if running as sub-agent
|
|
206
209
|
const isSubAgent = !!process.env.CLAUDE_PPID;
|
|
207
210
|
if (isSubAgent)
|
|
208
211
|
logger.info(`[${cli}-yes] Running as sub-agent (CLAUDE_PPID=${process.env.CLAUDE_PPID})`);
|
|
209
212
|
|
|
210
|
-
|
|
211
213
|
const getPtyOptions = () => {
|
|
212
214
|
const ptyEnv = { ...(env ?? (process.env as Record<string, string>)) };
|
|
213
215
|
return {
|
|
@@ -602,7 +604,7 @@ export default async function agentYes({
|
|
|
602
604
|
if (conf.noEOL) return s; // codex use cursor-move csi code insteadof \n to move lines, so the output have no \n at all, this hack prevents stuck on unended line
|
|
603
605
|
return s.lines({ EOL: "NONE" }); // other clis use ink, which is rerendering the block based on \n lines
|
|
604
606
|
})
|
|
605
|
-
|
|
607
|
+
|
|
606
608
|
// .forkTo(async function rawLinesLogger(f) {
|
|
607
609
|
// if (!rawLinesLogPath) return f.run(); // no stream
|
|
608
610
|
// // try stream the raw log for realtime debugging, including control chars, note: it will be a huge file
|
package/ts/logger.ts
CHANGED
|
@@ -12,6 +12,11 @@ const logFormat = winston.format.combine(
|
|
|
12
12
|
export const logger = winston.createLogger({
|
|
13
13
|
level: process.env.VERBOSE ? "debug" : "info",
|
|
14
14
|
format: logFormat,
|
|
15
|
-
transports: [
|
|
15
|
+
transports: [
|
|
16
|
+
new winston.transports.Console({
|
|
17
|
+
format: winston.format.combine(winston.format.colorize(), logFormat),
|
|
18
|
+
}),
|
|
19
|
+
],
|
|
16
20
|
silent: false,
|
|
17
21
|
});
|
|
22
|
+
|
package/ts/parseCliArgs.ts
CHANGED
|
@@ -11,11 +11,13 @@ import pkg from "../package.json" with { type: "json" };
|
|
|
11
11
|
*/
|
|
12
12
|
export function parseCliArgs(argv: string[]) {
|
|
13
13
|
// Detect cli name from script name (same logic as cli.ts:10-14)
|
|
14
|
-
const cliName =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
const cliName =
|
|
15
|
+
argv[1]
|
|
16
|
+
?.split(/[/\\]/)
|
|
17
|
+
.at(-1)
|
|
18
|
+
?.replace(/(\.[jt]s)?$/, "")
|
|
19
|
+
.replace(/^(cli|agent)(-yes$)?/, "")
|
|
20
|
+
.replace(/-yes$/, "") || undefined;
|
|
19
21
|
|
|
20
22
|
// Parse args with yargs (same logic as cli.ts:16-73)
|
|
21
23
|
const parsedArgv = yargs(hideBin(argv))
|
package/ts/postbuild.ts
CHANGED
|
@@ -9,15 +9,18 @@ import sflow from "sflow";
|
|
|
9
9
|
import pkg from "../package.json";
|
|
10
10
|
|
|
11
11
|
// Create copies for each CLI variant (all use the same wrapper logic)
|
|
12
|
-
await sflow([...Object.keys(CLIS_CONFIG),
|
|
12
|
+
await sflow([...Object.keys(CLIS_CONFIG), "agent"])
|
|
13
13
|
.map(async (cli) => {
|
|
14
14
|
const cliName = `${cli}-yes`;
|
|
15
15
|
|
|
16
16
|
const wrapperPath = `./dist/${cliName}.js`;
|
|
17
|
-
await writeFile(
|
|
17
|
+
await writeFile(
|
|
18
|
+
wrapperPath,
|
|
19
|
+
`
|
|
18
20
|
#!/usr/bin/env bun
|
|
19
21
|
await import('./cli.js')
|
|
20
|
-
`.trim()
|
|
22
|
+
`.trim(),
|
|
23
|
+
);
|
|
21
24
|
await chmod(wrapperPath, 0o755);
|
|
22
25
|
|
|
23
26
|
if (!(pkg.bin as Record<string, string>)?.[cliName]) {
|
package/ts/pty.ts
CHANGED
|
@@ -3,15 +3,16 @@ import { logger } from "./logger.ts";
|
|
|
3
3
|
// its recommened to use bun-pty in windows, since node-pty is super complex to install there, requires a 10G M$ build tools
|
|
4
4
|
|
|
5
5
|
async function getPty() {
|
|
6
|
-
return globalThis.Bun
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
6
|
+
return globalThis.Bun
|
|
7
|
+
? await import("bun-pty").catch((error) => {
|
|
8
|
+
logger.error("Failed to load bun-pty:", error);
|
|
9
|
+
throw error;
|
|
10
|
+
})
|
|
11
|
+
: await import("node-pty").catch((error) => {
|
|
12
|
+
logger.error("Failed to load node-pty:", error);
|
|
13
|
+
throw error;
|
|
14
|
+
});
|
|
15
|
+
}
|
|
15
16
|
|
|
16
17
|
const pty = await getPty();
|
|
17
18
|
export const ptyPackage = globalThis.Bun ? "bun-pty" : "node-pty";
|