agent-yes 1.44.7 → 1.44.9
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/cli.js +27 -5
- package/package.json +4 -2
- package/scripts/patch-mcp-sdk.js +11 -2
- package/scripts/verify-deps.js +112 -0
- package/ts/cli.ts +21 -3
- package/ts/index.ts +1 -0
package/dist/cli.js
CHANGED
|
@@ -28506,20 +28506,22 @@ var package_default = {
|
|
|
28506
28506
|
dev: "bun ts/index.ts",
|
|
28507
28507
|
typecheck: "tsgo --noEmit --skipLibCheck",
|
|
28508
28508
|
fmt: "oxlint --fix --fix-suggestions && oxfmt",
|
|
28509
|
+
"verify-deps": "node ./scripts/verify-deps.js",
|
|
28509
28510
|
_prepack: "bun run build",
|
|
28511
|
+
prepublishOnly: "npm run verify-deps",
|
|
28510
28512
|
prepare: "husky",
|
|
28511
28513
|
release: "standard-version && npm publish",
|
|
28512
28514
|
"release:beta": "standard-version && npm publish --tag beta",
|
|
28513
28515
|
test: "bun test --coverage"
|
|
28514
28516
|
},
|
|
28515
28517
|
dependencies: {
|
|
28518
|
+
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
28516
28519
|
"@snomiao/bun-pty": "^0.3.4",
|
|
28517
28520
|
"@snomiao/keyv-sqlite": "^5.0.4",
|
|
28518
28521
|
"bun-pty": "^0.4.8",
|
|
28519
28522
|
"from-node-stream": "^0.1.2"
|
|
28520
28523
|
},
|
|
28521
28524
|
devDependencies: {
|
|
28522
|
-
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
28523
28525
|
"@semantic-release/exec": "^7.1.0",
|
|
28524
28526
|
"@types/bun": "^1.3.6",
|
|
28525
28527
|
"@types/jest": "^30.0.0",
|
|
@@ -28905,9 +28907,29 @@ fifo/
|
|
|
28905
28907
|
// ts/cli.ts
|
|
28906
28908
|
var rawArgs = process.argv.slice(2);
|
|
28907
28909
|
if (rawArgs[0] === "mcp" && rawArgs[1] === "serve") {
|
|
28908
|
-
|
|
28909
|
-
|
|
28910
|
-
|
|
28910
|
+
try {
|
|
28911
|
+
await import("@modelcontextprotocol/sdk/server");
|
|
28912
|
+
const { startMcpServer: startMcpServer2 } = await init_mcp_server().then(() => exports_mcp_server);
|
|
28913
|
+
await startMcpServer2();
|
|
28914
|
+
process.exit(0);
|
|
28915
|
+
} catch (error) {
|
|
28916
|
+
if (error?.code === "MODULE_NOT_FOUND" || error?.message?.includes("@modelcontextprotocol/sdk")) {
|
|
28917
|
+
console.error(`
|
|
28918
|
+
\u274C MCP Server Error: @modelcontextprotocol/sdk is not installed.
|
|
28919
|
+
`);
|
|
28920
|
+
console.error("This is likely because:");
|
|
28921
|
+
console.error(" 1. The package was installed globally without dependencies");
|
|
28922
|
+
console.error(` 2. A corrupt or incomplete installation
|
|
28923
|
+
`);
|
|
28924
|
+
console.error("To fix this, try:");
|
|
28925
|
+
console.error(" npm install -g agent-yes --force");
|
|
28926
|
+
console.error(" OR");
|
|
28927
|
+
console.error(` npm install -g @modelcontextprotocol/sdk
|
|
28928
|
+
`);
|
|
28929
|
+
process.exit(1);
|
|
28930
|
+
}
|
|
28931
|
+
throw error;
|
|
28932
|
+
}
|
|
28911
28933
|
}
|
|
28912
28934
|
var config3 = parseCliArgs(process.argv);
|
|
28913
28935
|
if (config3.appendPrompt) {
|
|
@@ -28963,5 +28985,5 @@ var { exitCode } = await cliYes(config3);
|
|
|
28963
28985
|
console.log("exiting process");
|
|
28964
28986
|
process.exit(exitCode ?? 1);
|
|
28965
28987
|
|
|
28966
|
-
//# debugId=
|
|
28988
|
+
//# debugId=C65CA8BFF86417C864756E2164756E21
|
|
28967
28989
|
//# sourceMappingURL=cli.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-yes",
|
|
3
|
-
"version": "1.44.
|
|
3
|
+
"version": "1.44.9",
|
|
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",
|
|
@@ -71,20 +71,22 @@
|
|
|
71
71
|
"dev": "bun ts/index.ts",
|
|
72
72
|
"typecheck": "tsgo --noEmit --skipLibCheck",
|
|
73
73
|
"fmt": "oxlint --fix --fix-suggestions && oxfmt",
|
|
74
|
+
"verify-deps": "node ./scripts/verify-deps.js",
|
|
74
75
|
"_prepack": "bun run build",
|
|
76
|
+
"prepublishOnly": "npm run verify-deps",
|
|
75
77
|
"prepare": "husky",
|
|
76
78
|
"release": "standard-version && npm publish",
|
|
77
79
|
"release:beta": "standard-version && npm publish --tag beta",
|
|
78
80
|
"test": "bun test --coverage"
|
|
79
81
|
},
|
|
80
82
|
"dependencies": {
|
|
83
|
+
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
81
84
|
"@snomiao/bun-pty": "^0.3.4",
|
|
82
85
|
"@snomiao/keyv-sqlite": "^5.0.4",
|
|
83
86
|
"bun-pty": "^0.4.8",
|
|
84
87
|
"from-node-stream": "^0.1.2"
|
|
85
88
|
},
|
|
86
89
|
"devDependencies": {
|
|
87
|
-
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
88
90
|
"@semantic-release/exec": "^7.1.0",
|
|
89
91
|
"@types/bun": "^1.3.6",
|
|
90
92
|
"@types/jest": "^30.0.0",
|
package/scripts/patch-mcp-sdk.js
CHANGED
|
@@ -14,11 +14,18 @@ try {
|
|
|
14
14
|
// Check if SDK is installed
|
|
15
15
|
if (!existsSync(sdkPath)) {
|
|
16
16
|
console.log('⚠ @modelcontextprotocol/sdk not found, skipping patch');
|
|
17
|
+
console.log(' Note: MCP server features will not be available');
|
|
17
18
|
process.exit(0);
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
const pkg = JSON.parse(readFileSync(sdkPath, 'utf-8'));
|
|
21
22
|
|
|
23
|
+
// Ensure exports object exists
|
|
24
|
+
if (!pkg.exports || typeof pkg.exports !== 'object') {
|
|
25
|
+
console.error('⚠ @modelcontextprotocol/sdk package.json has invalid exports, skipping patch');
|
|
26
|
+
process.exit(0);
|
|
27
|
+
}
|
|
28
|
+
|
|
22
29
|
// Add missing exports
|
|
23
30
|
let modified = false;
|
|
24
31
|
|
|
@@ -45,6 +52,8 @@ try {
|
|
|
45
52
|
console.log('✓ @modelcontextprotocol/sdk already patched');
|
|
46
53
|
}
|
|
47
54
|
} catch (error) {
|
|
48
|
-
console.error('Failed to patch @modelcontextprotocol/sdk:', error);
|
|
49
|
-
|
|
55
|
+
console.error('⚠ Failed to patch @modelcontextprotocol/sdk:', error.message || error);
|
|
56
|
+
console.error(' MCP server features may not work correctly');
|
|
57
|
+
// Don't fail the installation - just warn
|
|
58
|
+
process.exit(0);
|
|
50
59
|
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Pre-publish verification script
|
|
4
|
+
* Checks that critical runtime dependencies are properly configured
|
|
5
|
+
*/
|
|
6
|
+
import { readFileSync, existsSync } from 'fs';
|
|
7
|
+
import { join } from 'path';
|
|
8
|
+
import { fileURLToPath } from 'url';
|
|
9
|
+
import { dirname } from 'path';
|
|
10
|
+
|
|
11
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
12
|
+
const __dirname = dirname(__filename);
|
|
13
|
+
|
|
14
|
+
const errors = [];
|
|
15
|
+
const warnings = [];
|
|
16
|
+
|
|
17
|
+
// Load package.json
|
|
18
|
+
const pkgPath = join(__dirname, '..', 'package.json');
|
|
19
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
|
20
|
+
|
|
21
|
+
console.log('🔍 Verifying agent-yes package configuration...\n');
|
|
22
|
+
|
|
23
|
+
// Check 1: Verify critical runtime dependencies are in dependencies, not devDependencies
|
|
24
|
+
const runtimeImports = [
|
|
25
|
+
{ module: '@modelcontextprotocol/sdk', reason: 'MCP server functionality (mcp-server.ts)' },
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
for (const { module, reason } of runtimeImports) {
|
|
29
|
+
const inDeps = pkg.dependencies?.[module];
|
|
30
|
+
const inDevDeps = pkg.devDependencies?.[module];
|
|
31
|
+
|
|
32
|
+
if (!inDeps && !inDevDeps) {
|
|
33
|
+
errors.push(`❌ ${module} is not listed in dependencies or devDependencies`);
|
|
34
|
+
console.error(` Required for: ${reason}`);
|
|
35
|
+
} else if (inDevDeps && !inDeps) {
|
|
36
|
+
errors.push(`❌ ${module} is in devDependencies but should be in dependencies`);
|
|
37
|
+
console.error(` Required at runtime for: ${reason}`);
|
|
38
|
+
} else if (inDeps) {
|
|
39
|
+
console.log(`✓ ${module} correctly in dependencies`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Check 2: Verify build script externalizes the right dependencies
|
|
44
|
+
const buildScript = pkg.scripts?.build || '';
|
|
45
|
+
const externals = buildScript.match(/--external=[^\s]+/g) || [];
|
|
46
|
+
|
|
47
|
+
console.log('\n📦 Build externals:');
|
|
48
|
+
for (const ext of externals) {
|
|
49
|
+
console.log(` ${ext}`);
|
|
50
|
+
const modName = ext.replace('--external=', '');
|
|
51
|
+
|
|
52
|
+
// Check if externalized module is in dependencies
|
|
53
|
+
if (modName.startsWith('@') || modName.includes('/')) {
|
|
54
|
+
const inDeps = pkg.dependencies?.[modName];
|
|
55
|
+
const inOptionalDeps = pkg.optionalDependencies?.[modName];
|
|
56
|
+
|
|
57
|
+
if (!inDeps && !inOptionalDeps) {
|
|
58
|
+
warnings.push(`⚠️ ${modName} is externalized but not in dependencies`);
|
|
59
|
+
console.warn(` This may cause "module not found" errors in production`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Check 3: Verify files field includes necessary runtime files
|
|
65
|
+
console.log('\n📁 Package files configuration:');
|
|
66
|
+
const files = pkg.files || [];
|
|
67
|
+
console.log(` Files patterns: ${files.join(', ')}`);
|
|
68
|
+
|
|
69
|
+
if (!files.includes('dist/**/*.js') && !files.includes('dist')) {
|
|
70
|
+
errors.push('❌ dist directory not included in package files');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (!files.includes('scripts') && pkg.scripts?.postinstall?.includes('scripts/')) {
|
|
74
|
+
warnings.push('⚠️ postinstall references scripts/ but it may not be included');
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Check 4: Verify bin entries point to existing files (after build)
|
|
78
|
+
console.log('\n🔗 Binary entries:');
|
|
79
|
+
for (const [name, path] of Object.entries(pkg.bin || {})) {
|
|
80
|
+
const fullPath = join(__dirname, '..', path);
|
|
81
|
+
if (existsSync(fullPath)) {
|
|
82
|
+
console.log(` ✓ ${name} → ${path}`);
|
|
83
|
+
} else {
|
|
84
|
+
warnings.push(`⚠️ Binary ${name} points to ${path} which doesn't exist yet`);
|
|
85
|
+
console.warn(` Run 'npm run build' before publishing`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Summary
|
|
90
|
+
console.log('\n' + '='.repeat(60));
|
|
91
|
+
if (errors.length === 0 && warnings.length === 0) {
|
|
92
|
+
console.log('✅ All checks passed! Package is ready for publish.\n');
|
|
93
|
+
process.exit(0);
|
|
94
|
+
} else {
|
|
95
|
+
if (errors.length > 0) {
|
|
96
|
+
console.error('\n❌ ERRORS FOUND:');
|
|
97
|
+
errors.forEach(err => console.error(` ${err}`));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (warnings.length > 0) {
|
|
101
|
+
console.warn('\n⚠️ WARNINGS:');
|
|
102
|
+
warnings.forEach(warn => console.warn(` ${warn}`));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (errors.length > 0) {
|
|
106
|
+
console.error('\n❌ Fix errors before publishing!\n');
|
|
107
|
+
process.exit(1);
|
|
108
|
+
} else {
|
|
109
|
+
console.warn('\n⚠️ Review warnings before publishing.\n');
|
|
110
|
+
process.exit(0);
|
|
111
|
+
}
|
|
112
|
+
}
|
package/ts/cli.ts
CHANGED
|
@@ -10,9 +10,27 @@ import { PidStore } from "./pidStore.ts";
|
|
|
10
10
|
// Check for MCP server subcommand
|
|
11
11
|
const rawArgs = process.argv.slice(2);
|
|
12
12
|
if (rawArgs[0] === 'mcp' && rawArgs[1] === 'serve') {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
try {
|
|
14
|
+
// Verify MCP SDK is available before attempting to start server
|
|
15
|
+
await import('@modelcontextprotocol/sdk/server');
|
|
16
|
+
const { startMcpServer } = await import('./mcp-server.ts');
|
|
17
|
+
await startMcpServer();
|
|
18
|
+
process.exit(0);
|
|
19
|
+
} catch (error: any) {
|
|
20
|
+
if (error?.code === 'MODULE_NOT_FOUND' || error?.message?.includes('@modelcontextprotocol/sdk')) {
|
|
21
|
+
console.error('\n❌ MCP Server Error: @modelcontextprotocol/sdk is not installed.\n');
|
|
22
|
+
console.error('This is likely because:');
|
|
23
|
+
console.error(' 1. The package was installed globally without dependencies');
|
|
24
|
+
console.error(' 2. A corrupt or incomplete installation\n');
|
|
25
|
+
console.error('To fix this, try:');
|
|
26
|
+
console.error(' npm install -g agent-yes --force');
|
|
27
|
+
console.error(' OR');
|
|
28
|
+
console.error(' npm install -g @modelcontextprotocol/sdk\n');
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
// Re-throw if it's a different error
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
16
34
|
}
|
|
17
35
|
|
|
18
36
|
// Parse CLI arguments
|
package/ts/index.ts
CHANGED
|
@@ -55,6 +55,7 @@ export type AgentCliConfig = {
|
|
|
55
55
|
|
|
56
56
|
// auto responds
|
|
57
57
|
enter?: RegExp[]; // array of regex to match for sending Enter
|
|
58
|
+
enterExclude?: RegExp[]; // array of regex to exclude from auto-enter (even if enter matches)
|
|
58
59
|
typingRespond?: { [message: string]: RegExp[] }; // type specified message to a specified pattern
|
|
59
60
|
|
|
60
61
|
// crash/resuming-session behaviour
|