yo-bug 0.1.0 → 0.1.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/bin/cli.ts +9 -7
- package/bin/install.ts +21 -10
- package/bin/start.ts +56 -0
- package/dist/bin/cli.js +10 -7
- package/dist/bin/cli.js.map +1 -1
- package/dist/bin/install.js +21 -10
- package/dist/bin/install.js.map +1 -1
- package/dist/bin/start.d.ts +3 -0
- package/dist/bin/start.d.ts.map +1 -0
- package/dist/bin/start.js +55 -0
- package/dist/bin/start.js.map +1 -0
- package/dist/src/install/detect-ai-tool.d.ts.map +1 -1
- package/dist/src/install/detect-ai-tool.js +3 -4
- package/dist/src/install/detect-ai-tool.js.map +1 -1
- package/dist/src/install/write-mcp-config.d.ts.map +1 -1
- package/dist/src/install/write-mcp-config.js +11 -23
- package/dist/src/install/write-mcp-config.js.map +1 -1
- package/package.json +1 -1
- package/src/install/detect-ai-tool.ts +3 -4
- package/src/install/write-mcp-config.ts +12 -22
package/bin/cli.ts
CHANGED
|
@@ -3,15 +3,17 @@
|
|
|
3
3
|
const command = process.argv[2];
|
|
4
4
|
|
|
5
5
|
if (command === 'mcp') {
|
|
6
|
-
// Start MCP server (stdio mode)
|
|
7
6
|
import('../src/mcp/index.js');
|
|
8
7
|
} else if (command === 'install') {
|
|
9
|
-
// Install MCP config to AI tools
|
|
10
8
|
import('./install.js');
|
|
9
|
+
} else if (command === 'start') {
|
|
10
|
+
// Standalone start — works without MCP, for fallback/testing
|
|
11
|
+
import('./start.js');
|
|
11
12
|
} else {
|
|
12
|
-
console.log('yo-bug — AI
|
|
13
|
-
console.log('
|
|
14
|
-
console.log(' npx yo-bug install
|
|
15
|
-
console.log(' npx yo-bug
|
|
16
|
-
console.log('\n
|
|
13
|
+
console.log('yo-bug — Point at bugs, AI fixes them.\n');
|
|
14
|
+
console.log('Commands:');
|
|
15
|
+
console.log(' npx yo-bug install Install MCP to your AI tool');
|
|
16
|
+
console.log(' npx yo-bug start Start test session manually (fallback)');
|
|
17
|
+
console.log(' npx yo-bug mcp Start MCP Server (called by AI tools)\n');
|
|
18
|
+
console.log('After install, your AI handles everything automatically.');
|
|
17
19
|
}
|
package/bin/install.ts
CHANGED
|
@@ -1,34 +1,45 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { execSync } from 'child_process';
|
|
2
3
|
import { detectAITools } from '../src/install/detect-ai-tool.js';
|
|
3
4
|
import { writeMcpConfig } from '../src/install/write-mcp-config.js';
|
|
4
5
|
|
|
5
6
|
async function main() {
|
|
6
|
-
console.log('yo-bug —
|
|
7
|
+
console.log('yo-bug — Installing MCP Server\n');
|
|
7
8
|
|
|
9
|
+
// Step 1: Global install for fast MCP startup (npx is too slow, causes timeout)
|
|
10
|
+
console.log(' Installing globally...');
|
|
11
|
+
try {
|
|
12
|
+
execSync('npm install -g yo-bug@latest', { stdio: 'pipe' });
|
|
13
|
+
console.log(' ✓ Global install complete\n');
|
|
14
|
+
} catch {
|
|
15
|
+
console.log(' ⚠ Global install failed (might need sudo/admin). Falling back to npx.\n');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Step 2: Detect and configure AI tools
|
|
8
19
|
const tools = await detectAITools();
|
|
9
20
|
const detected = tools.filter((t) => t.detected);
|
|
10
21
|
|
|
11
22
|
if (detected.length === 0) {
|
|
12
|
-
console.log('
|
|
13
|
-
console.log('
|
|
14
|
-
console.log('
|
|
15
|
-
console.log('
|
|
23
|
+
console.log('No AI tools detected (Claude Code / Cursor / Windsurf).');
|
|
24
|
+
console.log('Install at least one AI coding tool first.\n');
|
|
25
|
+
console.log('Manual config:');
|
|
26
|
+
console.log(' Add to your AI tool\'s MCP config:');
|
|
16
27
|
console.log(' {');
|
|
17
|
-
console.log(' "command": "
|
|
18
|
-
console.log(' "args": ["
|
|
28
|
+
console.log(' "command": "yo-bug",');
|
|
29
|
+
console.log(' "args": ["mcp"]');
|
|
19
30
|
console.log(' }');
|
|
20
31
|
process.exit(1);
|
|
21
32
|
}
|
|
22
33
|
|
|
23
|
-
console.log(
|
|
34
|
+
console.log(`Detected ${detected.length} AI tool(s):\n`);
|
|
24
35
|
|
|
25
36
|
for (const tool of detected) {
|
|
26
37
|
const result = await writeMcpConfig(tool);
|
|
27
38
|
console.log(` ${result.success ? '✓' : '✗'} ${result.message}`);
|
|
28
39
|
}
|
|
29
40
|
|
|
30
|
-
console.log('\
|
|
31
|
-
console.log('AI
|
|
41
|
+
console.log('\nDone! Restart your AI tool to activate yo-bug.');
|
|
42
|
+
console.log('Your AI will automatically have test session capabilities.');
|
|
32
43
|
}
|
|
33
44
|
|
|
34
45
|
main().catch(console.error);
|
package/bin/start.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Standalone start — launches test session without MCP.
|
|
4
|
+
* Usage: npx yo-bug start [port]
|
|
5
|
+
*
|
|
6
|
+
* Fallback for when MCP connection fails or for quick manual testing.
|
|
7
|
+
*/
|
|
8
|
+
import { FeedbackStore } from '../src/storage/store.js';
|
|
9
|
+
import { detectDevServer } from '../src/detect/dev-server.js';
|
|
10
|
+
import { spawnDevServer } from '../src/detect/spawn-dev.js';
|
|
11
|
+
import { startProxyServer } from '../src/server/proxy-server.js';
|
|
12
|
+
import open from 'open';
|
|
13
|
+
|
|
14
|
+
async function main() {
|
|
15
|
+
const manualPort = process.argv[3] ? parseInt(process.argv[3]) : undefined;
|
|
16
|
+
const cwd = process.cwd();
|
|
17
|
+
const store = new FeedbackStore();
|
|
18
|
+
await store.init();
|
|
19
|
+
|
|
20
|
+
console.log('yo-bug — Starting test session\n');
|
|
21
|
+
|
|
22
|
+
const info = await detectDevServer(cwd, manualPort);
|
|
23
|
+
|
|
24
|
+
if (info.isRunning) {
|
|
25
|
+
console.log(` ✓ Dev server detected → localhost:${info.port}`);
|
|
26
|
+
} else if (info.command) {
|
|
27
|
+
console.log(` Starting ${info.framework} dev server...`);
|
|
28
|
+
const started = await spawnDevServer(cwd, info.command, info.port);
|
|
29
|
+
if (!started) {
|
|
30
|
+
console.error(` ✗ Dev server failed to start on port ${info.port}`);
|
|
31
|
+
console.error(` Try: npx yo-bug start <port>`);
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
console.log(` ✓ ${info.framework} dev server started → localhost:${info.port}`);
|
|
35
|
+
} else if (manualPort) {
|
|
36
|
+
console.log(` Using manual port ${manualPort}`);
|
|
37
|
+
} else {
|
|
38
|
+
console.error(' ✗ No dev server detected and no port specified.');
|
|
39
|
+
console.error(' Usage: npx yo-bug start <port>');
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
try {
|
|
44
|
+
const { proxyUrl } = await startProxyServer(info.port, store);
|
|
45
|
+
console.log(` ✓ Proxy started → ${proxyUrl}`);
|
|
46
|
+
console.log(`\n Open ${proxyUrl} to start testing.`);
|
|
47
|
+
console.log(' Shortcuts: Alt+Q (quick flag), Alt+S (screenshot), Esc (exit)\n');
|
|
48
|
+
console.log(' Press Ctrl+C to stop.\n');
|
|
49
|
+
await open(proxyUrl);
|
|
50
|
+
} catch (err: any) {
|
|
51
|
+
console.error(` ✗ ${err.message}`);
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
main().catch(console.error);
|
package/dist/bin/cli.js
CHANGED
|
@@ -2,18 +2,21 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
const command = process.argv[2];
|
|
4
4
|
if (command === 'mcp') {
|
|
5
|
-
// Start MCP server (stdio mode)
|
|
6
5
|
import('../src/mcp/index.js');
|
|
7
6
|
}
|
|
8
7
|
else if (command === 'install') {
|
|
9
|
-
// Install MCP config to AI tools
|
|
10
8
|
import('./install.js');
|
|
11
9
|
}
|
|
10
|
+
else if (command === 'start') {
|
|
11
|
+
// Standalone start — works without MCP, for fallback/testing
|
|
12
|
+
import('./start.js');
|
|
13
|
+
}
|
|
12
14
|
else {
|
|
13
|
-
console.log('yo-bug — AI
|
|
14
|
-
console.log('
|
|
15
|
-
console.log(' npx yo-bug install
|
|
16
|
-
console.log(' npx yo-bug
|
|
17
|
-
console.log('\n
|
|
15
|
+
console.log('yo-bug — Point at bugs, AI fixes them.\n');
|
|
16
|
+
console.log('Commands:');
|
|
17
|
+
console.log(' npx yo-bug install Install MCP to your AI tool');
|
|
18
|
+
console.log(' npx yo-bug start Start test session manually (fallback)');
|
|
19
|
+
console.log(' npx yo-bug mcp Start MCP Server (called by AI tools)\n');
|
|
20
|
+
console.log('After install, your AI handles everything automatically.');
|
|
18
21
|
}
|
|
19
22
|
//# sourceMappingURL=cli.js.map
|
package/dist/bin/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../bin/cli.ts"],"names":[],"mappings":";;AAEA,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAEhC,IAAI,OAAO,KAAK,KAAK,EAAE,CAAC;IACtB,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../bin/cli.ts"],"names":[],"mappings":";;AAEA,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAEhC,IAAI,OAAO,KAAK,KAAK,EAAE,CAAC;IACtB,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAChC,CAAC;KAAM,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;IACjC,MAAM,CAAC,cAAc,CAAC,CAAC;AACzB,CAAC;KAAM,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;IAC/B,6DAA6D;IAC7D,MAAM,CAAC,YAAY,CAAC,CAAC;AACvB,CAAC;KAAM,CAAC;IACN,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAC;IACxD,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACzB,OAAO,CAAC,GAAG,CAAC,oDAAoD,CAAC,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,+DAA+D,CAAC,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,gEAAgE,CAAC,CAAC;IAC9E,OAAO,CAAC,GAAG,CAAC,0DAA0D,CAAC,CAAC;AAC1E,CAAC"}
|
package/dist/bin/install.js
CHANGED
|
@@ -1,28 +1,39 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { execSync } from 'child_process';
|
|
2
3
|
import { detectAITools } from '../src/install/detect-ai-tool.js';
|
|
3
4
|
import { writeMcpConfig } from '../src/install/write-mcp-config.js';
|
|
4
5
|
async function main() {
|
|
5
|
-
console.log('yo-bug —
|
|
6
|
+
console.log('yo-bug — Installing MCP Server\n');
|
|
7
|
+
// Step 1: Global install for fast MCP startup (npx is too slow, causes timeout)
|
|
8
|
+
console.log(' Installing globally...');
|
|
9
|
+
try {
|
|
10
|
+
execSync('npm install -g yo-bug@latest', { stdio: 'pipe' });
|
|
11
|
+
console.log(' ✓ Global install complete\n');
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
console.log(' ⚠ Global install failed (might need sudo/admin). Falling back to npx.\n');
|
|
15
|
+
}
|
|
16
|
+
// Step 2: Detect and configure AI tools
|
|
6
17
|
const tools = await detectAITools();
|
|
7
18
|
const detected = tools.filter((t) => t.detected);
|
|
8
19
|
if (detected.length === 0) {
|
|
9
|
-
console.log('
|
|
10
|
-
console.log('
|
|
11
|
-
console.log('
|
|
12
|
-
console.log('
|
|
20
|
+
console.log('No AI tools detected (Claude Code / Cursor / Windsurf).');
|
|
21
|
+
console.log('Install at least one AI coding tool first.\n');
|
|
22
|
+
console.log('Manual config:');
|
|
23
|
+
console.log(' Add to your AI tool\'s MCP config:');
|
|
13
24
|
console.log(' {');
|
|
14
|
-
console.log(' "command": "
|
|
15
|
-
console.log(' "args": ["
|
|
25
|
+
console.log(' "command": "yo-bug",');
|
|
26
|
+
console.log(' "args": ["mcp"]');
|
|
16
27
|
console.log(' }');
|
|
17
28
|
process.exit(1);
|
|
18
29
|
}
|
|
19
|
-
console.log(
|
|
30
|
+
console.log(`Detected ${detected.length} AI tool(s):\n`);
|
|
20
31
|
for (const tool of detected) {
|
|
21
32
|
const result = await writeMcpConfig(tool);
|
|
22
33
|
console.log(` ${result.success ? '✓' : '✗'} ${result.message}`);
|
|
23
34
|
}
|
|
24
|
-
console.log('\
|
|
25
|
-
console.log('AI
|
|
35
|
+
console.log('\nDone! Restart your AI tool to activate yo-bug.');
|
|
36
|
+
console.log('Your AI will automatically have test session capabilities.');
|
|
26
37
|
}
|
|
27
38
|
main().catch(console.error);
|
|
28
39
|
//# sourceMappingURL=install.js.map
|
package/dist/bin/install.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../bin/install.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEpE,KAAK,UAAU,IAAI;IACjB,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../bin/install.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEpE,KAAK,UAAU,IAAI;IACjB,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;IAEhD,gFAAgF;IAChF,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,IAAI,CAAC;QACH,QAAQ,CAAC,8BAA8B,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,+BA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D,CAAC,CAAC;AAC5E,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../bin/start.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Standalone start — launches test session without MCP.
|
|
4
|
+
* Usage: npx yo-bug start [port]
|
|
5
|
+
*
|
|
6
|
+
* Fallback for when MCP connection fails or for quick manual testing.
|
|
7
|
+
*/
|
|
8
|
+
import { FeedbackStore } from '../src/storage/store.js';
|
|
9
|
+
import { detectDevServer } from '../src/detect/dev-server.js';
|
|
10
|
+
import { spawnDevServer } from '../src/detect/spawn-dev.js';
|
|
11
|
+
import { startProxyServer } from '../src/server/proxy-server.js';
|
|
12
|
+
import open from 'open';
|
|
13
|
+
async function main() {
|
|
14
|
+
const manualPort = process.argv[3] ? parseInt(process.argv[3]) : undefined;
|
|
15
|
+
const cwd = process.cwd();
|
|
16
|
+
const store = new FeedbackStore();
|
|
17
|
+
await store.init();
|
|
18
|
+
console.log('yo-bug — Starting test session\n');
|
|
19
|
+
const info = await detectDevServer(cwd, manualPort);
|
|
20
|
+
if (info.isRunning) {
|
|
21
|
+
console.log(` ✓ Dev server detected → localhost:${info.port}`);
|
|
22
|
+
}
|
|
23
|
+
else if (info.command) {
|
|
24
|
+
console.log(` Starting ${info.framework} dev server...`);
|
|
25
|
+
const started = await spawnDevServer(cwd, info.command, info.port);
|
|
26
|
+
if (!started) {
|
|
27
|
+
console.error(` ✗ Dev server failed to start on port ${info.port}`);
|
|
28
|
+
console.error(` Try: npx yo-bug start <port>`);
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
console.log(` ✓ ${info.framework} dev server started → localhost:${info.port}`);
|
|
32
|
+
}
|
|
33
|
+
else if (manualPort) {
|
|
34
|
+
console.log(` Using manual port ${manualPort}`);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
console.error(' ✗ No dev server detected and no port specified.');
|
|
38
|
+
console.error(' Usage: npx yo-bug start <port>');
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
const { proxyUrl } = await startProxyServer(info.port, store);
|
|
43
|
+
console.log(` ✓ Proxy started → ${proxyUrl}`);
|
|
44
|
+
console.log(`\n Open ${proxyUrl} to start testing.`);
|
|
45
|
+
console.log(' Shortcuts: Alt+Q (quick flag), Alt+S (screenshot), Esc (exit)\n');
|
|
46
|
+
console.log(' Press Ctrl+C to stop.\n');
|
|
47
|
+
await open(proxyUrl);
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
console.error(` ✗ ${err.message}`);
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
main().catch(console.error);
|
|
55
|
+
//# sourceMappingURL=start.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../bin/start.ts"],"names":[],"mappings":";AACA;;;;;GAKG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,KAAK,UAAU,IAAI;IACjB,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3E,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC1B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gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC9D,OAAO,CAAC,GAAG,CAAC,uBAAuB,QAAQ,EAAE,CAAC,CAAC;QAC/C,OAAO,CAAC,GAAG,CAAC,YAAY,QAAQ,oBAAoB,CAAC,CAAC;QACtD,OAAO,CAAC,GAAG,CAAC,mEAAmE,CAAC,CAAC;QACjF,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;QACzC,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvB,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QACpC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detect-ai-tool.d.ts","sourceRoot":"","sources":["../../../src/install/detect-ai-tool.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAID,wBAAsB,aAAa,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"detect-ai-tool.d.ts","sourceRoot":"","sources":["../../../src/install/detect-ai-tool.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAID,wBAAsB,aAAa,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CA2BvD"}
|
|
@@ -3,12 +3,11 @@ import path from 'path';
|
|
|
3
3
|
const HOME = process.env.HOME || process.env.USERPROFILE || '';
|
|
4
4
|
export async function detectAITools() {
|
|
5
5
|
const tools = [];
|
|
6
|
-
// Claude Code
|
|
7
|
-
const claudeDir = path.join(HOME, '.claude');
|
|
6
|
+
// Claude Code — MCP config goes in ~/.claude.json (NOT ~/.claude/settings.json)
|
|
8
7
|
tools.push({
|
|
9
8
|
name: 'Claude Code',
|
|
10
|
-
configPath: path.join(
|
|
11
|
-
detected: await dirExists(
|
|
9
|
+
configPath: path.join(HOME, '.claude.json'),
|
|
10
|
+
detected: await dirExists(path.join(HOME, '.claude')),
|
|
12
11
|
});
|
|
13
12
|
// Cursor
|
|
14
13
|
const cursorDir = path.join(HOME, '.cursor');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detect-ai-tool.js","sourceRoot":"","sources":["../../../src/install/detect-ai-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AAQxB,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE,CAAC;AAE/D,MAAM,CAAC,KAAK,UAAU,aAAa;IACjC,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,
|
|
1
|
+
{"version":3,"file":"detect-ai-tool.js","sourceRoot":"","sources":["../../../src/install/detect-ai-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AAQxB,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE,CAAC;AAE/D,MAAM,CAAC,KAAK,UAAU,aAAa;IACjC,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,gFAAgF;IAChF,KAAK,CAAC,IAAI,CAAC;QACT,IAAI,EAAE,aAAa;QACnB,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC;QAC3C,QAAQ,EAAE,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;KACtD,CAAC,CAAC;IAEH,SAAS;IACT,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAC7C,KAAK,CAAC,IAAI,CAAC;QACT,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;QAC5C,QAAQ,EAAE,MAAM,SAAS,CAAC,SAAS,CAAC;KACrC,CAAC,CAAC;IAEH,WAAW;IACX,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACjD,KAAK,CAAC,IAAI,CAAC;QACT,IAAI,EAAE,UAAU;QAChB,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC;QAC9C,QAAQ,EAAE,MAAM,SAAS,CAAC,WAAW,CAAC;KACvC,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC;AACf,CAAC;AAED,KAAK,UAAU,SAAS,CAAC,GAAW;IAClC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChC,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-mcp-config.d.ts","sourceRoot":"","sources":["../../../src/install/write-mcp-config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"write-mcp-config.d.ts","sourceRoot":"","sources":["../../../src/install/write-mcp-config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAQlD,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CA4BjG"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import fs from 'fs/promises';
|
|
2
2
|
import path from 'path';
|
|
3
|
+
// Use global binary directly (fast), fallback to npx
|
|
3
4
|
const MCP_SERVER_CONFIG = {
|
|
4
|
-
command: '
|
|
5
|
-
args: ['
|
|
5
|
+
command: 'yo-bug',
|
|
6
|
+
args: ['mcp'],
|
|
6
7
|
};
|
|
7
8
|
export async function writeMcpConfig(tool) {
|
|
8
9
|
try {
|
|
@@ -17,31 +18,18 @@ export async function writeMcpConfig(tool) {
|
|
|
17
18
|
catch {
|
|
18
19
|
// File doesn't exist or invalid JSON — start fresh
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
config.mcpServers['yo-bug'] = {
|
|
27
|
-
type: 'stdio',
|
|
28
|
-
...MCP_SERVER_CONFIG,
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
// Cursor / Windsurf format
|
|
33
|
-
config.mcpServers = config.mcpServers || {};
|
|
34
|
-
if (config.mcpServers['yo-bug']) {
|
|
35
|
-
return { success: true, message: `${tool.name}: 已配置,跳过。` };
|
|
36
|
-
}
|
|
37
|
-
config.mcpServers['yo-bug'] = MCP_SERVER_CONFIG;
|
|
38
|
-
}
|
|
21
|
+
config.mcpServers = config.mcpServers || {};
|
|
22
|
+
// Always overwrite — don't skip, in case config was wrong before
|
|
23
|
+
config.mcpServers['yo-bug'] = {
|
|
24
|
+
...MCP_SERVER_CONFIG,
|
|
25
|
+
...(tool.name === 'Claude Code' ? { type: 'stdio' } : {}),
|
|
26
|
+
};
|
|
39
27
|
// Write config
|
|
40
28
|
await fs.writeFile(tool.configPath, JSON.stringify(config, null, 2), 'utf-8');
|
|
41
|
-
return { success: true, message: `${tool.name}: MCP
|
|
29
|
+
return { success: true, message: `${tool.name}: MCP config written to ${tool.configPath}` };
|
|
42
30
|
}
|
|
43
31
|
catch (err) {
|
|
44
|
-
return { success: false, message: `${tool.name}:
|
|
32
|
+
return { success: false, message: `${tool.name}: Write failed — ${err.message}` };
|
|
45
33
|
}
|
|
46
34
|
}
|
|
47
35
|
//# sourceMappingURL=write-mcp-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-mcp-config.js","sourceRoot":"","sources":["../../../src/install/write-mcp-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,MAAM,iBAAiB,GAAG;IACxB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"write-mcp-config.js","sourceRoot":"","sources":["../../../src/install/write-mcp-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,qDAAqD;AACrD,MAAM,iBAAiB,GAAG;IACxB,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,CAAC,KAAK,CAAC;CACd,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,IAAY;IAC/C,IAAI,CAAC;QACH,0BAA0B;QAC1B,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAEnE,uBAAuB;QACvB,IAAI,MAAM,GAAQ,EAAE,CAAC;QACrB,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;YAC5D,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC;QAAC,MAAM,CAAC;YACP,mDAAmD;QACrD,CAAC;QAED,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC;QAE5C,iEAAiE;QACjE,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG;YAC5B,GAAG,iBAAiB;YACpB,GAAG,CAAC,IAAI,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC1D,CAAC;QAEF,eAAe;QACf,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;QAC9E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI,2BAA2B,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC;IAC9F,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI,oBAAoB,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC;IACpF,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -12,12 +12,11 @@ const HOME = process.env.HOME || process.env.USERPROFILE || '';
|
|
|
12
12
|
export async function detectAITools(): Promise<AITool[]> {
|
|
13
13
|
const tools: AITool[] = [];
|
|
14
14
|
|
|
15
|
-
// Claude Code
|
|
16
|
-
const claudeDir = path.join(HOME, '.claude');
|
|
15
|
+
// Claude Code — MCP config goes in ~/.claude.json (NOT ~/.claude/settings.json)
|
|
17
16
|
tools.push({
|
|
18
17
|
name: 'Claude Code',
|
|
19
|
-
configPath: path.join(
|
|
20
|
-
detected: await dirExists(
|
|
18
|
+
configPath: path.join(HOME, '.claude.json'),
|
|
19
|
+
detected: await dirExists(path.join(HOME, '.claude')),
|
|
21
20
|
});
|
|
22
21
|
|
|
23
22
|
// Cursor
|
|
@@ -2,9 +2,10 @@ import fs from 'fs/promises';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import type { AITool } from './detect-ai-tool.js';
|
|
4
4
|
|
|
5
|
+
// Use global binary directly (fast), fallback to npx
|
|
5
6
|
const MCP_SERVER_CONFIG = {
|
|
6
|
-
command: '
|
|
7
|
-
args: ['
|
|
7
|
+
command: 'yo-bug',
|
|
8
|
+
args: ['mcp'],
|
|
8
9
|
};
|
|
9
10
|
|
|
10
11
|
export async function writeMcpConfig(tool: AITool): Promise<{ success: boolean; message: string }> {
|
|
@@ -21,29 +22,18 @@ export async function writeMcpConfig(tool: AITool): Promise<{ success: boolean;
|
|
|
21
22
|
// File doesn't exist or invalid JSON — start fresh
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
type: 'stdio',
|
|
32
|
-
...MCP_SERVER_CONFIG,
|
|
33
|
-
};
|
|
34
|
-
} else {
|
|
35
|
-
// Cursor / Windsurf format
|
|
36
|
-
config.mcpServers = config.mcpServers || {};
|
|
37
|
-
if (config.mcpServers['yo-bug']) {
|
|
38
|
-
return { success: true, message: `${tool.name}: 已配置,跳过。` };
|
|
39
|
-
}
|
|
40
|
-
config.mcpServers['yo-bug'] = MCP_SERVER_CONFIG;
|
|
41
|
-
}
|
|
25
|
+
config.mcpServers = config.mcpServers || {};
|
|
26
|
+
|
|
27
|
+
// Always overwrite — don't skip, in case config was wrong before
|
|
28
|
+
config.mcpServers['yo-bug'] = {
|
|
29
|
+
...MCP_SERVER_CONFIG,
|
|
30
|
+
...(tool.name === 'Claude Code' ? { type: 'stdio' } : {}),
|
|
31
|
+
};
|
|
42
32
|
|
|
43
33
|
// Write config
|
|
44
34
|
await fs.writeFile(tool.configPath, JSON.stringify(config, null, 2), 'utf-8');
|
|
45
|
-
return { success: true, message: `${tool.name}: MCP
|
|
35
|
+
return { success: true, message: `${tool.name}: MCP config written to ${tool.configPath}` };
|
|
46
36
|
} catch (err: any) {
|
|
47
|
-
return { success: false, message: `${tool.name}:
|
|
37
|
+
return { success: false, message: `${tool.name}: Write failed — ${err.message}` };
|
|
48
38
|
}
|
|
49
39
|
}
|