@getverbal/cli 0.1.0 → 0.4.0
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/LICENSE +1 -1
- package/README.md +34 -18
- package/dist/cli.js +19246 -56
- package/package.json +15 -8
- package/dist/auth/browser-auth.d.ts +0 -6
- package/dist/auth/browser-auth.d.ts.map +0 -1
- package/dist/auth/browser-auth.js +0 -202
- package/dist/auth/browser-auth.js.map +0 -1
- package/dist/auth/credentials.d.ts +0 -6
- package/dist/auth/credentials.d.ts.map +0 -1
- package/dist/auth/credentials.js +0 -78
- package/dist/auth/credentials.js.map +0 -1
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/commands/init.d.ts +0 -2
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -188
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/logout.d.ts +0 -2
- package/dist/commands/logout.d.ts.map +0 -1
- package/dist/commands/logout.js +0 -17
- package/dist/commands/logout.js.map +0 -1
- package/dist/commands/status.d.ts +0 -2
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js +0 -43
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/uninstall.d.ts +0 -2
- package/dist/commands/uninstall.d.ts.map +0 -1
- package/dist/commands/uninstall.js +0 -43
- package/dist/commands/uninstall.js.map +0 -1
- package/dist/configure/claude-code.d.ts +0 -7
- package/dist/configure/claude-code.d.ts.map +0 -1
- package/dist/configure/claude-code.js +0 -11
- package/dist/configure/claude-code.js.map +0 -1
- package/dist/configure/claude-desktop.d.ts +0 -8
- package/dist/configure/claude-desktop.d.ts.map +0 -1
- package/dist/configure/claude-desktop.js +0 -28
- package/dist/configure/claude-desktop.js.map +0 -1
- package/dist/configure/codex.d.ts +0 -7
- package/dist/configure/codex.d.ts.map +0 -1
- package/dist/configure/codex.js +0 -12
- package/dist/configure/codex.js.map +0 -1
- package/dist/configure/cursor.d.ts +0 -7
- package/dist/configure/cursor.d.ts.map +0 -1
- package/dist/configure/cursor.js +0 -12
- package/dist/configure/cursor.js.map +0 -1
- package/dist/configure/index.d.ts +0 -30
- package/dist/configure/index.d.ts.map +0 -1
- package/dist/configure/index.js +0 -149
- package/dist/configure/index.js.map +0 -1
- package/dist/detect/claude-code.d.ts +0 -3
- package/dist/detect/claude-code.d.ts.map +0 -1
- package/dist/detect/claude-code.js +0 -82
- package/dist/detect/claude-code.js.map +0 -1
- package/dist/detect/claude-desktop.d.ts +0 -3
- package/dist/detect/claude-desktop.d.ts.map +0 -1
- package/dist/detect/claude-desktop.js +0 -89
- package/dist/detect/claude-desktop.js.map +0 -1
- package/dist/detect/codex.d.ts +0 -3
- package/dist/detect/codex.d.ts.map +0 -1
- package/dist/detect/codex.js +0 -64
- package/dist/detect/codex.js.map +0 -1
- package/dist/detect/cursor.d.ts +0 -3
- package/dist/detect/cursor.d.ts.map +0 -1
- package/dist/detect/cursor.js +0 -81
- package/dist/detect/cursor.js.map +0 -1
- package/dist/detect/index.d.ts +0 -3
- package/dist/detect/index.d.ts.map +0 -1
- package/dist/detect/index.js +0 -28
- package/dist/detect/index.js.map +0 -1
- package/dist/types.d.ts +0 -18
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/verify.d.ts +0 -7
- package/dist/verify.d.ts.map +0 -1
- package/dist/verify.js +0 -40
- package/dist/verify.js.map +0 -1
package/dist/commands/status.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import pc from 'picocolors';
|
|
2
|
-
import { readCredentials } from '../auth/credentials.js';
|
|
3
|
-
import { detectAll } from '../detect/index.js';
|
|
4
|
-
import { verifyConnection } from '../verify.js';
|
|
5
|
-
export async function runStatus() {
|
|
6
|
-
// 1. Read credentials
|
|
7
|
-
const credentials = await readCredentials();
|
|
8
|
-
if (!credentials) {
|
|
9
|
-
console.log(pc.yellow('Not authenticated. Run `getverbal init` to get started.'));
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
// 2. Print authenticated identity
|
|
13
|
-
console.log(pc.green('✓') + ` Authenticated as ${pc.bold(credentials.user_email)} (org: ${credentials.org_id})`);
|
|
14
|
-
console.log();
|
|
15
|
-
// 3. Detect tools
|
|
16
|
-
const detections = await detectAll();
|
|
17
|
-
const configured = detections.filter((d) => d.detected && d.existingConfig);
|
|
18
|
-
const detected = detections.filter((d) => d.detected && !d.existingConfig);
|
|
19
|
-
if (configured.length > 0 || detected.length > 0) {
|
|
20
|
-
console.log(pc.bold('AI Tools:'));
|
|
21
|
-
for (const d of configured) {
|
|
22
|
-
console.log(` ${pc.green('✓')} ${d.tool} ${pc.dim('— configured')} ${pc.dim(`(${d.configPath})`)}`);
|
|
23
|
-
}
|
|
24
|
-
for (const d of detected) {
|
|
25
|
-
console.log(` ${pc.dim('○')} ${d.tool} ${pc.dim('— detected but not configured')}`);
|
|
26
|
-
}
|
|
27
|
-
console.log();
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
console.log(pc.dim('No AI tools configured. Run `getverbal init` to configure them.'));
|
|
31
|
-
console.log();
|
|
32
|
-
}
|
|
33
|
-
// 4. Verify connection — failure is a warning, not fatal
|
|
34
|
-
try {
|
|
35
|
-
await verifyConnection(credentials);
|
|
36
|
-
console.log(pc.green('✓') + ' API connection verified');
|
|
37
|
-
}
|
|
38
|
-
catch (err) {
|
|
39
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
40
|
-
console.log(pc.yellow('⚠') + ` Could not verify connection: ${message}`);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=status.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC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C,GAAG,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,UAAU,GAAG,CAAC,EAAE,CAAC,CAAC;QACvG,CAAC;QACD,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;YACzB,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,GAAG,CAAC,+BAA+B,CAAC,EAAE,CAAC,CAAC;QACvF,CAAC;QACD,OAAO,CAAC,GAAG,EAAE,CAAC;IAChB,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,iEAAiE,CAAC,CAAC,CAAC;QACvF,OAAO,CAAC,GAAG,EAAE,CAAC;IAChB,CAAC;IAED,yDAAyD;IACzD,IAAI,CAAC;QACH,MAAM,gBAAgB,CAAC,WAAW,CAAC,CAAC;QACpC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,0BAA0B,CAAC,CAAC;IAC1D,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,iCAAiC,OAAO,EAAE,CAAC,CAAC;IAC3E,CAAC;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../../src/commands/uninstall.ts"],"names":[],"mappings":"AAMA,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAyClD"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import pc from 'picocolors';
|
|
2
|
-
import { createInterface } from 'node:readline/promises';
|
|
3
|
-
import { clearCredentials } from '../auth/credentials.js';
|
|
4
|
-
import { detectAll } from '../detect/index.js';
|
|
5
|
-
import { removeVerbalConfig } from '../configure/index.js';
|
|
6
|
-
export async function runUninstall() {
|
|
7
|
-
// 1. Confirmation prompt — default NO
|
|
8
|
-
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
9
|
-
let answer;
|
|
10
|
-
try {
|
|
11
|
-
answer = await rl.question(pc.yellow('⚠') +
|
|
12
|
-
' This will remove Verbal from all configured AI tools and delete your credentials. Continue? (y/N) ');
|
|
13
|
-
}
|
|
14
|
-
finally {
|
|
15
|
-
rl.close();
|
|
16
|
-
}
|
|
17
|
-
if (answer.trim().toLowerCase() !== 'y') {
|
|
18
|
-
console.log('Uninstall cancelled.');
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
// 2. Detect tools
|
|
22
|
-
const detections = await detectAll();
|
|
23
|
-
// 3. Remove config from each detected+configured tool
|
|
24
|
-
for (const detection of detections) {
|
|
25
|
-
if (!detection.detected || !detection.existingConfig) {
|
|
26
|
-
continue;
|
|
27
|
-
}
|
|
28
|
-
try {
|
|
29
|
-
removeVerbalConfig(detection.configPath);
|
|
30
|
-
console.log(pc.green('✓') + ` Removed from ${detection.tool} ${pc.dim(`(${detection.configPath})`)}`);
|
|
31
|
-
}
|
|
32
|
-
catch (err) {
|
|
33
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
34
|
-
console.log(pc.red('✗') + ` Failed to remove from ${detection.tool}: ${message}`);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
// 4. Clear credentials
|
|
38
|
-
await clearCredentials();
|
|
39
|
-
console.log(pc.green('✓') + ' Credentials removed');
|
|
40
|
-
// 5. Done
|
|
41
|
-
console.log(pc.green('✓') + ' Verbal has been uninstalled. Restart your AI tools to complete removal.');
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=uninstall.js.map
|
|
@@ -1 +0,0 @@
|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,CAAC,GAAG,iBAAiB,SAAS,CAAC,IAAI,IAAI,EAAE,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,UAAU,GAAG,CAAC,EAAE,CAAC,CAAC;QACxG,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACjE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,0BAA0B,SAAS,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC;QACpF,CAAC;IACH,CAAC;IAED,uBAAuB;IACvB,MAAM,gBAAgB,EAAE,CAAC;IACzB,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,sBAAsB,CAAC,CAAC;IAEpD,UAAU;IACV,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,0EAA0E,CAAC,CAAC;AAC1G,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Credentials, DetectionResult } from '../types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Configures the Verbal MCP server in Claude Code by writing to
|
|
4
|
-
* `.mcp.json` in the current working directory.
|
|
5
|
-
*/
|
|
6
|
-
export declare function configureClaudeCode(_detection: DetectionResult, credentials: Credentials, billingType?: 'api' | 'subscription'): Promise<void>;
|
|
7
|
-
//# sourceMappingURL=claude-code.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../src/configure/claude-code.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGhE;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,eAAe,EAC3B,WAAW,EAAE,WAAW,EACxB,WAAW,CAAC,EAAE,KAAK,GAAG,cAAc,GACnC,OAAO,CAAC,IAAI,CAAC,CAGf"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { join } from 'node:path';
|
|
2
|
-
import { mergeConfig } from './index.js';
|
|
3
|
-
/**
|
|
4
|
-
* Configures the Verbal MCP server in Claude Code by writing to
|
|
5
|
-
* `.mcp.json` in the current working directory.
|
|
6
|
-
*/
|
|
7
|
-
export async function configureClaudeCode(_detection, credentials, billingType) {
|
|
8
|
-
const configPath = join(process.cwd(), '.mcp.json');
|
|
9
|
-
mergeConfig(configPath, credentials, billingType);
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=claude-code.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../src/configure/claude-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,UAA2B,EAC3B,WAAwB,EACxB,WAAoC;IAEpC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,WAAW,CAAC,CAAC;IACpD,WAAW,CAAC,UAAU,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Credentials, DetectionResult } from '../types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Configures the Verbal MCP server in Claude Desktop.
|
|
4
|
-
* Writes to the platform-specific claude_desktop_config.json path.
|
|
5
|
-
* User must restart Claude Desktop for changes to take effect.
|
|
6
|
-
*/
|
|
7
|
-
export declare function configureClaudeDesktop(_detection: DetectionResult, credentials: Credentials, billingType?: 'api' | 'subscription'): Promise<void>;
|
|
8
|
-
//# sourceMappingURL=claude-desktop.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claude-desktop.d.ts","sourceRoot":"","sources":["../../src/configure/claude-desktop.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAmBhE;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE,eAAe,EAC3B,WAAW,EAAE,WAAW,EACxB,WAAW,CAAC,EAAE,KAAK,GAAG,cAAc,GACnC,OAAO,CAAC,IAAI,CAAC,CAGf"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { homedir } from 'node:os';
|
|
2
|
-
import { join } from 'node:path';
|
|
3
|
-
import { mergeConfig } from './index.js';
|
|
4
|
-
/**
|
|
5
|
-
* Returns the platform-specific path to claude_desktop_config.json.
|
|
6
|
-
* Matches the same logic used in the detect module and setup-wizard.ts.
|
|
7
|
-
*/
|
|
8
|
-
function getConfigPath() {
|
|
9
|
-
const platform = process.platform;
|
|
10
|
-
if (platform === 'darwin') {
|
|
11
|
-
return join(homedir(), 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');
|
|
12
|
-
}
|
|
13
|
-
if (platform === 'win32') {
|
|
14
|
-
return join(process.env['APPDATA'] ?? homedir(), 'Claude', 'claude_desktop_config.json');
|
|
15
|
-
}
|
|
16
|
-
// Linux
|
|
17
|
-
return join(homedir(), '.config', 'claude', 'claude_desktop_config.json');
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Configures the Verbal MCP server in Claude Desktop.
|
|
21
|
-
* Writes to the platform-specific claude_desktop_config.json path.
|
|
22
|
-
* User must restart Claude Desktop for changes to take effect.
|
|
23
|
-
*/
|
|
24
|
-
export async function configureClaudeDesktop(_detection, credentials, billingType) {
|
|
25
|
-
const configPath = getConfigPath();
|
|
26
|
-
mergeConfig(configPath, credentials, billingType);
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=claude-desktop.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claude-desktop.js","sourceRoot":"","sources":["../../src/configure/claude-desktop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC;;;GAGG;AACH,SAAS,aAAa;IACpB,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IAClC,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,qBAAqB,EAAE,QAAQ,EAAE,4BAA4B,CAAC,CAAC;IACnG,CAAC;IACD,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,OAAO,EAAE,EAAE,QAAQ,EAAE,4BAA4B,CAAC,CAAC;IAC3F,CAAC;IACD,QAAQ;IACR,OAAO,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,4BAA4B,CAAC,CAAC;AAC5E,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,UAA2B,EAC3B,WAAwB,EACxB,WAAoC;IAEpC,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IACnC,WAAW,CAAC,UAAU,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Credentials, DetectionResult } from '../types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Configures the Verbal MCP server in OpenAI Codex CLI.
|
|
4
|
-
* Writes to ~/.codex/config.json, preserving any existing MCP server entries.
|
|
5
|
-
*/
|
|
6
|
-
export declare function configureCodex(_detection: DetectionResult, credentials: Credentials, billingType?: 'api' | 'subscription'): Promise<void>;
|
|
7
|
-
//# sourceMappingURL=codex.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../src/configure/codex.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGhE;;;GAGG;AACH,wBAAsB,cAAc,CAClC,UAAU,EAAE,eAAe,EAC3B,WAAW,EAAE,WAAW,EACxB,WAAW,CAAC,EAAE,KAAK,GAAG,cAAc,GACnC,OAAO,CAAC,IAAI,CAAC,CAGf"}
|
package/dist/configure/codex.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { homedir } from 'node:os';
|
|
2
|
-
import { join } from 'node:path';
|
|
3
|
-
import { mergeConfig } from './index.js';
|
|
4
|
-
/**
|
|
5
|
-
* Configures the Verbal MCP server in OpenAI Codex CLI.
|
|
6
|
-
* Writes to ~/.codex/config.json, preserving any existing MCP server entries.
|
|
7
|
-
*/
|
|
8
|
-
export async function configureCodex(_detection, credentials, billingType) {
|
|
9
|
-
const configPath = join(homedir(), '.codex', 'config.json');
|
|
10
|
-
mergeConfig(configPath, credentials, billingType);
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=codex.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"codex.js","sourceRoot":"","sources":["../../src/configure/codex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,UAA2B,EAC3B,WAAwB,EACxB,WAAoC;IAEpC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC;IAC5D,WAAW,CAAC,UAAU,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Credentials, DetectionResult } from '../types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Configures the Verbal MCP server in Cursor IDE.
|
|
4
|
-
* Writes to ~/.cursor/mcp.json, preserving any existing MCP server entries.
|
|
5
|
-
*/
|
|
6
|
-
export declare function configureCursor(_detection: DetectionResult, credentials: Credentials, billingType?: 'api' | 'subscription'): Promise<void>;
|
|
7
|
-
//# sourceMappingURL=cursor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../src/configure/cursor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGhE;;;GAGG;AACH,wBAAsB,eAAe,CACnC,UAAU,EAAE,eAAe,EAC3B,WAAW,EAAE,WAAW,EACxB,WAAW,CAAC,EAAE,KAAK,GAAG,cAAc,GACnC,OAAO,CAAC,IAAI,CAAC,CAGf"}
|
package/dist/configure/cursor.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { homedir } from 'node:os';
|
|
2
|
-
import { join } from 'node:path';
|
|
3
|
-
import { mergeConfig } from './index.js';
|
|
4
|
-
/**
|
|
5
|
-
* Configures the Verbal MCP server in Cursor IDE.
|
|
6
|
-
* Writes to ~/.cursor/mcp.json, preserving any existing MCP server entries.
|
|
7
|
-
*/
|
|
8
|
-
export async function configureCursor(_detection, credentials, billingType) {
|
|
9
|
-
const configPath = join(homedir(), '.cursor', 'mcp.json');
|
|
10
|
-
mergeConfig(configPath, credentials, billingType);
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=cursor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../src/configure/cursor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,UAA2B,EAC3B,WAAwB,EACxB,WAAoC;IAEpC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;IAC1D,WAAW,CAAC,UAAU,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { Credentials, DetectionResult } from '../types.js';
|
|
2
|
-
export interface ConfigureResult {
|
|
3
|
-
tool: string;
|
|
4
|
-
success: boolean;
|
|
5
|
-
error?: string;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Builds the verbal MCP server entry object from credentials.
|
|
9
|
-
*/
|
|
10
|
-
export declare function buildVerbalMcpEntry(credentials: Credentials, billingType?: 'api' | 'subscription'): Record<string, unknown>;
|
|
11
|
-
/**
|
|
12
|
-
* Safely reads an existing config file, merges in the verbal MCP entry,
|
|
13
|
-
* and writes it back atomically using a .tmp file + rename.
|
|
14
|
-
*
|
|
15
|
-
* Only the mcpServers.verbal key is overwritten; all other keys are preserved.
|
|
16
|
-
*/
|
|
17
|
-
export declare function mergeConfig(configPath: string, credentials: Credentials, billingType?: 'api' | 'subscription'): void;
|
|
18
|
-
/**
|
|
19
|
-
* Removes the mcpServers.verbal key from a config file.
|
|
20
|
-
* If removing it leaves mcpServers empty, removes mcpServers too.
|
|
21
|
-
* No-op if the file doesn't exist or has no verbal entry.
|
|
22
|
-
*/
|
|
23
|
-
export declare function removeVerbalConfig(configPath: string): void;
|
|
24
|
-
/**
|
|
25
|
-
* Configures all detected AI tools with the Verbal MCP server.
|
|
26
|
-
* Skips tools where detected === false.
|
|
27
|
-
* Returns a results array — never throws on individual failures.
|
|
28
|
-
*/
|
|
29
|
-
export declare function configureAll(detections: DetectionResult[], credentials: Credentials): Promise<ConfigureResult[]>;
|
|
30
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/configure/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAahE,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,WAAW,EACxB,WAAW,GAAE,KAAK,GAAG,cAAsB,GAC1C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAgBzB;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,WAAW,EACxB,WAAW,CAAC,EAAE,KAAK,GAAG,cAAc,GACnC,IAAI,CA2BN;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CA0C3D;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAChC,UAAU,EAAE,eAAe,EAAE,EAC7B,WAAW,EAAE,WAAW,GACvB,OAAO,CAAC,eAAe,EAAE,CAAC,CAyC5B"}
|
package/dist/configure/index.js
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { mkdirSync, readFileSync, renameSync, writeFileSync, existsSync } from 'node:fs';
|
|
2
|
-
import { dirname, resolve } from 'node:path';
|
|
3
|
-
import { configureClaudeCode } from './claude-code.js';
|
|
4
|
-
import { configureClaudeDesktop } from './claude-desktop.js';
|
|
5
|
-
import { configureCursor } from './cursor.js';
|
|
6
|
-
import { configureCodex } from './codex.js';
|
|
7
|
-
const TOOL_DEFAULT_BILLING_TYPE = {
|
|
8
|
-
'claude-code': 'api',
|
|
9
|
-
'claude-desktop': 'subscription',
|
|
10
|
-
'cursor': 'subscription',
|
|
11
|
-
'codex': 'api',
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Builds the verbal MCP server entry object from credentials.
|
|
15
|
-
*/
|
|
16
|
-
export function buildVerbalMcpEntry(credentials, billingType = 'api') {
|
|
17
|
-
return {
|
|
18
|
-
command: 'npx',
|
|
19
|
-
args: ['-y', '@verbal/mcp-service'],
|
|
20
|
-
env: {
|
|
21
|
-
VERBAL_API_KEY: credentials.api_key,
|
|
22
|
-
VERBAL_API_URL: credentials.api_url,
|
|
23
|
-
VERBAL_INGEST_URL: credentials.ingest_url,
|
|
24
|
-
VERBAL_SOURCE: 'mcp',
|
|
25
|
-
VERBAL_CAPTURE_MODE: 'full',
|
|
26
|
-
VERBAL_TRACE_ENABLED: 'true',
|
|
27
|
-
VERBAL_GIT_CONTEXT_ENABLED: 'true',
|
|
28
|
-
VERBAL_COST_CALC_ENABLED: 'true',
|
|
29
|
-
VERBAL_BILLING_TYPE: billingType,
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Safely reads an existing config file, merges in the verbal MCP entry,
|
|
35
|
-
* and writes it back atomically using a .tmp file + rename.
|
|
36
|
-
*
|
|
37
|
-
* Only the mcpServers.verbal key is overwritten; all other keys are preserved.
|
|
38
|
-
*/
|
|
39
|
-
export function mergeConfig(configPath, credentials, billingType) {
|
|
40
|
-
// Ensure parent directories exist
|
|
41
|
-
mkdirSync(dirname(configPath), { recursive: true });
|
|
42
|
-
// Read existing config or start fresh
|
|
43
|
-
let config = {};
|
|
44
|
-
if (existsSync(configPath)) {
|
|
45
|
-
try {
|
|
46
|
-
config = JSON.parse(readFileSync(configPath, 'utf-8'));
|
|
47
|
-
}
|
|
48
|
-
catch {
|
|
49
|
-
// Malformed JSON — start fresh rather than bail out
|
|
50
|
-
config = {};
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
// Ensure mcpServers key exists
|
|
54
|
-
if (config['mcpServers'] === undefined || config['mcpServers'] === null || typeof config['mcpServers'] !== 'object') {
|
|
55
|
-
config['mcpServers'] = {};
|
|
56
|
-
}
|
|
57
|
-
// Set only the verbal entry — preserve all other MCP server configs
|
|
58
|
-
config['mcpServers']['verbal'] = buildVerbalMcpEntry(credentials, billingType);
|
|
59
|
-
// Atomic write: write to .tmp then rename
|
|
60
|
-
const tmpPath = `${configPath}.tmp`;
|
|
61
|
-
writeFileSync(tmpPath, JSON.stringify(config, null, 2), 'utf-8');
|
|
62
|
-
renameSync(tmpPath, configPath);
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Removes the mcpServers.verbal key from a config file.
|
|
66
|
-
* If removing it leaves mcpServers empty, removes mcpServers too.
|
|
67
|
-
* No-op if the file doesn't exist or has no verbal entry.
|
|
68
|
-
*/
|
|
69
|
-
export function removeVerbalConfig(configPath) {
|
|
70
|
-
const resolvedPath = resolve(configPath);
|
|
71
|
-
// 1. Read the config file — return silently if not found
|
|
72
|
-
if (!existsSync(resolvedPath)) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
let config;
|
|
76
|
-
try {
|
|
77
|
-
config = JSON.parse(readFileSync(resolvedPath, 'utf-8'));
|
|
78
|
-
}
|
|
79
|
-
catch {
|
|
80
|
-
// Malformed JSON — nothing safe to do, leave it alone
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
// 2. Remove mcpServers.verbal if it exists
|
|
84
|
-
if (config['mcpServers'] !== undefined &&
|
|
85
|
-
config['mcpServers'] !== null &&
|
|
86
|
-
typeof config['mcpServers'] === 'object') {
|
|
87
|
-
const mcpServers = config['mcpServers'];
|
|
88
|
-
if (!Object.prototype.hasOwnProperty.call(mcpServers, 'verbal')) {
|
|
89
|
-
// No verbal entry — nothing to do
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
delete mcpServers['verbal'];
|
|
93
|
-
// 3. If mcpServers is now empty, remove the key entirely
|
|
94
|
-
if (Object.keys(mcpServers).length === 0) {
|
|
95
|
-
delete config['mcpServers'];
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
// No mcpServers section — nothing to do
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
// 4. Atomic write: tmp + rename
|
|
103
|
-
const tmpPath = `${resolvedPath}.tmp`;
|
|
104
|
-
writeFileSync(tmpPath, JSON.stringify(config, null, 2), 'utf-8');
|
|
105
|
-
renameSync(tmpPath, resolvedPath);
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Configures all detected AI tools with the Verbal MCP server.
|
|
109
|
-
* Skips tools where detected === false.
|
|
110
|
-
* Returns a results array — never throws on individual failures.
|
|
111
|
-
*/
|
|
112
|
-
export async function configureAll(detections, credentials) {
|
|
113
|
-
const results = [];
|
|
114
|
-
for (const detection of detections) {
|
|
115
|
-
if (!detection.detected) {
|
|
116
|
-
continue;
|
|
117
|
-
}
|
|
118
|
-
let success = false;
|
|
119
|
-
let error;
|
|
120
|
-
const billingType = TOOL_DEFAULT_BILLING_TYPE[detection.tool] ?? 'api';
|
|
121
|
-
try {
|
|
122
|
-
switch (detection.tool) {
|
|
123
|
-
case 'claude-code':
|
|
124
|
-
await configureClaudeCode(detection, credentials, billingType);
|
|
125
|
-
break;
|
|
126
|
-
case 'claude-desktop':
|
|
127
|
-
await configureClaudeDesktop(detection, credentials, billingType);
|
|
128
|
-
break;
|
|
129
|
-
case 'cursor':
|
|
130
|
-
await configureCursor(detection, credentials, billingType);
|
|
131
|
-
break;
|
|
132
|
-
case 'codex':
|
|
133
|
-
await configureCodex(detection, credentials, billingType);
|
|
134
|
-
break;
|
|
135
|
-
default: {
|
|
136
|
-
const _exhaustive = detection.tool;
|
|
137
|
-
throw new Error(`Unknown tool: ${String(_exhaustive)}`);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
success = true;
|
|
141
|
-
}
|
|
142
|
-
catch (err) {
|
|
143
|
-
error = err instanceof Error ? err.message : String(err);
|
|
144
|
-
}
|
|
145
|
-
results.push({ tool: detection.tool, success, error });
|
|
146
|
-
}
|
|
147
|
-
return results;
|
|
148
|
-
}
|
|
149
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/configure/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACzF,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,yBAAyB,GAA2C;IACxE,aAAa,EAAE,KAAK;IACpB,gBAAgB,EAAE,cAAc;IAChC,QAAQ,EAAE,cAAc;IACxB,OAAO,EAAE,KAAK;CACf,CAAC;AAQF;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,WAAwB,EACxB,cAAsC,KAAK;IAE3C,OAAO;QACL,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,CAAC,IAAI,EAAE,qBAAqB,CAAC;QACnC,GAAG,EAAE;YACH,cAAc,EAAE,WAAW,CAAC,OAAO;YACnC,cAAc,EAAE,WAAW,CAAC,OAAO;YACnC,iBAAiB,EAAE,WAAW,CAAC,UAAU;YACzC,aAAa,EAAE,KAAK;YACpB,mBAAmB,EAAE,MAAM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QAED,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../src/detect/claude-code.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,eAAe,CAAC,CAiFjE"}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
-
import { homedir } from 'node:os';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
import { execSync } from 'node:child_process';
|
|
5
|
-
export async function detectClaudeCode() {
|
|
6
|
-
const configPath = join(process.cwd(), '.mcp.json');
|
|
7
|
-
try {
|
|
8
|
-
// Check for claude binary
|
|
9
|
-
let binaryPath;
|
|
10
|
-
let version;
|
|
11
|
-
try {
|
|
12
|
-
binaryPath = execSync('which claude', { encoding: 'utf-8', timeout: 5000 }).trim();
|
|
13
|
-
}
|
|
14
|
-
catch {
|
|
15
|
-
// Binary not in PATH
|
|
16
|
-
}
|
|
17
|
-
// Check for ~/.claude/ directory
|
|
18
|
-
const claudeDir = join(homedir(), '.claude');
|
|
19
|
-
const hasClaudioDir = existsSync(claudeDir);
|
|
20
|
-
const detected = binaryPath !== undefined || hasClaudioDir;
|
|
21
|
-
if (!detected) {
|
|
22
|
-
return {
|
|
23
|
-
tool: 'claude-code',
|
|
24
|
-
detected: false,
|
|
25
|
-
configPath,
|
|
26
|
-
existingConfig: false,
|
|
27
|
-
details: 'Claude Code not found',
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
// Try to get version
|
|
31
|
-
if (binaryPath) {
|
|
32
|
-
try {
|
|
33
|
-
const versionOutput = execSync('claude --version', { encoding: 'utf-8', timeout: 5000 }).trim();
|
|
34
|
-
// Output is typically "Claude Code v1.2.3" or just "1.2.3"
|
|
35
|
-
const match = versionOutput.match(/(\d+\.\d+\.\d+)/);
|
|
36
|
-
if (match) {
|
|
37
|
-
version = match[1];
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
catch {
|
|
41
|
-
// Version check failed — non-fatal
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
// Check if .mcp.json already has mcpServers.verbal
|
|
45
|
-
let existingConfig = false;
|
|
46
|
-
if (existsSync(configPath)) {
|
|
47
|
-
try {
|
|
48
|
-
const raw = readFileSync(configPath, 'utf-8');
|
|
49
|
-
const parsed = JSON.parse(raw);
|
|
50
|
-
const mcpServers = parsed['mcpServers'];
|
|
51
|
-
if (mcpServers !== null && typeof mcpServers === 'object') {
|
|
52
|
-
existingConfig = 'verbal' in mcpServers;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
catch {
|
|
56
|
-
// Malformed JSON — treat as no existing config
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
const location = binaryPath ?? claudeDir;
|
|
60
|
-
const details = version
|
|
61
|
-
? `Claude Code v${version} at ${location}`
|
|
62
|
-
: `Claude Code at ${location}`;
|
|
63
|
-
return {
|
|
64
|
-
tool: 'claude-code',
|
|
65
|
-
detected: true,
|
|
66
|
-
version,
|
|
67
|
-
configPath,
|
|
68
|
-
existingConfig,
|
|
69
|
-
details,
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
catch {
|
|
73
|
-
return {
|
|
74
|
-
tool: 'claude-code',
|
|
75
|
-
detected: false,
|
|
76
|
-
configPath,
|
|
77
|
-
existingConfig: false,
|
|
78
|
-
details: 'Claude Code detection failed',
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
//# sourceMappingURL=claude-code.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claude-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CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claude-desktop.d.ts","sourceRoot":"","sources":["../../src/detect/claude-desktop.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA6CnD,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,eAAe,CAAC,CA+CpE"}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
-
import { homedir } from 'node:os';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
import { execSync } from 'node:child_process';
|
|
5
|
-
function getConfigPath() {
|
|
6
|
-
const platform = process.platform;
|
|
7
|
-
if (platform === 'darwin') {
|
|
8
|
-
return join(homedir(), 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');
|
|
9
|
-
}
|
|
10
|
-
if (platform === 'win32') {
|
|
11
|
-
return join(process.env['APPDATA'] ?? homedir(), 'Claude', 'claude_desktop_config.json');
|
|
12
|
-
}
|
|
13
|
-
// Linux
|
|
14
|
-
return join(homedir(), '.config', 'claude', 'claude_desktop_config.json');
|
|
15
|
-
}
|
|
16
|
-
function isInstalled() {
|
|
17
|
-
const platform = process.platform;
|
|
18
|
-
if (platform === 'darwin') {
|
|
19
|
-
return (existsSync('/Applications/Claude.app') ||
|
|
20
|
-
existsSync(join(homedir(), 'Applications', 'Claude.app')));
|
|
21
|
-
}
|
|
22
|
-
if (platform === 'win32') {
|
|
23
|
-
const localAppData = process.env['LOCALAPPDATA'] ?? join(homedir(), 'AppData', 'Local');
|
|
24
|
-
return existsSync(join(localAppData, 'Programs', 'Claude', 'Claude.exe'));
|
|
25
|
-
}
|
|
26
|
-
// Linux — check for claude-desktop binary in PATH
|
|
27
|
-
try {
|
|
28
|
-
execSync('which claude-desktop', { encoding: 'utf-8', timeout: 5000 });
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
catch {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
function platformLabel() {
|
|
36
|
-
const platform = process.platform;
|
|
37
|
-
if (platform === 'darwin')
|
|
38
|
-
return 'macOS app';
|
|
39
|
-
if (platform === 'win32')
|
|
40
|
-
return 'Windows app';
|
|
41
|
-
return 'Linux';
|
|
42
|
-
}
|
|
43
|
-
export async function detectClaudeDesktop() {
|
|
44
|
-
const configPath = getConfigPath();
|
|
45
|
-
try {
|
|
46
|
-
const detected = isInstalled();
|
|
47
|
-
if (!detected) {
|
|
48
|
-
return {
|
|
49
|
-
tool: 'claude-desktop',
|
|
50
|
-
detected: false,
|
|
51
|
-
configPath,
|
|
52
|
-
existingConfig: false,
|
|
53
|
-
details: 'Claude Desktop not found',
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
// Check if config already has mcpServers.verbal
|
|
57
|
-
let existingConfig = false;
|
|
58
|
-
if (existsSync(configPath)) {
|
|
59
|
-
try {
|
|
60
|
-
const raw = readFileSync(configPath, 'utf-8');
|
|
61
|
-
const parsed = JSON.parse(raw);
|
|
62
|
-
const mcpServers = parsed['mcpServers'];
|
|
63
|
-
if (mcpServers !== null && typeof mcpServers === 'object') {
|
|
64
|
-
existingConfig = 'verbal' in mcpServers;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
catch {
|
|
68
|
-
// Malformed JSON — treat as no existing config
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return {
|
|
72
|
-
tool: 'claude-desktop',
|
|
73
|
-
detected: true,
|
|
74
|
-
configPath,
|
|
75
|
-
existingConfig,
|
|
76
|
-
details: `Claude Desktop (${platformLabel()})`,
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
catch {
|
|
80
|
-
return {
|
|
81
|
-
tool: 'claude-desktop',
|
|
82
|
-
detected: false,
|
|
83
|
-
configPath,
|
|
84
|
-
existingConfig: false,
|
|
85
|
-
details: 'Claude Desktop detection failed',
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
//# sourceMappingURL=claude-desktop.js.map
|