@getverbal/cli 0.4.3 → 0.6.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.
Files changed (249) hide show
  1. package/dist/agent-hooks/claude.d.ts +10 -0
  2. package/dist/agent-hooks/claude.d.ts.map +1 -0
  3. package/dist/agent-hooks/claude.js +218 -0
  4. package/dist/agent-hooks/claude.js.map +1 -0
  5. package/dist/agent-hooks/cli.d.ts +2 -0
  6. package/dist/agent-hooks/cli.d.ts.map +1 -0
  7. package/dist/agent-hooks/cli.js +271 -0
  8. package/dist/agent-hooks/cli.js.map +1 -0
  9. package/dist/agent-hooks/codex.d.ts +9 -0
  10. package/dist/agent-hooks/codex.d.ts.map +1 -0
  11. package/dist/agent-hooks/codex.js +349 -0
  12. package/dist/agent-hooks/codex.js.map +1 -0
  13. package/dist/agent-hooks/config.d.ts +32 -0
  14. package/dist/agent-hooks/config.d.ts.map +1 -0
  15. package/dist/agent-hooks/config.js +176 -0
  16. package/dist/agent-hooks/config.js.map +1 -0
  17. package/dist/agent-hooks/ingest.d.ts +4 -0
  18. package/dist/agent-hooks/ingest.d.ts.map +1 -0
  19. package/dist/agent-hooks/ingest.js +22 -0
  20. package/dist/agent-hooks/ingest.js.map +1 -0
  21. package/dist/agent-hooks/launchagent.d.ts +7 -0
  22. package/dist/agent-hooks/launchagent.d.ts.map +1 -0
  23. package/dist/agent-hooks/launchagent.js +51 -0
  24. package/dist/agent-hooks/launchagent.js.map +1 -0
  25. package/dist/agent-hooks/runtime-context.d.ts +20 -0
  26. package/dist/agent-hooks/runtime-context.d.ts.map +1 -0
  27. package/dist/agent-hooks/runtime-context.js +90 -0
  28. package/dist/agent-hooks/runtime-context.js.map +1 -0
  29. package/dist/agent-hooks/state.d.ts +26 -0
  30. package/dist/agent-hooks/state.d.ts.map +1 -0
  31. package/dist/agent-hooks/state.js +67 -0
  32. package/dist/agent-hooks/state.js.map +1 -0
  33. package/dist/agent-hooks/tokscale.d.ts +70 -0
  34. package/dist/agent-hooks/tokscale.d.ts.map +1 -0
  35. package/dist/agent-hooks/tokscale.js +142 -0
  36. package/dist/agent-hooks/tokscale.js.map +1 -0
  37. package/dist/agent-hooks/tool-extraction.d.ts +7 -0
  38. package/dist/agent-hooks/tool-extraction.d.ts.map +1 -0
  39. package/dist/agent-hooks/tool-extraction.js +100 -0
  40. package/dist/agent-hooks/tool-extraction.js.map +1 -0
  41. package/dist/agent-hooks/trace.d.ts +17 -0
  42. package/dist/agent-hooks/trace.d.ts.map +1 -0
  43. package/dist/agent-hooks/trace.js +25 -0
  44. package/dist/agent-hooks/trace.js.map +1 -0
  45. package/dist/auth/browser-auth.d.ts +6 -0
  46. package/dist/auth/browser-auth.d.ts.map +1 -0
  47. package/dist/auth/browser-auth.js +202 -0
  48. package/dist/auth/browser-auth.js.map +1 -0
  49. package/dist/auth/credentials.d.ts +6 -0
  50. package/dist/auth/credentials.d.ts.map +1 -0
  51. package/dist/auth/credentials.js +78 -0
  52. package/dist/auth/credentials.js.map +1 -0
  53. package/dist/cli.d.ts +3 -0
  54. package/dist/cli.d.ts.map +1 -0
  55. package/dist/cli.js +1513 -440
  56. package/dist/cli.js.map +1 -0
  57. package/dist/commands/dashboard.d.ts +2 -0
  58. package/dist/commands/dashboard.d.ts.map +1 -0
  59. package/dist/commands/dashboard.js +19 -0
  60. package/dist/commands/dashboard.js.map +1 -0
  61. package/dist/commands/hooks.d.ts +2 -0
  62. package/dist/commands/hooks.d.ts.map +1 -0
  63. package/dist/commands/hooks.js +6 -0
  64. package/dist/commands/hooks.js.map +1 -0
  65. package/dist/commands/import.d.ts +2 -0
  66. package/dist/commands/import.d.ts.map +1 -0
  67. package/dist/commands/import.js +129 -0
  68. package/dist/commands/import.js.map +1 -0
  69. package/dist/commands/init.d.ts +2 -0
  70. package/dist/commands/init.d.ts.map +1 -0
  71. package/dist/commands/init.js +262 -0
  72. package/dist/commands/init.js.map +1 -0
  73. package/dist/commands/logout.d.ts +2 -0
  74. package/dist/commands/logout.d.ts.map +1 -0
  75. package/dist/commands/logout.js +17 -0
  76. package/dist/commands/logout.js.map +1 -0
  77. package/dist/commands/mcp-serve.d.ts +2 -0
  78. package/dist/commands/mcp-serve.d.ts.map +1 -0
  79. package/dist/commands/mcp-serve.js +7 -0
  80. package/dist/commands/mcp-serve.js.map +1 -0
  81. package/dist/commands/status.d.ts +2 -0
  82. package/dist/commands/status.d.ts.map +1 -0
  83. package/dist/commands/status.js +43 -0
  84. package/dist/commands/status.js.map +1 -0
  85. package/dist/commands/uninstall.d.ts +2 -0
  86. package/dist/commands/uninstall.d.ts.map +1 -0
  87. package/dist/commands/uninstall.js +43 -0
  88. package/dist/commands/uninstall.js.map +1 -0
  89. package/dist/commands/update.d.ts +2 -0
  90. package/dist/commands/update.d.ts.map +1 -0
  91. package/dist/commands/update.js +58 -0
  92. package/dist/commands/update.js.map +1 -0
  93. package/dist/configure/claude-code.d.ts +7 -0
  94. package/dist/configure/claude-code.d.ts.map +1 -0
  95. package/dist/configure/claude-code.js +11 -0
  96. package/dist/configure/claude-code.js.map +1 -0
  97. package/dist/configure/claude-desktop.d.ts +8 -0
  98. package/dist/configure/claude-desktop.d.ts.map +1 -0
  99. package/dist/configure/claude-desktop.js +28 -0
  100. package/dist/configure/claude-desktop.js.map +1 -0
  101. package/dist/configure/codex.d.ts +7 -0
  102. package/dist/configure/codex.d.ts.map +1 -0
  103. package/dist/configure/codex.js +12 -0
  104. package/dist/configure/codex.js.map +1 -0
  105. package/dist/configure/cursor.d.ts +7 -0
  106. package/dist/configure/cursor.d.ts.map +1 -0
  107. package/dist/configure/cursor.js +12 -0
  108. package/dist/configure/cursor.js.map +1 -0
  109. package/dist/configure/index.d.ts +34 -0
  110. package/dist/configure/index.d.ts.map +1 -0
  111. package/dist/configure/index.js +153 -0
  112. package/dist/configure/index.js.map +1 -0
  113. package/dist/detect/claude-code.d.ts +3 -0
  114. package/dist/detect/claude-code.d.ts.map +1 -0
  115. package/dist/detect/claude-code.js +82 -0
  116. package/dist/detect/claude-code.js.map +1 -0
  117. package/dist/detect/claude-desktop.d.ts +3 -0
  118. package/dist/detect/claude-desktop.d.ts.map +1 -0
  119. package/dist/detect/claude-desktop.js +89 -0
  120. package/dist/detect/claude-desktop.js.map +1 -0
  121. package/dist/detect/codex.d.ts +3 -0
  122. package/dist/detect/codex.d.ts.map +1 -0
  123. package/dist/detect/codex.js +64 -0
  124. package/dist/detect/codex.js.map +1 -0
  125. package/dist/detect/cursor.d.ts +3 -0
  126. package/dist/detect/cursor.d.ts.map +1 -0
  127. package/dist/detect/cursor.js +81 -0
  128. package/dist/detect/cursor.js.map +1 -0
  129. package/dist/detect/index.d.ts +3 -0
  130. package/dist/detect/index.d.ts.map +1 -0
  131. package/dist/detect/index.js +28 -0
  132. package/dist/detect/index.js.map +1 -0
  133. package/dist/import/file-upload.d.ts +10 -0
  134. package/dist/import/file-upload.d.ts.map +1 -0
  135. package/dist/import/file-upload.js +37 -0
  136. package/dist/import/file-upload.js.map +1 -0
  137. package/dist/import/index.d.ts +11 -0
  138. package/dist/import/index.d.ts.map +1 -0
  139. package/dist/import/index.js +51 -0
  140. package/dist/import/index.js.map +1 -0
  141. package/dist/mcp/exports.d.ts +13 -0
  142. package/dist/mcp/exports.d.ts.map +1 -0
  143. package/dist/mcp/exports.js +13 -0
  144. package/dist/mcp/exports.js.map +1 -0
  145. package/dist/mcp/git-context.d.ts +17 -0
  146. package/dist/mcp/git-context.d.ts.map +1 -0
  147. package/dist/mcp/git-context.js +72 -0
  148. package/dist/mcp/git-context.js.map +1 -0
  149. package/dist/mcp/hooks/anthropic.d.ts +31 -0
  150. package/dist/mcp/hooks/anthropic.d.ts.map +1 -0
  151. package/dist/mcp/hooks/anthropic.js +137 -0
  152. package/dist/mcp/hooks/anthropic.js.map +1 -0
  153. package/dist/mcp/hooks/google.d.ts +53 -0
  154. package/dist/mcp/hooks/google.d.ts.map +1 -0
  155. package/dist/mcp/hooks/google.js +161 -0
  156. package/dist/mcp/hooks/google.js.map +1 -0
  157. package/dist/mcp/hooks/index.d.ts +9 -0
  158. package/dist/mcp/hooks/index.d.ts.map +1 -0
  159. package/dist/mcp/hooks/index.js +7 -0
  160. package/dist/mcp/hooks/index.js.map +1 -0
  161. package/dist/mcp/hooks/openai.d.ts +59 -0
  162. package/dist/mcp/hooks/openai.d.ts.map +1 -0
  163. package/dist/mcp/hooks/openai.js +158 -0
  164. package/dist/mcp/hooks/openai.js.map +1 -0
  165. package/dist/mcp/hooks/types.d.ts +8 -0
  166. package/dist/mcp/hooks/types.d.ts.map +1 -0
  167. package/dist/mcp/hooks/types.js +5 -0
  168. package/dist/mcp/hooks/types.js.map +1 -0
  169. package/dist/mcp/ingestor.d.ts +23 -0
  170. package/dist/mcp/ingestor.d.ts.map +1 -0
  171. package/dist/mcp/ingestor.js +310 -0
  172. package/dist/mcp/ingestor.js.map +1 -0
  173. package/dist/mcp/pricing.d.ts +19 -0
  174. package/dist/mcp/pricing.d.ts.map +1 -0
  175. package/dist/mcp/pricing.js +130 -0
  176. package/dist/mcp/pricing.js.map +1 -0
  177. package/dist/mcp/server.d.ts +10 -0
  178. package/dist/mcp/server.d.ts.map +1 -0
  179. package/dist/mcp/server.js +689 -0
  180. package/dist/mcp/server.js.map +1 -0
  181. package/dist/mcp/session-tracker.d.ts +52 -0
  182. package/dist/mcp/session-tracker.d.ts.map +1 -0
  183. package/dist/mcp/session-tracker.js +186 -0
  184. package/dist/mcp/session-tracker.js.map +1 -0
  185. package/dist/mcp/tools/analyze-spending-trend.d.ts +10 -0
  186. package/dist/mcp/tools/analyze-spending-trend.d.ts.map +1 -0
  187. package/dist/mcp/tools/analyze-spending-trend.js +126 -0
  188. package/dist/mcp/tools/analyze-spending-trend.js.map +1 -0
  189. package/dist/mcp/tools/get-budget-status.d.ts +9 -0
  190. package/dist/mcp/tools/get-budget-status.d.ts.map +1 -0
  191. package/dist/mcp/tools/get-budget-status.js +59 -0
  192. package/dist/mcp/tools/get-budget-status.js.map +1 -0
  193. package/dist/mcp/tools/get-cost-breakdown.d.ts +10 -0
  194. package/dist/mcp/tools/get-cost-breakdown.d.ts.map +1 -0
  195. package/dist/mcp/tools/get-cost-breakdown.js +52 -0
  196. package/dist/mcp/tools/get-cost-breakdown.js.map +1 -0
  197. package/dist/mcp/tools/get-model-efficiency.d.ts +9 -0
  198. package/dist/mcp/tools/get-model-efficiency.d.ts.map +1 -0
  199. package/dist/mcp/tools/get-model-efficiency.js +137 -0
  200. package/dist/mcp/tools/get-model-efficiency.js.map +1 -0
  201. package/dist/mcp/tools/get-recent-prompts.d.ts +13 -0
  202. package/dist/mcp/tools/get-recent-prompts.d.ts.map +1 -0
  203. package/dist/mcp/tools/get-recent-prompts.js +56 -0
  204. package/dist/mcp/tools/get-recent-prompts.js.map +1 -0
  205. package/dist/mcp/tools/get-roi-metrics.d.ts +9 -0
  206. package/dist/mcp/tools/get-roi-metrics.d.ts.map +1 -0
  207. package/dist/mcp/tools/get-roi-metrics.js +84 -0
  208. package/dist/mcp/tools/get-roi-metrics.js.map +1 -0
  209. package/dist/mcp/tools/get-usage-summary.d.ts +10 -0
  210. package/dist/mcp/tools/get-usage-summary.d.ts.map +1 -0
  211. package/dist/mcp/tools/get-usage-summary.js +47 -0
  212. package/dist/mcp/tools/get-usage-summary.js.map +1 -0
  213. package/dist/mcp/tools/index.d.ts +221 -0
  214. package/dist/mcp/tools/index.d.ts.map +1 -0
  215. package/dist/mcp/tools/index.js +161 -0
  216. package/dist/mcp/tools/index.js.map +1 -0
  217. package/dist/mcp/tools/list-projects.d.ts +6 -0
  218. package/dist/mcp/tools/list-projects.d.ts.map +1 -0
  219. package/dist/mcp/tools/list-projects.js +43 -0
  220. package/dist/mcp/tools/list-projects.js.map +1 -0
  221. package/dist/mcp/tools/optimize-prompt.d.ts +44 -0
  222. package/dist/mcp/tools/optimize-prompt.d.ts.map +1 -0
  223. package/dist/mcp/tools/optimize-prompt.js +95 -0
  224. package/dist/mcp/tools/optimize-prompt.js.map +1 -0
  225. package/dist/mcp/types.d.ts +118 -0
  226. package/dist/mcp/types.d.ts.map +1 -0
  227. package/dist/mcp/types.js +5 -0
  228. package/dist/mcp/types.js.map +1 -0
  229. package/dist/types.d.ts +18 -0
  230. package/dist/types.d.ts.map +1 -0
  231. package/dist/types.js +2 -0
  232. package/dist/types.js.map +1 -0
  233. package/dist/update-check/check.d.ts +6 -0
  234. package/dist/update-check/check.d.ts.map +1 -0
  235. package/dist/update-check/check.js +64 -0
  236. package/dist/update-check/check.js.map +1 -0
  237. package/dist/update-check/notify.d.ts +6 -0
  238. package/dist/update-check/notify.d.ts.map +1 -0
  239. package/dist/update-check/notify.js +40 -0
  240. package/dist/update-check/notify.js.map +1 -0
  241. package/dist/verify.d.ts +7 -0
  242. package/dist/verify.d.ts.map +1 -0
  243. package/dist/verify.js +40 -0
  244. package/dist/verify.js.map +1 -0
  245. package/dist/version.d.ts +9 -0
  246. package/dist/version.d.ts.map +1 -0
  247. package/dist/version.js +21 -0
  248. package/dist/version.js.map +1 -0
  249. package/package.json +10 -5
@@ -0,0 +1,43 @@
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uninstall.js","sourceRoot":"","sources":["../../src/commands/uninstall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,sCAAsC;IACtC,MAAM,EAAE,GAAG,eAAe,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC7E,IAAI,MAAc,CAAC;IACnB,IAAI,CAAC;QACH,MAAM,GAAG,MAAM,EAAE,CAAC,QAAQ,CACxB,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC;YACZ,qGAAqG,CACxG,CAAC;IACJ,CAAC;YAAS,CAAC;QACT,EAAE,CAAC,KAAK,EAAE,CAAC;IACb,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,GAAG,EAAE,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;QACpC,OAAO;IACT,CAAC;IAED,kBAAkB;IAClB,MAAM,UAAU,GAAG,MAAM,SAAS,EAAE,CAAC;IAErC,sDAAsD;IACtD,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,IAAI,CAAC,SAAS,CAAC,QAAQ,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC;YACrD,SAAS;QACX,CAAC;QACD,IAAI,CAAC;YACH,kBAAkB,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;YACzC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,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"}
@@ -0,0 +1,2 @@
1
+ export declare function runUpdate(currentVersion: string): Promise<void>;
2
+ //# sourceMappingURL=update.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AAKA,wBAAsB,SAAS,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA8CrE"}
@@ -0,0 +1,58 @@
1
+ import { execSync } from 'node:child_process';
2
+ import pc from 'picocolors';
3
+ import { readCredentials } from '../auth/credentials.js';
4
+ import { compareSemver } from '../version.js';
5
+ export async function runUpdate(currentVersion) {
6
+ console.log(`\n ${pc.bold('Verbal')} — Update\n`);
7
+ // Fetch latest version (blocking — user explicitly asked)
8
+ const creds = await readCredentials();
9
+ const apiUrl = creds?.api_url || 'https://www.getverbal.ai';
10
+ let latest;
11
+ try {
12
+ const res = await fetch(`${apiUrl}/api/v1/cli/version`);
13
+ if (!res.ok)
14
+ throw new Error(`HTTP ${res.status}`);
15
+ const body = (await res.json());
16
+ latest = body.latest;
17
+ if (!/^\d+\.\d+\.\d+$/.test(latest)) {
18
+ console.error(pc.red(' Server returned an invalid version. Try again later.'));
19
+ process.exitCode = 1;
20
+ return;
21
+ }
22
+ }
23
+ catch {
24
+ console.error(pc.red(' Failed to check for updates. Try again later.'));
25
+ process.exitCode = 1;
26
+ return;
27
+ }
28
+ if (compareSemver(currentVersion, latest) >= 0) {
29
+ console.log(pc.green(` You're up to date! (v${currentVersion})`));
30
+ return;
31
+ }
32
+ console.log(` ${pc.dim(currentVersion)} → ${pc.green(latest)}\n`);
33
+ // Detect package manager
34
+ const pm = detectPackageManager();
35
+ const installCmd = pm === 'bun' ? `bun install -g getverbal@${latest}` : `npm install -g getverbal@${latest}`;
36
+ console.log(` Running: ${pc.dim(installCmd)}`);
37
+ try {
38
+ execSync(installCmd, { stdio: 'inherit' });
39
+ console.log(pc.green(`\n Updated getverbal ${currentVersion} → ${latest}`));
40
+ }
41
+ catch {
42
+ console.error(pc.red(`\n Update failed. Try manually:`));
43
+ console.error(` ${pc.cyan(installCmd)}`);
44
+ process.exitCode = 1;
45
+ }
46
+ }
47
+ function detectPackageManager() {
48
+ try {
49
+ const which = execSync('which getverbal', { encoding: 'utf-8' }).trim();
50
+ if (which.includes('.bun/'))
51
+ return 'bun';
52
+ }
53
+ catch {
54
+ // getverbal not in PATH — default to npm
55
+ }
56
+ return 'npm';
57
+ }
58
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,cAAsB;IACpD,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;IAEnD,0DAA0D;IAC1D,MAAM,KAAK,GAAG,MAAM,eAAe,EAAE,CAAC;IACtC,MAAM,MAAM,GAAG,KAAK,EAAE,OAAO,IAAI,0BAA0B,CAAC;IAE5D,IAAI,MAAc,CAAC;IACnB,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,MAAM,qBAAqB,CAAC,CAAC;QACxD,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,QAAQ,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;QACnD,MAAM,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAuB,CAAC;QACtD,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QACrB,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YACpC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC,CAAC;YAChF,OAAO,CAAC,QAAQ,GAAG,CAAC,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AC,CAAC;IACvB,CAAC;AACH,CAAC;AAED,SAAS,oBAAoB;IAC3B,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,QAAQ,CAAC,iBAAiB,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACxE,IAAI,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC;YAAE,OAAO,KAAK,CAAC;IAC5C,CAAC;IAAC,MAAM,CAAC;QACP,yCAAyC;IAC3C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,7 @@
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', useGlobal?: boolean): Promise<void>;
7
+ //# sourceMappingURL=claude-code.d.ts.map
@@ -0,0 +1 @@
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,EACpC,SAAS,GAAE,OAAe,GACzB,OAAO,CAAC,IAAI,CAAC,CAGf"}
@@ -0,0 +1,11 @@
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, useGlobal = false) {
8
+ const configPath = join(process.cwd(), '.mcp.json');
9
+ mergeConfig(configPath, credentials, billingType, useGlobal);
10
+ }
11
+ //# sourceMappingURL=claude-code.js.map
@@ -0,0 +1 @@
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,EACpC,YAAqB,KAAK;IAE1B,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,WAAW,CAAC,CAAC;IACpD,WAAW,CAAC,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,8 @@
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', useGlobal?: boolean): Promise<void>;
8
+ //# sourceMappingURL=claude-desktop.d.ts.map
@@ -0,0 +1 @@
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,EACpC,SAAS,GAAE,OAAe,GACzB,OAAO,CAAC,IAAI,CAAC,CAGf"}
@@ -0,0 +1,28 @@
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, useGlobal = false) {
25
+ const configPath = getConfigPath();
26
+ mergeConfig(configPath, credentials, billingType, useGlobal);
27
+ }
28
+ //# sourceMappingURL=claude-desktop.js.map
@@ -0,0 +1 @@
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,EACpC,YAAqB,KAAK;IAE1B,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IACnC,WAAW,CAAC,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,7 @@
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', useGlobal?: boolean): Promise<void>;
7
+ //# sourceMappingURL=codex.d.ts.map
@@ -0,0 +1 @@
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,EACpC,SAAS,GAAE,OAAe,GACzB,OAAO,CAAC,IAAI,CAAC,CAGf"}
@@ -0,0 +1,12 @@
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, useGlobal = false) {
9
+ const configPath = join(homedir(), '.codex', 'config.json');
10
+ mergeConfig(configPath, credentials, billingType, useGlobal);
11
+ }
12
+ //# sourceMappingURL=codex.js.map
@@ -0,0 +1 @@
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,EACpC,YAAqB,KAAK;IAE1B,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC;IAC5D,WAAW,CAAC,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,7 @@
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', useGlobal?: boolean): Promise<void>;
7
+ //# sourceMappingURL=cursor.d.ts.map
@@ -0,0 +1 @@
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,EACpC,SAAS,GAAE,OAAe,GACzB,OAAO,CAAC,IAAI,CAAC,CAGf"}
@@ -0,0 +1,12 @@
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, useGlobal = false) {
9
+ const configPath = join(homedir(), '.cursor', 'mcp.json');
10
+ mergeConfig(configPath, credentials, billingType, useGlobal);
11
+ }
12
+ //# sourceMappingURL=cursor.js.map
@@ -0,0 +1 @@
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,EACpC,YAAqB,KAAK;IAE1B,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;IAC1D,WAAW,CAAC,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,34 @@
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
+ * When useGlobal=true the entry invokes the globally installed `getverbal`
11
+ * binary directly. When useGlobal=false (default) it falls back to npx so
12
+ * the command works even without a global install.
13
+ */
14
+ export declare function buildVerbalMcpEntry(credentials: Credentials, billingType?: 'api' | 'subscription', useGlobal?: boolean): Record<string, unknown>;
15
+ /**
16
+ * Safely reads an existing config file, merges in the verbal MCP entry,
17
+ * and writes it back atomically using a .tmp file + rename.
18
+ *
19
+ * Only the mcpServers.verbal key is overwritten; all other keys are preserved.
20
+ */
21
+ export declare function mergeConfig(configPath: string, credentials: Credentials, billingType?: 'api' | 'subscription', useGlobal?: boolean): void;
22
+ /**
23
+ * Removes the mcpServers.verbal key from a config file.
24
+ * If removing it leaves mcpServers empty, removes mcpServers too.
25
+ * No-op if the file doesn't exist or has no verbal entry.
26
+ */
27
+ export declare function removeVerbalConfig(configPath: string): void;
28
+ /**
29
+ * Configures all detected AI tools with the Verbal MCP server.
30
+ * Skips tools where detected === false.
31
+ * Returns a results array — never throws on individual failures.
32
+ */
33
+ export declare function configureAll(detections: DetectionResult[], credentials: Credentials, useGlobal?: boolean): Promise<ConfigureResult[]>;
34
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
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;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,WAAW,EACxB,WAAW,GAAE,KAAK,GAAG,cAAsB,EAC3C,SAAS,GAAE,OAAe,GACzB,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,EACpC,SAAS,GAAE,OAAe,GACzB,IAAI,CA+BN;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,EACxB,SAAS,GAAE,OAAe,GACzB,OAAO,CAAC,eAAe,EAAE,CAAC,CAyC5B"}
@@ -0,0 +1,153 @@
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
+ * When useGlobal=true the entry invokes the globally installed `getverbal`
17
+ * binary directly. When useGlobal=false (default) it falls back to npx so
18
+ * the command works even without a global install.
19
+ */
20
+ export function buildVerbalMcpEntry(credentials, billingType = 'api', useGlobal = false) {
21
+ return {
22
+ command: useGlobal ? 'getverbal' : 'npx',
23
+ args: useGlobal ? ['mcp-serve'] : ['-y', 'getverbal', 'mcp-serve'],
24
+ env: {
25
+ VERBAL_API_KEY: credentials.api_key,
26
+ VERBAL_API_URL: credentials.api_url,
27
+ VERBAL_INGEST_URL: credentials.ingest_url,
28
+ VERBAL_SOURCE: 'mcp',
29
+ VERBAL_CAPTURE_MODE: 'full',
30
+ VERBAL_TRACE_ENABLED: 'true',
31
+ VERBAL_GIT_CONTEXT_ENABLED: 'true',
32
+ VERBAL_COST_CALC_ENABLED: 'true',
33
+ VERBAL_BILLING_TYPE: billingType,
34
+ },
35
+ };
36
+ }
37
+ /**
38
+ * Safely reads an existing config file, merges in the verbal MCP entry,
39
+ * and writes it back atomically using a .tmp file + rename.
40
+ *
41
+ * Only the mcpServers.verbal key is overwritten; all other keys are preserved.
42
+ */
43
+ export function mergeConfig(configPath, credentials, billingType, useGlobal = false) {
44
+ // Ensure parent directories exist
45
+ mkdirSync(dirname(configPath), { recursive: true });
46
+ // Read existing config or start fresh
47
+ let config = {};
48
+ if (existsSync(configPath)) {
49
+ try {
50
+ config = JSON.parse(readFileSync(configPath, 'utf-8'));
51
+ }
52
+ catch {
53
+ // Malformed JSON — start fresh rather than bail out
54
+ config = {};
55
+ }
56
+ }
57
+ // Ensure mcpServers key exists
58
+ if (config['mcpServers'] === undefined || config['mcpServers'] === null || typeof config['mcpServers'] !== 'object') {
59
+ config['mcpServers'] = {};
60
+ }
61
+ // Set only the verbal entry — preserve all other MCP server configs
62
+ config['mcpServers']['verbal'] = buildVerbalMcpEntry(credentials, billingType, useGlobal);
63
+ // Atomic write: write to .tmp then rename
64
+ const tmpPath = `${configPath}.tmp`;
65
+ writeFileSync(tmpPath, JSON.stringify(config, null, 2), 'utf-8');
66
+ renameSync(tmpPath, configPath);
67
+ }
68
+ /**
69
+ * Removes the mcpServers.verbal key from a config file.
70
+ * If removing it leaves mcpServers empty, removes mcpServers too.
71
+ * No-op if the file doesn't exist or has no verbal entry.
72
+ */
73
+ export function removeVerbalConfig(configPath) {
74
+ const resolvedPath = resolve(configPath);
75
+ // 1. Read the config file — return silently if not found
76
+ if (!existsSync(resolvedPath)) {
77
+ return;
78
+ }
79
+ let config;
80
+ try {
81
+ config = JSON.parse(readFileSync(resolvedPath, 'utf-8'));
82
+ }
83
+ catch {
84
+ // Malformed JSON — nothing safe to do, leave it alone
85
+ return;
86
+ }
87
+ // 2. Remove mcpServers.verbal if it exists
88
+ if (config['mcpServers'] !== undefined &&
89
+ config['mcpServers'] !== null &&
90
+ typeof config['mcpServers'] === 'object') {
91
+ const mcpServers = config['mcpServers'];
92
+ if (!Object.prototype.hasOwnProperty.call(mcpServers, 'verbal')) {
93
+ // No verbal entry — nothing to do
94
+ return;
95
+ }
96
+ delete mcpServers['verbal'];
97
+ // 3. If mcpServers is now empty, remove the key entirely
98
+ if (Object.keys(mcpServers).length === 0) {
99
+ delete config['mcpServers'];
100
+ }
101
+ }
102
+ else {
103
+ // No mcpServers section — nothing to do
104
+ return;
105
+ }
106
+ // 4. Atomic write: tmp + rename
107
+ const tmpPath = `${resolvedPath}.tmp`;
108
+ writeFileSync(tmpPath, JSON.stringify(config, null, 2), 'utf-8');
109
+ renameSync(tmpPath, resolvedPath);
110
+ }
111
+ /**
112
+ * Configures all detected AI tools with the Verbal MCP server.
113
+ * Skips tools where detected === false.
114
+ * Returns a results array — never throws on individual failures.
115
+ */
116
+ export async function configureAll(detections, credentials, useGlobal = false) {
117
+ const results = [];
118
+ for (const detection of detections) {
119
+ if (!detection.detected) {
120
+ continue;
121
+ }
122
+ let success = false;
123
+ let error;
124
+ const billingType = TOOL_DEFAULT_BILLING_TYPE[detection.tool] ?? 'api';
125
+ try {
126
+ switch (detection.tool) {
127
+ case 'claude-code':
128
+ await configureClaudeCode(detection, credentials, billingType, useGlobal);
129
+ break;
130
+ case 'claude-desktop':
131
+ await configureClaudeDesktop(detection, credentials, billingType, useGlobal);
132
+ break;
133
+ case 'cursor':
134
+ await configureCursor(detection, credentials, billingType, useGlobal);
135
+ break;
136
+ case 'codex':
137
+ await configureCodex(detection, credentials, billingType, useGlobal);
138
+ break;
139
+ default: {
140
+ const _exhaustive = detection.tool;
141
+ throw new Error(`Unknown tool: ${String(_exhaustive)}`);
142
+ }
143
+ }
144
+ success = true;
145
+ }
146
+ catch (err) {
147
+ error = err instanceof Error ? err.message : String(err);
148
+ }
149
+ results.push({ tool: detection.tool, success, error });
150
+ }
151
+ return results;
152
+ }
153
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
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;AAC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,IAAI,EAAE,CAAC;gBACvB,KAAK,aAAa;oBAChB,MAAM,mBAAmB,CAAC,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;oBAC1E,MAAM;gBACR,KAAK,gBAAgB;oBACnB,MAAM,sBAAsB,CAAC,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;oBAC7E,MAAM;gBACR,KAAK,QAAQ;oBACX,MAAM,eAAe,CAAC,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;oBACtE,MAAM;gBACR,KAAK,OAAO;oBACV,MAAM,cAAc,CAAC,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;oBACrE,MAAM;gBACR,OAAO,CAAC,CAAC,CAAC;oBACR,MAAM,WAAW,GAAU,SAAS,CAAC,IAAI,CAAC;oBAC1C,MAAM,IAAI,KAAK,CAAC,iBAAiB,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;gBAC1D,CAAC;YACH,CAAC;YACD,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,KAAK,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC3D,CAAC;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"}
@@ -0,0 +1,3 @@
1
+ import type { DetectionResult } from '../types.js';
2
+ export declare function detectClaudeCode(): Promise<DetectionResult>;
3
+ //# sourceMappingURL=claude-code.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,82 @@
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../src/detect/claude-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,WAAW,CAAC,CAAC;IAEpD,IAAI,CAAC;QACH,0BAA0B;QAC1B,IAAI,UAA8B,CAAC;QACnC,IAAI,OAA2B,CAAC;QAEhC,IAAI,CAAC;YACH,UAAU,GAAG,QAAQ,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACrF,CAAC;QAAC,MAAM,CAAC;YACP,qBAAqB;QACvB,CAAC;QAED,iCAAiC;QACjC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;QAC7C,MAAM,aAAa,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;QAE5C,MAAM,QAAQ,GAAG,UAAU,KAAK,SAAS,IAAI,aAAa,CAAC;QAE3D,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BAAgB,OAAO,OAAO,QAAQ,EAAE;YAC1C,CAAC,CAAC,kBAAkB,QAAQ,EAAE,CAAC;QAEjC,OAAO;YACL,IAAI,EAAE,aAAa;YACnB,QAAQ,EAAE,IAAI;YACd,OAAO;YACP,UAAU;YACV,cAAc;YACd,OAAO;SACR,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO;YACL,IAAI,EAAE,aAAa;YACnB,QAAQ,EAAE,KAAK;YACf,UAAU;YACV,cAAc,EAAE,KAAK;YACrB,OAAO,EAAE,8BAA8B;SACxC,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { DetectionResult } from '../types.js';
2
+ export declare function detectClaudeDesktop(): Promise<DetectionResult>;
3
+ //# sourceMappingURL=claude-desktop.d.ts.map
@@ -0,0 +1 @@
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"}