@nordsym/apiclaw 2.1.0 → 2.2.1

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 (185) hide show
  1. package/README.md +15 -2
  2. package/dist/bin-http.js +0 -0
  3. package/dist/bin.bundled.js +79288 -0
  4. package/dist/funnel-client.d.ts +24 -0
  5. package/dist/funnel-client.d.ts.map +1 -0
  6. package/dist/funnel-client.js +131 -0
  7. package/dist/funnel-client.js.map +1 -0
  8. package/dist/funnel.test.d.ts +2 -0
  9. package/dist/funnel.test.d.ts.map +1 -0
  10. package/dist/funnel.test.js +145 -0
  11. package/dist/funnel.test.js.map +1 -0
  12. package/dist/gateway-client.d.ts.map +1 -1
  13. package/dist/gateway-client.js +24 -2
  14. package/dist/gateway-client.js.map +1 -1
  15. package/dist/index.bundled.js +61263 -0
  16. package/dist/index.js +161 -74
  17. package/dist/index.js.map +1 -1
  18. package/dist/postinstall.d.ts +0 -5
  19. package/dist/postinstall.d.ts.map +1 -1
  20. package/dist/postinstall.js +24 -3
  21. package/dist/postinstall.js.map +1 -1
  22. package/dist/registration-guard.d.ts +29 -0
  23. package/dist/registration-guard.d.ts.map +1 -0
  24. package/dist/registration-guard.js +87 -0
  25. package/dist/registration-guard.js.map +1 -0
  26. package/package.json +7 -2
  27. package/.claude/settings.local.json +0 -9
  28. package/.env.prod +0 -1
  29. package/apiclaw-README.md +0 -494
  30. package/convex/_generated/api.d.ts +0 -137
  31. package/convex/_generated/api.js +0 -23
  32. package/convex/_generated/dataModel.d.ts +0 -60
  33. package/convex/_generated/server.d.ts +0 -143
  34. package/convex/_generated/server.js +0 -93
  35. package/convex/adminActivate.ts +0 -53
  36. package/convex/adminStats.ts +0 -306
  37. package/convex/agents.ts +0 -939
  38. package/convex/analytics.ts +0 -187
  39. package/convex/apiKeys.ts +0 -220
  40. package/convex/backfillAnalytics.ts +0 -272
  41. package/convex/backfillSearchLogs.ts +0 -35
  42. package/convex/billing.ts +0 -834
  43. package/convex/capabilities.ts +0 -157
  44. package/convex/chains.ts +0 -1318
  45. package/convex/credits.ts +0 -211
  46. package/convex/crons.ts +0 -50
  47. package/convex/debugFilestackLogs.ts +0 -16
  48. package/convex/debugGetToken.ts +0 -18
  49. package/convex/directCall.ts +0 -713
  50. package/convex/earnProgress.ts +0 -753
  51. package/convex/email.ts +0 -329
  52. package/convex/feedback.ts +0 -265
  53. package/convex/http.ts +0 -3430
  54. package/convex/inbound.ts +0 -32
  55. package/convex/logs.ts +0 -701
  56. package/convex/migrateFilestack.ts +0 -81
  57. package/convex/migratePartnersProd.ts +0 -174
  58. package/convex/migratePratham.ts +0 -126
  59. package/convex/migrateProviderWorkspaces.ts +0 -175
  60. package/convex/mou.ts +0 -91
  61. package/convex/providerKeys.ts +0 -289
  62. package/convex/providers.ts +0 -1135
  63. package/convex/purchases.ts +0 -183
  64. package/convex/ratelimit.ts +0 -104
  65. package/convex/schema.ts +0 -869
  66. package/convex/searchLogs.ts +0 -265
  67. package/convex/seedAPILayerAPIs.ts +0 -191
  68. package/convex/seedDirectCallConfigs.ts +0 -336
  69. package/convex/seedPratham.ts +0 -149
  70. package/convex/spendAlerts.ts +0 -442
  71. package/convex/stripeActions.ts +0 -607
  72. package/convex/teams.ts +0 -243
  73. package/convex/telemetry.ts +0 -81
  74. package/convex/tsconfig.json +0 -25
  75. package/convex/updateAPIStatus.ts +0 -44
  76. package/convex/usage.ts +0 -260
  77. package/convex/usageReports.ts +0 -357
  78. package/convex/waitlist.ts +0 -55
  79. package/convex/webhooks.ts +0 -494
  80. package/convex/workspaceSettings.ts +0 -143
  81. package/convex/workspaces.ts +0 -1331
  82. package/convex.json +0 -3
  83. package/direct-test.mjs +0 -51
  84. package/email-templates/filestack-provider-outreach.html +0 -162
  85. package/email-templates/partnership-template.html +0 -116
  86. package/email-templates/pratham-draft-preview.txt +0 -57
  87. package/email-templates/pratham-partnership-draft.html +0 -141
  88. package/reports/APIClaw-Session-Report-2026-04-05.pdf +0 -0
  89. package/reports/pipeline/PIPELINE-REPORT.json +0 -153
  90. package/reports/pipeline/acquire_apisguru.json +0 -17
  91. package/reports/pipeline/capabilities.json +0 -38
  92. package/reports/pipeline/discover_azure_recursive.json +0 -1551
  93. package/reports/pipeline/discover_github.json +0 -25
  94. package/reports/pipeline/discover_github_repos.json +0 -49
  95. package/reports/pipeline/discover_swaggerhub.json +0 -24
  96. package/reports/pipeline/discover_well_known.json +0 -23
  97. package/reports/pipeline/fetch_specs.json +0 -19
  98. package/reports/pipeline/generate_providers.json +0 -14
  99. package/reports/pipeline/match_registry.json +0 -11
  100. package/reports/pipeline/parse_specs.json +0 -17
  101. package/reports/pipeline/promote_candidates.json +0 -34
  102. package/reports/pipeline/validate.json +0 -30
  103. package/reports/pipeline/validate_smoke_details.json +0 -3835
  104. package/reports/session-report-2026-04-05.html +0 -433
  105. package/seed-apis-direct.mjs +0 -106
  106. package/src/access-control.ts +0 -174
  107. package/src/adapters/base.ts +0 -364
  108. package/src/adapters/claude-desktop.ts +0 -41
  109. package/src/adapters/cline.ts +0 -88
  110. package/src/adapters/continue.ts +0 -91
  111. package/src/adapters/cursor.ts +0 -43
  112. package/src/adapters/custom.ts +0 -188
  113. package/src/adapters/detect.ts +0 -202
  114. package/src/adapters/index.ts +0 -47
  115. package/src/adapters/windsurf.ts +0 -44
  116. package/src/bin-http.ts +0 -45
  117. package/src/bin.ts +0 -34
  118. package/src/capability-router.ts +0 -331
  119. package/src/chainExecutor.ts +0 -730
  120. package/src/chainResolver.test.ts +0 -246
  121. package/src/chainResolver.ts +0 -658
  122. package/src/cli/commands/demo.ts +0 -109
  123. package/src/cli/commands/doctor.ts +0 -435
  124. package/src/cli/commands/index.ts +0 -9
  125. package/src/cli/commands/login.ts +0 -203
  126. package/src/cli/commands/mcp-install.ts +0 -373
  127. package/src/cli/commands/restore.ts +0 -333
  128. package/src/cli/commands/setup.ts +0 -297
  129. package/src/cli/commands/uninstall.ts +0 -240
  130. package/src/cli/index.ts +0 -148
  131. package/src/cli.ts +0 -370
  132. package/src/confirmation.ts +0 -296
  133. package/src/credentials.ts +0 -455
  134. package/src/credits.ts +0 -329
  135. package/src/crypto.ts +0 -75
  136. package/src/discovery.ts +0 -568
  137. package/src/enterprise/env.ts +0 -156
  138. package/src/enterprise/index.ts +0 -7
  139. package/src/enterprise/script-generator.ts +0 -481
  140. package/src/execute-dynamic.ts +0 -617
  141. package/src/execute.ts +0 -2386
  142. package/src/gateway-client.ts +0 -192
  143. package/src/hivr-whitelist.ts +0 -110
  144. package/src/http-api.ts +0 -286
  145. package/src/http-server-minimal.ts +0 -154
  146. package/src/index.ts +0 -2611
  147. package/src/intelligent-gateway.ts +0 -339
  148. package/src/mcp-analytics.ts +0 -156
  149. package/src/metered.ts +0 -149
  150. package/src/open-apis-generated.ts +0 -157
  151. package/src/open-apis.ts +0 -558
  152. package/src/postinstall.ts +0 -18
  153. package/src/product-whitelist.ts +0 -246
  154. package/src/proxy.ts +0 -36
  155. package/src/session.ts +0 -129
  156. package/src/stripe.ts +0 -497
  157. package/src/telemetry.ts +0 -71
  158. package/src/test.ts +0 -135
  159. package/src/types/convex-api.d.ts +0 -20
  160. package/src/types/convex-api.ts +0 -21
  161. package/src/types.ts +0 -109
  162. package/src/ui/colors.ts +0 -219
  163. package/src/ui/errors.ts +0 -394
  164. package/src/ui/index.ts +0 -17
  165. package/src/ui/prompts.ts +0 -390
  166. package/src/ui/spinner.ts +0 -325
  167. package/src/utils/backup.ts +0 -224
  168. package/src/utils/config.ts +0 -318
  169. package/src/utils/os.ts +0 -124
  170. package/src/utils/paths.ts +0 -203
  171. package/src/webhook.ts +0 -107
  172. package/test-10-working.cjs +0 -97
  173. package/test-14-final.cjs +0 -96
  174. package/test-actual-handlers.ts +0 -92
  175. package/test-apilayer-all-14.ts +0 -249
  176. package/test-apilayer-fixed.ts +0 -248
  177. package/test-direct-endpoints.ts +0 -174
  178. package/test-exact-endpoints.ts +0 -144
  179. package/test-final.ts +0 -83
  180. package/test-full-routing.ts +0 -100
  181. package/test-handlers-correct.ts +0 -217
  182. package/test-numverify-key.ts +0 -41
  183. package/test-via-handlers.ts +0 -92
  184. package/test-worldnews.mjs +0 -26
  185. package/tsconfig.json +0 -20
@@ -1,455 +0,0 @@
1
- // Real credential providers for APIClaw Connected tier
2
- // Reads from environment variables or ~/.secrets/
3
-
4
- import { readFileSync, existsSync } from 'fs';
5
- import { join } from 'path';
6
- import { homedir } from 'os';
7
- import { APICredentials } from './types.js';
8
-
9
- interface ProviderCredential {
10
- type: 'basic' | 'api_key' | 'bearer';
11
- get(): APICredentials | null;
12
- }
13
-
14
- // Load env file helper
15
- function loadEnvFile(filename: string): Record<string, string> {
16
- const paths = [
17
- join(homedir(), '.secrets', filename),
18
- join(process.cwd(), filename),
19
- join(process.cwd(), '.env.local'),
20
- ];
21
-
22
- for (const path of paths) {
23
- if (existsSync(path)) {
24
- const content = readFileSync(path, 'utf-8');
25
- const vars: Record<string, string> = {};
26
- for (const line of content.split('\n')) {
27
- const match = line.match(/^([^=]+)=(.*)$/);
28
- if (match) {
29
- vars[match[1].trim()] = match[2].trim().replace(/^["']|["']$/g, '');
30
- }
31
- }
32
- return vars;
33
- }
34
- }
35
- return {};
36
- }
37
-
38
- // Provider credential getters
39
- const providers: Record<string, ProviderCredential> = {
40
- '46elks': {
41
- type: 'basic',
42
- get(): APICredentials | null {
43
- const env = loadEnvFile('46elks.env');
44
- const user = env.ELKS_API_USER || process.env.ELKS_API_USER;
45
- const pass = env.ELKS_API_PASSWORD || process.env.ELKS_API_PASSWORD;
46
-
47
- if (!user || !pass) return null;
48
-
49
- return {
50
- type: 'basic',
51
- username: user,
52
- password: pass,
53
- };
54
- },
55
- },
56
-
57
- twilio: {
58
- type: 'basic',
59
- get(): APICredentials | null {
60
- const env = loadEnvFile('twilio.env');
61
- const sid = env.TWILIO_ACCOUNT_SID || process.env.TWILIO_ACCOUNT_SID;
62
- const token = env.TWILIO_AUTH_TOKEN || process.env.TWILIO_AUTH_TOKEN;
63
-
64
- if (!sid || !token) return null;
65
-
66
- return {
67
- type: 'basic',
68
- username: sid,
69
- password: token,
70
- };
71
- },
72
- },
73
-
74
- // Real credential providers
75
- resend: {
76
- type: 'api_key',
77
- get(): APICredentials | null {
78
- const env = loadEnvFile('resend.env');
79
- const key = env.RESEND_API_KEY || process.env.RESEND_API_KEY;
80
- if (key) {
81
- return { type: 'api_key', api_key: key };
82
- }
83
- return null;
84
- },
85
- },
86
-
87
- brave_search: {
88
- type: 'api_key',
89
- get(): APICredentials | null {
90
- const env = loadEnvFile('brave.env');
91
- const key = env.BRAVE_API_KEY || process.env.BRAVE_API_KEY;
92
- if (key) {
93
- return { type: 'api_key', api_key: key };
94
- }
95
- return null;
96
- },
97
- },
98
-
99
- openrouter: {
100
- type: 'bearer',
101
- get(): APICredentials | null {
102
- const env = loadEnvFile('openrouter.env');
103
- const key = env.OPENROUTER_API_KEY || process.env.OPENROUTER_API_KEY;
104
- if (key) {
105
- return { type: 'bearer', api_key: key };
106
- }
107
- return null;
108
- },
109
- },
110
-
111
- elevenlabs: {
112
- type: 'api_key',
113
- get(): APICredentials | null {
114
- const env = loadEnvFile('elevenlabs.env');
115
- const key = env.ELEVENLABS_API_KEY || process.env.ELEVENLABS_API_KEY;
116
- if (key) {
117
- return { type: 'api_key', api_key: key };
118
- }
119
- return null;
120
- },
121
- },
122
-
123
- replicate: {
124
- type: 'bearer',
125
- get(): APICredentials | null {
126
- const env = loadEnvFile('replicate.env');
127
- const key = env.REPLICATE_API_TOKEN || process.env.REPLICATE_API_TOKEN;
128
- if (key) {
129
- return { type: 'bearer', api_key: key };
130
- }
131
- return null;
132
- },
133
- },
134
-
135
- firecrawl: {
136
- type: 'bearer',
137
- get(): APICredentials | null {
138
- const env = loadEnvFile('firecrawl.env');
139
- const key = env.FIRECRAWL_API_KEY || process.env.FIRECRAWL_API_KEY;
140
- if (key) {
141
- return { type: 'bearer', api_key: key };
142
- }
143
- return null;
144
- },
145
- },
146
-
147
- github: {
148
- type: 'bearer',
149
- get(): APICredentials | null {
150
- const env = loadEnvFile('github.env');
151
- const key = env.GITHUB_TOKEN || process.env.GITHUB_TOKEN;
152
- if (key) {
153
- return { type: 'bearer', token: key };
154
- }
155
- return null;
156
- },
157
- },
158
-
159
- e2b: {
160
- type: 'api_key',
161
- get(): APICredentials | null {
162
- const env = loadEnvFile('e2b.env');
163
- const key = env.E2B_API_KEY || process.env.E2B_API_KEY;
164
- if (key) {
165
- return { type: 'api_key', api_key: key };
166
- }
167
- return null;
168
- },
169
- },
170
-
171
- apilayer: {
172
- type: 'api_key',
173
- get(): APICredentials | null {
174
- const env = loadEnvFile('apilayer.env');
175
- const legacy = loadEnvFile('apilayer-legacy.env');
176
-
177
- // Merge unified + legacy keys
178
- const keys: Record<string, string> = {};
179
-
180
- // Unified APILayer keys (APILAYER_*)
181
- for (const [k, v] of Object.entries(env)) {
182
- if (k.startsWith('APILAYER_') && v) {
183
- keys[k] = v;
184
- }
185
- }
186
-
187
- // Legacy keys (separate API domains)
188
- for (const [k, v] of Object.entries(legacy)) {
189
- if (v && k.endsWith('_API_KEY')) {
190
- keys[k] = v;
191
- }
192
- }
193
-
194
- if (Object.keys(keys).length === 0) return null;
195
- return { type: 'api_key', api_key: keys.APILAYER_EXCHANGERATE_KEY || '', ...keys } as any;
196
- },
197
- },
198
-
199
- groq: {
200
- type: 'bearer',
201
- get(): APICredentials | null {
202
- const env = loadEnvFile('groq.env');
203
- const key = env.GROQ_API_KEY || process.env.GROQ_API_KEY;
204
- if (key) {
205
- return { type: 'bearer', api_key: key };
206
- }
207
- return null;
208
- },
209
- },
210
-
211
- deepgram: {
212
- type: 'bearer',
213
- get(): APICredentials | null {
214
- const env = loadEnvFile('deepgram.env');
215
- const key = env.DEEPGRAM_API_KEY || process.env.DEEPGRAM_API_KEY;
216
- if (key) {
217
- return { type: 'bearer', api_key: key };
218
- }
219
- return null;
220
- },
221
- },
222
-
223
- mistral: {
224
- type: 'api_key',
225
- get(): APICredentials | null {
226
- const env = loadEnvFile('mistral.env');
227
- const key = env.MISTRAL_API_KEY || process.env.MISTRAL_API_KEY;
228
- if (key) {
229
- return { type: 'api_key', api_key: key };
230
- }
231
- return null;
232
- },
233
- },
234
-
235
- cohere: {
236
- type: 'api_key',
237
- get(): APICredentials | null {
238
- const env = loadEnvFile('cohere.env');
239
- const key = env.COHERE_API_KEY || process.env.COHERE_API_KEY;
240
- if (key) {
241
- return { type: 'api_key', api_key: key };
242
- }
243
- return null;
244
- },
245
- },
246
-
247
- serper: {
248
- type: 'api_key',
249
- get(): APICredentials | null {
250
- const env = loadEnvFile('serpapi.env');
251
- const key = env.SERPAPI_API_KEY || process.env.SERPER_API_KEY || process.env.SERPAPI_API_KEY;
252
- if (key) {
253
- return { type: 'api_key', api_key: key };
254
- }
255
- return null;
256
- },
257
- },
258
-
259
- stability: {
260
- type: 'api_key',
261
- get(): APICredentials | null {
262
- const env = loadEnvFile('stability.env');
263
- const key = env.STABILITY_API_KEY || process.env.STABILITY_API_KEY;
264
- if (key) {
265
- return { type: 'api_key', api_key: key };
266
- }
267
- return null;
268
- },
269
- },
270
-
271
- together: {
272
- type: 'bearer',
273
- get(): APICredentials | null {
274
- const env = loadEnvFile('together.env');
275
- const key = env.TOGETHER_API_KEY || process.env.TOGETHER_API_KEY;
276
- if (key) {
277
- return { type: 'bearer', api_key: key };
278
- }
279
- return null;
280
- },
281
- },
282
-
283
- assemblyai: {
284
- type: 'api_key',
285
- get(): APICredentials | null {
286
- const env = loadEnvFile('assemblyai.env');
287
- const key = env.ASSEMBLYAI_API_KEY || process.env.ASSEMBLYAI_API_KEY;
288
- if (key) {
289
- return { type: 'api_key', api_key: key };
290
- }
291
- return null;
292
- },
293
- },
294
-
295
- voyage: {
296
- type: 'bearer',
297
- get(): APICredentials | null {
298
- const env = loadEnvFile('voyage.env');
299
- const key = env.VOYAGE_API_KEY || process.env.VOYAGE_API_KEY;
300
- if (key) {
301
- return { type: 'bearer', api_key: key };
302
- }
303
- return null;
304
- },
305
- },
306
- };
307
-
308
- /**
309
- * Get real credentials for a provider
310
- * Returns null if provider not supported
311
- */
312
- export function getCredentials(providerId: string): APICredentials | null {
313
- const provider = providers[providerId];
314
- if (!provider) return null;
315
- return provider.get();
316
- }
317
-
318
- /**
319
- * Check if a provider has real (non-demo) credentials available
320
- */
321
- export function hasRealCredentials(providerId: string): boolean {
322
- if (providerId === '46elks') {
323
- const env = loadEnvFile('46elks.env');
324
- return !!(env.ELKS_API_USER || process.env.ELKS_API_USER);
325
- }
326
- if (providerId === 'twilio') {
327
- const env = loadEnvFile('twilio.env');
328
- return !!(env.TWILIO_ACCOUNT_SID || process.env.TWILIO_ACCOUNT_SID);
329
- }
330
- if (providerId === 'resend') {
331
- const env = loadEnvFile('resend.env');
332
- return !!(env.RESEND_API_KEY || process.env.RESEND_API_KEY);
333
- }
334
- if (providerId === 'brave_search') {
335
- const env = loadEnvFile('brave.env');
336
- return !!(env.BRAVE_API_KEY || process.env.BRAVE_API_KEY);
337
- }
338
- if (providerId === 'openrouter') {
339
- const env = loadEnvFile('openrouter.env');
340
- return !!(env.OPENROUTER_API_KEY || process.env.OPENROUTER_API_KEY);
341
- }
342
- if (providerId === 'elevenlabs') {
343
- const env = loadEnvFile('elevenlabs.env');
344
- return !!(env.ELEVENLABS_API_KEY || process.env.ELEVENLABS_API_KEY);
345
- }
346
- if (providerId === 'replicate') {
347
- const env = loadEnvFile('replicate.env');
348
- return !!(env.REPLICATE_API_TOKEN || process.env.REPLICATE_API_TOKEN);
349
- }
350
- if (providerId === 'e2b') {
351
- const env = loadEnvFile('e2b.env');
352
- return !!(env.E2B_API_KEY || process.env.E2B_API_KEY);
353
- }
354
- if (providerId === 'firecrawl') {
355
- const env = loadEnvFile('firecrawl.env');
356
- return !!(env.FIRECRAWL_API_KEY || process.env.FIRECRAWL_API_KEY);
357
- }
358
- if (providerId === 'github') {
359
- const env = loadEnvFile('github.env');
360
- return !!(env.GITHUB_TOKEN || process.env.GITHUB_TOKEN);
361
- }
362
- if (providerId === 'apilayer') {
363
- const env = loadEnvFile('apilayer.env');
364
- const legacy = loadEnvFile('apilayer-legacy.env');
365
- return !!(
366
- env.APILAYER_EXCHANGERATE_KEY ||
367
- process.env.APILAYER_EXCHANGERATE_KEY ||
368
- Object.keys(legacy).length > 0
369
- );
370
- }
371
- if (providerId === 'groq') {
372
- const env = loadEnvFile('groq.env');
373
- return !!(env.GROQ_API_KEY || process.env.GROQ_API_KEY);
374
- }
375
- if (providerId === 'mistral') {
376
- const env = loadEnvFile('mistral.env');
377
- return !!(env.MISTRAL_API_KEY || process.env.MISTRAL_API_KEY);
378
- }
379
- if (providerId === 'cohere') {
380
- const env = loadEnvFile('cohere.env');
381
- return !!(env.COHERE_API_KEY || process.env.COHERE_API_KEY);
382
- }
383
- if (providerId === 'together') {
384
- const env = loadEnvFile('together.env');
385
- return !!(env.TOGETHER_API_KEY || process.env.TOGETHER_API_KEY);
386
- }
387
- if (providerId === 'stability') {
388
- const env = loadEnvFile('stability.env');
389
- return !!(env.STABILITY_API_KEY || process.env.STABILITY_API_KEY);
390
- }
391
- if (providerId === 'deepgram') {
392
- const env = loadEnvFile('deepgram.env');
393
- return !!(env.DEEPGRAM_API_KEY || process.env.DEEPGRAM_API_KEY);
394
- }
395
- if (providerId === 'assemblyai') {
396
- const env = loadEnvFile('assemblyai.env');
397
- return !!(env.ASSEMBLYAI_API_KEY || process.env.ASSEMBLYAI_API_KEY);
398
- }
399
- if (providerId === 'voyage') {
400
- const env = loadEnvFile('voyage.env');
401
- return !!(env.VOYAGE_API_KEY || process.env.VOYAGE_API_KEY);
402
- }
403
- if (providerId === 'serper') {
404
- const env = loadEnvFile('serper.env');
405
- const envAlt = loadEnvFile('serpapi.env');
406
- return !!(env.SERPER_API_KEY || envAlt.SERPAPI_API_KEY || envAlt.SERPER_API_KEY || process.env.SERPER_API_KEY);
407
- }
408
- if (providerId === 'groq') {
409
- const env = loadEnvFile('groq.env');
410
- return !!(env.GROQ_API_KEY || process.env.GROQ_API_KEY);
411
- }
412
- if (providerId === 'deepgram') {
413
- const env = loadEnvFile('deepgram.env');
414
- return !!(env.DEEPGRAM_API_KEY || process.env.DEEPGRAM_API_KEY);
415
- }
416
- if (providerId === 'mistral') {
417
- const env = loadEnvFile('mistral.env');
418
- return !!(env.MISTRAL_API_KEY || process.env.MISTRAL_API_KEY);
419
- }
420
- if (providerId === 'cohere') {
421
- const env = loadEnvFile('cohere.env');
422
- return !!(env.COHERE_API_KEY || process.env.COHERE_API_KEY);
423
- }
424
- if (providerId === 'serper') {
425
- const env = loadEnvFile('serpapi.env');
426
- return !!(env.SERPAPI_API_KEY || process.env.SERPER_API_KEY || process.env.SERPAPI_API_KEY);
427
- }
428
- if (providerId === 'stability') {
429
- const env = loadEnvFile('stability.env');
430
- return !!(env.STABILITY_API_KEY || process.env.STABILITY_API_KEY);
431
- }
432
- if (providerId === 'together') {
433
- const env = loadEnvFile('together.env');
434
- return !!(env.TOGETHER_API_KEY || process.env.TOGETHER_API_KEY);
435
- }
436
- if (providerId === 'assemblyai') {
437
- const env = loadEnvFile('assemblyai.env');
438
- return !!(env.ASSEMBLYAI_API_KEY || process.env.ASSEMBLYAI_API_KEY);
439
- }
440
- return false;
441
- }
442
-
443
- /**
444
- * List all supported providers
445
- */
446
- export function listProviders(): string[] {
447
- return Object.keys(providers);
448
- }
449
-
450
- /**
451
- * Get credential type for a provider
452
- */
453
- export function getCredentialType(providerId: string): string | null {
454
- return providers[providerId]?.type || null;
455
- }