@nordsym/apiclaw 1.7.3 → 1.7.5

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 (219) hide show
  1. package/convex/_generated/api.d.ts +115 -0
  2. package/convex/_generated/api.js +23 -0
  3. package/convex/_generated/dataModel.d.ts +60 -0
  4. package/convex/_generated/server.d.ts +143 -0
  5. package/convex/_generated/server.js +93 -0
  6. package/convex/adminActivate.d.ts +3 -0
  7. package/convex/adminActivate.d.ts.map +1 -0
  8. package/convex/adminActivate.js +47 -0
  9. package/convex/adminActivate.js.map +1 -0
  10. package/convex/adminActivate.ts +54 -0
  11. package/convex/adminStats.d.ts +3 -0
  12. package/convex/adminStats.d.ts.map +1 -0
  13. package/convex/adminStats.js +42 -0
  14. package/convex/adminStats.js.map +1 -0
  15. package/convex/adminStats.ts +44 -0
  16. package/convex/agents.d.ts +76 -0
  17. package/convex/agents.d.ts.map +1 -0
  18. package/convex/agents.js +699 -0
  19. package/convex/agents.js.map +1 -0
  20. package/convex/agents.ts +814 -0
  21. package/convex/analytics.d.ts +5 -0
  22. package/convex/analytics.d.ts.map +1 -0
  23. package/convex/analytics.js +166 -0
  24. package/convex/analytics.js.map +1 -0
  25. package/convex/analytics.ts +186 -0
  26. package/convex/billing.d.ts +88 -0
  27. package/convex/billing.d.ts.map +1 -0
  28. package/convex/billing.js +655 -0
  29. package/convex/billing.js.map +1 -0
  30. package/convex/billing.ts +791 -0
  31. package/convex/capabilities.d.ts +9 -0
  32. package/convex/capabilities.d.ts.map +1 -0
  33. package/convex/capabilities.js +145 -0
  34. package/convex/capabilities.js.map +1 -0
  35. package/convex/capabilities.ts +157 -0
  36. package/convex/chains.d.ts +68 -0
  37. package/convex/chains.d.ts.map +1 -0
  38. package/convex/chains.js +1105 -0
  39. package/convex/chains.js.map +1 -0
  40. package/convex/chains.ts +1318 -0
  41. package/convex/credits.d.ts +25 -0
  42. package/convex/credits.d.ts.map +1 -0
  43. package/convex/credits.js +186 -0
  44. package/convex/credits.js.map +1 -0
  45. package/convex/credits.ts +211 -0
  46. package/convex/crons.d.ts +3 -0
  47. package/convex/crons.d.ts.map +1 -0
  48. package/convex/crons.js +17 -0
  49. package/convex/crons.js.map +1 -0
  50. package/convex/crons.ts +28 -0
  51. package/convex/directCall.d.ts +72 -0
  52. package/convex/directCall.d.ts.map +1 -0
  53. package/convex/directCall.js +627 -0
  54. package/convex/directCall.js.map +1 -0
  55. package/convex/directCall.ts +678 -0
  56. package/convex/earnProgress.d.ts +58 -0
  57. package/convex/earnProgress.d.ts.map +1 -0
  58. package/convex/earnProgress.js +649 -0
  59. package/convex/earnProgress.js.map +1 -0
  60. package/convex/earnProgress.ts +753 -0
  61. package/convex/email.d.ts +14 -0
  62. package/convex/email.d.ts.map +1 -0
  63. package/convex/email.js +300 -0
  64. package/convex/email.js.map +1 -0
  65. package/convex/email.ts +329 -0
  66. package/convex/feedback.d.ts +7 -0
  67. package/convex/feedback.d.ts.map +1 -0
  68. package/convex/feedback.js +227 -0
  69. package/convex/feedback.js.map +1 -0
  70. package/convex/feedback.ts +265 -0
  71. package/convex/http.d.ts +3 -0
  72. package/convex/http.d.ts.map +1 -0
  73. package/convex/http.js +1405 -0
  74. package/convex/http.js.map +1 -0
  75. package/convex/http.ts +1577 -0
  76. package/convex/inbound.d.ts +2 -0
  77. package/convex/inbound.d.ts.map +1 -0
  78. package/convex/inbound.js +32 -0
  79. package/convex/inbound.js.map +1 -0
  80. package/convex/inbound.ts +32 -0
  81. package/convex/logs.d.ts +48 -0
  82. package/convex/logs.d.ts.map +1 -0
  83. package/convex/logs.js +592 -0
  84. package/convex/logs.js.map +1 -0
  85. package/convex/logs.ts +662 -0
  86. package/convex/mou.d.ts +6 -0
  87. package/convex/mou.d.ts.map +1 -0
  88. package/convex/mou.js +82 -0
  89. package/convex/mou.js.map +1 -0
  90. package/convex/mou.ts +91 -0
  91. package/convex/providerKeys.d.ts +31 -0
  92. package/convex/providerKeys.d.ts.map +1 -0
  93. package/convex/providerKeys.js +257 -0
  94. package/convex/providerKeys.js.map +1 -0
  95. package/convex/providerKeys.ts +289 -0
  96. package/convex/providers.d.ts +32 -0
  97. package/convex/providers.d.ts.map +1 -0
  98. package/convex/providers.js +814 -0
  99. package/convex/providers.js.map +1 -0
  100. package/convex/providers.ts +909 -0
  101. package/convex/purchases.d.ts +7 -0
  102. package/convex/purchases.d.ts.map +1 -0
  103. package/convex/purchases.js +157 -0
  104. package/convex/purchases.js.map +1 -0
  105. package/convex/purchases.ts +183 -0
  106. package/convex/ratelimit.d.ts +4 -0
  107. package/convex/ratelimit.d.ts.map +1 -0
  108. package/convex/ratelimit.js +91 -0
  109. package/convex/ratelimit.js.map +1 -0
  110. package/convex/ratelimit.ts +104 -0
  111. package/convex/schema.ts +805 -0
  112. package/convex/searchLogs.d.ts +4 -0
  113. package/convex/searchLogs.d.ts.map +1 -0
  114. package/convex/searchLogs.js +129 -0
  115. package/convex/searchLogs.js.map +1 -0
  116. package/convex/searchLogs.ts +146 -0
  117. package/convex/seedAPILayerAPIs.d.ts +7 -0
  118. package/convex/seedAPILayerAPIs.d.ts.map +1 -0
  119. package/convex/seedAPILayerAPIs.js +177 -0
  120. package/convex/seedAPILayerAPIs.js.map +1 -0
  121. package/convex/seedAPILayerAPIs.ts +191 -0
  122. package/convex/seedDirectCallConfigs.d.ts +2 -0
  123. package/convex/seedDirectCallConfigs.d.ts.map +1 -0
  124. package/convex/seedDirectCallConfigs.js +324 -0
  125. package/convex/seedDirectCallConfigs.js.map +1 -0
  126. package/convex/seedDirectCallConfigs.ts +336 -0
  127. package/convex/seedPratham.d.ts +6 -0
  128. package/convex/seedPratham.d.ts.map +1 -0
  129. package/convex/seedPratham.js +150 -0
  130. package/convex/seedPratham.js.map +1 -0
  131. package/convex/seedPratham.ts +161 -0
  132. package/convex/spendAlerts.d.ts +36 -0
  133. package/convex/spendAlerts.d.ts.map +1 -0
  134. package/convex/spendAlerts.js +380 -0
  135. package/convex/spendAlerts.js.map +1 -0
  136. package/convex/spendAlerts.ts +442 -0
  137. package/convex/stripeActions.d.ts +19 -0
  138. package/convex/stripeActions.d.ts.map +1 -0
  139. package/convex/stripeActions.js +411 -0
  140. package/convex/stripeActions.js.map +1 -0
  141. package/convex/stripeActions.ts +512 -0
  142. package/convex/teams.d.ts +21 -0
  143. package/convex/teams.d.ts.map +1 -0
  144. package/convex/teams.js +215 -0
  145. package/convex/teams.js.map +1 -0
  146. package/convex/teams.ts +243 -0
  147. package/convex/telemetry.d.ts +4 -0
  148. package/convex/telemetry.d.ts.map +1 -0
  149. package/convex/telemetry.js +74 -0
  150. package/convex/telemetry.js.map +1 -0
  151. package/convex/telemetry.ts +81 -0
  152. package/convex/tsconfig.json +25 -0
  153. package/convex/updateAPIStatus.d.ts +6 -0
  154. package/convex/updateAPIStatus.d.ts.map +1 -0
  155. package/convex/updateAPIStatus.js +40 -0
  156. package/convex/updateAPIStatus.js.map +1 -0
  157. package/convex/updateAPIStatus.ts +45 -0
  158. package/convex/usage.d.ts +27 -0
  159. package/convex/usage.d.ts.map +1 -0
  160. package/convex/usage.js +229 -0
  161. package/convex/usage.js.map +1 -0
  162. package/convex/usage.ts +260 -0
  163. package/convex/waitlist.d.ts +4 -0
  164. package/convex/waitlist.d.ts.map +1 -0
  165. package/convex/waitlist.js +49 -0
  166. package/convex/waitlist.js.map +1 -0
  167. package/convex/waitlist.ts +55 -0
  168. package/convex/webhooks.d.ts +12 -0
  169. package/convex/webhooks.d.ts.map +1 -0
  170. package/convex/webhooks.js +410 -0
  171. package/convex/webhooks.js.map +1 -0
  172. package/convex/webhooks.ts +494 -0
  173. package/convex/workspaces.d.ts +31 -0
  174. package/convex/workspaces.d.ts.map +1 -0
  175. package/convex/workspaces.js +975 -0
  176. package/convex/workspaces.js.map +1 -0
  177. package/convex/workspaces.ts +1130 -0
  178. package/dist/bin.js +0 -0
  179. package/dist/index.js +9 -0
  180. package/dist/index.js.map +1 -1
  181. package/package.json +1 -1
  182. package/src/index.ts +10 -0
  183. package/dist/chain-types.d.ts +0 -187
  184. package/dist/chain-types.d.ts.map +0 -1
  185. package/dist/chain-types.js +0 -33
  186. package/dist/chain-types.js.map +0 -1
  187. package/dist/registry/apis.json.bak +0 -248811
  188. package/dist/src/bin.js +0 -17
  189. package/dist/src/capability-router.js +0 -240
  190. package/dist/src/chainExecutor.js +0 -451
  191. package/dist/src/chainResolver.js +0 -518
  192. package/dist/src/cli/commands/doctor.js +0 -324
  193. package/dist/src/cli/commands/mcp-install.js +0 -255
  194. package/dist/src/cli/commands/restore.js +0 -259
  195. package/dist/src/cli/commands/setup.js +0 -205
  196. package/dist/src/cli/commands/uninstall.js +0 -188
  197. package/dist/src/cli/index.js +0 -111
  198. package/dist/src/cli.js +0 -302
  199. package/dist/src/confirmation.js +0 -240
  200. package/dist/src/credentials.js +0 -357
  201. package/dist/src/credits.js +0 -260
  202. package/dist/src/crypto.js +0 -66
  203. package/dist/src/discovery.js +0 -504
  204. package/dist/src/enterprise/env.js +0 -123
  205. package/dist/src/enterprise/script-generator.js +0 -460
  206. package/dist/src/execute-dynamic.js +0 -473
  207. package/dist/src/execute.js +0 -1727
  208. package/dist/src/index.js +0 -2062
  209. package/dist/src/metered.js +0 -80
  210. package/dist/src/open-apis.js +0 -276
  211. package/dist/src/proxy.js +0 -28
  212. package/dist/src/session.js +0 -86
  213. package/dist/src/stripe.js +0 -407
  214. package/dist/src/telemetry.js +0 -49
  215. package/dist/src/types.js +0 -2
  216. package/dist/src/utils/backup.js +0 -181
  217. package/dist/src/utils/config.js +0 -220
  218. package/dist/src/utils/os.js +0 -105
  219. package/dist/src/utils/paths.js +0 -159
@@ -1,220 +0,0 @@
1
- /**
2
- * Config Management
3
- * Handles JSON read/write/merge operations for MCP config files
4
- */
5
- import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
6
- import { dirname } from 'path';
7
- import { createBackup } from './backup.js';
8
- /**
9
- * Read and parse a JSON config file
10
- */
11
- export function readConfig(configPath) {
12
- try {
13
- if (!existsSync(configPath)) {
14
- return {
15
- success: true,
16
- config: {},
17
- isNew: true,
18
- };
19
- }
20
- const content = readFileSync(configPath, 'utf-8');
21
- // Handle empty files
22
- if (!content.trim()) {
23
- return {
24
- success: true,
25
- config: {},
26
- isNew: true,
27
- };
28
- }
29
- const config = JSON.parse(content);
30
- return {
31
- success: true,
32
- config,
33
- isNew: false,
34
- };
35
- }
36
- catch (error) {
37
- if (error instanceof SyntaxError) {
38
- return {
39
- success: false,
40
- config: null,
41
- error: `Invalid JSON in config file: ${error.message}`,
42
- };
43
- }
44
- return {
45
- success: false,
46
- config: null,
47
- error: error instanceof Error ? error.message : 'Unknown error reading config',
48
- };
49
- }
50
- }
51
- /**
52
- * Write config to file with backup
53
- */
54
- export function writeConfig(configPath, config, createBackupFirst = true) {
55
- try {
56
- // Ensure directory exists
57
- const dir = dirname(configPath);
58
- if (!existsSync(dir)) {
59
- mkdirSync(dir, { recursive: true });
60
- }
61
- // Create backup if file exists and backup requested
62
- let backupPath = null;
63
- if (createBackupFirst && existsSync(configPath)) {
64
- const backupResult = createBackup(configPath);
65
- if (!backupResult.success) {
66
- return {
67
- success: false,
68
- error: `Failed to create backup: ${backupResult.error}`,
69
- };
70
- }
71
- backupPath = backupResult.backupPath;
72
- }
73
- // Validate JSON before writing
74
- const content = JSON.stringify(config, null, 2);
75
- JSON.parse(content); // Validation parse
76
- // Write file
77
- writeFileSync(configPath, content, 'utf-8');
78
- return {
79
- success: true,
80
- backupPath,
81
- };
82
- }
83
- catch (error) {
84
- return {
85
- success: false,
86
- error: error instanceof Error ? error.message : 'Unknown error writing config',
87
- };
88
- }
89
- }
90
- /**
91
- * Deep merge two objects
92
- */
93
- export function deepMerge(target, source) {
94
- const result = { ...target };
95
- for (const key in source) {
96
- const sourceValue = source[key];
97
- const targetValue = result[key];
98
- if (sourceValue !== null &&
99
- typeof sourceValue === 'object' &&
100
- !Array.isArray(sourceValue) &&
101
- targetValue !== null &&
102
- typeof targetValue === 'object' &&
103
- !Array.isArray(targetValue)) {
104
- // Recursively merge objects
105
- result[key] = deepMerge(targetValue, sourceValue);
106
- }
107
- else {
108
- // Overwrite value
109
- result[key] = sourceValue;
110
- }
111
- }
112
- return result;
113
- }
114
- /**
115
- * Generate APIClaw MCP server configuration
116
- */
117
- export function generateApiclawConfig(options = {}) {
118
- const config = {
119
- command: 'npx',
120
- args: ['-y', '@nordsym/apiclaw'],
121
- };
122
- if (options.workspace) {
123
- config.env = {
124
- APICLAW_WORKSPACE: options.workspace,
125
- };
126
- }
127
- return config;
128
- }
129
- /**
130
- * Generate APIClaw config for Continue (array format)
131
- */
132
- export function generateApiclawContinueConfig(options = {}) {
133
- const config = {
134
- name: options.serverName || 'apiclaw',
135
- command: 'npx',
136
- args: ['-y', '@nordsym/apiclaw'],
137
- };
138
- if (options.workspace) {
139
- config.env = {
140
- APICLAW_WORKSPACE: options.workspace,
141
- };
142
- }
143
- return config;
144
- }
145
- /**
146
- * Check if APIClaw is already configured
147
- */
148
- export function hasApiclawConfig(config, serverName = 'apiclaw') {
149
- // Handle Continue's array format
150
- if (Array.isArray(config.mcpServers)) {
151
- const continueConfig = config;
152
- return continueConfig.mcpServers?.some(s => s.name === serverName) || false;
153
- }
154
- // Handle standard object format
155
- const mcpConfig = config;
156
- return mcpConfig.mcpServers?.[serverName] !== undefined;
157
- }
158
- /**
159
- * Merge APIClaw config into existing config (standard format)
160
- */
161
- export function mergeApiclawConfig(existingConfig, options = {}) {
162
- const serverName = options.serverName || 'apiclaw';
163
- const apiclawConfig = generateApiclawConfig(options);
164
- return deepMerge(existingConfig, {
165
- mcpServers: {
166
- ...existingConfig.mcpServers,
167
- [serverName]: apiclawConfig,
168
- },
169
- });
170
- }
171
- /**
172
- * Merge APIClaw config into Continue config (array format)
173
- */
174
- export function mergeApiclawContinueConfig(existingConfig, options = {}) {
175
- const serverName = options.serverName || 'apiclaw';
176
- const apiclawConfig = generateApiclawContinueConfig(options);
177
- const existingServers = existingConfig.mcpServers || [];
178
- // Check if already exists
179
- const existingIndex = existingServers.findIndex(s => s.name === serverName);
180
- let newServers;
181
- if (existingIndex >= 0) {
182
- // Update existing
183
- newServers = [...existingServers];
184
- newServers[existingIndex] = apiclawConfig;
185
- }
186
- else {
187
- // Add new
188
- newServers = [...existingServers, apiclawConfig];
189
- }
190
- return {
191
- ...existingConfig,
192
- mcpServers: newServers,
193
- };
194
- }
195
- /**
196
- * Remove APIClaw from config
197
- */
198
- export function removeApiclawConfig(config, serverName = 'apiclaw') {
199
- // Handle Continue's array format
200
- if (Array.isArray(config.mcpServers)) {
201
- const continueConfig = config;
202
- return {
203
- ...continueConfig,
204
- mcpServers: continueConfig.mcpServers?.filter(s => s.name !== serverName),
205
- };
206
- }
207
- // Handle standard object format
208
- const mcpConfig = config;
209
- const { [serverName]: _, ...remainingServers } = mcpConfig.mcpServers || {};
210
- return {
211
- ...mcpConfig,
212
- mcpServers: remainingServers,
213
- };
214
- }
215
- /**
216
- * Detect if config uses Continue's array format
217
- */
218
- export function isContinueFormat(config) {
219
- return Array.isArray(config.mcpServers);
220
- }
@@ -1,105 +0,0 @@
1
- /**
2
- * OS Detection Utility
3
- * Detects the operating system and provides platform-specific helpers
4
- */
5
- import { platform, homedir } from 'os';
6
- import { join } from 'path';
7
- /**
8
- * Detect the current operating system
9
- */
10
- export function detectOS() {
11
- const os = platform();
12
- switch (os) {
13
- case 'darwin':
14
- return 'mac';
15
- case 'win32':
16
- return 'win';
17
- case 'linux':
18
- return 'linux';
19
- default:
20
- // Default to linux for other Unix-like systems
21
- return 'linux';
22
- }
23
- }
24
- /**
25
- * Get the home directory for the current user
26
- */
27
- export function getHomeDir() {
28
- return homedir();
29
- }
30
- /**
31
- * Get the app data directory based on OS
32
- * - macOS: ~/Library/Application Support
33
- * - Windows: %APPDATA%
34
- * - Linux: ~/.config
35
- */
36
- export function getAppDataDir() {
37
- const home = getHomeDir();
38
- const os = detectOS();
39
- switch (os) {
40
- case 'mac':
41
- return join(home, 'Library', 'Application Support');
42
- case 'win':
43
- return process.env.APPDATA || join(home, 'AppData', 'Roaming');
44
- case 'linux':
45
- return process.env.XDG_CONFIG_HOME || join(home, '.config');
46
- }
47
- }
48
- /**
49
- * Get the user profile directory (Windows-specific, falls back to home)
50
- */
51
- export function getUserProfileDir() {
52
- return process.env.USERPROFILE || getHomeDir();
53
- }
54
- /**
55
- * Check if running as root/admin
56
- */
57
- export function isElevated() {
58
- const os = detectOS();
59
- if (os === 'win') {
60
- // Windows admin check is more complex, skip for now
61
- return false;
62
- }
63
- // Unix-like: check if UID is 0
64
- return process.getuid?.() === 0;
65
- }
66
- /**
67
- * Get OS-specific path separator
68
- */
69
- export function getPathSeparator() {
70
- return detectOS() === 'win' ? '\\' : '/';
71
- }
72
- /**
73
- * Normalize path for current OS
74
- */
75
- export function normalizePath(path) {
76
- const os = detectOS();
77
- if (os === 'win') {
78
- // Convert forward slashes to backslashes on Windows
79
- return path.replace(/\//g, '\\');
80
- }
81
- return path;
82
- }
83
- /**
84
- * Expand ~ to home directory
85
- */
86
- export function expandHome(path) {
87
- if (path.startsWith('~')) {
88
- return join(getHomeDir(), path.slice(1));
89
- }
90
- return path;
91
- }
92
- /**
93
- * Get OS display name
94
- */
95
- export function getOSDisplayName() {
96
- const os = detectOS();
97
- switch (os) {
98
- case 'mac':
99
- return 'macOS';
100
- case 'win':
101
- return 'Windows';
102
- case 'linux':
103
- return 'Linux';
104
- }
105
- }
@@ -1,159 +0,0 @@
1
- /**
2
- * Config Path Resolver
3
- * Resolves config file paths for all MCP clients across all operating systems
4
- */
5
- import { join } from 'path';
6
- import { detectOS, getHomeDir, getAppDataDir, getUserProfileDir } from './os.js';
7
- /**
8
- * Get config path for Claude Desktop
9
- */
10
- function getClaudeDesktopPath(os) {
11
- const home = getHomeDir();
12
- const appData = getAppDataDir();
13
- switch (os) {
14
- case 'mac':
15
- return join(appData, 'Claude', 'claude_desktop_config.json');
16
- case 'win':
17
- return join(appData, 'Claude', 'claude_desktop_config.json');
18
- case 'linux':
19
- return join(home, '.config', 'Claude', 'claude_desktop_config.json');
20
- }
21
- }
22
- /**
23
- * Get config path for Cursor
24
- */
25
- function getCursorPath(os) {
26
- const home = getHomeDir();
27
- const appData = getAppDataDir();
28
- switch (os) {
29
- case 'mac':
30
- return join(appData, 'Cursor', 'User', 'globalStorage', 'cursor.mcp', 'config.json');
31
- case 'win':
32
- return join(appData, 'Cursor', 'User', 'globalStorage', 'cursor.mcp', 'config.json');
33
- case 'linux':
34
- return join(home, '.config', 'Cursor', 'User', 'globalStorage', 'cursor.mcp', 'config.json');
35
- }
36
- }
37
- /**
38
- * Get config path for Windsurf
39
- */
40
- function getWindsurfPath(os) {
41
- const home = getHomeDir();
42
- const userProfile = getUserProfileDir();
43
- switch (os) {
44
- case 'mac':
45
- case 'linux':
46
- return join(home, '.codeium', 'windsurf', 'mcp_config.json');
47
- case 'win':
48
- return join(userProfile, '.codeium', 'windsurf', 'mcp_config.json');
49
- }
50
- }
51
- /**
52
- * Get config path for Cline (VS Code extension)
53
- */
54
- function getClinePath(os) {
55
- const home = getHomeDir();
56
- const appData = getAppDataDir();
57
- const relativePath = join('Code', 'User', 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json');
58
- switch (os) {
59
- case 'mac':
60
- return join(appData, relativePath);
61
- case 'win':
62
- return join(appData, relativePath);
63
- case 'linux':
64
- return join(home, '.config', relativePath);
65
- }
66
- }
67
- /**
68
- * Get config path for Continue
69
- */
70
- function getContinuePath(os) {
71
- const home = getHomeDir();
72
- const userProfile = getUserProfileDir();
73
- switch (os) {
74
- case 'mac':
75
- case 'linux':
76
- return join(home, '.continue', 'config.json');
77
- case 'win':
78
- return join(userProfile, '.continue', 'config.json');
79
- }
80
- }
81
- /**
82
- * Get the config path for a specific MCP client
83
- */
84
- export function getConfigPath(client, os) {
85
- const currentOS = os || detectOS();
86
- switch (client) {
87
- case 'claude-desktop':
88
- return getClaudeDesktopPath(currentOS);
89
- case 'cursor':
90
- return getCursorPath(currentOS);
91
- case 'windsurf':
92
- return getWindsurfPath(currentOS);
93
- case 'cline':
94
- return getClinePath(currentOS);
95
- case 'continue':
96
- return getContinuePath(currentOS);
97
- }
98
- }
99
- /**
100
- * Get full client configuration info
101
- */
102
- export function getClientConfig(client, os) {
103
- const configPath = getConfigPath(client, os);
104
- const pathParts = configPath.split(/[/\\]/);
105
- const configFile = pathParts.pop() || '';
106
- const configDir = pathParts.join('/');
107
- const displayNames = {
108
- 'claude-desktop': 'Claude Desktop',
109
- 'cursor': 'Cursor',
110
- 'windsurf': 'Windsurf',
111
- 'cline': 'Cline',
112
- 'continue': 'Continue',
113
- };
114
- return {
115
- name: client,
116
- displayName: displayNames[client],
117
- configPath,
118
- configDir,
119
- configFile,
120
- };
121
- }
122
- /**
123
- * Get all supported MCP clients
124
- */
125
- export function getAllClients() {
126
- return ['claude-desktop', 'cursor', 'windsurf', 'cline', 'continue'];
127
- }
128
- /**
129
- * Get config paths for all clients
130
- */
131
- export function getAllConfigPaths(os) {
132
- const paths = new Map();
133
- for (const client of getAllClients()) {
134
- paths.set(client, getClientConfig(client, os));
135
- }
136
- return paths;
137
- }
138
- /**
139
- * Validate that a client name is valid
140
- */
141
- export function isValidClient(client) {
142
- return getAllClients().includes(client);
143
- }
144
- /**
145
- * Parse client argument (accepts various formats)
146
- */
147
- export function parseClientArg(arg) {
148
- const normalized = arg.toLowerCase().replace(/[_\s]/g, '-');
149
- const aliases = {
150
- 'claude': 'claude-desktop',
151
- 'claude-desktop': 'claude-desktop',
152
- 'claudedesktop': 'claude-desktop',
153
- 'cursor': 'cursor',
154
- 'windsurf': 'windsurf',
155
- 'cline': 'cline',
156
- 'continue': 'continue',
157
- };
158
- return aliases[normalized] || null;
159
- }