@everworker/oneringai 0.1.2 → 0.1.4

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.
@@ -0,0 +1,1780 @@
1
+ 'use strict';
2
+
3
+ // src/core/Vendor.ts
4
+ var Vendor = {
5
+ OpenAI: "openai",
6
+ Anthropic: "anthropic",
7
+ Google: "google",
8
+ GoogleVertex: "google-vertex",
9
+ Groq: "groq",
10
+ Together: "together",
11
+ Perplexity: "perplexity",
12
+ Grok: "grok",
13
+ DeepSeek: "deepseek",
14
+ Mistral: "mistral",
15
+ Ollama: "ollama",
16
+ Custom: "custom"
17
+ // OpenAI-compatible endpoint
18
+ };
19
+ var VENDORS = Object.values(Vendor);
20
+ function isVendor(value) {
21
+ return VENDORS.includes(value);
22
+ }
23
+
24
+ // src/domain/entities/Model.ts
25
+ var LLM_MODELS = {
26
+ [Vendor.OpenAI]: {
27
+ // GPT-5.2 Series (Current Flagship)
28
+ GPT_5_2: "gpt-5.2",
29
+ GPT_5_2_PRO: "gpt-5.2-pro",
30
+ // GPT-5 Series
31
+ GPT_5: "gpt-5",
32
+ GPT_5_MINI: "gpt-5-mini",
33
+ GPT_5_NANO: "gpt-5-nano",
34
+ // GPT-4.1 Series
35
+ GPT_4_1: "gpt-4.1",
36
+ GPT_4_1_MINI: "gpt-4.1-mini",
37
+ GPT_4_1_NANO: "gpt-4.1-nano",
38
+ // GPT-4o Series (Legacy, Audio Capable)
39
+ GPT_4O: "gpt-4o",
40
+ GPT_4O_MINI: "gpt-4o-mini",
41
+ // Reasoning Models (o-series)
42
+ O3_MINI: "o3-mini",
43
+ O1: "o1"
44
+ },
45
+ [Vendor.Anthropic]: {
46
+ // Claude 4.5 Series (Current)
47
+ CLAUDE_OPUS_4_5: "claude-opus-4-5-20251101",
48
+ CLAUDE_SONNET_4_5: "claude-sonnet-4-5-20250929",
49
+ CLAUDE_HAIKU_4_5: "claude-haiku-4-5-20251001",
50
+ // Claude 4.x Legacy
51
+ CLAUDE_OPUS_4_1: "claude-opus-4-1-20250805",
52
+ CLAUDE_SONNET_4: "claude-sonnet-4-20250514",
53
+ CLAUDE_SONNET_3_7: "claude-3-7-sonnet-20250219",
54
+ // Claude 3.x Legacy
55
+ CLAUDE_HAIKU_3: "claude-3-haiku-20240307"
56
+ },
57
+ [Vendor.Google]: {
58
+ // Gemini 3 Series (Preview)
59
+ GEMINI_3_FLASH_PREVIEW: "gemini-3-flash-preview",
60
+ GEMINI_3_PRO_PREVIEW: "gemini-3-pro-preview",
61
+ GEMINI_3_PRO_IMAGE_PREVIEW: "gemini-3-pro-image-preview",
62
+ // Gemini 2.5 Series (Production)
63
+ GEMINI_2_5_PRO: "gemini-2.5-pro",
64
+ GEMINI_2_5_FLASH: "gemini-2.5-flash",
65
+ GEMINI_2_5_FLASH_LITE: "gemini-2.5-flash-lite",
66
+ GEMINI_2_5_FLASH_IMAGE: "gemini-2.5-flash-image"
67
+ },
68
+ [Vendor.Grok]: {
69
+ // Grok 4.1 Series (2M context, fast)
70
+ GROK_4_1_FAST_REASONING: "grok-4-1-fast-reasoning",
71
+ GROK_4_1_FAST_NON_REASONING: "grok-4-1-fast-non-reasoning",
72
+ // Grok 4 Series
73
+ GROK_4_FAST_REASONING: "grok-4-fast-reasoning",
74
+ GROK_4_FAST_NON_REASONING: "grok-4-fast-non-reasoning",
75
+ GROK_4_0709: "grok-4-0709",
76
+ // Grok Code
77
+ GROK_CODE_FAST_1: "grok-code-fast-1",
78
+ // Grok 3 Series
79
+ GROK_3: "grok-3",
80
+ GROK_3_MINI: "grok-3-mini",
81
+ // Grok 2 Series (Vision)
82
+ GROK_2_VISION_1212: "grok-2-vision-1212"
83
+ }
84
+ };
85
+ var MODEL_REGISTRY = {
86
+ // ============================================================================
87
+ // OpenAI Models (Verified from platform.openai.com)
88
+ // ============================================================================
89
+ // GPT-5.2 Series (Current Flagship)
90
+ "gpt-5.2": {
91
+ name: "gpt-5.2",
92
+ provider: Vendor.OpenAI,
93
+ description: "Flagship model for coding and agentic tasks. Reasoning.effort: none, low, medium, high, xhigh",
94
+ isActive: true,
95
+ releaseDate: "2025-12-01",
96
+ knowledgeCutoff: "2025-08-31",
97
+ features: {
98
+ reasoning: true,
99
+ streaming: true,
100
+ structuredOutput: true,
101
+ functionCalling: true,
102
+ fineTuning: false,
103
+ predictedOutputs: false,
104
+ realtime: false,
105
+ vision: true,
106
+ audio: false,
107
+ video: false,
108
+ batchAPI: true,
109
+ promptCaching: true,
110
+ parameters: {
111
+ temperature: false,
112
+ topP: false,
113
+ frequencyPenalty: false,
114
+ presencePenalty: false
115
+ },
116
+ input: {
117
+ tokens: 4e5,
118
+ text: true,
119
+ image: true,
120
+ cpm: 1.75
121
+ },
122
+ output: {
123
+ tokens: 128e3,
124
+ text: true,
125
+ cpm: 14
126
+ }
127
+ }
128
+ },
129
+ "gpt-5.2-pro": {
130
+ name: "gpt-5.2-pro",
131
+ provider: Vendor.OpenAI,
132
+ description: "GPT-5.2 pro produces smarter and more precise responses. Reasoning.effort: medium, high, xhigh",
133
+ isActive: true,
134
+ releaseDate: "2025-12-01",
135
+ knowledgeCutoff: "2025-08-31",
136
+ features: {
137
+ reasoning: true,
138
+ streaming: true,
139
+ structuredOutput: true,
140
+ functionCalling: true,
141
+ fineTuning: false,
142
+ predictedOutputs: false,
143
+ realtime: false,
144
+ vision: true,
145
+ audio: false,
146
+ video: false,
147
+ batchAPI: true,
148
+ promptCaching: true,
149
+ parameters: {
150
+ temperature: false,
151
+ topP: false,
152
+ frequencyPenalty: false,
153
+ presencePenalty: false
154
+ },
155
+ input: {
156
+ tokens: 4e5,
157
+ text: true,
158
+ image: true,
159
+ cpm: 21
160
+ },
161
+ output: {
162
+ tokens: 128e3,
163
+ text: true,
164
+ cpm: 168
165
+ }
166
+ }
167
+ },
168
+ // GPT-5 Series
169
+ "gpt-5": {
170
+ name: "gpt-5",
171
+ provider: Vendor.OpenAI,
172
+ description: "Previous intelligent reasoning model for coding and agentic tasks. Reasoning.effort: minimal, low, medium, high",
173
+ isActive: true,
174
+ releaseDate: "2025-08-01",
175
+ knowledgeCutoff: "2024-09-30",
176
+ features: {
177
+ reasoning: true,
178
+ streaming: true,
179
+ structuredOutput: true,
180
+ functionCalling: true,
181
+ fineTuning: false,
182
+ predictedOutputs: false,
183
+ realtime: false,
184
+ vision: true,
185
+ audio: false,
186
+ video: false,
187
+ batchAPI: true,
188
+ promptCaching: true,
189
+ parameters: {
190
+ temperature: false,
191
+ topP: false,
192
+ frequencyPenalty: false,
193
+ presencePenalty: false
194
+ },
195
+ input: {
196
+ tokens: 4e5,
197
+ text: true,
198
+ image: true,
199
+ cpm: 1.25
200
+ },
201
+ output: {
202
+ tokens: 128e3,
203
+ text: true,
204
+ cpm: 10
205
+ }
206
+ }
207
+ },
208
+ "gpt-5-mini": {
209
+ name: "gpt-5-mini",
210
+ provider: Vendor.OpenAI,
211
+ description: "Faster, cost-efficient version of GPT-5 for well-defined tasks and precise prompts",
212
+ isActive: true,
213
+ releaseDate: "2025-08-01",
214
+ knowledgeCutoff: "2024-05-31",
215
+ features: {
216
+ reasoning: true,
217
+ streaming: true,
218
+ structuredOutput: true,
219
+ functionCalling: true,
220
+ fineTuning: false,
221
+ predictedOutputs: false,
222
+ realtime: false,
223
+ vision: true,
224
+ audio: false,
225
+ video: false,
226
+ batchAPI: true,
227
+ promptCaching: true,
228
+ parameters: {
229
+ temperature: false,
230
+ topP: false,
231
+ frequencyPenalty: false,
232
+ presencePenalty: false
233
+ },
234
+ input: {
235
+ tokens: 4e5,
236
+ text: true,
237
+ image: true,
238
+ cpm: 0.25
239
+ },
240
+ output: {
241
+ tokens: 128e3,
242
+ text: true,
243
+ cpm: 2
244
+ }
245
+ }
246
+ },
247
+ "gpt-5-nano": {
248
+ name: "gpt-5-nano",
249
+ provider: Vendor.OpenAI,
250
+ description: "Fastest, most cost-efficient GPT-5. Great for summarization and classification tasks",
251
+ isActive: true,
252
+ releaseDate: "2025-08-01",
253
+ knowledgeCutoff: "2024-05-31",
254
+ features: {
255
+ reasoning: true,
256
+ streaming: true,
257
+ structuredOutput: true,
258
+ functionCalling: true,
259
+ fineTuning: false,
260
+ predictedOutputs: false,
261
+ realtime: false,
262
+ vision: true,
263
+ audio: false,
264
+ video: false,
265
+ batchAPI: true,
266
+ promptCaching: true,
267
+ parameters: {
268
+ temperature: false,
269
+ topP: false,
270
+ frequencyPenalty: false,
271
+ presencePenalty: false
272
+ },
273
+ input: {
274
+ tokens: 4e5,
275
+ text: true,
276
+ image: true,
277
+ cpm: 0.05
278
+ },
279
+ output: {
280
+ tokens: 128e3,
281
+ text: true,
282
+ cpm: 0.4
283
+ }
284
+ }
285
+ },
286
+ // GPT-4.1 Series
287
+ "gpt-4.1": {
288
+ name: "gpt-4.1",
289
+ provider: Vendor.OpenAI,
290
+ description: "GPT-4.1 specialized for coding with 1M token context window",
291
+ isActive: true,
292
+ releaseDate: "2025-04-14",
293
+ knowledgeCutoff: "2025-04-01",
294
+ features: {
295
+ reasoning: false,
296
+ streaming: true,
297
+ structuredOutput: true,
298
+ functionCalling: true,
299
+ fineTuning: false,
300
+ predictedOutputs: false,
301
+ realtime: false,
302
+ vision: true,
303
+ audio: false,
304
+ video: false,
305
+ batchAPI: true,
306
+ promptCaching: true,
307
+ input: {
308
+ tokens: 1e6,
309
+ text: true,
310
+ image: true,
311
+ cpm: 2
312
+ },
313
+ output: {
314
+ tokens: 32768,
315
+ text: true,
316
+ cpm: 8
317
+ }
318
+ }
319
+ },
320
+ "gpt-4.1-mini": {
321
+ name: "gpt-4.1-mini",
322
+ provider: Vendor.OpenAI,
323
+ description: "Efficient GPT-4.1 model, beats GPT-4o in many benchmarks at 83% lower cost",
324
+ isActive: true,
325
+ releaseDate: "2025-04-14",
326
+ knowledgeCutoff: "2025-04-01",
327
+ features: {
328
+ reasoning: false,
329
+ streaming: true,
330
+ structuredOutput: true,
331
+ functionCalling: true,
332
+ fineTuning: false,
333
+ predictedOutputs: false,
334
+ realtime: false,
335
+ vision: true,
336
+ audio: false,
337
+ video: false,
338
+ batchAPI: true,
339
+ promptCaching: true,
340
+ input: {
341
+ tokens: 1e6,
342
+ text: true,
343
+ image: true,
344
+ cpm: 0.4
345
+ },
346
+ output: {
347
+ tokens: 16384,
348
+ text: true,
349
+ cpm: 1.6
350
+ }
351
+ }
352
+ },
353
+ "gpt-4.1-nano": {
354
+ name: "gpt-4.1-nano",
355
+ provider: Vendor.OpenAI,
356
+ description: "Fastest and cheapest model with 1M context. 80.1% MMLU, ideal for classification/autocompletion",
357
+ isActive: true,
358
+ releaseDate: "2025-04-14",
359
+ knowledgeCutoff: "2025-04-01",
360
+ features: {
361
+ reasoning: false,
362
+ streaming: true,
363
+ structuredOutput: true,
364
+ functionCalling: true,
365
+ fineTuning: false,
366
+ predictedOutputs: false,
367
+ realtime: false,
368
+ vision: true,
369
+ audio: false,
370
+ video: false,
371
+ batchAPI: true,
372
+ promptCaching: true,
373
+ input: {
374
+ tokens: 1e6,
375
+ text: true,
376
+ image: true,
377
+ cpm: 0.1
378
+ },
379
+ output: {
380
+ tokens: 16384,
381
+ text: true,
382
+ cpm: 0.4
383
+ }
384
+ }
385
+ },
386
+ // GPT-4o Series (Legacy, Audio Capable)
387
+ "gpt-4o": {
388
+ name: "gpt-4o",
389
+ provider: Vendor.OpenAI,
390
+ description: "Versatile omni model with audio support. Legacy but still available",
391
+ isActive: true,
392
+ releaseDate: "2024-05-13",
393
+ knowledgeCutoff: "2024-04-01",
394
+ features: {
395
+ reasoning: false,
396
+ streaming: true,
397
+ structuredOutput: true,
398
+ functionCalling: true,
399
+ fineTuning: false,
400
+ predictedOutputs: true,
401
+ realtime: true,
402
+ vision: true,
403
+ audio: true,
404
+ video: false,
405
+ batchAPI: true,
406
+ promptCaching: true,
407
+ input: {
408
+ tokens: 128e3,
409
+ text: true,
410
+ image: true,
411
+ audio: true,
412
+ cpm: 2.5
413
+ },
414
+ output: {
415
+ tokens: 16384,
416
+ text: true,
417
+ audio: true,
418
+ cpm: 10
419
+ }
420
+ }
421
+ },
422
+ "gpt-4o-mini": {
423
+ name: "gpt-4o-mini",
424
+ provider: Vendor.OpenAI,
425
+ description: "Fast, affordable omni model with audio support",
426
+ isActive: true,
427
+ releaseDate: "2024-07-18",
428
+ knowledgeCutoff: "2024-04-01",
429
+ features: {
430
+ reasoning: false,
431
+ streaming: true,
432
+ structuredOutput: true,
433
+ functionCalling: true,
434
+ fineTuning: true,
435
+ predictedOutputs: false,
436
+ realtime: true,
437
+ vision: true,
438
+ audio: true,
439
+ video: false,
440
+ batchAPI: true,
441
+ promptCaching: true,
442
+ input: {
443
+ tokens: 128e3,
444
+ text: true,
445
+ image: true,
446
+ audio: true,
447
+ cpm: 0.15
448
+ },
449
+ output: {
450
+ tokens: 16384,
451
+ text: true,
452
+ audio: true,
453
+ cpm: 0.6
454
+ }
455
+ }
456
+ },
457
+ // Reasoning Models (o-series)
458
+ "o3-mini": {
459
+ name: "o3-mini",
460
+ provider: Vendor.OpenAI,
461
+ description: "Fast reasoning model tailored for coding, math, and science",
462
+ isActive: true,
463
+ releaseDate: "2025-01-31",
464
+ knowledgeCutoff: "2024-10-01",
465
+ features: {
466
+ reasoning: true,
467
+ streaming: true,
468
+ structuredOutput: true,
469
+ functionCalling: true,
470
+ fineTuning: false,
471
+ predictedOutputs: false,
472
+ realtime: false,
473
+ vision: true,
474
+ audio: false,
475
+ video: false,
476
+ batchAPI: true,
477
+ promptCaching: false,
478
+ parameters: {
479
+ temperature: false,
480
+ topP: false,
481
+ frequencyPenalty: false,
482
+ presencePenalty: false
483
+ },
484
+ input: {
485
+ tokens: 2e5,
486
+ text: true,
487
+ image: true,
488
+ cpm: 1.1
489
+ },
490
+ output: {
491
+ tokens: 1e5,
492
+ text: true,
493
+ cpm: 4.4
494
+ }
495
+ }
496
+ },
497
+ "o1": {
498
+ name: "o1",
499
+ provider: Vendor.OpenAI,
500
+ description: "Advanced reasoning model for complex problems",
501
+ isActive: true,
502
+ releaseDate: "2024-12-17",
503
+ knowledgeCutoff: "2024-10-01",
504
+ features: {
505
+ reasoning: true,
506
+ streaming: true,
507
+ structuredOutput: true,
508
+ functionCalling: true,
509
+ fineTuning: false,
510
+ predictedOutputs: false,
511
+ realtime: false,
512
+ vision: true,
513
+ audio: false,
514
+ video: false,
515
+ batchAPI: true,
516
+ promptCaching: false,
517
+ parameters: {
518
+ temperature: false,
519
+ topP: false,
520
+ frequencyPenalty: false,
521
+ presencePenalty: false
522
+ },
523
+ input: {
524
+ tokens: 2e5,
525
+ text: true,
526
+ image: true,
527
+ cpm: 15
528
+ },
529
+ output: {
530
+ tokens: 1e5,
531
+ text: true,
532
+ cpm: 60
533
+ }
534
+ }
535
+ },
536
+ // ============================================================================
537
+ // Anthropic Models (Verified from platform.claude.com)
538
+ // ============================================================================
539
+ // Claude 4.5 Series (Current)
540
+ "claude-opus-4-5-20251101": {
541
+ name: "claude-opus-4-5-20251101",
542
+ provider: Vendor.Anthropic,
543
+ description: "Premium model combining maximum intelligence with practical performance",
544
+ isActive: true,
545
+ releaseDate: "2025-11-01",
546
+ knowledgeCutoff: "2025-05-01",
547
+ features: {
548
+ reasoning: false,
549
+ streaming: true,
550
+ structuredOutput: true,
551
+ functionCalling: true,
552
+ fineTuning: false,
553
+ predictedOutputs: false,
554
+ realtime: false,
555
+ vision: true,
556
+ audio: false,
557
+ video: false,
558
+ extendedThinking: true,
559
+ batchAPI: true,
560
+ promptCaching: true,
561
+ input: {
562
+ tokens: 2e5,
563
+ text: true,
564
+ image: true,
565
+ cpm: 5,
566
+ cpmCached: 0.5
567
+ },
568
+ output: {
569
+ tokens: 64e3,
570
+ text: true,
571
+ cpm: 25
572
+ }
573
+ }
574
+ },
575
+ "claude-sonnet-4-5-20250929": {
576
+ name: "claude-sonnet-4-5-20250929",
577
+ provider: Vendor.Anthropic,
578
+ description: "Smart model for complex agents and coding. Best balance of intelligence, speed, cost",
579
+ isActive: true,
580
+ releaseDate: "2025-09-29",
581
+ knowledgeCutoff: "2025-01-01",
582
+ features: {
583
+ reasoning: false,
584
+ streaming: true,
585
+ structuredOutput: true,
586
+ functionCalling: true,
587
+ fineTuning: false,
588
+ predictedOutputs: false,
589
+ realtime: false,
590
+ vision: true,
591
+ audio: false,
592
+ video: false,
593
+ extendedThinking: true,
594
+ batchAPI: true,
595
+ promptCaching: true,
596
+ input: {
597
+ tokens: 2e5,
598
+ text: true,
599
+ image: true,
600
+ cpm: 3,
601
+ cpmCached: 0.3
602
+ },
603
+ output: {
604
+ tokens: 64e3,
605
+ text: true,
606
+ cpm: 15
607
+ }
608
+ }
609
+ },
610
+ "claude-haiku-4-5-20251001": {
611
+ name: "claude-haiku-4-5-20251001",
612
+ provider: Vendor.Anthropic,
613
+ description: "Fastest model with near-frontier intelligence. Matches Sonnet 4 on coding",
614
+ isActive: true,
615
+ releaseDate: "2025-10-01",
616
+ knowledgeCutoff: "2025-02-01",
617
+ features: {
618
+ reasoning: false,
619
+ streaming: true,
620
+ structuredOutput: true,
621
+ functionCalling: true,
622
+ fineTuning: false,
623
+ predictedOutputs: false,
624
+ realtime: false,
625
+ vision: true,
626
+ audio: false,
627
+ video: false,
628
+ extendedThinking: true,
629
+ batchAPI: true,
630
+ promptCaching: true,
631
+ input: {
632
+ tokens: 2e5,
633
+ text: true,
634
+ image: true,
635
+ cpm: 1,
636
+ cpmCached: 0.1
637
+ },
638
+ output: {
639
+ tokens: 64e3,
640
+ text: true,
641
+ cpm: 5
642
+ }
643
+ }
644
+ },
645
+ // Claude 4.x Legacy
646
+ "claude-opus-4-1-20250805": {
647
+ name: "claude-opus-4-1-20250805",
648
+ provider: Vendor.Anthropic,
649
+ description: "Legacy Opus 4.1 focused on agentic tasks, real-world coding, and reasoning",
650
+ isActive: true,
651
+ releaseDate: "2025-08-05",
652
+ knowledgeCutoff: "2025-01-01",
653
+ features: {
654
+ reasoning: false,
655
+ streaming: true,
656
+ structuredOutput: true,
657
+ functionCalling: true,
658
+ fineTuning: false,
659
+ predictedOutputs: false,
660
+ realtime: false,
661
+ vision: true,
662
+ audio: false,
663
+ video: false,
664
+ extendedThinking: true,
665
+ batchAPI: true,
666
+ promptCaching: true,
667
+ input: {
668
+ tokens: 2e5,
669
+ text: true,
670
+ image: true,
671
+ cpm: 15,
672
+ cpmCached: 1.5
673
+ },
674
+ output: {
675
+ tokens: 32e3,
676
+ text: true,
677
+ cpm: 75
678
+ }
679
+ }
680
+ },
681
+ "claude-sonnet-4-20250514": {
682
+ name: "claude-sonnet-4-20250514",
683
+ provider: Vendor.Anthropic,
684
+ description: "Legacy Sonnet 4. Default for most users, supports 1M context beta",
685
+ isActive: true,
686
+ releaseDate: "2025-05-14",
687
+ knowledgeCutoff: "2025-01-01",
688
+ features: {
689
+ reasoning: false,
690
+ streaming: true,
691
+ structuredOutput: true,
692
+ functionCalling: true,
693
+ fineTuning: false,
694
+ predictedOutputs: false,
695
+ realtime: false,
696
+ vision: true,
697
+ audio: false,
698
+ video: false,
699
+ extendedThinking: true,
700
+ batchAPI: true,
701
+ promptCaching: true,
702
+ input: {
703
+ tokens: 2e5,
704
+ // 1M with beta header
705
+ text: true,
706
+ image: true,
707
+ cpm: 3,
708
+ cpmCached: 0.3
709
+ },
710
+ output: {
711
+ tokens: 64e3,
712
+ text: true,
713
+ cpm: 15
714
+ }
715
+ }
716
+ },
717
+ "claude-3-7-sonnet-20250219": {
718
+ name: "claude-3-7-sonnet-20250219",
719
+ provider: Vendor.Anthropic,
720
+ description: "Claude 3.7 Sonnet with extended thinking, supports 128K output beta",
721
+ isActive: true,
722
+ releaseDate: "2025-02-19",
723
+ knowledgeCutoff: "2024-10-01",
724
+ features: {
725
+ reasoning: false,
726
+ streaming: true,
727
+ structuredOutput: true,
728
+ functionCalling: true,
729
+ fineTuning: false,
730
+ predictedOutputs: false,
731
+ realtime: false,
732
+ vision: true,
733
+ audio: false,
734
+ video: false,
735
+ extendedThinking: true,
736
+ batchAPI: true,
737
+ promptCaching: true,
738
+ input: {
739
+ tokens: 2e5,
740
+ text: true,
741
+ image: true,
742
+ cpm: 3,
743
+ cpmCached: 0.3
744
+ },
745
+ output: {
746
+ tokens: 64e3,
747
+ // 128K with beta header
748
+ text: true,
749
+ cpm: 15
750
+ }
751
+ }
752
+ },
753
+ // Claude 3.x Legacy
754
+ "claude-3-haiku-20240307": {
755
+ name: "claude-3-haiku-20240307",
756
+ provider: Vendor.Anthropic,
757
+ description: "Fast legacy model. Recommend migrating to Haiku 4.5",
758
+ isActive: true,
759
+ releaseDate: "2024-03-07",
760
+ knowledgeCutoff: "2023-08-01",
761
+ features: {
762
+ reasoning: false,
763
+ streaming: true,
764
+ structuredOutput: true,
765
+ functionCalling: true,
766
+ fineTuning: false,
767
+ predictedOutputs: false,
768
+ realtime: false,
769
+ vision: true,
770
+ audio: false,
771
+ video: false,
772
+ extendedThinking: false,
773
+ batchAPI: true,
774
+ promptCaching: true,
775
+ input: {
776
+ tokens: 2e5,
777
+ text: true,
778
+ image: true,
779
+ cpm: 0.25,
780
+ cpmCached: 0.03
781
+ },
782
+ output: {
783
+ tokens: 4096,
784
+ text: true,
785
+ cpm: 1.25
786
+ }
787
+ }
788
+ },
789
+ // ============================================================================
790
+ // Google Models (Verified from ai.google.dev)
791
+ // ============================================================================
792
+ // Gemini 3 Series (Preview)
793
+ "gemini-3-flash-preview": {
794
+ name: "gemini-3-flash-preview",
795
+ provider: Vendor.Google,
796
+ description: "Pro-grade reasoning with Flash-level latency and efficiency",
797
+ isActive: true,
798
+ releaseDate: "2025-11-18",
799
+ knowledgeCutoff: "2025-08-01",
800
+ features: {
801
+ reasoning: true,
802
+ streaming: true,
803
+ structuredOutput: true,
804
+ functionCalling: true,
805
+ fineTuning: false,
806
+ predictedOutputs: false,
807
+ realtime: false,
808
+ vision: true,
809
+ audio: true,
810
+ video: true,
811
+ batchAPI: true,
812
+ promptCaching: true,
813
+ input: {
814
+ tokens: 1e6,
815
+ text: true,
816
+ image: true,
817
+ audio: true,
818
+ video: true,
819
+ cpm: 0.15
820
+ },
821
+ output: {
822
+ tokens: 65536,
823
+ text: true,
824
+ cpm: 0.6
825
+ }
826
+ }
827
+ },
828
+ "gemini-3-pro-preview": {
829
+ name: "gemini-3-pro-preview",
830
+ provider: Vendor.Google,
831
+ description: "Most advanced reasoning Gemini model for complex tasks",
832
+ isActive: true,
833
+ releaseDate: "2025-11-18",
834
+ knowledgeCutoff: "2025-08-01",
835
+ features: {
836
+ reasoning: true,
837
+ streaming: true,
838
+ structuredOutput: true,
839
+ functionCalling: true,
840
+ fineTuning: false,
841
+ predictedOutputs: false,
842
+ realtime: false,
843
+ vision: true,
844
+ audio: true,
845
+ video: true,
846
+ batchAPI: true,
847
+ promptCaching: true,
848
+ input: {
849
+ tokens: 1e6,
850
+ text: true,
851
+ image: true,
852
+ audio: true,
853
+ video: true,
854
+ cpm: 1.25
855
+ },
856
+ output: {
857
+ tokens: 65536,
858
+ text: true,
859
+ cpm: 10
860
+ }
861
+ }
862
+ },
863
+ "gemini-3-pro-image-preview": {
864
+ name: "gemini-3-pro-image-preview",
865
+ provider: Vendor.Google,
866
+ description: "Highest quality image generation model",
867
+ isActive: true,
868
+ releaseDate: "2025-11-18",
869
+ knowledgeCutoff: "2025-08-01",
870
+ features: {
871
+ reasoning: true,
872
+ streaming: true,
873
+ structuredOutput: false,
874
+ functionCalling: false,
875
+ fineTuning: false,
876
+ predictedOutputs: false,
877
+ realtime: false,
878
+ vision: true,
879
+ audio: false,
880
+ video: false,
881
+ batchAPI: true,
882
+ promptCaching: true,
883
+ input: {
884
+ tokens: 1e6,
885
+ text: true,
886
+ image: true,
887
+ cpm: 1.25
888
+ },
889
+ output: {
890
+ tokens: 65536,
891
+ text: true,
892
+ image: true,
893
+ cpm: 10
894
+ }
895
+ }
896
+ },
897
+ // Gemini 2.5 Series (Production)
898
+ "gemini-2.5-pro": {
899
+ name: "gemini-2.5-pro",
900
+ provider: Vendor.Google,
901
+ description: "Advanced multimodal model built for deep reasoning and agents",
902
+ isActive: true,
903
+ releaseDate: "2025-03-01",
904
+ knowledgeCutoff: "2025-01-01",
905
+ features: {
906
+ reasoning: true,
907
+ streaming: true,
908
+ structuredOutput: true,
909
+ functionCalling: true,
910
+ fineTuning: false,
911
+ predictedOutputs: false,
912
+ realtime: false,
913
+ vision: true,
914
+ audio: true,
915
+ video: true,
916
+ batchAPI: true,
917
+ promptCaching: true,
918
+ input: {
919
+ tokens: 1e6,
920
+ text: true,
921
+ image: true,
922
+ audio: true,
923
+ video: true,
924
+ cpm: 1.25
925
+ },
926
+ output: {
927
+ tokens: 65536,
928
+ text: true,
929
+ cpm: 10
930
+ }
931
+ }
932
+ },
933
+ "gemini-2.5-flash": {
934
+ name: "gemini-2.5-flash",
935
+ provider: Vendor.Google,
936
+ description: "Fast, cost-effective model with excellent reasoning",
937
+ isActive: true,
938
+ releaseDate: "2025-06-17",
939
+ knowledgeCutoff: "2025-01-01",
940
+ features: {
941
+ reasoning: true,
942
+ streaming: true,
943
+ structuredOutput: true,
944
+ functionCalling: true,
945
+ fineTuning: false,
946
+ predictedOutputs: false,
947
+ realtime: false,
948
+ vision: true,
949
+ audio: true,
950
+ video: true,
951
+ batchAPI: true,
952
+ promptCaching: true,
953
+ input: {
954
+ tokens: 1e6,
955
+ text: true,
956
+ image: true,
957
+ audio: true,
958
+ video: true,
959
+ cpm: 0.15
960
+ },
961
+ output: {
962
+ tokens: 65536,
963
+ text: true,
964
+ cpm: 0.6
965
+ }
966
+ }
967
+ },
968
+ "gemini-2.5-flash-lite": {
969
+ name: "gemini-2.5-flash-lite",
970
+ provider: Vendor.Google,
971
+ description: "Lowest latency for high-volume tasks, summarization, classification",
972
+ isActive: true,
973
+ releaseDate: "2025-06-17",
974
+ knowledgeCutoff: "2025-01-01",
975
+ features: {
976
+ reasoning: true,
977
+ streaming: true,
978
+ structuredOutput: true,
979
+ functionCalling: true,
980
+ fineTuning: false,
981
+ predictedOutputs: false,
982
+ realtime: false,
983
+ vision: true,
984
+ audio: true,
985
+ video: true,
986
+ batchAPI: true,
987
+ promptCaching: true,
988
+ input: {
989
+ tokens: 1e6,
990
+ text: true,
991
+ image: true,
992
+ audio: true,
993
+ video: true,
994
+ cpm: 0.075
995
+ },
996
+ output: {
997
+ tokens: 65536,
998
+ text: true,
999
+ cpm: 0.3
1000
+ }
1001
+ }
1002
+ },
1003
+ "gemini-2.5-flash-image": {
1004
+ name: "gemini-2.5-flash-image",
1005
+ provider: Vendor.Google,
1006
+ description: "Image generation and editing model",
1007
+ isActive: true,
1008
+ releaseDate: "2025-09-01",
1009
+ knowledgeCutoff: "2025-01-01",
1010
+ features: {
1011
+ reasoning: true,
1012
+ streaming: true,
1013
+ structuredOutput: false,
1014
+ functionCalling: false,
1015
+ fineTuning: false,
1016
+ predictedOutputs: false,
1017
+ realtime: false,
1018
+ vision: true,
1019
+ audio: false,
1020
+ video: false,
1021
+ batchAPI: true,
1022
+ promptCaching: true,
1023
+ input: {
1024
+ tokens: 1e6,
1025
+ text: true,
1026
+ image: true,
1027
+ cpm: 0.15
1028
+ },
1029
+ output: {
1030
+ tokens: 65536,
1031
+ text: true,
1032
+ image: true,
1033
+ cpm: 0.6
1034
+ }
1035
+ }
1036
+ },
1037
+ // ============================================================================
1038
+ // xAI Grok Models (Verified from docs.x.ai - January 2026)
1039
+ // ============================================================================
1040
+ // Grok 4.1 Series (2M context, fast)
1041
+ "grok-4-1-fast-reasoning": {
1042
+ name: "grok-4-1-fast-reasoning",
1043
+ provider: Vendor.Grok,
1044
+ description: "Fast Grok 4.1 with reasoning capabilities, 2M context window, vision support",
1045
+ isActive: true,
1046
+ releaseDate: "2025-11-01",
1047
+ knowledgeCutoff: "2024-11-01",
1048
+ features: {
1049
+ reasoning: true,
1050
+ streaming: true,
1051
+ structuredOutput: true,
1052
+ functionCalling: true,
1053
+ fineTuning: false,
1054
+ predictedOutputs: false,
1055
+ realtime: false,
1056
+ vision: true,
1057
+ audio: false,
1058
+ video: false,
1059
+ batchAPI: false,
1060
+ promptCaching: false,
1061
+ input: {
1062
+ tokens: 2e6,
1063
+ text: true,
1064
+ image: true,
1065
+ cpm: 0.2
1066
+ },
1067
+ output: {
1068
+ tokens: 65536,
1069
+ text: true,
1070
+ cpm: 0.5
1071
+ }
1072
+ }
1073
+ },
1074
+ "grok-4-1-fast-non-reasoning": {
1075
+ name: "grok-4-1-fast-non-reasoning",
1076
+ provider: Vendor.Grok,
1077
+ description: "Fast Grok 4.1 without reasoning, 2M context window, vision support",
1078
+ isActive: true,
1079
+ releaseDate: "2025-11-01",
1080
+ knowledgeCutoff: "2024-11-01",
1081
+ features: {
1082
+ reasoning: false,
1083
+ streaming: true,
1084
+ structuredOutput: true,
1085
+ functionCalling: true,
1086
+ fineTuning: false,
1087
+ predictedOutputs: false,
1088
+ realtime: false,
1089
+ vision: true,
1090
+ audio: false,
1091
+ video: false,
1092
+ batchAPI: false,
1093
+ promptCaching: false,
1094
+ input: {
1095
+ tokens: 2e6,
1096
+ text: true,
1097
+ image: true,
1098
+ cpm: 0.2
1099
+ },
1100
+ output: {
1101
+ tokens: 65536,
1102
+ text: true,
1103
+ cpm: 0.5
1104
+ }
1105
+ }
1106
+ },
1107
+ // Grok Code Series
1108
+ "grok-code-fast-1": {
1109
+ name: "grok-code-fast-1",
1110
+ provider: Vendor.Grok,
1111
+ description: "Specialized coding model with reasoning capabilities, 256K context",
1112
+ isActive: true,
1113
+ releaseDate: "2025-10-01",
1114
+ knowledgeCutoff: "2024-11-01",
1115
+ features: {
1116
+ reasoning: true,
1117
+ streaming: true,
1118
+ structuredOutput: true,
1119
+ functionCalling: true,
1120
+ fineTuning: false,
1121
+ predictedOutputs: false,
1122
+ realtime: false,
1123
+ vision: false,
1124
+ audio: false,
1125
+ video: false,
1126
+ batchAPI: false,
1127
+ promptCaching: false,
1128
+ input: {
1129
+ tokens: 256e3,
1130
+ text: true,
1131
+ cpm: 0.2
1132
+ },
1133
+ output: {
1134
+ tokens: 32768,
1135
+ text: true,
1136
+ cpm: 1.5
1137
+ }
1138
+ }
1139
+ },
1140
+ // Grok 4 Series
1141
+ "grok-4-fast-reasoning": {
1142
+ name: "grok-4-fast-reasoning",
1143
+ provider: Vendor.Grok,
1144
+ description: "Fast Grok 4 with reasoning capabilities, 2M context window",
1145
+ isActive: true,
1146
+ releaseDate: "2025-09-01",
1147
+ knowledgeCutoff: "2024-11-01",
1148
+ features: {
1149
+ reasoning: true,
1150
+ streaming: true,
1151
+ structuredOutput: true,
1152
+ functionCalling: true,
1153
+ fineTuning: false,
1154
+ predictedOutputs: false,
1155
+ realtime: false,
1156
+ vision: false,
1157
+ audio: false,
1158
+ video: false,
1159
+ batchAPI: false,
1160
+ promptCaching: false,
1161
+ input: {
1162
+ tokens: 2e6,
1163
+ text: true,
1164
+ cpm: 0.2
1165
+ },
1166
+ output: {
1167
+ tokens: 65536,
1168
+ text: true,
1169
+ cpm: 0.5
1170
+ }
1171
+ }
1172
+ },
1173
+ "grok-4-fast-non-reasoning": {
1174
+ name: "grok-4-fast-non-reasoning",
1175
+ provider: Vendor.Grok,
1176
+ description: "Fast Grok 4 without reasoning, 2M context window, vision support",
1177
+ isActive: true,
1178
+ releaseDate: "2025-09-01",
1179
+ knowledgeCutoff: "2024-11-01",
1180
+ features: {
1181
+ reasoning: false,
1182
+ streaming: true,
1183
+ structuredOutput: true,
1184
+ functionCalling: true,
1185
+ fineTuning: false,
1186
+ predictedOutputs: false,
1187
+ realtime: false,
1188
+ vision: true,
1189
+ audio: false,
1190
+ video: false,
1191
+ batchAPI: false,
1192
+ promptCaching: false,
1193
+ input: {
1194
+ tokens: 2e6,
1195
+ text: true,
1196
+ image: true,
1197
+ cpm: 0.2
1198
+ },
1199
+ output: {
1200
+ tokens: 65536,
1201
+ text: true,
1202
+ cpm: 0.5
1203
+ }
1204
+ }
1205
+ },
1206
+ "grok-4-0709": {
1207
+ name: "grok-4-0709",
1208
+ provider: Vendor.Grok,
1209
+ description: "Grok 4 flagship model (July 2025 release), 256K context, vision support",
1210
+ isActive: true,
1211
+ releaseDate: "2025-07-09",
1212
+ knowledgeCutoff: "2024-11-01",
1213
+ features: {
1214
+ reasoning: false,
1215
+ streaming: true,
1216
+ structuredOutput: true,
1217
+ functionCalling: true,
1218
+ fineTuning: false,
1219
+ predictedOutputs: false,
1220
+ realtime: false,
1221
+ vision: true,
1222
+ audio: false,
1223
+ video: false,
1224
+ batchAPI: false,
1225
+ promptCaching: false,
1226
+ input: {
1227
+ tokens: 256e3,
1228
+ text: true,
1229
+ image: true,
1230
+ cpm: 3
1231
+ },
1232
+ output: {
1233
+ tokens: 32768,
1234
+ text: true,
1235
+ cpm: 15
1236
+ }
1237
+ }
1238
+ },
1239
+ // Grok 3 Series
1240
+ "grok-3-mini": {
1241
+ name: "grok-3-mini",
1242
+ provider: Vendor.Grok,
1243
+ description: "Lightweight, cost-efficient model for simpler tasks, 131K context",
1244
+ isActive: true,
1245
+ releaseDate: "2025-06-01",
1246
+ knowledgeCutoff: "2024-11-01",
1247
+ features: {
1248
+ reasoning: false,
1249
+ streaming: true,
1250
+ structuredOutput: true,
1251
+ functionCalling: true,
1252
+ fineTuning: false,
1253
+ predictedOutputs: false,
1254
+ realtime: false,
1255
+ vision: false,
1256
+ audio: false,
1257
+ video: false,
1258
+ batchAPI: false,
1259
+ promptCaching: false,
1260
+ input: {
1261
+ tokens: 131072,
1262
+ text: true,
1263
+ cpm: 0.3
1264
+ },
1265
+ output: {
1266
+ tokens: 32768,
1267
+ text: true,
1268
+ cpm: 0.5
1269
+ }
1270
+ }
1271
+ },
1272
+ "grok-3": {
1273
+ name: "grok-3",
1274
+ provider: Vendor.Grok,
1275
+ description: "Production model for general-purpose tasks, 131K context",
1276
+ isActive: true,
1277
+ releaseDate: "2025-06-01",
1278
+ knowledgeCutoff: "2024-11-01",
1279
+ features: {
1280
+ reasoning: false,
1281
+ streaming: true,
1282
+ structuredOutput: true,
1283
+ functionCalling: true,
1284
+ fineTuning: false,
1285
+ predictedOutputs: false,
1286
+ realtime: false,
1287
+ vision: false,
1288
+ audio: false,
1289
+ video: false,
1290
+ batchAPI: false,
1291
+ promptCaching: false,
1292
+ input: {
1293
+ tokens: 131072,
1294
+ text: true,
1295
+ cpm: 3
1296
+ },
1297
+ output: {
1298
+ tokens: 32768,
1299
+ text: true,
1300
+ cpm: 15
1301
+ }
1302
+ }
1303
+ },
1304
+ // Grok 2 Series (Vision)
1305
+ "grok-2-vision-1212": {
1306
+ name: "grok-2-vision-1212",
1307
+ provider: Vendor.Grok,
1308
+ description: "Vision-capable model for image understanding, 32K context",
1309
+ isActive: true,
1310
+ releaseDate: "2024-12-12",
1311
+ knowledgeCutoff: "2024-11-01",
1312
+ features: {
1313
+ reasoning: false,
1314
+ streaming: true,
1315
+ structuredOutput: true,
1316
+ functionCalling: true,
1317
+ fineTuning: false,
1318
+ predictedOutputs: false,
1319
+ realtime: false,
1320
+ vision: true,
1321
+ audio: false,
1322
+ video: false,
1323
+ batchAPI: false,
1324
+ promptCaching: false,
1325
+ input: {
1326
+ tokens: 32768,
1327
+ text: true,
1328
+ image: true,
1329
+ cpm: 2
1330
+ },
1331
+ output: {
1332
+ tokens: 8192,
1333
+ text: true,
1334
+ cpm: 10
1335
+ }
1336
+ }
1337
+ }
1338
+ };
1339
+ function getModelInfo(modelName) {
1340
+ return MODEL_REGISTRY[modelName];
1341
+ }
1342
+ function getModelsByVendor(vendor) {
1343
+ return Object.values(MODEL_REGISTRY).filter((model) => model.provider === vendor);
1344
+ }
1345
+ function getActiveModels() {
1346
+ return Object.values(MODEL_REGISTRY).filter((model) => model.isActive);
1347
+ }
1348
+ function calculateCost(model, inputTokens, outputTokens, options) {
1349
+ const modelInfo = getModelInfo(model);
1350
+ if (!modelInfo) {
1351
+ return null;
1352
+ }
1353
+ const inputCPM = options?.useCachedInput && modelInfo.features.input.cpmCached !== void 0 ? modelInfo.features.input.cpmCached : modelInfo.features.input.cpm;
1354
+ const outputCPM = modelInfo.features.output.cpm;
1355
+ const inputCost = inputTokens / 1e6 * inputCPM;
1356
+ const outputCost = outputTokens / 1e6 * outputCPM;
1357
+ return inputCost + outputCost;
1358
+ }
1359
+
1360
+ // src/domain/entities/Services.ts
1361
+ var SERVICE_DEFINITIONS = [
1362
+ // ============ Major Vendors ============
1363
+ {
1364
+ id: "microsoft",
1365
+ name: "Microsoft",
1366
+ category: "major-vendors",
1367
+ urlPattern: /graph\.microsoft\.com|login\.microsoftonline\.com/i,
1368
+ baseURL: "https://graph.microsoft.com/v1.0",
1369
+ docsURL: "https://learn.microsoft.com/en-us/graph/",
1370
+ commonScopes: ["User.Read", "Files.ReadWrite", "Mail.Read", "Calendars.ReadWrite"]
1371
+ },
1372
+ {
1373
+ id: "google",
1374
+ name: "Google",
1375
+ category: "major-vendors",
1376
+ urlPattern: /googleapis\.com|accounts\.google\.com/i,
1377
+ baseURL: "https://www.googleapis.com",
1378
+ docsURL: "https://developers.google.com/",
1379
+ commonScopes: [
1380
+ "https://www.googleapis.com/auth/drive",
1381
+ "https://www.googleapis.com/auth/calendar",
1382
+ "https://www.googleapis.com/auth/gmail.readonly"
1383
+ ]
1384
+ },
1385
+ // ============ Communication ============
1386
+ {
1387
+ id: "slack",
1388
+ name: "Slack",
1389
+ category: "communication",
1390
+ urlPattern: /slack\.com/i,
1391
+ baseURL: "https://slack.com/api",
1392
+ docsURL: "https://api.slack.com/methods",
1393
+ commonScopes: ["chat:write", "channels:read", "users:read"]
1394
+ },
1395
+ {
1396
+ id: "discord",
1397
+ name: "Discord",
1398
+ category: "communication",
1399
+ urlPattern: /discord\.com|discordapp\.com/i,
1400
+ baseURL: "https://discord.com/api/v10",
1401
+ docsURL: "https://discord.com/developers/docs",
1402
+ commonScopes: ["bot", "messages.read"]
1403
+ },
1404
+ {
1405
+ id: "telegram",
1406
+ name: "Telegram",
1407
+ category: "communication",
1408
+ urlPattern: /api\.telegram\.org/i,
1409
+ baseURL: "https://api.telegram.org",
1410
+ docsURL: "https://core.telegram.org/bots/api"
1411
+ },
1412
+ // ============ Development & Project Management ============
1413
+ {
1414
+ id: "github",
1415
+ name: "GitHub",
1416
+ category: "development",
1417
+ urlPattern: /api\.github\.com/i,
1418
+ baseURL: "https://api.github.com",
1419
+ docsURL: "https://docs.github.com/en/rest",
1420
+ commonScopes: ["repo", "read:user", "read:org"]
1421
+ },
1422
+ {
1423
+ id: "gitlab",
1424
+ name: "GitLab",
1425
+ category: "development",
1426
+ urlPattern: /gitlab\.com|gitlab\./i,
1427
+ baseURL: "https://gitlab.com/api/v4",
1428
+ docsURL: "https://docs.gitlab.com/ee/api/",
1429
+ commonScopes: ["api", "read_user", "read_repository"]
1430
+ },
1431
+ {
1432
+ id: "bitbucket",
1433
+ name: "Bitbucket",
1434
+ category: "development",
1435
+ urlPattern: /api\.bitbucket\.org|bitbucket\.org/i,
1436
+ baseURL: "https://api.bitbucket.org/2.0",
1437
+ docsURL: "https://developer.atlassian.com/cloud/bitbucket/rest/",
1438
+ commonScopes: ["repository", "pullrequest"]
1439
+ },
1440
+ {
1441
+ id: "jira",
1442
+ name: "Jira",
1443
+ category: "development",
1444
+ urlPattern: /atlassian\.net.*jira|jira\./i,
1445
+ baseURL: "https://your-domain.atlassian.net/rest/api/3",
1446
+ docsURL: "https://developer.atlassian.com/cloud/jira/platform/rest/v3/",
1447
+ commonScopes: ["read:jira-work", "write:jira-work"]
1448
+ },
1449
+ {
1450
+ id: "linear",
1451
+ name: "Linear",
1452
+ category: "development",
1453
+ urlPattern: /api\.linear\.app/i,
1454
+ baseURL: "https://api.linear.app/graphql",
1455
+ docsURL: "https://developers.linear.app/docs",
1456
+ commonScopes: ["read", "write"]
1457
+ },
1458
+ {
1459
+ id: "asana",
1460
+ name: "Asana",
1461
+ category: "development",
1462
+ urlPattern: /api\.asana\.com/i,
1463
+ baseURL: "https://app.asana.com/api/1.0",
1464
+ docsURL: "https://developers.asana.com/docs"
1465
+ },
1466
+ {
1467
+ id: "trello",
1468
+ name: "Trello",
1469
+ category: "development",
1470
+ urlPattern: /api\.trello\.com/i,
1471
+ baseURL: "https://api.trello.com/1",
1472
+ docsURL: "https://developer.atlassian.com/cloud/trello/rest/",
1473
+ commonScopes: ["read", "write"]
1474
+ },
1475
+ // ============ Productivity & Collaboration ============
1476
+ {
1477
+ id: "notion",
1478
+ name: "Notion",
1479
+ category: "productivity",
1480
+ urlPattern: /api\.notion\.com/i,
1481
+ baseURL: "https://api.notion.com/v1",
1482
+ docsURL: "https://developers.notion.com/reference"
1483
+ },
1484
+ {
1485
+ id: "airtable",
1486
+ name: "Airtable",
1487
+ category: "productivity",
1488
+ urlPattern: /api\.airtable\.com/i,
1489
+ baseURL: "https://api.airtable.com/v0",
1490
+ docsURL: "https://airtable.com/developers/web/api",
1491
+ commonScopes: ["data.records:read", "data.records:write"]
1492
+ },
1493
+ {
1494
+ id: "confluence",
1495
+ name: "Confluence",
1496
+ category: "productivity",
1497
+ urlPattern: /atlassian\.net.*wiki|confluence\./i,
1498
+ baseURL: "https://your-domain.atlassian.net/wiki/rest/api",
1499
+ docsURL: "https://developer.atlassian.com/cloud/confluence/rest/",
1500
+ commonScopes: ["read:confluence-content.all", "write:confluence-content"]
1501
+ },
1502
+ // ============ CRM & Sales ============
1503
+ {
1504
+ id: "salesforce",
1505
+ name: "Salesforce",
1506
+ category: "crm",
1507
+ urlPattern: /salesforce\.com|force\.com/i,
1508
+ baseURL: "https://your-instance.salesforce.com/services/data/v58.0",
1509
+ docsURL: "https://developer.salesforce.com/docs/apis",
1510
+ commonScopes: ["api", "refresh_token"]
1511
+ },
1512
+ {
1513
+ id: "hubspot",
1514
+ name: "HubSpot",
1515
+ category: "crm",
1516
+ urlPattern: /api\.hubapi\.com|api\.hubspot\.com/i,
1517
+ baseURL: "https://api.hubapi.com",
1518
+ docsURL: "https://developers.hubspot.com/docs/api",
1519
+ commonScopes: ["crm.objects.contacts.read", "crm.objects.contacts.write"]
1520
+ },
1521
+ {
1522
+ id: "pipedrive",
1523
+ name: "Pipedrive",
1524
+ category: "crm",
1525
+ urlPattern: /api\.pipedrive\.com/i,
1526
+ baseURL: "https://api.pipedrive.com/v1",
1527
+ docsURL: "https://developers.pipedrive.com/docs/api/v1"
1528
+ },
1529
+ // ============ Payments & Finance ============
1530
+ {
1531
+ id: "stripe",
1532
+ name: "Stripe",
1533
+ category: "payments",
1534
+ urlPattern: /api\.stripe\.com/i,
1535
+ baseURL: "https://api.stripe.com/v1",
1536
+ docsURL: "https://stripe.com/docs/api"
1537
+ },
1538
+ {
1539
+ id: "paypal",
1540
+ name: "PayPal",
1541
+ category: "payments",
1542
+ urlPattern: /api\.paypal\.com|api-m\.paypal\.com/i,
1543
+ baseURL: "https://api-m.paypal.com/v2",
1544
+ docsURL: "https://developer.paypal.com/docs/api/"
1545
+ },
1546
+ // ============ Cloud Providers ============
1547
+ {
1548
+ id: "aws",
1549
+ name: "Amazon Web Services",
1550
+ category: "cloud",
1551
+ urlPattern: /amazonaws\.com/i,
1552
+ baseURL: "https://aws.amazon.com",
1553
+ docsURL: "https://docs.aws.amazon.com/"
1554
+ },
1555
+ // ============ Storage ============
1556
+ {
1557
+ id: "dropbox",
1558
+ name: "Dropbox",
1559
+ category: "storage",
1560
+ urlPattern: /api\.dropboxapi\.com|dropbox\.com/i,
1561
+ baseURL: "https://api.dropboxapi.com/2",
1562
+ docsURL: "https://www.dropbox.com/developers/documentation",
1563
+ commonScopes: ["files.content.read", "files.content.write"]
1564
+ },
1565
+ {
1566
+ id: "box",
1567
+ name: "Box",
1568
+ category: "storage",
1569
+ urlPattern: /api\.box\.com/i,
1570
+ baseURL: "https://api.box.com/2.0",
1571
+ docsURL: "https://developer.box.com/reference/"
1572
+ },
1573
+ // ============ Email ============
1574
+ {
1575
+ id: "sendgrid",
1576
+ name: "SendGrid",
1577
+ category: "email",
1578
+ urlPattern: /api\.sendgrid\.com/i,
1579
+ baseURL: "https://api.sendgrid.com/v3",
1580
+ docsURL: "https://docs.sendgrid.com/api-reference"
1581
+ },
1582
+ {
1583
+ id: "mailchimp",
1584
+ name: "Mailchimp",
1585
+ category: "email",
1586
+ urlPattern: /api\.mailchimp\.com|mandrillapp\.com/i,
1587
+ baseURL: "https://server.api.mailchimp.com/3.0",
1588
+ docsURL: "https://mailchimp.com/developer/marketing/api/"
1589
+ },
1590
+ {
1591
+ id: "postmark",
1592
+ name: "Postmark",
1593
+ category: "email",
1594
+ urlPattern: /api\.postmarkapp\.com/i,
1595
+ baseURL: "https://api.postmarkapp.com",
1596
+ docsURL: "https://postmarkapp.com/developer"
1597
+ },
1598
+ // ============ Monitoring & Observability ============
1599
+ {
1600
+ id: "datadog",
1601
+ name: "Datadog",
1602
+ category: "monitoring",
1603
+ urlPattern: /api\.datadoghq\.com/i,
1604
+ baseURL: "https://api.datadoghq.com/api/v2",
1605
+ docsURL: "https://docs.datadoghq.com/api/"
1606
+ },
1607
+ {
1608
+ id: "pagerduty",
1609
+ name: "PagerDuty",
1610
+ category: "monitoring",
1611
+ urlPattern: /api\.pagerduty\.com/i,
1612
+ baseURL: "https://api.pagerduty.com",
1613
+ docsURL: "https://developer.pagerduty.com/api-reference/"
1614
+ },
1615
+ {
1616
+ id: "sentry",
1617
+ name: "Sentry",
1618
+ category: "monitoring",
1619
+ urlPattern: /sentry\.io/i,
1620
+ baseURL: "https://sentry.io/api/0",
1621
+ docsURL: "https://docs.sentry.io/api/"
1622
+ },
1623
+ // ============ Search ============
1624
+ {
1625
+ id: "serper",
1626
+ name: "Serper",
1627
+ category: "search",
1628
+ urlPattern: /serper\.dev/i,
1629
+ baseURL: "https://google.serper.dev",
1630
+ docsURL: "https://serper.dev/docs"
1631
+ },
1632
+ {
1633
+ id: "brave-search",
1634
+ name: "Brave Search",
1635
+ category: "search",
1636
+ urlPattern: /api\.search\.brave\.com/i,
1637
+ baseURL: "https://api.search.brave.com/res/v1",
1638
+ docsURL: "https://brave.com/search/api/"
1639
+ },
1640
+ {
1641
+ id: "tavily",
1642
+ name: "Tavily",
1643
+ category: "search",
1644
+ urlPattern: /api\.tavily\.com/i,
1645
+ baseURL: "https://api.tavily.com",
1646
+ docsURL: "https://tavily.com/docs"
1647
+ },
1648
+ {
1649
+ id: "rapidapi-search",
1650
+ name: "RapidAPI Search",
1651
+ category: "search",
1652
+ urlPattern: /real-time-web-search\.p\.rapidapi\.com/i,
1653
+ baseURL: "https://real-time-web-search.p.rapidapi.com",
1654
+ docsURL: "https://rapidapi.com/letscrape-6bRBa3QguO5/api/real-time-web-search"
1655
+ },
1656
+ // ============ Scraping ============
1657
+ {
1658
+ id: "zenrows",
1659
+ name: "ZenRows",
1660
+ category: "scrape",
1661
+ urlPattern: /api\.zenrows\.com/i,
1662
+ baseURL: "https://api.zenrows.com/v1",
1663
+ docsURL: "https://docs.zenrows.com/universal-scraper-api/api-reference"
1664
+ },
1665
+ // ============ Other ============
1666
+ {
1667
+ id: "twilio",
1668
+ name: "Twilio",
1669
+ category: "other",
1670
+ urlPattern: /api\.twilio\.com/i,
1671
+ baseURL: "https://api.twilio.com/2010-04-01",
1672
+ docsURL: "https://www.twilio.com/docs/usage/api"
1673
+ },
1674
+ {
1675
+ id: "zendesk",
1676
+ name: "Zendesk",
1677
+ category: "other",
1678
+ urlPattern: /zendesk\.com/i,
1679
+ baseURL: "https://your-subdomain.zendesk.com/api/v2",
1680
+ docsURL: "https://developer.zendesk.com/api-reference/",
1681
+ commonScopes: ["read", "write"]
1682
+ },
1683
+ {
1684
+ id: "intercom",
1685
+ name: "Intercom",
1686
+ category: "other",
1687
+ urlPattern: /api\.intercom\.io/i,
1688
+ baseURL: "https://api.intercom.io",
1689
+ docsURL: "https://developers.intercom.com/docs/"
1690
+ },
1691
+ {
1692
+ id: "shopify",
1693
+ name: "Shopify",
1694
+ category: "other",
1695
+ urlPattern: /shopify\.com.*admin/i,
1696
+ baseURL: "https://your-store.myshopify.com/admin/api/2024-01",
1697
+ docsURL: "https://shopify.dev/docs/api",
1698
+ commonScopes: ["read_products", "write_products", "read_orders"]
1699
+ }
1700
+ ];
1701
+ var Services = Object.fromEntries(
1702
+ SERVICE_DEFINITIONS.map((def) => [
1703
+ // Convert kebab-case to PascalCase for object key
1704
+ def.id.split("-").map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(""),
1705
+ def.id
1706
+ ])
1707
+ );
1708
+ var SERVICE_URL_PATTERNS = SERVICE_DEFINITIONS.map((def) => ({
1709
+ service: def.id,
1710
+ pattern: def.urlPattern
1711
+ }));
1712
+ var SERVICE_INFO = Object.fromEntries(
1713
+ SERVICE_DEFINITIONS.map((def) => [
1714
+ def.id,
1715
+ {
1716
+ id: def.id,
1717
+ name: def.name,
1718
+ category: def.category,
1719
+ baseURL: def.baseURL,
1720
+ docsURL: def.docsURL,
1721
+ commonScopes: def.commonScopes
1722
+ }
1723
+ ])
1724
+ );
1725
+ var compiledPatterns = null;
1726
+ function getCompiledPatterns() {
1727
+ if (!compiledPatterns) {
1728
+ compiledPatterns = SERVICE_DEFINITIONS.map((def) => ({
1729
+ service: def.id,
1730
+ pattern: def.urlPattern
1731
+ }));
1732
+ }
1733
+ return compiledPatterns;
1734
+ }
1735
+ function detectServiceFromURL(url) {
1736
+ const patterns = getCompiledPatterns();
1737
+ for (const { service, pattern } of patterns) {
1738
+ if (pattern.test(url)) {
1739
+ return service;
1740
+ }
1741
+ }
1742
+ return void 0;
1743
+ }
1744
+ function getServiceInfo(serviceType) {
1745
+ return SERVICE_INFO[serviceType];
1746
+ }
1747
+ function getServiceDefinition(serviceType) {
1748
+ return SERVICE_DEFINITIONS.find((def) => def.id === serviceType);
1749
+ }
1750
+ function getServicesByCategory(category) {
1751
+ return SERVICE_DEFINITIONS.filter((def) => def.category === category);
1752
+ }
1753
+ function getAllServiceIds() {
1754
+ return SERVICE_DEFINITIONS.map((def) => def.id);
1755
+ }
1756
+ function isKnownService(serviceId) {
1757
+ return SERVICE_DEFINITIONS.some((def) => def.id === serviceId);
1758
+ }
1759
+
1760
+ exports.LLM_MODELS = LLM_MODELS;
1761
+ exports.MODEL_REGISTRY = MODEL_REGISTRY;
1762
+ exports.SERVICE_DEFINITIONS = SERVICE_DEFINITIONS;
1763
+ exports.SERVICE_INFO = SERVICE_INFO;
1764
+ exports.SERVICE_URL_PATTERNS = SERVICE_URL_PATTERNS;
1765
+ exports.Services = Services;
1766
+ exports.VENDORS = VENDORS;
1767
+ exports.Vendor = Vendor;
1768
+ exports.calculateCost = calculateCost;
1769
+ exports.detectServiceFromURL = detectServiceFromURL;
1770
+ exports.getActiveModels = getActiveModels;
1771
+ exports.getAllServiceIds = getAllServiceIds;
1772
+ exports.getModelInfo = getModelInfo;
1773
+ exports.getModelsByVendor = getModelsByVendor;
1774
+ exports.getServiceDefinition = getServiceDefinition;
1775
+ exports.getServiceInfo = getServiceInfo;
1776
+ exports.getServicesByCategory = getServicesByCategory;
1777
+ exports.isKnownService = isKnownService;
1778
+ exports.isVendor = isVendor;
1779
+ //# sourceMappingURL=index.cjs.map
1780
+ //# sourceMappingURL=index.cjs.map