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