@nordsym/apiclaw 1.5.17 → 1.5.19

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 (228) hide show
  1. package/convex/http.js.map +1 -1
  2. package/convex/http.ts +516 -0
  3. package/dist/analytics.d.ts +0 -4
  4. package/dist/analytics.d.ts.map +1 -1
  5. package/dist/analytics.js +0 -1
  6. package/dist/analytics.js.map +1 -1
  7. package/dist/bin.js +1 -1
  8. package/dist/cli/commands/mcp-install.d.ts.map +1 -1
  9. package/dist/cli/commands/mcp-install.js +8 -87
  10. package/dist/cli/commands/mcp-install.js.map +1 -1
  11. package/dist/cli/index.js +0 -7
  12. package/dist/credentials.d.ts.map +1 -1
  13. package/dist/credentials.js +38 -43
  14. package/dist/credentials.js.map +1 -1
  15. package/dist/discovery.d.ts.map +1 -1
  16. package/dist/discovery.js +82 -191
  17. package/dist/discovery.js.map +1 -1
  18. package/dist/http-api.d.ts.map +1 -1
  19. package/dist/http-api.js +33 -17
  20. package/dist/http-api.js.map +1 -1
  21. package/dist/proxy.js +1 -1
  22. package/dist/proxy.js.map +1 -1
  23. package/landing/next-env.d.ts +0 -1
  24. package/landing/src/app/api/auth/magic-link/route.ts +1 -1
  25. package/landing/src/app/auth/verify/page.tsx +0 -6
  26. package/landing/src/app/dashboard/verify/page.tsx +0 -6
  27. package/landing/src/app/join/page.tsx +0 -6
  28. package/landing/src/app/layout.tsx +2 -2
  29. package/landing/src/app/login/page.tsx +1 -1
  30. package/landing/src/app/mou/[partnerId]/page.tsx +0 -6
  31. package/landing/src/app/page.tsx +18 -39
  32. package/landing/src/app/providers/dashboard/[apiId]/actions/[actionId]/edit/page.tsx +0 -6
  33. package/landing/src/app/providers/dashboard/[apiId]/actions/new/page.tsx +0 -5
  34. package/landing/src/app/providers/dashboard/[apiId]/actions/page.tsx +0 -5
  35. package/landing/src/app/providers/dashboard/[apiId]/direct-call/page.tsx +1 -6
  36. package/landing/src/app/providers/dashboard/[apiId]/page.tsx +0 -5
  37. package/landing/src/app/providers/dashboard/[apiId]/test/page.tsx +0 -5
  38. package/landing/src/app/providers/dashboard/layout.tsx +6 -6
  39. package/landing/src/app/providers/dashboard/login/page.tsx +1 -1
  40. package/landing/src/app/providers/dashboard/page.tsx +1 -1
  41. package/landing/src/app/providers/dashboard/verify/page.tsx +0 -6
  42. package/landing/src/app/providers/layout.tsx +1 -1
  43. package/landing/src/app/upgrade/page.tsx +0 -6
  44. package/landing/src/app/workspace/page.tsx +0 -6
  45. package/landing/src/components/HeroTabs.tsx +2 -2
  46. package/landing/src/components/{Workspace.tsx → ProviderDashboard.tsx} +2 -2
  47. package/landing/src/components/VideoDemo.tsx +10 -21
  48. package/landing/src/lib/mock-data.ts +1 -1
  49. package/landing/src/lib/stats.json +1 -1
  50. package/package.json +3 -8
  51. package/src/analytics.ts +0 -5
  52. package/src/bin.ts +1 -1
  53. package/src/cli/commands/mcp-install.ts +8 -90
  54. package/src/cli/index.ts +0 -8
  55. package/src/credentials.ts +39 -44
  56. package/src/discovery.ts +82 -191
  57. package/src/http-api.ts +34 -18
  58. package/src/proxy.ts +1 -1
  59. package/APILAYER_STATUS_2026-03-24.md +0 -38
  60. package/CHANGELOG-WHITELIST-V2.md +0 -269
  61. package/HIVR-WHITELIST-STATUS.md +0 -205
  62. package/HIVR-WHITELIST.md +0 -148
  63. package/TERMINOLOGY-AUDIT.md +0 -99
  64. package/TERMINOLOGY-FIXED.md +0 -74
  65. package/VIDEO-DEMO-GUIDE.md +0 -82
  66. package/WHITELIST-ARCHITECTURE.md +0 -379
  67. package/api/discover.ts +0 -71
  68. package/api/health.ts +0 -20
  69. package/convex/adminActivate.d.ts +0 -3
  70. package/convex/adminActivate.js +0 -47
  71. package/convex/adminStats.d.ts +0 -3
  72. package/convex/adminStats.js +0 -42
  73. package/convex/agents.d.ts +0 -54
  74. package/convex/agents.js +0 -499
  75. package/convex/analytics.d.ts +0 -5
  76. package/convex/analytics.js +0 -166
  77. package/convex/billing.d.ts +0 -88
  78. package/convex/billing.js +0 -655
  79. package/convex/capabilities.d.ts +0 -9
  80. package/convex/capabilities.js +0 -145
  81. package/convex/chains.d.ts +0 -67
  82. package/convex/chains.js +0 -1042
  83. package/convex/credits.d.ts +0 -25
  84. package/convex/credits.js +0 -186
  85. package/convex/crons.d.ts +0 -3
  86. package/convex/crons.js +0 -17
  87. package/convex/directCall.d.ts +0 -72
  88. package/convex/directCall.js +0 -627
  89. package/convex/earnProgress.d.ts +0 -58
  90. package/convex/earnProgress.js +0 -649
  91. package/convex/email.d.ts +0 -14
  92. package/convex/email.js +0 -300
  93. package/convex/feedback.d.ts +0 -7
  94. package/convex/feedback.js +0 -227
  95. package/convex/http.d.ts +0 -3
  96. package/convex/http.js +0 -910
  97. package/convex/logs.d.ts +0 -38
  98. package/convex/logs.js +0 -487
  99. package/convex/mou.d.ts +0 -6
  100. package/convex/mou.js +0 -82
  101. package/convex/providerKeys.d.ts +0 -31
  102. package/convex/providerKeys.js +0 -257
  103. package/convex/providers.d.ts +0 -29
  104. package/convex/providers.js +0 -756
  105. package/convex/purchases.d.ts +0 -7
  106. package/convex/purchases.js +0 -157
  107. package/convex/ratelimit.d.ts +0 -4
  108. package/convex/ratelimit.js +0 -91
  109. package/convex/searchLogs.d.ts +0 -4
  110. package/convex/searchLogs.js +0 -129
  111. package/convex/spendAlerts.d.ts +0 -36
  112. package/convex/spendAlerts.js +0 -380
  113. package/convex/stripeActions.d.ts +0 -19
  114. package/convex/stripeActions.js +0 -411
  115. package/convex/teams.d.ts +0 -21
  116. package/convex/teams.js +0 -215
  117. package/convex/telemetry.d.ts +0 -4
  118. package/convex/telemetry.js +0 -74
  119. package/convex/usage.d.ts +0 -27
  120. package/convex/usage.js +0 -229
  121. package/convex/waitlist.d.ts +0 -4
  122. package/convex/waitlist.js +0 -49
  123. package/convex/webhooks.d.ts +0 -12
  124. package/convex/webhooks.js +0 -410
  125. package/convex/workspaces.d.ts +0 -29
  126. package/convex/workspaces.js +0 -880
  127. package/direct-test.mjs +0 -51
  128. package/dist/access-control.d.ts +0 -45
  129. package/dist/access-control.d.ts.map +0 -1
  130. package/dist/access-control.js +0 -142
  131. package/dist/access-control.js.map +0 -1
  132. package/dist/chain-types.d.ts +0 -187
  133. package/dist/chain-types.d.ts.map +0 -1
  134. package/dist/chain-types.js +0 -33
  135. package/dist/chain-types.js.map +0 -1
  136. package/dist/convex/adminActivate.js +0 -46
  137. package/dist/convex/adminStats.js +0 -41
  138. package/dist/convex/agents.js +0 -498
  139. package/dist/convex/analytics.js +0 -165
  140. package/dist/convex/billing.js +0 -654
  141. package/dist/convex/capabilities.js +0 -144
  142. package/dist/convex/chains.js +0 -1041
  143. package/dist/convex/credits.js +0 -185
  144. package/dist/convex/crons.js +0 -16
  145. package/dist/convex/directCall.js +0 -626
  146. package/dist/convex/earnProgress.js +0 -648
  147. package/dist/convex/email.js +0 -299
  148. package/dist/convex/feedback.js +0 -226
  149. package/dist/convex/http.js +0 -909
  150. package/dist/convex/logs.js +0 -486
  151. package/dist/convex/mou.js +0 -81
  152. package/dist/convex/providerKeys.js +0 -256
  153. package/dist/convex/providers.js +0 -755
  154. package/dist/convex/purchases.js +0 -156
  155. package/dist/convex/ratelimit.js +0 -90
  156. package/dist/convex/schema.js +0 -709
  157. package/dist/convex/searchLogs.js +0 -128
  158. package/dist/convex/spendAlerts.js +0 -379
  159. package/dist/convex/stripeActions.js +0 -410
  160. package/dist/convex/teams.js +0 -214
  161. package/dist/convex/telemetry.js +0 -73
  162. package/dist/convex/usage.js +0 -228
  163. package/dist/convex/waitlist.js +0 -48
  164. package/dist/convex/webhooks.js +0 -409
  165. package/dist/convex/workspaces.js +0 -879
  166. package/dist/hivr-whitelist.d.ts +0 -18
  167. package/dist/hivr-whitelist.d.ts.map +0 -1
  168. package/dist/hivr-whitelist.js +0 -95
  169. package/dist/hivr-whitelist.js.map +0 -1
  170. package/dist/http-server-minimal.d.ts +0 -7
  171. package/dist/http-server-minimal.d.ts.map +0 -1
  172. package/dist/http-server-minimal.js +0 -126
  173. package/dist/http-server-minimal.js.map +0 -1
  174. package/dist/product-whitelist.d.ts +0 -37
  175. package/dist/product-whitelist.d.ts.map +0 -1
  176. package/dist/product-whitelist.js +0 -203
  177. package/dist/product-whitelist.js.map +0 -1
  178. package/dist/src/analytics.js +0 -129
  179. package/dist/src/bin.js +0 -17
  180. package/dist/src/capability-router.js +0 -240
  181. package/dist/src/chainExecutor.js +0 -451
  182. package/dist/src/chainResolver.js +0 -518
  183. package/dist/src/cli/commands/doctor.js +0 -324
  184. package/dist/src/cli/commands/mcp-install.js +0 -255
  185. package/dist/src/cli/commands/restore.js +0 -259
  186. package/dist/src/cli/commands/setup.js +0 -205
  187. package/dist/src/cli/commands/uninstall.js +0 -188
  188. package/dist/src/cli/index.js +0 -111
  189. package/dist/src/cli.js +0 -302
  190. package/dist/src/confirmation.js +0 -240
  191. package/dist/src/credentials.js +0 -357
  192. package/dist/src/credits.js +0 -260
  193. package/dist/src/crypto.js +0 -66
  194. package/dist/src/discovery.js +0 -504
  195. package/dist/src/enterprise/env.js +0 -123
  196. package/dist/src/enterprise/script-generator.js +0 -460
  197. package/dist/src/execute-dynamic.js +0 -473
  198. package/dist/src/execute.js +0 -1727
  199. package/dist/src/index.js +0 -2062
  200. package/dist/src/metered.js +0 -80
  201. package/dist/src/open-apis.js +0 -276
  202. package/dist/src/proxy.js +0 -28
  203. package/dist/src/session.js +0 -86
  204. package/dist/src/stripe.js +0 -407
  205. package/dist/src/telemetry.js +0 -49
  206. package/dist/src/types.js +0 -2
  207. package/dist/src/utils/backup.js +0 -181
  208. package/dist/src/utils/config.js +0 -220
  209. package/dist/src/utils/os.js +0 -105
  210. package/dist/src/utils/paths.js +0 -159
  211. package/landing/pages/api/discover.ts +0 -43
  212. package/landing/pages/api/health.ts +0 -20
  213. package/scripts/test-whitelist-v2.sh +0 -128
  214. package/src/access-control.ts +0 -174
  215. package/src/hivr-whitelist.ts +0 -110
  216. package/src/http-server-minimal.ts +0 -154
  217. package/src/product-whitelist.ts +0 -246
  218. package/test-actual-handlers.ts +0 -92
  219. package/test-apilayer-all-14.ts +0 -249
  220. package/test-apilayer-fixed.ts +0 -248
  221. package/test-direct-endpoints.ts +0 -174
  222. package/test-exact-endpoints.ts +0 -144
  223. package/test-final.ts +0 -83
  224. package/test-full-routing.ts +0 -100
  225. package/test-handlers-correct.ts +0 -217
  226. package/test-numverify-key.ts +0 -41
  227. package/test-via-handlers.ts +0 -92
  228. package/test-worldnews.mjs +0 -26
@@ -7,7 +7,6 @@
7
7
  import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
8
8
  import { dirname, join } from 'path';
9
9
  import { platform, homedir } from 'os';
10
- import { execSync } from 'child_process';
11
10
  import chalk from 'chalk';
12
11
 
13
12
  export interface MCPInstallOptions {
@@ -75,15 +74,6 @@ function getClientConfigs(): ClientConfig[] {
75
74
  return join(home, '.claude.json');
76
75
  },
77
76
  },
78
- {
79
- name: 'codex',
80
- displayName: 'Codex (OpenAI)',
81
- configKey: 'mcp',
82
- getConfigPath: () => {
83
- // Codex uses ~/.codex/config.toml
84
- return join(home, '.codex', 'config.toml');
85
- },
86
- },
87
77
  ];
88
78
 
89
79
  return clients;
@@ -148,62 +138,10 @@ function writeConfig(path: string, config: any, createBackup = true): { success:
148
138
  }
149
139
  }
150
140
 
151
- /**
152
- * Check if Codex CLI is available
153
- */
154
- function isCodexAvailable(): boolean {
155
- try {
156
- execSync('codex --version', { stdio: 'pipe' });
157
- return true;
158
- } catch {
159
- return false;
160
- }
161
- }
162
-
163
- /**
164
- * Install APIClaw to Codex using CLI
165
- */
166
- function installToCodex(dryRun: boolean): { success: boolean; message: string; skipped?: boolean } {
167
- if (!isCodexAvailable()) {
168
- return { success: false, message: 'Codex CLI not found' };
169
- }
170
-
171
- try {
172
- // Check if already installed
173
- try {
174
- const output = execSync('codex mcp get apiclaw', { encoding: 'utf-8', stdio: 'pipe' });
175
- if (output.includes('apiclaw')) {
176
- return { success: true, message: 'Already installed', skipped: true };
177
- }
178
- } catch {
179
- // Not installed, continue
180
- }
181
-
182
- if (dryRun) {
183
- console.log(chalk.cyan('\n Would run: codex mcp add apiclaw -- npx -y @nordsym/apiclaw'));
184
- return { success: true, message: 'Dry run - no changes made', skipped: true };
185
- }
186
-
187
- // Install
188
- execSync('codex mcp add apiclaw -- npx -y @nordsym/apiclaw', { stdio: 'pipe' });
189
- return { success: true, message: 'Installed via CLI' };
190
- } catch (error) {
191
- return {
192
- success: false,
193
- message: error instanceof Error ? error.message : 'Unknown error'
194
- };
195
- }
196
- }
197
-
198
141
  /**
199
142
  * Install APIClaw into a client config
200
143
  */
201
144
  function installToClient(client: ClientConfig, dryRun: boolean): { success: boolean; message: string; skipped?: boolean } {
202
- // Special handling for Codex
203
- if (client.name === 'codex') {
204
- return installToCodex(dryRun);
205
- }
206
-
207
145
  const configPath = client.getConfigPath();
208
146
 
209
147
  // Read existing config
@@ -269,14 +207,12 @@ export async function mcpInstallCommand(options: MCPInstallOptions): Promise<voi
269
207
  'code': 'claude-code',
270
208
  'claude-code': 'claude-code',
271
209
  'claudecode': 'claude-code',
272
- 'codex': 'codex',
273
- 'openai': 'codex',
274
210
  };
275
211
 
276
212
  const targetName = aliases[normalizedClient];
277
213
  if (!targetName) {
278
214
  console.log(chalk.red(`❌ Unknown client: ${options.client}`));
279
- console.log(' Supported: claude-desktop, claude-code, codex');
215
+ console.log(' Supported: claude-desktop, claude-code');
280
216
  process.exit(1);
281
217
  }
282
218
 
@@ -288,17 +224,9 @@ export async function mcpInstallCommand(options: MCPInstallOptions): Promise<voi
288
224
 
289
225
  const detectedClients: ClientConfig[] = [];
290
226
  for (const client of targetClients) {
291
- let exists = false;
292
-
293
- // Special detection for Codex (check CLI availability)
294
- if (client.name === 'codex') {
295
- exists = isCodexAvailable();
296
- } else {
297
- // For JSON-based configs, check file/dir existence
298
- const configPath = client.getConfigPath();
299
- const configDir = dirname(configPath);
300
- exists = existsSync(configPath) || existsSync(configDir);
301
- }
227
+ const configPath = client.getConfigPath();
228
+ const configDir = dirname(configPath);
229
+ const exists = existsSync(configPath) || existsSync(configDir);
302
230
 
303
231
  const icon = exists ? chalk.green('✓') : chalk.gray('✗');
304
232
  const status = exists ? 'found' : 'not found';
@@ -347,23 +275,13 @@ export async function mcpInstallCommand(options: MCPInstallOptions): Promise<voi
347
275
  console.log(chalk.cyan('\n✅ Dry run complete! Run without --dry-run to apply changes.\n'));
348
276
  } else if (successCount > 0) {
349
277
  console.log(chalk.green('\n✅ APIClaw installed successfully!\n'));
350
- console.log(chalk.bold('What you get:\n'));
351
- console.log(chalk.cyan(' 🔍 Search') + ' 22,000+ APIs to discover');
352
- console.log(chalk.cyan(' 🌐 Open APIs') + ' 1,600 free APIs');
353
- console.log(chalk.cyan(' 🔑 Direct Call') + ' 1,500+ premium (APIClaw manages keys)');
278
+ console.log('Next steps:');
279
+ console.log(' 1. Restart your MCP client (Claude Desktop/Code)');
280
+ console.log(' 2. Ask: "List available APIs"');
354
281
  console.log('');
355
- console.log('Next:');
356
- console.log(' 1. Restart your MCP client');
357
- console.log(' 2. Try: "Find weather APIs"');
358
- console.log('');
359
- console.log('Docs: https://apiclaw.com/docs\n');
282
+ console.log('Need help? https://apiclaw.com/docs\n');
360
283
  } else {
361
284
  console.log(chalk.yellow('\n✅ APIClaw already installed in all clients.\n'));
362
- console.log(chalk.bold('What you have:\n'));
363
- console.log(chalk.cyan(' 🔍 Search') + ' 22,000+ APIs to discover');
364
- console.log(chalk.cyan(' 🌐 Open APIs') + ' 1,600 free APIs');
365
- console.log(chalk.cyan(' 🔑 Direct Call') + ' 1,500+ premium (APIClaw manages keys)');
366
- console.log('');
367
285
  console.log('Run with --force to reinstall (coming soon).\n');
368
286
  }
369
287
  } else {
package/src/cli/index.ts CHANGED
@@ -107,14 +107,6 @@ program
107
107
  .option('-f, --force', 'Remove even if not configured')
108
108
  .action(uninstallCommand);
109
109
 
110
- // MCP Uninstall alias - same as uninstall but for consistency with mcp-install
111
- program
112
- .command('mcp-uninstall')
113
- .description('Remove APIClaw from Claude Desktop or Claude Code MCP config')
114
- .option('-c, --client <client>', 'Target specific client (claude-desktop, claude-code)')
115
- .option('--dry-run', 'Show what would be done without making changes')
116
- .action(uninstallCommand);
117
-
118
110
  // Parse and execute
119
111
  program.parse();
120
112
 
@@ -196,49 +196,37 @@ const providers: Record<string, ProviderCredential> = {
196
196
  },
197
197
  },
198
198
 
199
- deepgram: {
200
- type: 'bearer',
201
- get(): APICredentials | null {
202
- const env = loadEnvFile('deepgram.env');
203
- const key = env.DEEPGRAM_API_KEY || process.env.DEEPGRAM_API_KEY;
204
- if (key) {
205
- return { type: 'bearer', api_key: key };
206
- }
207
- return null;
208
- },
209
- },
210
-
211
199
  mistral: {
212
- type: 'api_key',
200
+ type: 'bearer',
213
201
  get(): APICredentials | null {
214
202
  const env = loadEnvFile('mistral.env');
215
203
  const key = env.MISTRAL_API_KEY || process.env.MISTRAL_API_KEY;
216
204
  if (key) {
217
- return { type: 'api_key', api_key: key };
205
+ return { type: 'bearer', api_key: key };
218
206
  }
219
207
  return null;
220
208
  },
221
209
  },
222
210
 
223
211
  cohere: {
224
- type: 'api_key',
212
+ type: 'bearer',
225
213
  get(): APICredentials | null {
226
214
  const env = loadEnvFile('cohere.env');
227
215
  const key = env.COHERE_API_KEY || process.env.COHERE_API_KEY;
228
216
  if (key) {
229
- return { type: 'api_key', api_key: key };
217
+ return { type: 'bearer', api_key: key };
230
218
  }
231
219
  return null;
232
220
  },
233
221
  },
234
222
 
235
- serper: {
236
- type: 'api_key',
223
+ together: {
224
+ type: 'bearer',
237
225
  get(): APICredentials | null {
238
- const env = loadEnvFile('serpapi.env');
239
- const key = env.SERPAPI_API_KEY || process.env.SERPER_API_KEY || process.env.SERPAPI_API_KEY;
226
+ const env = loadEnvFile('together.env');
227
+ const key = env.TOGETHER_API_KEY || process.env.TOGETHER_API_KEY;
240
228
  if (key) {
241
- return { type: 'api_key', api_key: key };
229
+ return { type: 'bearer', api_key: key };
242
230
  }
243
231
  return null;
244
232
  },
@@ -256,13 +244,13 @@ const providers: Record<string, ProviderCredential> = {
256
244
  },
257
245
  },
258
246
 
259
- together: {
260
- type: 'bearer',
247
+ deepgram: {
248
+ type: 'api_key',
261
249
  get(): APICredentials | null {
262
- const env = loadEnvFile('together.env');
263
- const key = env.TOGETHER_API_KEY || process.env.TOGETHER_API_KEY;
250
+ const env = loadEnvFile('deepgram.env');
251
+ const key = env.DEEPGRAM_API_KEY || process.env.DEEPGRAM_API_KEY;
264
252
  if (key) {
265
- return { type: 'bearer', api_key: key };
253
+ return { type: 'api_key', api_key: key };
266
254
  }
267
255
  return null;
268
256
  },
@@ -279,6 +267,20 @@ const providers: Record<string, ProviderCredential> = {
279
267
  return null;
280
268
  },
281
269
  },
270
+
271
+ serper: {
272
+ type: 'api_key',
273
+ get(): APICredentials | null {
274
+ // Note: local file is serpapi.env for historical reasons
275
+ const env = loadEnvFile('serper.env');
276
+ const envAlt = loadEnvFile('serpapi.env');
277
+ const key = env.SERPER_API_KEY || envAlt.SERPAPI_API_KEY || envAlt.SERPER_API_KEY || process.env.SERPER_API_KEY;
278
+ if (key) {
279
+ return { type: 'api_key', api_key: key };
280
+ }
281
+ return null;
282
+ },
283
+ },
282
284
  };
283
285
 
284
286
  /**
@@ -327,14 +329,6 @@ export function hasRealCredentials(providerId: string): boolean {
327
329
  const env = loadEnvFile('e2b.env');
328
330
  return !!(env.E2B_API_KEY || process.env.E2B_API_KEY);
329
331
  }
330
- if (providerId === 'firecrawl') {
331
- const env = loadEnvFile('firecrawl.env');
332
- return !!(env.FIRECRAWL_API_KEY || process.env.FIRECRAWL_API_KEY);
333
- }
334
- if (providerId === 'github') {
335
- const env = loadEnvFile('github.env');
336
- return !!(env.GITHUB_TOKEN || process.env.GITHUB_TOKEN);
337
- }
338
332
  if (providerId === 'apilayer') {
339
333
  const env = loadEnvFile('apilayer.env');
340
334
  return !!(env.APILAYER_EXCHANGERATE_KEY || process.env.APILAYER_EXCHANGERATE_KEY);
@@ -343,10 +337,6 @@ export function hasRealCredentials(providerId: string): boolean {
343
337
  const env = loadEnvFile('groq.env');
344
338
  return !!(env.GROQ_API_KEY || process.env.GROQ_API_KEY);
345
339
  }
346
- if (providerId === 'deepgram') {
347
- const env = loadEnvFile('deepgram.env');
348
- return !!(env.DEEPGRAM_API_KEY || process.env.DEEPGRAM_API_KEY);
349
- }
350
340
  if (providerId === 'mistral') {
351
341
  const env = loadEnvFile('mistral.env');
352
342
  return !!(env.MISTRAL_API_KEY || process.env.MISTRAL_API_KEY);
@@ -355,22 +345,27 @@ export function hasRealCredentials(providerId: string): boolean {
355
345
  const env = loadEnvFile('cohere.env');
356
346
  return !!(env.COHERE_API_KEY || process.env.COHERE_API_KEY);
357
347
  }
358
- if (providerId === 'serper') {
359
- const env = loadEnvFile('serpapi.env');
360
- return !!(env.SERPAPI_API_KEY || process.env.SERPER_API_KEY || process.env.SERPAPI_API_KEY);
348
+ if (providerId === 'together') {
349
+ const env = loadEnvFile('together.env');
350
+ return !!(env.TOGETHER_API_KEY || process.env.TOGETHER_API_KEY);
361
351
  }
362
352
  if (providerId === 'stability') {
363
353
  const env = loadEnvFile('stability.env');
364
354
  return !!(env.STABILITY_API_KEY || process.env.STABILITY_API_KEY);
365
355
  }
366
- if (providerId === 'together') {
367
- const env = loadEnvFile('together.env');
368
- return !!(env.TOGETHER_API_KEY || process.env.TOGETHER_API_KEY);
356
+ if (providerId === 'deepgram') {
357
+ const env = loadEnvFile('deepgram.env');
358
+ return !!(env.DEEPGRAM_API_KEY || process.env.DEEPGRAM_API_KEY);
369
359
  }
370
360
  if (providerId === 'assemblyai') {
371
361
  const env = loadEnvFile('assemblyai.env');
372
362
  return !!(env.ASSEMBLYAI_API_KEY || process.env.ASSEMBLYAI_API_KEY);
373
363
  }
364
+ if (providerId === 'serper') {
365
+ const env = loadEnvFile('serper.env');
366
+ const envAlt = loadEnvFile('serpapi.env');
367
+ return !!(env.SERPER_API_KEY || envAlt.SERPAPI_API_KEY || envAlt.SERPER_API_KEY || process.env.SERPER_API_KEY);
368
+ }
374
369
  return false;
375
370
  }
376
371
 
package/src/discovery.ts CHANGED
@@ -17,13 +17,73 @@ const apisData = JSON.parse(
17
17
  const apis: APIProvider[] = apisData.apis;
18
18
 
19
19
  // Direct Call provider specs (hardcoded handlers with params)
20
- // Ordered: AI-first (models, LLM routing, audio), then infrastructure (code, web, search, email, SMS)
21
20
  const DIRECT_CALL_SPECS: Record<string, {
22
21
  description: string;
23
22
  auth: string;
24
23
  docs: string;
25
24
  actions: Record<string, { params: { name: string; required: boolean; desc: string }[]; desc: string }>;
26
25
  }> = {
26
+ '46elks': {
27
+ description: 'Swedish SMS and voice API',
28
+ auth: 'basic',
29
+ docs: 'https://46elks.com/docs',
30
+ actions: {
31
+ send_sms: {
32
+ desc: 'Send SMS message',
33
+ params: [
34
+ { name: 'to', required: true, desc: 'Phone number (+46...)' },
35
+ { name: 'message', required: true, desc: 'SMS text (max 160 chars for 1 segment)' },
36
+ { name: 'from', required: false, desc: 'Sender ID (default: APIClaw)' },
37
+ ],
38
+ },
39
+ },
40
+ },
41
+ twilio: {
42
+ description: 'Global SMS and voice API',
43
+ auth: 'basic',
44
+ docs: 'https://www.twilio.com/docs',
45
+ actions: {
46
+ send_sms: {
47
+ desc: 'Send SMS message',
48
+ params: [
49
+ { name: 'to', required: true, desc: 'Phone number (E.164 format)' },
50
+ { name: 'message', required: true, desc: 'SMS text' },
51
+ { name: 'from', required: false, desc: 'Sender phone number' },
52
+ ],
53
+ },
54
+ },
55
+ },
56
+ brave_search: {
57
+ description: 'Web search API',
58
+ auth: 'api_key',
59
+ docs: 'https://api.search.brave.com/docs',
60
+ actions: {
61
+ search: {
62
+ desc: 'Search the web',
63
+ params: [
64
+ { name: 'query', required: true, desc: 'Search query' },
65
+ { name: 'count', required: false, desc: 'Number of results (default: 5)' },
66
+ ],
67
+ },
68
+ },
69
+ },
70
+ resend: {
71
+ description: 'Email API',
72
+ auth: 'bearer',
73
+ docs: 'https://resend.com/docs',
74
+ actions: {
75
+ send_email: {
76
+ desc: 'Send email',
77
+ params: [
78
+ { name: 'to', required: true, desc: 'Recipient email' },
79
+ { name: 'subject', required: true, desc: 'Email subject' },
80
+ { name: 'html', required: false, desc: 'HTML body' },
81
+ { name: 'text', required: false, desc: 'Plain text body' },
82
+ { name: 'from', required: false, desc: 'Sender (default: noreply@apiclaw.nordsym.com)' },
83
+ ],
84
+ },
85
+ },
86
+ },
27
87
  openrouter: {
28
88
  description: 'LLM routing (100+ models)',
29
89
  auth: 'bearer',
@@ -39,24 +99,6 @@ const DIRECT_CALL_SPECS: Record<string, {
39
99
  },
40
100
  },
41
101
  },
42
- replicate: {
43
- description: 'Run any AI model (images, video, audio)',
44
- auth: 'bearer',
45
- docs: 'https://replicate.com/docs',
46
- actions: {
47
- run: {
48
- desc: 'Run a model',
49
- params: [
50
- { name: 'model', required: true, desc: 'Model ID (e.g., stability-ai/sdxl:...)' },
51
- { name: 'input', required: true, desc: 'Model input parameters' },
52
- ],
53
- },
54
- list_models: {
55
- desc: 'List available models',
56
- params: [],
57
- },
58
- },
59
- },
60
102
  elevenlabs: {
61
103
  description: 'Text-to-speech',
62
104
  auth: 'api_key',
@@ -72,23 +114,21 @@ const DIRECT_CALL_SPECS: Record<string, {
72
114
  },
73
115
  },
74
116
  },
75
- e2b: {
76
- description: 'Code sandbox for AI agents',
77
- auth: 'api_key',
78
- docs: 'https://e2b.dev/docs',
117
+ replicate: {
118
+ description: 'Run any AI model (images, video, audio)',
119
+ auth: 'bearer',
120
+ docs: 'https://replicate.com/docs',
79
121
  actions: {
80
- run_code: {
81
- desc: 'Execute code in sandbox',
122
+ run: {
123
+ desc: 'Run a model',
82
124
  params: [
83
- { name: 'code', required: true, desc: 'Code to run' },
84
- { name: 'language', required: false, desc: 'Language (default: python)' },
125
+ { name: 'model', required: true, desc: 'Model ID (e.g., stability-ai/sdxl:...)' },
126
+ { name: 'input', required: true, desc: 'Model input parameters' },
85
127
  ],
86
128
  },
87
- run_shell: {
88
- desc: 'Execute shell command',
89
- params: [
90
- { name: 'command', required: true, desc: 'Shell command' },
91
- ],
129
+ list_models: {
130
+ desc: 'List available models',
131
+ params: [],
92
132
  },
93
133
  },
94
134
  },
@@ -166,171 +206,22 @@ const DIRECT_CALL_SPECS: Record<string, {
166
206
  },
167
207
  },
168
208
  },
169
- brave_search: {
170
- description: 'Web search API',
171
- auth: 'api_key',
172
- docs: 'https://api.search.brave.com/docs',
173
- actions: {
174
- search: {
175
- desc: 'Search the web',
176
- params: [
177
- { name: 'query', required: true, desc: 'Search query' },
178
- { name: 'count', required: false, desc: 'Number of results (default: 5)' },
179
- ],
180
- },
181
- },
182
- },
183
- resend: {
184
- description: 'Email API',
185
- auth: 'bearer',
186
- docs: 'https://resend.com/docs',
187
- actions: {
188
- send_email: {
189
- desc: 'Send email',
190
- params: [
191
- { name: 'to', required: true, desc: 'Recipient email' },
192
- { name: 'subject', required: true, desc: 'Email subject' },
193
- { name: 'html', required: false, desc: 'HTML body' },
194
- { name: 'text', required: false, desc: 'Plain text body' },
195
- { name: 'from', required: false, desc: 'Sender (default: noreply@apiclaw.nordsym.com)' },
196
- ],
197
- },
198
- },
199
- },
200
- '46elks': {
201
- description: 'Swedish SMS and voice API',
202
- auth: 'basic',
203
- docs: 'https://46elks.com/docs',
204
- actions: {
205
- send_sms: {
206
- desc: 'Send SMS message',
207
- params: [
208
- { name: 'to', required: true, desc: 'Phone number (+46...)' },
209
- { name: 'message', required: true, desc: 'SMS text (max 160 chars for 1 segment)' },
210
- { name: 'from', required: false, desc: 'Sender ID (default: APIClaw)' },
211
- ],
212
- },
213
- },
214
- },
215
- twilio: {
216
- description: 'Global SMS and voice API',
217
- auth: 'basic',
218
- docs: 'https://www.twilio.com/docs',
219
- actions: {
220
- send_sms: {
221
- desc: 'Send SMS message',
222
- params: [
223
- { name: 'to', required: true, desc: 'Phone number (E.164 format)' },
224
- { name: 'message', required: true, desc: 'SMS text' },
225
- { name: 'from', required: false, desc: 'Sender phone number' },
226
- ],
227
- },
228
- },
229
- },
230
- apilayer: {
231
- description: 'APILayer marketplace — currency, news, scraping, PDFs, verification & more',
209
+ e2b: {
210
+ description: 'Code sandbox for AI agents',
232
211
  auth: 'api_key',
233
- docs: 'https://apilayer.com',
212
+ docs: 'https://e2b.dev/docs',
234
213
  actions: {
235
- exchange_rates: {
236
- desc: 'Get live or historical currency exchange rates',
237
- params: [
238
- { name: 'base', required: false, desc: 'Base currency (default: USD)' },
239
- { name: 'symbols', required: false, desc: 'Comma-separated target currencies' },
240
- { name: 'date', required: false, desc: 'Historical date YYYY-MM-DD (omit for live)' },
241
- ],
242
- },
243
- market_data: {
244
- desc: 'End-of-day stock market data',
245
- params: [
246
- { name: 'symbols', required: true, desc: 'Stock ticker(s), comma-separated e.g. AAPL,MSFT' },
247
- { name: 'date_from', required: false, desc: 'Start date YYYY-MM-DD' },
248
- { name: 'date_to', required: false, desc: 'End date YYYY-MM-DD' },
249
- ],
250
- },
251
- aviation: {
252
- desc: 'Real-time flight data and tracking',
253
- params: [
254
- { name: 'flight_iata', required: false, desc: 'IATA flight number e.g. AA100' },
255
- { name: 'dep_iata', required: false, desc: 'Departure airport IATA code' },
256
- { name: 'arr_iata', required: false, desc: 'Arrival airport IATA code' },
257
- ],
258
- },
259
- pdf_generate: {
260
- desc: 'Generate PDF from URL or HTML',
261
- params: [
262
- { name: 'document_url', required: false, desc: 'URL to convert to PDF' },
263
- { name: 'document_html', required: false, desc: 'HTML string to convert (alternative to URL)' },
264
- { name: 'page_size', required: false, desc: 'Page size: A4, Letter, etc (default: A4)' },
265
- ],
266
- },
267
- screenshot: {
268
- desc: 'Capture full-page screenshot of any URL',
269
- params: [
270
- { name: 'url', required: true, desc: 'URL to screenshot' },
271
- { name: 'viewport', required: false, desc: 'Viewport size e.g. 1440x900 (default)' },
272
- { name: 'fullpage', required: false, desc: '1 for full page, 0 for viewport only (default: 0)' },
273
- ],
274
- },
275
- verify_email: {
276
- desc: 'Validate email address format and deliverability',
277
- params: [
278
- { name: 'email', required: true, desc: 'Email address to verify' },
279
- ],
280
- },
281
- verify_number: {
282
- desc: 'Validate and lookup phone number details',
283
- params: [
284
- { name: 'number', required: true, desc: 'Phone number in E.164 format e.g. +46701234567' },
285
- ],
286
- },
287
- vat_check: {
288
- desc: 'Validate EU VAT number',
289
- params: [
290
- { name: 'vat_number', required: true, desc: 'EU VAT number e.g. SE556012345601' },
291
- ],
292
- },
293
- world_news: {
294
- desc: 'Extract and analyze news articles from a URL',
295
- params: [
296
- { name: 'url', required: true, desc: 'URL of the news article to analyze' },
297
- { name: 'analyze', required: false, desc: 'Whether to analyze the news (default: true)' },
298
- ],
299
- },
300
- finance_news: {
301
- desc: 'Latest financial and stock market news',
302
- params: [
303
- { name: 'tickers', required: false, desc: 'Stock tickers comma-separated e.g. AAPL,TSLA' },
304
- { name: 'text', required: false, desc: 'Keyword filter' },
305
- { name: 'number', required: false, desc: 'Number of results (default: 5)' },
306
- ],
307
- },
308
- scrape: {
309
- desc: 'Advanced web scraper — returns clean page content',
310
- params: [
311
- { name: 'url', required: true, desc: 'URL to scrape' },
312
- ],
313
- },
314
- image_crop: {
315
- desc: 'Smart crop an image to specified dimensions',
316
- params: [
317
- { name: 'url', required: true, desc: 'Image URL to crop' },
318
- { name: 'width', required: false, desc: 'Target width in pixels' },
319
- { name: 'height', required: false, desc: 'Target height in pixels' },
320
- ],
321
- },
322
- skills: {
323
- desc: 'Search 7000+ professional skills database',
214
+ run_code: {
215
+ desc: 'Execute code in sandbox',
324
216
  params: [
325
- { name: 'q', required: true, desc: 'Skill search query e.g. "machine learning"' },
326
- { name: 'count', required: false, desc: 'Number of results (default: 10)' },
217
+ { name: 'code', required: true, desc: 'Code to run' },
218
+ { name: 'language', required: false, desc: 'Language (default: python)' },
327
219
  ],
328
220
  },
329
- form_submit: {
330
- desc: 'Submit form data to a FormAPI endpoint',
221
+ run_shell: {
222
+ desc: 'Execute shell command',
331
223
  params: [
332
- { name: 'endpoint', required: true, desc: 'FormAPI endpoint path' },
333
- { name: 'data', required: false, desc: 'Form data object to submit' },
224
+ { name: 'command', required: true, desc: 'Shell command' },
334
225
  ],
335
226
  },
336
227
  },