@nordsym/apiclaw 2.2.0 → 2.3.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 (176) 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/gateway-client.d.ts.map +1 -1
  5. package/dist/gateway-client.js +24 -2
  6. package/dist/gateway-client.js.map +1 -1
  7. package/dist/index.bundled.js +61263 -0
  8. package/dist/index.js +2 -2
  9. package/dist/index.js.map +1 -1
  10. package/package.json +7 -2
  11. package/.claude/settings.local.json +0 -13
  12. package/.env.prod +0 -1
  13. package/apiclaw-README.md +0 -494
  14. package/convex/_generated/api.d.ts +0 -145
  15. package/convex/_generated/api.js +0 -23
  16. package/convex/_generated/dataModel.d.ts +0 -60
  17. package/convex/_generated/server.d.ts +0 -143
  18. package/convex/_generated/server.js +0 -93
  19. package/convex/_listWorkspaces.ts +0 -13
  20. package/convex/adminActivate.ts +0 -53
  21. package/convex/adminStats.ts +0 -306
  22. package/convex/agents.ts +0 -939
  23. package/convex/analytics.ts +0 -187
  24. package/convex/apiKeys.ts +0 -220
  25. package/convex/backfillAnalytics.ts +0 -272
  26. package/convex/backfillSearchLogs.ts +0 -35
  27. package/convex/billing.ts +0 -834
  28. package/convex/capabilities.ts +0 -157
  29. package/convex/chains.ts +0 -1318
  30. package/convex/credits.ts +0 -211
  31. package/convex/crons.ts +0 -65
  32. package/convex/debugFilestackLogs.ts +0 -16
  33. package/convex/debugGetToken.ts +0 -18
  34. package/convex/directCall.ts +0 -713
  35. package/convex/earnProgress.ts +0 -753
  36. package/convex/email.ts +0 -329
  37. package/convex/feedback.ts +0 -265
  38. package/convex/funnel.ts +0 -431
  39. package/convex/guards.ts +0 -174
  40. package/convex/http.ts +0 -3756
  41. package/convex/inbound.ts +0 -32
  42. package/convex/logs.ts +0 -701
  43. package/convex/migrateFilestack.ts +0 -81
  44. package/convex/migratePartnersProd.ts +0 -174
  45. package/convex/migratePratham.ts +0 -126
  46. package/convex/migrateProviderWorkspaces.ts +0 -175
  47. package/convex/mou.ts +0 -91
  48. package/convex/nurture.ts +0 -355
  49. package/convex/providerKeys.ts +0 -289
  50. package/convex/providers.ts +0 -1135
  51. package/convex/purchases.ts +0 -183
  52. package/convex/ratelimit.ts +0 -104
  53. package/convex/schema.ts +0 -926
  54. package/convex/searchLogs.ts +0 -265
  55. package/convex/seedAPILayerAPIs.ts +0 -191
  56. package/convex/seedDirectCallConfigs.ts +0 -336
  57. package/convex/seedPratham.ts +0 -149
  58. package/convex/spendAlerts.ts +0 -442
  59. package/convex/stripeActions.ts +0 -607
  60. package/convex/teams.ts +0 -243
  61. package/convex/telemetry.ts +0 -81
  62. package/convex/tsconfig.json +0 -25
  63. package/convex/updateAPIStatus.ts +0 -44
  64. package/convex/usage.ts +0 -260
  65. package/convex/usageReports.ts +0 -357
  66. package/convex/waitlist.ts +0 -55
  67. package/convex/webhooks.ts +0 -494
  68. package/convex/workspaceSettings.ts +0 -143
  69. package/convex/workspaces.ts +0 -1331
  70. package/convex.json +0 -3
  71. package/direct-test.mjs +0 -51
  72. package/email-templates/filestack-provider-outreach.html +0 -162
  73. package/email-templates/partnership-template.html +0 -116
  74. package/email-templates/pratham-draft-preview.txt +0 -57
  75. package/email-templates/pratham-partnership-draft.html +0 -141
  76. package/reports/APIClaw-Session-Report-2026-04-05.pdf +0 -0
  77. package/reports/pipeline/PIPELINE-REPORT.json +0 -153
  78. package/reports/pipeline/acquire_apisguru.json +0 -17
  79. package/reports/pipeline/capabilities.json +0 -38
  80. package/reports/pipeline/discover_azure_recursive.json +0 -1551
  81. package/reports/pipeline/discover_github.json +0 -25
  82. package/reports/pipeline/discover_github_repos.json +0 -49
  83. package/reports/pipeline/discover_swaggerhub.json +0 -24
  84. package/reports/pipeline/discover_well_known.json +0 -23
  85. package/reports/pipeline/fetch_specs.json +0 -19
  86. package/reports/pipeline/generate_providers.json +0 -14
  87. package/reports/pipeline/match_registry.json +0 -11
  88. package/reports/pipeline/parse_specs.json +0 -17
  89. package/reports/pipeline/promote_candidates.json +0 -34
  90. package/reports/pipeline/validate.json +0 -30
  91. package/reports/pipeline/validate_smoke_details.json +0 -3835
  92. package/reports/session-report-2026-04-05.html +0 -433
  93. package/seed-apis-direct.mjs +0 -106
  94. package/src/access-control.ts +0 -174
  95. package/src/adapters/base.ts +0 -364
  96. package/src/adapters/claude-desktop.ts +0 -41
  97. package/src/adapters/cline.ts +0 -88
  98. package/src/adapters/continue.ts +0 -91
  99. package/src/adapters/cursor.ts +0 -43
  100. package/src/adapters/custom.ts +0 -188
  101. package/src/adapters/detect.ts +0 -202
  102. package/src/adapters/index.ts +0 -47
  103. package/src/adapters/windsurf.ts +0 -44
  104. package/src/bin-http.ts +0 -45
  105. package/src/bin.ts +0 -34
  106. package/src/capability-router.ts +0 -331
  107. package/src/chainExecutor.ts +0 -730
  108. package/src/chainResolver.test.ts +0 -246
  109. package/src/chainResolver.ts +0 -658
  110. package/src/cli/commands/demo.ts +0 -109
  111. package/src/cli/commands/doctor.ts +0 -435
  112. package/src/cli/commands/index.ts +0 -9
  113. package/src/cli/commands/login.ts +0 -203
  114. package/src/cli/commands/mcp-install.ts +0 -373
  115. package/src/cli/commands/restore.ts +0 -333
  116. package/src/cli/commands/setup.ts +0 -297
  117. package/src/cli/commands/uninstall.ts +0 -240
  118. package/src/cli/index.ts +0 -148
  119. package/src/cli.ts +0 -370
  120. package/src/confirmation.ts +0 -296
  121. package/src/credentials.ts +0 -455
  122. package/src/credits.ts +0 -329
  123. package/src/crypto.ts +0 -75
  124. package/src/discovery.ts +0 -568
  125. package/src/enterprise/env.ts +0 -156
  126. package/src/enterprise/index.ts +0 -7
  127. package/src/enterprise/script-generator.ts +0 -481
  128. package/src/execute-dynamic.ts +0 -617
  129. package/src/execute.ts +0 -2386
  130. package/src/funnel-client.ts +0 -168
  131. package/src/funnel.test.ts +0 -187
  132. package/src/gateway-client.ts +0 -192
  133. package/src/hivr-whitelist.ts +0 -110
  134. package/src/http-api.ts +0 -286
  135. package/src/http-server-minimal.ts +0 -154
  136. package/src/index.ts +0 -2702
  137. package/src/intelligent-gateway.ts +0 -339
  138. package/src/mcp-analytics.ts +0 -156
  139. package/src/metered.ts +0 -149
  140. package/src/open-apis-generated.ts +0 -157
  141. package/src/open-apis.ts +0 -558
  142. package/src/postinstall.ts +0 -40
  143. package/src/product-whitelist.ts +0 -246
  144. package/src/proxy.ts +0 -36
  145. package/src/registration-guard.ts +0 -117
  146. package/src/session.ts +0 -129
  147. package/src/stripe.ts +0 -497
  148. package/src/telemetry.ts +0 -71
  149. package/src/test.ts +0 -135
  150. package/src/types/convex-api.d.ts +0 -20
  151. package/src/types/convex-api.ts +0 -21
  152. package/src/types.ts +0 -109
  153. package/src/ui/colors.ts +0 -219
  154. package/src/ui/errors.ts +0 -394
  155. package/src/ui/index.ts +0 -17
  156. package/src/ui/prompts.ts +0 -390
  157. package/src/ui/spinner.ts +0 -325
  158. package/src/utils/backup.ts +0 -224
  159. package/src/utils/config.ts +0 -318
  160. package/src/utils/os.ts +0 -124
  161. package/src/utils/paths.ts +0 -203
  162. package/src/webhook.ts +0 -107
  163. package/test-10-working.cjs +0 -97
  164. package/test-14-final.cjs +0 -96
  165. package/test-actual-handlers.ts +0 -92
  166. package/test-apilayer-all-14.ts +0 -249
  167. package/test-apilayer-fixed.ts +0 -248
  168. package/test-direct-endpoints.ts +0 -174
  169. package/test-exact-endpoints.ts +0 -144
  170. package/test-final.ts +0 -83
  171. package/test-full-routing.ts +0 -100
  172. package/test-handlers-correct.ts +0 -217
  173. package/test-numverify-key.ts +0 -41
  174. package/test-via-handlers.ts +0 -92
  175. package/test-worldnews.mjs +0 -26
  176. 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
- }