@everworker/oneringai 0.4.5 → 0.4.6

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.
package/dist/index.js CHANGED
@@ -12599,18 +12599,30 @@ function isVendor(value) {
12599
12599
  // src/domain/entities/Model.ts
12600
12600
  var LLM_MODELS = {
12601
12601
  [Vendor.OpenAI]: {
12602
+ // GPT-5.3 Series
12603
+ GPT_5_3_CODEX: "gpt-5.3-codex",
12604
+ GPT_5_3_CHAT: "gpt-5.3-chat-latest",
12602
12605
  // GPT-5.2 Series (Current Flagship)
12603
12606
  GPT_5_2: "gpt-5.2",
12604
12607
  GPT_5_2_PRO: "gpt-5.2-pro",
12608
+ GPT_5_2_CODEX: "gpt-5.2-codex",
12609
+ GPT_5_2_CHAT: "gpt-5.2-chat-latest",
12610
+ // GPT-5.1 Series
12611
+ GPT_5_1: "gpt-5.1",
12612
+ GPT_5_1_CODEX: "gpt-5.1-codex",
12613
+ GPT_5_1_CODEX_MAX: "gpt-5.1-codex-max",
12614
+ GPT_5_1_CODEX_MINI: "gpt-5.1-codex-mini",
12615
+ GPT_5_1_CHAT: "gpt-5.1-chat-latest",
12605
12616
  // GPT-5 Series
12606
12617
  GPT_5: "gpt-5",
12607
12618
  GPT_5_MINI: "gpt-5-mini",
12608
12619
  GPT_5_NANO: "gpt-5-nano",
12620
+ GPT_5_CHAT: "gpt-5-chat-latest",
12609
12621
  // GPT-4.1 Series
12610
12622
  GPT_4_1: "gpt-4.1",
12611
12623
  GPT_4_1_MINI: "gpt-4.1-mini",
12612
12624
  GPT_4_1_NANO: "gpt-4.1-nano",
12613
- // GPT-4o Series (Legacy, Audio Capable)
12625
+ // GPT-4o Series (Legacy)
12614
12626
  GPT_4O: "gpt-4o",
12615
12627
  GPT_4O_MINI: "gpt-4o-mini",
12616
12628
  // Reasoning Models (o-series)
@@ -12618,18 +12630,26 @@ var LLM_MODELS = {
12618
12630
  O1: "o1"
12619
12631
  },
12620
12632
  [Vendor.Anthropic]: {
12621
- // Claude 4.5 Series (Current)
12633
+ // Claude 4.6 Series (Current)
12634
+ CLAUDE_OPUS_4_6: "claude-opus-4-6",
12635
+ CLAUDE_SONNET_4_6: "claude-sonnet-4-6",
12636
+ // Claude 4.5 Series
12622
12637
  CLAUDE_OPUS_4_5: "claude-opus-4-5-20251101",
12623
12638
  CLAUDE_SONNET_4_5: "claude-sonnet-4-5-20250929",
12624
12639
  CLAUDE_HAIKU_4_5: "claude-haiku-4-5-20251001",
12625
12640
  // Claude 4.x Legacy
12626
12641
  CLAUDE_OPUS_4_1: "claude-opus-4-1-20250805",
12642
+ CLAUDE_OPUS_4: "claude-opus-4-20250514",
12627
12643
  CLAUDE_SONNET_4: "claude-sonnet-4-20250514",
12628
12644
  CLAUDE_SONNET_3_7: "claude-3-7-sonnet-20250219",
12629
- // Claude 3.x Legacy
12645
+ // Claude 3.x Legacy (Deprecated)
12630
12646
  CLAUDE_HAIKU_3: "claude-3-haiku-20240307"
12631
12647
  },
12632
12648
  [Vendor.Google]: {
12649
+ // Gemini 3.1 Series (Preview)
12650
+ GEMINI_3_1_PRO_PREVIEW: "gemini-3.1-pro-preview",
12651
+ GEMINI_3_1_FLASH_LITE_PREVIEW: "gemini-3.1-flash-lite-preview",
12652
+ GEMINI_3_1_FLASH_IMAGE_PREVIEW: "gemini-3.1-flash-image-preview",
12633
12653
  // Gemini 3 Series (Preview)
12634
12654
  GEMINI_3_FLASH_PREVIEW: "gemini-3-flash-preview",
12635
12655
  GEMINI_3_PRO_PREVIEW: "gemini-3-pro-preview",
@@ -12661,12 +12681,88 @@ var MODEL_REGISTRY = {
12661
12681
  // ============================================================================
12662
12682
  // OpenAI Models (Verified from platform.openai.com)
12663
12683
  // ============================================================================
12684
+ // GPT-5.3 Series
12685
+ "gpt-5.3-codex": {
12686
+ name: "gpt-5.3-codex",
12687
+ provider: Vendor.OpenAI,
12688
+ description: "Latest codex model for coding and agentic tasks. Reasoning.effort: low, medium, high, xhigh",
12689
+ isActive: true,
12690
+ releaseDate: "2026-02-01",
12691
+ knowledgeCutoff: "2025-08-31",
12692
+ features: {
12693
+ reasoning: true,
12694
+ streaming: true,
12695
+ structuredOutput: true,
12696
+ functionCalling: true,
12697
+ fineTuning: false,
12698
+ predictedOutputs: false,
12699
+ realtime: false,
12700
+ vision: true,
12701
+ audio: false,
12702
+ video: false,
12703
+ batchAPI: true,
12704
+ promptCaching: true,
12705
+ parameters: {
12706
+ temperature: false,
12707
+ topP: false,
12708
+ frequencyPenalty: false,
12709
+ presencePenalty: false
12710
+ },
12711
+ input: {
12712
+ tokens: 4e5,
12713
+ text: true,
12714
+ image: true,
12715
+ cpm: 1.75,
12716
+ cpmCached: 0.175
12717
+ },
12718
+ output: {
12719
+ tokens: 128e3,
12720
+ text: true,
12721
+ cpm: 14
12722
+ }
12723
+ }
12724
+ },
12725
+ "gpt-5.3-chat-latest": {
12726
+ name: "gpt-5.3-chat-latest",
12727
+ provider: Vendor.OpenAI,
12728
+ description: "Latest GPT-5.3 chat model for general-purpose use",
12729
+ isActive: true,
12730
+ releaseDate: "2026-02-01",
12731
+ knowledgeCutoff: "2025-08-31",
12732
+ features: {
12733
+ reasoning: false,
12734
+ streaming: true,
12735
+ structuredOutput: true,
12736
+ functionCalling: true,
12737
+ fineTuning: false,
12738
+ predictedOutputs: false,
12739
+ realtime: false,
12740
+ vision: true,
12741
+ audio: false,
12742
+ video: false,
12743
+ batchAPI: true,
12744
+ promptCaching: true,
12745
+ input: {
12746
+ tokens: 128e3,
12747
+ text: true,
12748
+ image: true,
12749
+ cpm: 1.75,
12750
+ cpmCached: 0.175
12751
+ },
12752
+ output: {
12753
+ tokens: 16e3,
12754
+ text: true,
12755
+ cpm: 14
12756
+ }
12757
+ }
12758
+ },
12664
12759
  // GPT-5.2 Series (Current Flagship)
12665
12760
  "gpt-5.2": {
12666
12761
  name: "gpt-5.2",
12667
12762
  provider: Vendor.OpenAI,
12668
12763
  description: "Flagship model for coding and agentic tasks. Reasoning.effort: none, low, medium, high, xhigh",
12669
12764
  isActive: true,
12765
+ preferred: true,
12670
12766
  releaseDate: "2025-12-01",
12671
12767
  knowledgeCutoff: "2025-08-31",
12672
12768
  features: {
@@ -12692,7 +12788,8 @@ var MODEL_REGISTRY = {
12692
12788
  tokens: 4e5,
12693
12789
  text: true,
12694
12790
  image: true,
12695
- cpm: 1.75
12791
+ cpm: 1.75,
12792
+ cpmCached: 0.175
12696
12793
  },
12697
12794
  output: {
12698
12795
  tokens: 128e3,
@@ -12711,7 +12808,7 @@ var MODEL_REGISTRY = {
12711
12808
  features: {
12712
12809
  reasoning: true,
12713
12810
  streaming: true,
12714
- structuredOutput: true,
12811
+ structuredOutput: false,
12715
12812
  functionCalling: true,
12716
12813
  fineTuning: false,
12717
12814
  predictedOutputs: false,
@@ -12740,6 +12837,276 @@ var MODEL_REGISTRY = {
12740
12837
  }
12741
12838
  }
12742
12839
  },
12840
+ "gpt-5.2-codex": {
12841
+ name: "gpt-5.2-codex",
12842
+ provider: Vendor.OpenAI,
12843
+ description: "GPT-5.2 codex for coding and agentic tasks. Reasoning.effort: low, medium, high, xhigh",
12844
+ isActive: true,
12845
+ preferred: true,
12846
+ releaseDate: "2025-12-01",
12847
+ knowledgeCutoff: "2025-08-31",
12848
+ features: {
12849
+ reasoning: true,
12850
+ streaming: true,
12851
+ structuredOutput: true,
12852
+ functionCalling: true,
12853
+ fineTuning: false,
12854
+ predictedOutputs: false,
12855
+ realtime: false,
12856
+ vision: true,
12857
+ audio: false,
12858
+ video: false,
12859
+ batchAPI: true,
12860
+ promptCaching: true,
12861
+ parameters: {
12862
+ temperature: false,
12863
+ topP: false,
12864
+ frequencyPenalty: false,
12865
+ presencePenalty: false
12866
+ },
12867
+ input: {
12868
+ tokens: 4e5,
12869
+ text: true,
12870
+ image: true,
12871
+ cpm: 1.75,
12872
+ cpmCached: 0.175
12873
+ },
12874
+ output: {
12875
+ tokens: 128e3,
12876
+ text: true,
12877
+ cpm: 14
12878
+ }
12879
+ }
12880
+ },
12881
+ "gpt-5.2-chat-latest": {
12882
+ name: "gpt-5.2-chat-latest",
12883
+ provider: Vendor.OpenAI,
12884
+ description: "GPT-5.2 chat model for general-purpose use",
12885
+ isActive: true,
12886
+ releaseDate: "2025-12-01",
12887
+ knowledgeCutoff: "2025-08-31",
12888
+ features: {
12889
+ reasoning: false,
12890
+ streaming: true,
12891
+ structuredOutput: true,
12892
+ functionCalling: true,
12893
+ fineTuning: false,
12894
+ predictedOutputs: false,
12895
+ realtime: false,
12896
+ vision: true,
12897
+ audio: false,
12898
+ video: false,
12899
+ batchAPI: true,
12900
+ promptCaching: true,
12901
+ input: {
12902
+ tokens: 128e3,
12903
+ text: true,
12904
+ image: true,
12905
+ cpm: 1.75,
12906
+ cpmCached: 0.175
12907
+ },
12908
+ output: {
12909
+ tokens: 16e3,
12910
+ text: true,
12911
+ cpm: 14
12912
+ }
12913
+ }
12914
+ },
12915
+ // GPT-5.1 Series
12916
+ "gpt-5.1": {
12917
+ name: "gpt-5.1",
12918
+ provider: Vendor.OpenAI,
12919
+ description: "Intelligent reasoning model for coding and agentic tasks. Reasoning.effort: none, low, medium, high",
12920
+ isActive: true,
12921
+ releaseDate: "2025-10-01",
12922
+ knowledgeCutoff: "2024-09-30",
12923
+ features: {
12924
+ reasoning: true,
12925
+ streaming: true,
12926
+ structuredOutput: true,
12927
+ functionCalling: true,
12928
+ fineTuning: false,
12929
+ predictedOutputs: false,
12930
+ realtime: false,
12931
+ vision: true,
12932
+ audio: false,
12933
+ video: false,
12934
+ batchAPI: true,
12935
+ promptCaching: true,
12936
+ parameters: {
12937
+ temperature: false,
12938
+ topP: false,
12939
+ frequencyPenalty: false,
12940
+ presencePenalty: false
12941
+ },
12942
+ input: {
12943
+ tokens: 4e5,
12944
+ text: true,
12945
+ image: true,
12946
+ cpm: 1.25,
12947
+ cpmCached: 0.125
12948
+ },
12949
+ output: {
12950
+ tokens: 128e3,
12951
+ text: true,
12952
+ cpm: 10
12953
+ }
12954
+ }
12955
+ },
12956
+ "gpt-5.1-codex": {
12957
+ name: "gpt-5.1-codex",
12958
+ provider: Vendor.OpenAI,
12959
+ description: "GPT-5.1 codex for coding and agentic tasks with reasoning",
12960
+ isActive: true,
12961
+ releaseDate: "2025-10-01",
12962
+ knowledgeCutoff: "2024-09-30",
12963
+ features: {
12964
+ reasoning: true,
12965
+ streaming: true,
12966
+ structuredOutput: true,
12967
+ functionCalling: true,
12968
+ fineTuning: false,
12969
+ predictedOutputs: false,
12970
+ realtime: false,
12971
+ vision: true,
12972
+ audio: false,
12973
+ video: false,
12974
+ batchAPI: true,
12975
+ promptCaching: true,
12976
+ parameters: {
12977
+ temperature: false,
12978
+ topP: false,
12979
+ frequencyPenalty: false,
12980
+ presencePenalty: false
12981
+ },
12982
+ input: {
12983
+ tokens: 4e5,
12984
+ text: true,
12985
+ image: true,
12986
+ cpm: 1.25,
12987
+ cpmCached: 0.125
12988
+ },
12989
+ output: {
12990
+ tokens: 128e3,
12991
+ text: true,
12992
+ cpm: 10
12993
+ }
12994
+ }
12995
+ },
12996
+ "gpt-5.1-codex-max": {
12997
+ name: "gpt-5.1-codex-max",
12998
+ provider: Vendor.OpenAI,
12999
+ description: "GPT-5.1 codex max for maximum reasoning depth on coding tasks",
13000
+ isActive: true,
13001
+ releaseDate: "2025-10-01",
13002
+ knowledgeCutoff: "2024-09-30",
13003
+ features: {
13004
+ reasoning: true,
13005
+ streaming: true,
13006
+ structuredOutput: true,
13007
+ functionCalling: true,
13008
+ fineTuning: false,
13009
+ predictedOutputs: false,
13010
+ realtime: false,
13011
+ vision: true,
13012
+ audio: false,
13013
+ video: false,
13014
+ batchAPI: true,
13015
+ promptCaching: true,
13016
+ parameters: {
13017
+ temperature: false,
13018
+ topP: false,
13019
+ frequencyPenalty: false,
13020
+ presencePenalty: false
13021
+ },
13022
+ input: {
13023
+ tokens: 4e5,
13024
+ text: true,
13025
+ image: true,
13026
+ cpm: 1.25,
13027
+ cpmCached: 0.125
13028
+ },
13029
+ output: {
13030
+ tokens: 128e3,
13031
+ text: true,
13032
+ cpm: 10
13033
+ }
13034
+ }
13035
+ },
13036
+ "gpt-5.1-codex-mini": {
13037
+ name: "gpt-5.1-codex-mini",
13038
+ provider: Vendor.OpenAI,
13039
+ description: "GPT-5.1 codex mini for cost-efficient coding tasks",
13040
+ isActive: true,
13041
+ releaseDate: "2025-10-01",
13042
+ knowledgeCutoff: "2024-09-30",
13043
+ features: {
13044
+ reasoning: true,
13045
+ streaming: true,
13046
+ structuredOutput: true,
13047
+ functionCalling: true,
13048
+ fineTuning: false,
13049
+ predictedOutputs: false,
13050
+ realtime: false,
13051
+ vision: true,
13052
+ audio: false,
13053
+ video: false,
13054
+ batchAPI: true,
13055
+ promptCaching: true,
13056
+ parameters: {
13057
+ temperature: false,
13058
+ topP: false,
13059
+ frequencyPenalty: false,
13060
+ presencePenalty: false
13061
+ },
13062
+ input: {
13063
+ tokens: 4e5,
13064
+ text: true,
13065
+ image: true,
13066
+ cpm: 0.25,
13067
+ cpmCached: 0.025
13068
+ },
13069
+ output: {
13070
+ tokens: 128e3,
13071
+ text: true,
13072
+ cpm: 2
13073
+ }
13074
+ }
13075
+ },
13076
+ "gpt-5.1-chat-latest": {
13077
+ name: "gpt-5.1-chat-latest",
13078
+ provider: Vendor.OpenAI,
13079
+ description: "GPT-5.1 chat model for general-purpose use",
13080
+ isActive: true,
13081
+ releaseDate: "2025-10-01",
13082
+ knowledgeCutoff: "2024-09-30",
13083
+ features: {
13084
+ reasoning: false,
13085
+ streaming: true,
13086
+ structuredOutput: true,
13087
+ functionCalling: true,
13088
+ fineTuning: false,
13089
+ predictedOutputs: false,
13090
+ realtime: false,
13091
+ vision: true,
13092
+ audio: false,
13093
+ video: false,
13094
+ batchAPI: true,
13095
+ promptCaching: true,
13096
+ input: {
13097
+ tokens: 128e3,
13098
+ text: true,
13099
+ image: true,
13100
+ cpm: 1.25,
13101
+ cpmCached: 0.125
13102
+ },
13103
+ output: {
13104
+ tokens: 16e3,
13105
+ text: true,
13106
+ cpm: 10
13107
+ }
13108
+ }
13109
+ },
12743
13110
  // GPT-5 Series
12744
13111
  "gpt-5": {
12745
13112
  name: "gpt-5",
@@ -12771,7 +13138,8 @@ var MODEL_REGISTRY = {
12771
13138
  tokens: 4e5,
12772
13139
  text: true,
12773
13140
  image: true,
12774
- cpm: 1.25
13141
+ cpm: 1.25,
13142
+ cpmCached: 0.125
12775
13143
  },
12776
13144
  output: {
12777
13145
  tokens: 128e3,
@@ -12810,7 +13178,8 @@ var MODEL_REGISTRY = {
12810
13178
  tokens: 4e5,
12811
13179
  text: true,
12812
13180
  image: true,
12813
- cpm: 0.25
13181
+ cpm: 0.25,
13182
+ cpmCached: 0.025
12814
13183
  },
12815
13184
  output: {
12816
13185
  tokens: 128e3,
@@ -12849,7 +13218,8 @@ var MODEL_REGISTRY = {
12849
13218
  tokens: 4e5,
12850
13219
  text: true,
12851
13220
  image: true,
12852
- cpm: 0.05
13221
+ cpm: 0.05,
13222
+ cpmCached: 5e-3
12853
13223
  },
12854
13224
  output: {
12855
13225
  tokens: 128e3,
@@ -12858,6 +13228,40 @@ var MODEL_REGISTRY = {
12858
13228
  }
12859
13229
  }
12860
13230
  },
13231
+ "gpt-5-chat-latest": {
13232
+ name: "gpt-5-chat-latest",
13233
+ provider: Vendor.OpenAI,
13234
+ description: "GPT-5 chat model for general-purpose use",
13235
+ isActive: true,
13236
+ releaseDate: "2025-08-01",
13237
+ knowledgeCutoff: "2024-09-30",
13238
+ features: {
13239
+ reasoning: false,
13240
+ streaming: true,
13241
+ structuredOutput: true,
13242
+ functionCalling: true,
13243
+ fineTuning: false,
13244
+ predictedOutputs: false,
13245
+ realtime: false,
13246
+ vision: true,
13247
+ audio: false,
13248
+ video: false,
13249
+ batchAPI: true,
13250
+ promptCaching: true,
13251
+ input: {
13252
+ tokens: 128e3,
13253
+ text: true,
13254
+ image: true,
13255
+ cpm: 1.25,
13256
+ cpmCached: 0.125
13257
+ },
13258
+ output: {
13259
+ tokens: 16e3,
13260
+ text: true,
13261
+ cpm: 10
13262
+ }
13263
+ }
13264
+ },
12861
13265
  // GPT-4.1 Series
12862
13266
  "gpt-4.1": {
12863
13267
  name: "gpt-4.1",
@@ -12865,7 +13269,7 @@ var MODEL_REGISTRY = {
12865
13269
  description: "GPT-4.1 specialized for coding with 1M token context window",
12866
13270
  isActive: true,
12867
13271
  releaseDate: "2025-04-14",
12868
- knowledgeCutoff: "2025-04-01",
13272
+ knowledgeCutoff: "2024-06-01",
12869
13273
  features: {
12870
13274
  reasoning: false,
12871
13275
  streaming: true,
@@ -12883,7 +13287,8 @@ var MODEL_REGISTRY = {
12883
13287
  tokens: 1e6,
12884
13288
  text: true,
12885
13289
  image: true,
12886
- cpm: 2
13290
+ cpm: 2,
13291
+ cpmCached: 0.5
12887
13292
  },
12888
13293
  output: {
12889
13294
  tokens: 32768,
@@ -12898,7 +13303,7 @@ var MODEL_REGISTRY = {
12898
13303
  description: "Efficient GPT-4.1 model, beats GPT-4o in many benchmarks at 83% lower cost",
12899
13304
  isActive: true,
12900
13305
  releaseDate: "2025-04-14",
12901
- knowledgeCutoff: "2025-04-01",
13306
+ knowledgeCutoff: "2024-06-01",
12902
13307
  features: {
12903
13308
  reasoning: false,
12904
13309
  streaming: true,
@@ -12916,7 +13321,8 @@ var MODEL_REGISTRY = {
12916
13321
  tokens: 1e6,
12917
13322
  text: true,
12918
13323
  image: true,
12919
- cpm: 0.4
13324
+ cpm: 0.4,
13325
+ cpmCached: 0.1
12920
13326
  },
12921
13327
  output: {
12922
13328
  tokens: 16384,
@@ -12931,7 +13337,7 @@ var MODEL_REGISTRY = {
12931
13337
  description: "Fastest and cheapest model with 1M context. 80.1% MMLU, ideal for classification/autocompletion",
12932
13338
  isActive: true,
12933
13339
  releaseDate: "2025-04-14",
12934
- knowledgeCutoff: "2025-04-01",
13340
+ knowledgeCutoff: "2024-06-01",
12935
13341
  features: {
12936
13342
  reasoning: false,
12937
13343
  streaming: true,
@@ -12949,7 +13355,8 @@ var MODEL_REGISTRY = {
12949
13355
  tokens: 1e6,
12950
13356
  text: true,
12951
13357
  image: true,
12952
- cpm: 0.1
13358
+ cpm: 0.1,
13359
+ cpmCached: 0.025
12953
13360
  },
12954
13361
  output: {
12955
13362
  tokens: 16384,
@@ -12958,14 +13365,14 @@ var MODEL_REGISTRY = {
12958
13365
  }
12959
13366
  }
12960
13367
  },
12961
- // GPT-4o Series (Legacy, Audio Capable)
13368
+ // GPT-4o Series (Legacy)
12962
13369
  "gpt-4o": {
12963
13370
  name: "gpt-4o",
12964
13371
  provider: Vendor.OpenAI,
12965
- description: "Versatile omni model with audio support. Legacy but still available",
13372
+ description: "Versatile omni model. Legacy but still available",
12966
13373
  isActive: true,
12967
13374
  releaseDate: "2024-05-13",
12968
- knowledgeCutoff: "2024-04-01",
13375
+ knowledgeCutoff: "2023-10-01",
12969
13376
  features: {
12970
13377
  reasoning: false,
12971
13378
  streaming: true,
@@ -12975,7 +13382,7 @@ var MODEL_REGISTRY = {
12975
13382
  predictedOutputs: true,
12976
13383
  realtime: true,
12977
13384
  vision: true,
12978
- audio: true,
13385
+ audio: false,
12979
13386
  video: false,
12980
13387
  batchAPI: true,
12981
13388
  promptCaching: true,
@@ -12983,13 +13390,12 @@ var MODEL_REGISTRY = {
12983
13390
  tokens: 128e3,
12984
13391
  text: true,
12985
13392
  image: true,
12986
- audio: true,
12987
- cpm: 2.5
13393
+ cpm: 2.5,
13394
+ cpmCached: 1.25
12988
13395
  },
12989
13396
  output: {
12990
13397
  tokens: 16384,
12991
13398
  text: true,
12992
- audio: true,
12993
13399
  cpm: 10
12994
13400
  }
12995
13401
  }
@@ -12997,10 +13403,10 @@ var MODEL_REGISTRY = {
12997
13403
  "gpt-4o-mini": {
12998
13404
  name: "gpt-4o-mini",
12999
13405
  provider: Vendor.OpenAI,
13000
- description: "Fast, affordable omni model with audio support",
13406
+ description: "Fast, affordable omni model",
13001
13407
  isActive: true,
13002
13408
  releaseDate: "2024-07-18",
13003
- knowledgeCutoff: "2024-04-01",
13409
+ knowledgeCutoff: "2023-10-01",
13004
13410
  features: {
13005
13411
  reasoning: false,
13006
13412
  streaming: true,
@@ -13010,7 +13416,7 @@ var MODEL_REGISTRY = {
13010
13416
  predictedOutputs: false,
13011
13417
  realtime: true,
13012
13418
  vision: true,
13013
- audio: true,
13419
+ audio: false,
13014
13420
  video: false,
13015
13421
  batchAPI: true,
13016
13422
  promptCaching: true,
@@ -13018,13 +13424,12 @@ var MODEL_REGISTRY = {
13018
13424
  tokens: 128e3,
13019
13425
  text: true,
13020
13426
  image: true,
13021
- audio: true,
13022
- cpm: 0.15
13427
+ cpm: 0.15,
13428
+ cpmCached: 0.075
13023
13429
  },
13024
13430
  output: {
13025
13431
  tokens: 16384,
13026
13432
  text: true,
13027
- audio: true,
13028
13433
  cpm: 0.6
13029
13434
  }
13030
13435
  }
@@ -13036,7 +13441,7 @@ var MODEL_REGISTRY = {
13036
13441
  description: "Fast reasoning model tailored for coding, math, and science",
13037
13442
  isActive: true,
13038
13443
  releaseDate: "2025-01-31",
13039
- knowledgeCutoff: "2024-10-01",
13444
+ knowledgeCutoff: "2023-10-01",
13040
13445
  features: {
13041
13446
  reasoning: true,
13042
13447
  streaming: true,
@@ -13045,11 +13450,11 @@ var MODEL_REGISTRY = {
13045
13450
  fineTuning: false,
13046
13451
  predictedOutputs: false,
13047
13452
  realtime: false,
13048
- vision: true,
13453
+ vision: false,
13049
13454
  audio: false,
13050
13455
  video: false,
13051
13456
  batchAPI: true,
13052
- promptCaching: false,
13457
+ promptCaching: true,
13053
13458
  parameters: {
13054
13459
  temperature: false,
13055
13460
  topP: false,
@@ -13059,8 +13464,8 @@ var MODEL_REGISTRY = {
13059
13464
  input: {
13060
13465
  tokens: 2e5,
13061
13466
  text: true,
13062
- image: true,
13063
- cpm: 1.1
13467
+ cpm: 1.1,
13468
+ cpmCached: 0.55
13064
13469
  },
13065
13470
  output: {
13066
13471
  tokens: 1e5,
@@ -13075,7 +13480,7 @@ var MODEL_REGISTRY = {
13075
13480
  description: "Advanced reasoning model for complex problems",
13076
13481
  isActive: true,
13077
13482
  releaseDate: "2024-12-17",
13078
- knowledgeCutoff: "2024-10-01",
13483
+ knowledgeCutoff: "2023-10-01",
13079
13484
  features: {
13080
13485
  reasoning: true,
13081
13486
  streaming: true,
@@ -13088,7 +13493,7 @@ var MODEL_REGISTRY = {
13088
13493
  audio: false,
13089
13494
  video: false,
13090
13495
  batchAPI: true,
13091
- promptCaching: false,
13496
+ promptCaching: true,
13092
13497
  parameters: {
13093
13498
  temperature: false,
13094
13499
  topP: false,
@@ -13099,7 +13504,8 @@ var MODEL_REGISTRY = {
13099
13504
  tokens: 2e5,
13100
13505
  text: true,
13101
13506
  image: true,
13102
- cpm: 15
13507
+ cpm: 15,
13508
+ cpmCached: 7.5
13103
13509
  },
13104
13510
  output: {
13105
13511
  tokens: 1e5,
@@ -13109,13 +13515,88 @@ var MODEL_REGISTRY = {
13109
13515
  }
13110
13516
  },
13111
13517
  // ============================================================================
13112
- // Anthropic Models (Verified from platform.claude.com)
13518
+ // Anthropic Models (Verified from platform.claude.com - March 2026)
13113
13519
  // ============================================================================
13114
- // Claude 4.5 Series (Current)
13520
+ // Claude 4.6 Series (Current)
13521
+ "claude-opus-4-6": {
13522
+ name: "claude-opus-4-6",
13523
+ provider: Vendor.Anthropic,
13524
+ description: "The most intelligent model for building agents and coding. 128K output, adaptive thinking",
13525
+ isActive: true,
13526
+ preferred: true,
13527
+ releaseDate: "2026-02-01",
13528
+ knowledgeCutoff: "2025-05-01",
13529
+ features: {
13530
+ reasoning: false,
13531
+ streaming: true,
13532
+ structuredOutput: true,
13533
+ functionCalling: true,
13534
+ fineTuning: false,
13535
+ predictedOutputs: false,
13536
+ realtime: false,
13537
+ vision: true,
13538
+ audio: false,
13539
+ video: false,
13540
+ extendedThinking: true,
13541
+ batchAPI: true,
13542
+ promptCaching: true,
13543
+ input: {
13544
+ tokens: 2e5,
13545
+ // 1M with beta header
13546
+ text: true,
13547
+ image: true,
13548
+ cpm: 5,
13549
+ cpmCached: 0.5
13550
+ },
13551
+ output: {
13552
+ tokens: 128e3,
13553
+ text: true,
13554
+ cpm: 25
13555
+ }
13556
+ }
13557
+ },
13558
+ "claude-sonnet-4-6": {
13559
+ name: "claude-sonnet-4-6",
13560
+ provider: Vendor.Anthropic,
13561
+ description: "Best combination of speed and intelligence. Adaptive thinking, 1M context beta",
13562
+ isActive: true,
13563
+ preferred: true,
13564
+ releaseDate: "2026-02-01",
13565
+ knowledgeCutoff: "2025-08-01",
13566
+ features: {
13567
+ reasoning: false,
13568
+ streaming: true,
13569
+ structuredOutput: true,
13570
+ functionCalling: true,
13571
+ fineTuning: false,
13572
+ predictedOutputs: false,
13573
+ realtime: false,
13574
+ vision: true,
13575
+ audio: false,
13576
+ video: false,
13577
+ extendedThinking: true,
13578
+ batchAPI: true,
13579
+ promptCaching: true,
13580
+ input: {
13581
+ tokens: 2e5,
13582
+ // 1M with beta header
13583
+ text: true,
13584
+ image: true,
13585
+ cpm: 3,
13586
+ cpmCached: 0.3
13587
+ },
13588
+ output: {
13589
+ tokens: 64e3,
13590
+ text: true,
13591
+ cpm: 15
13592
+ }
13593
+ }
13594
+ },
13595
+ // Claude 4.5 Series
13115
13596
  "claude-opus-4-5-20251101": {
13116
13597
  name: "claude-opus-4-5-20251101",
13117
13598
  provider: Vendor.Anthropic,
13118
- description: "Premium model combining maximum intelligence with practical performance",
13599
+ description: "Legacy Opus 4.5. Premium model combining maximum intelligence with practical performance",
13119
13600
  isActive: true,
13120
13601
  releaseDate: "2025-11-01",
13121
13602
  knowledgeCutoff: "2025-05-01",
@@ -13150,7 +13631,7 @@ var MODEL_REGISTRY = {
13150
13631
  "claude-sonnet-4-5-20250929": {
13151
13632
  name: "claude-sonnet-4-5-20250929",
13152
13633
  provider: Vendor.Anthropic,
13153
- description: "Smart model for complex agents and coding. Best balance of intelligence, speed, cost",
13634
+ description: "Legacy Sonnet 4.5. Smart model for complex agents and coding",
13154
13635
  isActive: true,
13155
13636
  releaseDate: "2025-09-29",
13156
13637
  knowledgeCutoff: "2025-01-01",
@@ -13170,6 +13651,7 @@ var MODEL_REGISTRY = {
13170
13651
  promptCaching: true,
13171
13652
  input: {
13172
13653
  tokens: 2e5,
13654
+ // 1M with beta header
13173
13655
  text: true,
13174
13656
  image: true,
13175
13657
  cpm: 3,
@@ -13253,10 +13735,45 @@ var MODEL_REGISTRY = {
13253
13735
  }
13254
13736
  }
13255
13737
  },
13738
+ "claude-opus-4-20250514": {
13739
+ name: "claude-opus-4-20250514",
13740
+ provider: Vendor.Anthropic,
13741
+ description: "Legacy Opus 4. Agentic tasks and reasoning",
13742
+ isActive: true,
13743
+ releaseDate: "2025-05-14",
13744
+ knowledgeCutoff: "2025-01-01",
13745
+ features: {
13746
+ reasoning: false,
13747
+ streaming: true,
13748
+ structuredOutput: true,
13749
+ functionCalling: true,
13750
+ fineTuning: false,
13751
+ predictedOutputs: false,
13752
+ realtime: false,
13753
+ vision: true,
13754
+ audio: false,
13755
+ video: false,
13756
+ extendedThinking: true,
13757
+ batchAPI: true,
13758
+ promptCaching: true,
13759
+ input: {
13760
+ tokens: 2e5,
13761
+ text: true,
13762
+ image: true,
13763
+ cpm: 15,
13764
+ cpmCached: 1.5
13765
+ },
13766
+ output: {
13767
+ tokens: 32e3,
13768
+ text: true,
13769
+ cpm: 75
13770
+ }
13771
+ }
13772
+ },
13256
13773
  "claude-sonnet-4-20250514": {
13257
13774
  name: "claude-sonnet-4-20250514",
13258
13775
  provider: Vendor.Anthropic,
13259
- description: "Legacy Sonnet 4. Default for most users, supports 1M context beta",
13776
+ description: "Legacy Sonnet 4. Supports 1M context beta",
13260
13777
  isActive: true,
13261
13778
  releaseDate: "2025-05-14",
13262
13779
  knowledgeCutoff: "2025-01-01",
@@ -13292,7 +13809,7 @@ var MODEL_REGISTRY = {
13292
13809
  "claude-3-7-sonnet-20250219": {
13293
13810
  name: "claude-3-7-sonnet-20250219",
13294
13811
  provider: Vendor.Anthropic,
13295
- description: "Claude 3.7 Sonnet with extended thinking, supports 128K output beta",
13812
+ description: "Deprecated. Claude 3.7 Sonnet with extended thinking",
13296
13813
  isActive: true,
13297
13814
  releaseDate: "2025-02-19",
13298
13815
  knowledgeCutoff: "2024-10-01",
@@ -13319,17 +13836,16 @@ var MODEL_REGISTRY = {
13319
13836
  },
13320
13837
  output: {
13321
13838
  tokens: 64e3,
13322
- // 128K with beta header
13323
13839
  text: true,
13324
13840
  cpm: 15
13325
13841
  }
13326
13842
  }
13327
13843
  },
13328
- // Claude 3.x Legacy
13844
+ // Claude 3.x Legacy (Deprecated - retiring April 19, 2026)
13329
13845
  "claude-3-haiku-20240307": {
13330
13846
  name: "claude-3-haiku-20240307",
13331
13847
  provider: Vendor.Anthropic,
13332
- description: "Fast legacy model. Recommend migrating to Haiku 4.5",
13848
+ description: "Deprecated. Retiring April 19, 2026. Migrate to Haiku 4.5",
13333
13849
  isActive: true,
13334
13850
  releaseDate: "2024-03-07",
13335
13851
  knowledgeCutoff: "2023-08-01",
@@ -13362,16 +13878,124 @@ var MODEL_REGISTRY = {
13362
13878
  }
13363
13879
  },
13364
13880
  // ============================================================================
13365
- // Google Models (Verified from ai.google.dev)
13881
+ // Google Models (Verified from ai.google.dev - March 2026)
13366
13882
  // ============================================================================
13883
+ // Gemini 3.1 Series (Preview)
13884
+ "gemini-3.1-pro-preview": {
13885
+ name: "gemini-3.1-pro-preview",
13886
+ provider: Vendor.Google,
13887
+ description: "Advanced intelligence with powerful agentic and coding capabilities. Replaces gemini-3-pro-preview",
13888
+ isActive: true,
13889
+ preferred: true,
13890
+ releaseDate: "2026-02-01",
13891
+ knowledgeCutoff: "2025-01-01",
13892
+ features: {
13893
+ reasoning: true,
13894
+ streaming: true,
13895
+ structuredOutput: true,
13896
+ functionCalling: true,
13897
+ fineTuning: false,
13898
+ predictedOutputs: false,
13899
+ realtime: false,
13900
+ vision: true,
13901
+ audio: true,
13902
+ video: true,
13903
+ batchAPI: true,
13904
+ promptCaching: true,
13905
+ input: {
13906
+ tokens: 1048576,
13907
+ text: true,
13908
+ image: true,
13909
+ audio: true,
13910
+ video: true,
13911
+ cpm: 2,
13912
+ cpmCached: 0.2
13913
+ },
13914
+ output: {
13915
+ tokens: 65536,
13916
+ text: true,
13917
+ cpm: 12
13918
+ }
13919
+ }
13920
+ },
13921
+ "gemini-3.1-flash-lite-preview": {
13922
+ name: "gemini-3.1-flash-lite-preview",
13923
+ provider: Vendor.Google,
13924
+ description: "High performance, budget-friendly for high-volume agentic tasks and data extraction",
13925
+ isActive: true,
13926
+ releaseDate: "2026-03-01",
13927
+ knowledgeCutoff: "2025-01-01",
13928
+ features: {
13929
+ reasoning: true,
13930
+ streaming: true,
13931
+ structuredOutput: true,
13932
+ functionCalling: true,
13933
+ fineTuning: false,
13934
+ predictedOutputs: false,
13935
+ realtime: false,
13936
+ vision: true,
13937
+ audio: true,
13938
+ video: true,
13939
+ batchAPI: true,
13940
+ promptCaching: true,
13941
+ input: {
13942
+ tokens: 1048576,
13943
+ text: true,
13944
+ image: true,
13945
+ audio: true,
13946
+ video: true,
13947
+ cpm: 0.25
13948
+ },
13949
+ output: {
13950
+ tokens: 65536,
13951
+ text: true,
13952
+ cpm: 1.5
13953
+ }
13954
+ }
13955
+ },
13956
+ "gemini-3.1-flash-image-preview": {
13957
+ name: "gemini-3.1-flash-image-preview",
13958
+ provider: Vendor.Google,
13959
+ description: "High-efficiency image generation with up to 4K output, search grounding support",
13960
+ isActive: true,
13961
+ releaseDate: "2026-02-01",
13962
+ knowledgeCutoff: "2025-01-01",
13963
+ features: {
13964
+ reasoning: true,
13965
+ streaming: true,
13966
+ structuredOutput: false,
13967
+ functionCalling: false,
13968
+ fineTuning: false,
13969
+ predictedOutputs: false,
13970
+ realtime: false,
13971
+ vision: true,
13972
+ audio: false,
13973
+ video: false,
13974
+ batchAPI: true,
13975
+ promptCaching: false,
13976
+ input: {
13977
+ tokens: 131072,
13978
+ text: true,
13979
+ image: true,
13980
+ cpm: 0.25
13981
+ },
13982
+ output: {
13983
+ tokens: 32768,
13984
+ text: true,
13985
+ image: true,
13986
+ cpm: 1.5
13987
+ }
13988
+ }
13989
+ },
13367
13990
  // Gemini 3 Series (Preview)
13368
13991
  "gemini-3-flash-preview": {
13369
13992
  name: "gemini-3-flash-preview",
13370
13993
  provider: Vendor.Google,
13371
- description: "Pro-grade reasoning with Flash-level latency and efficiency",
13994
+ description: "Most powerful agentic and coding model with frontier-class reasoning",
13372
13995
  isActive: true,
13373
- releaseDate: "2025-11-18",
13374
- knowledgeCutoff: "2025-08-01",
13996
+ preferred: true,
13997
+ releaseDate: "2025-12-01",
13998
+ knowledgeCutoff: "2025-01-01",
13375
13999
  features: {
13376
14000
  reasoning: true,
13377
14001
  streaming: true,
@@ -13386,27 +14010,28 @@ var MODEL_REGISTRY = {
13386
14010
  batchAPI: true,
13387
14011
  promptCaching: true,
13388
14012
  input: {
13389
- tokens: 1e6,
14013
+ tokens: 1048576,
13390
14014
  text: true,
13391
14015
  image: true,
13392
14016
  audio: true,
13393
14017
  video: true,
13394
- cpm: 0.15
14018
+ cpm: 0.5,
14019
+ cpmCached: 0.05
13395
14020
  },
13396
14021
  output: {
13397
14022
  tokens: 65536,
13398
14023
  text: true,
13399
- cpm: 0.6
14024
+ cpm: 3
13400
14025
  }
13401
14026
  }
13402
14027
  },
13403
14028
  "gemini-3-pro-preview": {
13404
14029
  name: "gemini-3-pro-preview",
13405
14030
  provider: Vendor.Google,
13406
- description: "Most advanced reasoning Gemini model for complex tasks",
14031
+ description: "Deprecated. Shutting down March 9, 2026. Migrate to gemini-3.1-pro-preview",
13407
14032
  isActive: true,
13408
14033
  releaseDate: "2025-11-18",
13409
- knowledgeCutoff: "2025-08-01",
14034
+ knowledgeCutoff: "2025-01-01",
13410
14035
  features: {
13411
14036
  reasoning: true,
13412
14037
  streaming: true,
@@ -13421,7 +14046,7 @@ var MODEL_REGISTRY = {
13421
14046
  batchAPI: true,
13422
14047
  promptCaching: true,
13423
14048
  input: {
13424
- tokens: 1e6,
14049
+ tokens: 1048576,
13425
14050
  text: true,
13426
14051
  image: true,
13427
14052
  audio: true,
@@ -13438,14 +14063,14 @@ var MODEL_REGISTRY = {
13438
14063
  "gemini-3-pro-image-preview": {
13439
14064
  name: "gemini-3-pro-image-preview",
13440
14065
  provider: Vendor.Google,
13441
- description: "Highest quality image generation model",
14066
+ description: "Professional-grade image generation and editing with reasoning",
13442
14067
  isActive: true,
13443
14068
  releaseDate: "2025-11-18",
13444
- knowledgeCutoff: "2025-08-01",
14069
+ knowledgeCutoff: "2025-01-01",
13445
14070
  features: {
13446
14071
  reasoning: true,
13447
14072
  streaming: true,
13448
- structuredOutput: false,
14073
+ structuredOutput: true,
13449
14074
  functionCalling: false,
13450
14075
  fineTuning: false,
13451
14076
  predictedOutputs: false,
@@ -13454,15 +14079,15 @@ var MODEL_REGISTRY = {
13454
14079
  audio: false,
13455
14080
  video: false,
13456
14081
  batchAPI: true,
13457
- promptCaching: true,
14082
+ promptCaching: false,
13458
14083
  input: {
13459
- tokens: 1e6,
14084
+ tokens: 65536,
13460
14085
  text: true,
13461
14086
  image: true,
13462
14087
  cpm: 1.25
13463
14088
  },
13464
14089
  output: {
13465
- tokens: 65536,
14090
+ tokens: 32768,
13466
14091
  text: true,
13467
14092
  image: true,
13468
14093
  cpm: 10
@@ -13473,7 +14098,7 @@ var MODEL_REGISTRY = {
13473
14098
  "gemini-2.5-pro": {
13474
14099
  name: "gemini-2.5-pro",
13475
14100
  provider: Vendor.Google,
13476
- description: "Advanced multimodal model built for deep reasoning and agents",
14101
+ description: "Most advanced model for complex tasks with deep reasoning and coding",
13477
14102
  isActive: true,
13478
14103
  releaseDate: "2025-03-01",
13479
14104
  knowledgeCutoff: "2025-01-01",
@@ -13491,12 +14116,13 @@ var MODEL_REGISTRY = {
13491
14116
  batchAPI: true,
13492
14117
  promptCaching: true,
13493
14118
  input: {
13494
- tokens: 1e6,
14119
+ tokens: 1048576,
13495
14120
  text: true,
13496
14121
  image: true,
13497
14122
  audio: true,
13498
14123
  video: true,
13499
- cpm: 1.25
14124
+ cpm: 1.25,
14125
+ cpmCached: 0.125
13500
14126
  },
13501
14127
  output: {
13502
14128
  tokens: 65536,
@@ -13508,7 +14134,7 @@ var MODEL_REGISTRY = {
13508
14134
  "gemini-2.5-flash": {
13509
14135
  name: "gemini-2.5-flash",
13510
14136
  provider: Vendor.Google,
13511
- description: "Fast, cost-effective model with excellent reasoning",
14137
+ description: "Best price-performance for low-latency, high-volume tasks with reasoning",
13512
14138
  isActive: true,
13513
14139
  releaseDate: "2025-06-17",
13514
14140
  knowledgeCutoff: "2025-01-01",
@@ -13526,24 +14152,25 @@ var MODEL_REGISTRY = {
13526
14152
  batchAPI: true,
13527
14153
  promptCaching: true,
13528
14154
  input: {
13529
- tokens: 1e6,
14155
+ tokens: 1048576,
13530
14156
  text: true,
13531
14157
  image: true,
13532
14158
  audio: true,
13533
14159
  video: true,
13534
- cpm: 0.15
14160
+ cpm: 0.3,
14161
+ cpmCached: 0.03
13535
14162
  },
13536
14163
  output: {
13537
14164
  tokens: 65536,
13538
14165
  text: true,
13539
- cpm: 0.6
14166
+ cpm: 2.5
13540
14167
  }
13541
14168
  }
13542
14169
  },
13543
14170
  "gemini-2.5-flash-lite": {
13544
14171
  name: "gemini-2.5-flash-lite",
13545
14172
  provider: Vendor.Google,
13546
- description: "Lowest latency for high-volume tasks, summarization, classification",
14173
+ description: "Fastest and most budget-friendly multimodal model in the 2.5 family",
13547
14174
  isActive: true,
13548
14175
  releaseDate: "2025-06-17",
13549
14176
  knowledgeCutoff: "2025-01-01",
@@ -13561,31 +14188,31 @@ var MODEL_REGISTRY = {
13561
14188
  batchAPI: true,
13562
14189
  promptCaching: true,
13563
14190
  input: {
13564
- tokens: 1e6,
14191
+ tokens: 1048576,
13565
14192
  text: true,
13566
14193
  image: true,
13567
14194
  audio: true,
13568
14195
  video: true,
13569
- cpm: 0.075
14196
+ cpm: 0.1
13570
14197
  },
13571
14198
  output: {
13572
14199
  tokens: 65536,
13573
14200
  text: true,
13574
- cpm: 0.3
14201
+ cpm: 0.4
13575
14202
  }
13576
14203
  }
13577
14204
  },
13578
14205
  "gemini-2.5-flash-image": {
13579
14206
  name: "gemini-2.5-flash-image",
13580
14207
  provider: Vendor.Google,
13581
- description: "Image generation and editing model",
14208
+ description: "Fast native image generation and editing (Nano Banana)",
13582
14209
  isActive: true,
13583
- releaseDate: "2025-09-01",
13584
- knowledgeCutoff: "2025-01-01",
14210
+ releaseDate: "2025-10-01",
14211
+ knowledgeCutoff: "2025-06-01",
13585
14212
  features: {
13586
- reasoning: true,
14213
+ reasoning: false,
13587
14214
  streaming: true,
13588
- structuredOutput: false,
14215
+ structuredOutput: true,
13589
14216
  functionCalling: false,
13590
14217
  fineTuning: false,
13591
14218
  predictedOutputs: false,
@@ -13596,13 +14223,13 @@ var MODEL_REGISTRY = {
13596
14223
  batchAPI: true,
13597
14224
  promptCaching: true,
13598
14225
  input: {
13599
- tokens: 1e6,
14226
+ tokens: 65536,
13600
14227
  text: true,
13601
14228
  image: true,
13602
14229
  cpm: 0.15
13603
14230
  },
13604
14231
  output: {
13605
- tokens: 65536,
14232
+ tokens: 32768,
13606
14233
  text: true,
13607
14234
  image: true,
13608
14235
  cpm: 0.6
@@ -13610,7 +14237,7 @@ var MODEL_REGISTRY = {
13610
14237
  }
13611
14238
  },
13612
14239
  // ============================================================================
13613
- // xAI Grok Models (Verified from docs.x.ai - January 2026)
14240
+ // xAI Grok Models (Verified from docs.x.ai - March 2026)
13614
14241
  // ============================================================================
13615
14242
  // Grok 4.1 Series (2M context, fast)
13616
14243
  "grok-4-1-fast-reasoning": {
@@ -13631,13 +14258,14 @@ var MODEL_REGISTRY = {
13631
14258
  vision: true,
13632
14259
  audio: false,
13633
14260
  video: false,
13634
- batchAPI: false,
13635
- promptCaching: false,
14261
+ batchAPI: true,
14262
+ promptCaching: true,
13636
14263
  input: {
13637
14264
  tokens: 2e6,
13638
14265
  text: true,
13639
14266
  image: true,
13640
- cpm: 0.2
14267
+ cpm: 0.2,
14268
+ cpmCached: 0.05
13641
14269
  },
13642
14270
  output: {
13643
14271
  tokens: 65536,
@@ -13664,13 +14292,14 @@ var MODEL_REGISTRY = {
13664
14292
  vision: true,
13665
14293
  audio: false,
13666
14294
  video: false,
13667
- batchAPI: false,
13668
- promptCaching: false,
14295
+ batchAPI: true,
14296
+ promptCaching: true,
13669
14297
  input: {
13670
14298
  tokens: 2e6,
13671
14299
  text: true,
13672
14300
  image: true,
13673
- cpm: 0.2
14301
+ cpm: 0.2,
14302
+ cpmCached: 0.05
13674
14303
  },
13675
14304
  output: {
13676
14305
  tokens: 65536,
@@ -13698,12 +14327,13 @@ var MODEL_REGISTRY = {
13698
14327
  vision: false,
13699
14328
  audio: false,
13700
14329
  video: false,
13701
- batchAPI: false,
13702
- promptCaching: false,
14330
+ batchAPI: true,
14331
+ promptCaching: true,
13703
14332
  input: {
13704
14333
  tokens: 256e3,
13705
14334
  text: true,
13706
- cpm: 0.2
14335
+ cpm: 0.2,
14336
+ cpmCached: 0.02
13707
14337
  },
13708
14338
  output: {
13709
14339
  tokens: 32768,
@@ -13716,7 +14346,7 @@ var MODEL_REGISTRY = {
13716
14346
  "grok-4-fast-reasoning": {
13717
14347
  name: "grok-4-fast-reasoning",
13718
14348
  provider: Vendor.Grok,
13719
- description: "Fast Grok 4 with reasoning capabilities, 2M context window",
14349
+ description: "Fast Grok 4 with reasoning capabilities, 2M context window, vision support",
13720
14350
  isActive: true,
13721
14351
  releaseDate: "2025-09-01",
13722
14352
  knowledgeCutoff: "2024-11-01",
@@ -13728,15 +14358,17 @@ var MODEL_REGISTRY = {
13728
14358
  fineTuning: false,
13729
14359
  predictedOutputs: false,
13730
14360
  realtime: false,
13731
- vision: false,
14361
+ vision: true,
13732
14362
  audio: false,
13733
14363
  video: false,
13734
- batchAPI: false,
13735
- promptCaching: false,
14364
+ batchAPI: true,
14365
+ promptCaching: true,
13736
14366
  input: {
13737
14367
  tokens: 2e6,
13738
14368
  text: true,
13739
- cpm: 0.2
14369
+ image: true,
14370
+ cpm: 0.2,
14371
+ cpmCached: 0.05
13740
14372
  },
13741
14373
  output: {
13742
14374
  tokens: 65536,
@@ -13763,13 +14395,14 @@ var MODEL_REGISTRY = {
13763
14395
  vision: true,
13764
14396
  audio: false,
13765
14397
  video: false,
13766
- batchAPI: false,
13767
- promptCaching: false,
14398
+ batchAPI: true,
14399
+ promptCaching: true,
13768
14400
  input: {
13769
14401
  tokens: 2e6,
13770
14402
  text: true,
13771
14403
  image: true,
13772
- cpm: 0.2
14404
+ cpm: 0.2,
14405
+ cpmCached: 0.05
13773
14406
  },
13774
14407
  output: {
13775
14408
  tokens: 65536,
@@ -13781,12 +14414,12 @@ var MODEL_REGISTRY = {
13781
14414
  "grok-4-0709": {
13782
14415
  name: "grok-4-0709",
13783
14416
  provider: Vendor.Grok,
13784
- description: "Grok 4 flagship model (July 2025 release), 256K context, vision support",
14417
+ description: "Grok 4 flagship model (July 2025 release), 256K context, vision support, reasoning",
13785
14418
  isActive: true,
13786
14419
  releaseDate: "2025-07-09",
13787
14420
  knowledgeCutoff: "2024-11-01",
13788
14421
  features: {
13789
- reasoning: false,
14422
+ reasoning: true,
13790
14423
  streaming: true,
13791
14424
  structuredOutput: true,
13792
14425
  functionCalling: true,
@@ -13796,13 +14429,14 @@ var MODEL_REGISTRY = {
13796
14429
  vision: true,
13797
14430
  audio: false,
13798
14431
  video: false,
13799
- batchAPI: false,
13800
- promptCaching: false,
14432
+ batchAPI: true,
14433
+ promptCaching: true,
13801
14434
  input: {
13802
14435
  tokens: 256e3,
13803
14436
  text: true,
13804
14437
  image: true,
13805
- cpm: 3
14438
+ cpm: 3,
14439
+ cpmCached: 0.75
13806
14440
  },
13807
14441
  output: {
13808
14442
  tokens: 32768,
@@ -13815,12 +14449,12 @@ var MODEL_REGISTRY = {
13815
14449
  "grok-3-mini": {
13816
14450
  name: "grok-3-mini",
13817
14451
  provider: Vendor.Grok,
13818
- description: "Lightweight, cost-efficient model for simpler tasks, 131K context",
14452
+ description: "Lightweight, cost-efficient model with reasoning, 131K context",
13819
14453
  isActive: true,
13820
14454
  releaseDate: "2025-06-01",
13821
14455
  knowledgeCutoff: "2024-11-01",
13822
14456
  features: {
13823
- reasoning: false,
14457
+ reasoning: true,
13824
14458
  streaming: true,
13825
14459
  structuredOutput: true,
13826
14460
  functionCalling: true,
@@ -13830,12 +14464,13 @@ var MODEL_REGISTRY = {
13830
14464
  vision: false,
13831
14465
  audio: false,
13832
14466
  video: false,
13833
- batchAPI: false,
13834
- promptCaching: false,
14467
+ batchAPI: true,
14468
+ promptCaching: true,
13835
14469
  input: {
13836
14470
  tokens: 131072,
13837
14471
  text: true,
13838
- cpm: 0.3
14472
+ cpm: 0.3,
14473
+ cpmCached: 0.07
13839
14474
  },
13840
14475
  output: {
13841
14476
  tokens: 32768,
@@ -13862,12 +14497,13 @@ var MODEL_REGISTRY = {
13862
14497
  vision: false,
13863
14498
  audio: false,
13864
14499
  video: false,
13865
- batchAPI: false,
13866
- promptCaching: false,
14500
+ batchAPI: true,
14501
+ promptCaching: true,
13867
14502
  input: {
13868
14503
  tokens: 131072,
13869
14504
  text: true,
13870
- cpm: 3
14505
+ cpm: 3,
14506
+ cpmCached: 0.75
13871
14507
  },
13872
14508
  output: {
13873
14509
  tokens: 32768,
@@ -13876,11 +14512,11 @@ var MODEL_REGISTRY = {
13876
14512
  }
13877
14513
  }
13878
14514
  },
13879
- // Grok 2 Series (Vision)
14515
+ // Grok 2 Series (Legacy - not in current docs)
13880
14516
  "grok-2-vision-1212": {
13881
14517
  name: "grok-2-vision-1212",
13882
14518
  provider: Vendor.Grok,
13883
- description: "Vision-capable model for image understanding, 32K context",
14519
+ description: "Legacy vision model for image understanding, 32K context. Not in current xAI docs",
13884
14520
  isActive: true,
13885
14521
  releaseDate: "2024-12-12",
13886
14522
  knowledgeCutoff: "2024-11-01",
@@ -17026,27 +17662,6 @@ ${formatValue(entry.value)}`).join("\n\n")
17026
17662
  // src/core/context-nextgen/plugins/ToolCatalogPluginNextGen.ts
17027
17663
  init_Logger();
17028
17664
  var DEFAULT_MAX_LOADED = 10;
17029
- var TOOL_CATALOG_INSTRUCTIONS = `## Tool Catalog
17030
-
17031
- You have access to a dynamic tool catalog. Not all tools are loaded at once \u2014 use these metatools to discover and load what you need:
17032
-
17033
- **tool_catalog_search** \u2014 Browse available tool categories and search for specific tools.
17034
- - No params \u2192 list all available categories with descriptions
17035
- - \`category\` \u2192 list tools in that category
17036
- - \`query\` \u2192 keyword search across categories and tools
17037
-
17038
- **tool_catalog_load** \u2014 Load a category's tools so you can use them.
17039
- - Tools become available immediately after loading.
17040
- - If you need tools from a category, load it first.
17041
-
17042
- **tool_catalog_unload** \u2014 Unload a category to free token budget.
17043
- - Unloaded tools are no longer sent to you.
17044
- - Use when you're done with a category.
17045
-
17046
- **Best practices:**
17047
- - Search first to find the right category before loading.
17048
- - Unload categories you no longer need to keep context lean.
17049
- - Categories marked [LOADED] are already available.`;
17050
17665
  var catalogSearchDefinition = {
17051
17666
  type: "function",
17052
17667
  function: {
@@ -17105,6 +17720,8 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17105
17720
  name = "tool_catalog";
17106
17721
  /** category name → array of tool names that were loaded */
17107
17722
  _loadedCategories = /* @__PURE__ */ new Map();
17723
+ /** Categories that cannot be unloaded */
17724
+ _pinnedCategories = /* @__PURE__ */ new Set();
17108
17725
  /** Reference to the ToolManager for registering/disabling tools */
17109
17726
  _toolManager = null;
17110
17727
  /** Cached connector categories — discovered once in setToolManager() */
@@ -17120,12 +17737,17 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17120
17737
  maxLoadedCategories: DEFAULT_MAX_LOADED,
17121
17738
  ...config
17122
17739
  };
17740
+ if (this._config.pinned?.length) {
17741
+ for (const cat of this._config.pinned) {
17742
+ this._pinnedCategories.add(cat);
17743
+ }
17744
+ }
17123
17745
  }
17124
17746
  // ========================================================================
17125
17747
  // Plugin Interface
17126
17748
  // ========================================================================
17127
17749
  getInstructions() {
17128
- return TOOL_CATALOG_INSTRUCTIONS;
17750
+ return this.buildInstructions();
17129
17751
  }
17130
17752
  async getContent() {
17131
17753
  const categories = this.getAllowedCategories();
@@ -17136,15 +17758,15 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17136
17758
  if (loaded.length > 0) {
17137
17759
  lines.push(`**Loaded:** ${loaded.join(", ")}`);
17138
17760
  }
17139
- lines.push(`**Available categories:** ${categories.length}`);
17761
+ lines.push(`**Available categories:** ${categories.length + this.getConnectorCategories().length}`);
17140
17762
  for (const cat of categories) {
17141
17763
  const tools = ToolCatalogRegistry.getToolsInCategory(cat.name);
17142
- const marker = this._loadedCategories.has(cat.name) ? " [LOADED]" : "";
17143
- lines.push(`- **${cat.displayName}** (${tools.length} tools)${marker}: ${cat.description}`);
17764
+ const markers = this.getCategoryMarkers(cat.name);
17765
+ lines.push(`- **${cat.displayName}** (${tools.length} tools)${markers}: ${cat.description}`);
17144
17766
  }
17145
17767
  for (const cc of this.getConnectorCategories()) {
17146
- const marker = this._loadedCategories.has(cc.name) ? " [LOADED]" : "";
17147
- lines.push(`- **${cc.displayName}** (${cc.toolCount} tools)${marker}: ${cc.description}`);
17768
+ const markers = this.getCategoryMarkers(cc.name);
17769
+ lines.push(`- **${cc.displayName}** (${cc.toolCount} tools)${markers}: ${cc.description}`);
17148
17770
  }
17149
17771
  const content = lines.join("\n");
17150
17772
  this.updateTokenCache(this.estimator.estimateTokens(content));
@@ -17155,7 +17777,8 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17155
17777
  loadedCategories: Array.from(this._loadedCategories.entries()).map(([name, tools]) => ({
17156
17778
  category: name,
17157
17779
  toolCount: tools.length,
17158
- tools
17780
+ tools,
17781
+ pinned: this._pinnedCategories.has(name)
17159
17782
  }))
17160
17783
  };
17161
17784
  }
@@ -17182,11 +17805,14 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17182
17805
  return [searchTool, loadTool, unloadTool];
17183
17806
  }
17184
17807
  isCompactable() {
17185
- return this._loadedCategories.size > 0;
17808
+ for (const category of this._loadedCategories.keys()) {
17809
+ if (!this._pinnedCategories.has(category)) return true;
17810
+ }
17811
+ return false;
17186
17812
  }
17187
17813
  async compact(targetTokensToFree) {
17188
17814
  if (!this._toolManager || this._loadedCategories.size === 0) return 0;
17189
- const categoriesByLastUsed = this.getCategoriesSortedByLastUsed();
17815
+ const categoriesByLastUsed = this.getCategoriesSortedByLastUsed().filter((cat) => !this._pinnedCategories.has(cat));
17190
17816
  let freed = 0;
17191
17817
  for (const category of categoriesByLastUsed) {
17192
17818
  if (freed >= targetTokensToFree) break;
@@ -17227,6 +17853,7 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17227
17853
  }
17228
17854
  destroy() {
17229
17855
  this._loadedCategories.clear();
17856
+ this._pinnedCategories.clear();
17230
17857
  this._toolManager = null;
17231
17858
  this._connectorCategories = null;
17232
17859
  this._destroyed = true;
@@ -17240,11 +17867,20 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17240
17867
  setToolManager(tm) {
17241
17868
  this._toolManager = tm;
17242
17869
  this._connectorCategories = ToolCatalogRegistry.discoverConnectorCategories({
17243
- scope: this._config.categoryScope,
17244
17870
  identities: this._config.identities
17245
17871
  });
17872
+ for (const category of this._pinnedCategories) {
17873
+ const result = this.executeLoad(category);
17874
+ if (result.error) {
17875
+ logger.warn(
17876
+ { category, error: result.error },
17877
+ `[ToolCatalogPlugin] Failed to load pinned category '${category}'`
17878
+ );
17879
+ }
17880
+ }
17246
17881
  if (this._config.autoLoadCategories?.length) {
17247
17882
  for (const category of this._config.autoLoadCategories) {
17883
+ if (this._pinnedCategories.has(category)) continue;
17248
17884
  const result = this.executeLoad(category);
17249
17885
  if (result.error) {
17250
17886
  logger.warn(
@@ -17259,6 +17895,10 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17259
17895
  get loadedCategories() {
17260
17896
  return Array.from(this._loadedCategories.keys());
17261
17897
  }
17898
+ /** Get set of pinned category names */
17899
+ get pinnedCategories() {
17900
+ return this._pinnedCategories;
17901
+ }
17262
17902
  // ========================================================================
17263
17903
  // Metatool Implementations
17264
17904
  // ========================================================================
@@ -17279,6 +17919,7 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17279
17919
  return {
17280
17920
  category,
17281
17921
  loaded,
17922
+ pinned: this._pinnedCategories.has(category),
17282
17923
  tools: tools.map((t) => ({
17283
17924
  name: t.name,
17284
17925
  displayName: t.displayName,
@@ -17300,7 +17941,8 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17300
17941
  displayName: cat.displayName,
17301
17942
  description: cat.description,
17302
17943
  toolCount: tools.length,
17303
- loaded: this._loadedCategories.has(cat.name)
17944
+ loaded: this._loadedCategories.has(cat.name),
17945
+ pinned: this._pinnedCategories.has(cat.name)
17304
17946
  });
17305
17947
  }
17306
17948
  for (const cc of connectorCats) {
@@ -17309,7 +17951,8 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17309
17951
  displayName: cc.displayName,
17310
17952
  description: cc.description,
17311
17953
  toolCount: cc.toolCount,
17312
- loaded: this._loadedCategories.has(cc.name)
17954
+ loaded: this._loadedCategories.has(cc.name),
17955
+ pinned: this._pinnedCategories.has(cc.name)
17313
17956
  });
17314
17957
  }
17315
17958
  return { categories: result };
@@ -17319,20 +17962,28 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17319
17962
  if (!this._toolManager) {
17320
17963
  return { error: "ToolManager not connected. Plugin not properly initialized." };
17321
17964
  }
17322
- if (!ToolCatalogRegistry.isCategoryAllowed(category, this._config.categoryScope)) {
17323
- return { error: `Category '${category}' is not available for this agent.` };
17965
+ const isConnector = ToolCatalogRegistry.parseConnectorCategory(category) !== null;
17966
+ if (isConnector) {
17967
+ const allowed = this.getConnectorCategories().some((cc) => cc.name === category);
17968
+ if (!allowed) {
17969
+ return { error: `Category '${category}' is not available for this agent.` };
17970
+ }
17971
+ } else {
17972
+ if (!ToolCatalogRegistry.isCategoryAllowed(category, this._config.categoryScope)) {
17973
+ return { error: `Category '${category}' is not available for this agent.` };
17974
+ }
17324
17975
  }
17325
17976
  if (this._loadedCategories.has(category)) {
17326
17977
  const toolNames2 = this._loadedCategories.get(category);
17327
17978
  return { loaded: toolNames2.length, tools: toolNames2, alreadyLoaded: true };
17328
17979
  }
17329
- if (this._loadedCategories.size >= this._config.maxLoadedCategories) {
17980
+ const nonPinnedLoaded = this._loadedCategories.size - this._pinnedCategories.size;
17981
+ if (!this._pinnedCategories.has(category) && nonPinnedLoaded >= this._config.maxLoadedCategories) {
17330
17982
  return {
17331
17983
  error: `Maximum loaded categories (${this._config.maxLoadedCategories}) reached. Unload a category first.`,
17332
17984
  loaded: Array.from(this._loadedCategories.keys())
17333
17985
  };
17334
17986
  }
17335
- const isConnector = ToolCatalogRegistry.parseConnectorCategory(category) !== null;
17336
17987
  let tools;
17337
17988
  if (isConnector) {
17338
17989
  tools = ToolCatalogRegistry.resolveConnectorCategoryTools(category);
@@ -17369,6 +18020,9 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17369
18020
  if (!this._toolManager) {
17370
18021
  return { error: "ToolManager not connected." };
17371
18022
  }
18023
+ if (this._pinnedCategories.has(category)) {
18024
+ return { error: `Category '${category}' is pinned and cannot be unloaded.` };
18025
+ }
17372
18026
  const toolNames = this._loadedCategories.get(category);
17373
18027
  if (!toolNames) {
17374
18028
  return { unloaded: 0, message: `Category '${category}' is not loaded.` };
@@ -17394,6 +18048,61 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17394
18048
  getConnectorCategories() {
17395
18049
  return this._connectorCategories ?? [];
17396
18050
  }
18051
+ /**
18052
+ * Build status markers for a category (e.g., " [PINNED]", " [LOADED]", " [PINNED] [LOADED]")
18053
+ */
18054
+ getCategoryMarkers(name) {
18055
+ const parts = [];
18056
+ if (this._pinnedCategories.has(name)) parts.push("[PINNED]");
18057
+ if (this._loadedCategories.has(name)) parts.push("[LOADED]");
18058
+ return parts.length > 0 ? " " + parts.join(" ") : "";
18059
+ }
18060
+ /**
18061
+ * Build dynamic instructions that include the list of available categories.
18062
+ */
18063
+ buildInstructions() {
18064
+ const lines = [];
18065
+ lines.push("## Tool Catalog");
18066
+ lines.push("");
18067
+ lines.push("Your core tools (memory, context, instructions, etc.) are always available.");
18068
+ lines.push("Additional tool categories can be loaded on demand from the catalog below.");
18069
+ lines.push("");
18070
+ lines.push("**tool_catalog_search** \u2014 Browse available tool categories and search for specific tools.");
18071
+ lines.push(" - No params \u2192 list all available categories with descriptions");
18072
+ lines.push(" - `category` \u2192 list tools in that category");
18073
+ lines.push(" - `query` \u2192 keyword search across categories and tools");
18074
+ lines.push("");
18075
+ lines.push("**tool_catalog_load** \u2014 Load a category's tools so you can use them.");
18076
+ lines.push(" - Tools become available immediately after loading.");
18077
+ lines.push(" - If you need tools from a category, load it first.");
18078
+ lines.push("");
18079
+ lines.push("**tool_catalog_unload** \u2014 Unload a category to free token budget.");
18080
+ lines.push(" - Unloaded tools are no longer sent to you.");
18081
+ lines.push(" - Use when you're done with a category.");
18082
+ lines.push(" - Pinned categories cannot be unloaded.");
18083
+ lines.push("");
18084
+ const builtIn = this.getAllowedCategories();
18085
+ const connectors = this.getConnectorCategories();
18086
+ if (builtIn.length > 0 || connectors.length > 0) {
18087
+ lines.push("**Available categories:**");
18088
+ for (const cat of builtIn) {
18089
+ const tools = ToolCatalogRegistry.getToolsInCategory(cat.name);
18090
+ const pinned = this._pinnedCategories.has(cat.name) ? " [PINNED]" : "";
18091
+ lines.push(`- ${cat.name} (${tools.length} tools)${pinned}: ${cat.description}`);
18092
+ }
18093
+ for (const cc of connectors) {
18094
+ const pinned = this._pinnedCategories.has(cc.name) ? " [PINNED]" : "";
18095
+ lines.push(`- ${cc.name} (${cc.toolCount} tools)${pinned}: ${cc.description}`);
18096
+ }
18097
+ lines.push("");
18098
+ }
18099
+ lines.push("**Best practices:**");
18100
+ lines.push("- Search first to find the right category before loading.");
18101
+ lines.push("- Unload categories you no longer need to keep context lean.");
18102
+ lines.push("- Categories marked [LOADED] are already available.");
18103
+ lines.push("- Categories marked [PINNED] are always available and cannot be unloaded.");
18104
+ return lines.join("\n");
18105
+ }
17397
18106
  keywordSearch(query) {
17398
18107
  const lq = query.toLowerCase();
17399
18108
  const results = [];
@@ -17431,12 +18140,17 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17431
18140
  return { query, results, totalMatches: results.length };
17432
18141
  }
17433
18142
  searchConnectorCategory(category) {
18143
+ const allowed = this.getConnectorCategories().some((cc) => cc.name === category);
18144
+ if (!allowed) {
18145
+ return { error: `Category '${category}' is not available for this agent.` };
18146
+ }
17434
18147
  const connectorName = ToolCatalogRegistry.parseConnectorCategory(category);
17435
18148
  const tools = ToolCatalogRegistry.resolveConnectorCategoryTools(category);
17436
18149
  const loaded = this._loadedCategories.has(category);
17437
18150
  return {
17438
18151
  category,
17439
18152
  loaded,
18153
+ pinned: this._pinnedCategories.has(category),
17440
18154
  connectorName,
17441
18155
  tools: tools.map((t) => ({
17442
18156
  name: t.name,
@@ -20523,9 +21237,17 @@ var OpenAITextProvider = class extends BaseTextProvider {
20523
21237
  ...options.metadata && { metadata: options.metadata }
20524
21238
  };
20525
21239
  this.applyReasoningConfig(params, options);
21240
+ console.log(
21241
+ `[OpenAITextProvider] generate: calling OpenAI API (model=${options.model}, tools=${params.tools?.length ?? 0})`
21242
+ );
21243
+ const genStartTime = Date.now();
20526
21244
  const response = await this.client.responses.create(params);
21245
+ console.log(
21246
+ `[OpenAITextProvider] generate: response received (${Date.now() - genStartTime}ms)`
21247
+ );
20527
21248
  return this.converter.convertResponse(response);
20528
21249
  } catch (error) {
21250
+ console.error(`[OpenAITextProvider] generate error (model=${options.model}):`, error.message || error);
20529
21251
  this.handleError(error, options.model);
20530
21252
  throw error;
20531
21253
  }
@@ -20565,9 +21287,27 @@ var OpenAITextProvider = class extends BaseTextProvider {
20565
21287
  stream: true
20566
21288
  };
20567
21289
  this.applyReasoningConfig(params, options);
21290
+ console.log(
21291
+ `[OpenAITextProvider] streamGenerate: calling OpenAI API (model=${options.model}, tools=${params.tools?.length ?? 0})`
21292
+ );
21293
+ const streamStartTime = Date.now();
20568
21294
  const stream = await this.client.responses.create(params);
20569
- yield* this.streamConverter.convertStream(stream);
21295
+ console.log(
21296
+ `[OpenAITextProvider] streamGenerate: OpenAI stream opened (${Date.now() - streamStartTime}ms)`
21297
+ );
21298
+ let chunkCount = 0;
21299
+ for await (const event of this.streamConverter.convertStream(stream)) {
21300
+ chunkCount++;
21301
+ yield event;
21302
+ }
21303
+ console.log(
21304
+ `[OpenAITextProvider] streamGenerate: stream complete (${chunkCount} events, ${Date.now() - streamStartTime}ms total)`
21305
+ );
20570
21306
  } catch (error) {
21307
+ console.error(
21308
+ `[OpenAITextProvider] streamGenerate error (model=${options.model}):`,
21309
+ error.message || error
21310
+ );
20571
21311
  this.handleError(error, options.model);
20572
21312
  throw error;
20573
21313
  }
@@ -21573,12 +22313,20 @@ var AnthropicTextProvider = class extends BaseTextProvider {
21573
22313
  return this.executeWithCircuitBreaker(async () => {
21574
22314
  try {
21575
22315
  const anthropicRequest = this.converter.convertRequest(options);
22316
+ console.log(
22317
+ `[AnthropicTextProvider] generate: calling Anthropic API (model=${options.model}, messages=${anthropicRequest.messages?.length ?? 0}, tools=${anthropicRequest.tools?.length ?? 0})`
22318
+ );
22319
+ const genStartTime = Date.now();
21576
22320
  const anthropicResponse = await this.client.messages.create({
21577
22321
  ...anthropicRequest,
21578
22322
  stream: false
21579
22323
  });
22324
+ console.log(
22325
+ `[AnthropicTextProvider] generate: response received (${Date.now() - genStartTime}ms)`
22326
+ );
21580
22327
  return this.converter.convertResponse(anthropicResponse);
21581
22328
  } catch (error) {
22329
+ console.error(`[AnthropicTextProvider] generate error (model=${options.model}):`, error.message || error);
21582
22330
  this.handleError(error, options.model);
21583
22331
  throw error;
21584
22332
  }
@@ -21590,13 +22338,31 @@ var AnthropicTextProvider = class extends BaseTextProvider {
21590
22338
  async *streamGenerate(options) {
21591
22339
  try {
21592
22340
  const anthropicRequest = this.converter.convertRequest(options);
22341
+ console.log(
22342
+ `[AnthropicTextProvider] streamGenerate: calling Anthropic API (model=${options.model}, messages=${anthropicRequest.messages?.length ?? 0}, tools=${anthropicRequest.tools?.length ?? 0})`
22343
+ );
22344
+ const streamStartTime = Date.now();
21593
22345
  const stream = await this.client.messages.create({
21594
22346
  ...anthropicRequest,
21595
22347
  stream: true
21596
22348
  });
22349
+ console.log(
22350
+ `[AnthropicTextProvider] streamGenerate: Anthropic stream opened (${Date.now() - streamStartTime}ms)`
22351
+ );
21597
22352
  this.streamConverter.reset();
21598
- yield* this.streamConverter.convertStream(stream, options.model);
22353
+ let chunkCount = 0;
22354
+ for await (const event of this.streamConverter.convertStream(stream, options.model)) {
22355
+ chunkCount++;
22356
+ yield event;
22357
+ }
22358
+ console.log(
22359
+ `[AnthropicTextProvider] streamGenerate: stream complete (${chunkCount} events, ${Date.now() - streamStartTime}ms total)`
22360
+ );
21599
22361
  } catch (error) {
22362
+ console.error(
22363
+ `[AnthropicTextProvider] streamGenerate error (model=${options.model}):`,
22364
+ error.message || error
22365
+ );
21600
22366
  this.handleError(error, options.model);
21601
22367
  throw error;
21602
22368
  } finally {
@@ -22390,6 +23156,10 @@ var GoogleTextProvider = class extends BaseTextProvider {
22390
23156
  // First message only
22391
23157
  }, null, 2));
22392
23158
  }
23159
+ console.log(
23160
+ `[GoogleTextProvider] generate: calling Google API (model=${options.model}, contents=${googleRequest.contents?.length ?? 0} messages, tools=${googleRequest.tools?.[0]?.functionDeclarations?.length ?? 0} tools)`
23161
+ );
23162
+ const genStartTime = Date.now();
22393
23163
  const result = await this.client.models.generateContent({
22394
23164
  model: options.model,
22395
23165
  contents: googleRequest.contents,
@@ -22400,6 +23170,9 @@ var GoogleTextProvider = class extends BaseTextProvider {
22400
23170
  ...googleRequest.generationConfig
22401
23171
  }
22402
23172
  });
23173
+ console.log(
23174
+ `[GoogleTextProvider] generate: response received (${Date.now() - genStartTime}ms)`
23175
+ );
22403
23176
  if (process.env.DEBUG_GOOGLE) {
22404
23177
  console.error("[DEBUG] Google Response:", JSON.stringify({
22405
23178
  candidates: result.candidates?.map((c) => ({
@@ -22418,6 +23191,7 @@ var GoogleTextProvider = class extends BaseTextProvider {
22418
23191
  }
22419
23192
  return response;
22420
23193
  } catch (error) {
23194
+ console.error(`[GoogleTextProvider] generate error (model=${options.model}):`, error.message || error);
22421
23195
  this.converter.clearMappings();
22422
23196
  this.handleError(error, options.model);
22423
23197
  throw error;
@@ -22430,6 +23204,10 @@ var GoogleTextProvider = class extends BaseTextProvider {
22430
23204
  async *streamGenerate(options) {
22431
23205
  try {
22432
23206
  const googleRequest = await this.converter.convertRequest(options);
23207
+ console.log(
23208
+ `[GoogleTextProvider] streamGenerate: calling Google API (model=${options.model}, contents=${googleRequest.contents?.length ?? 0} messages, tools=${googleRequest.tools?.[0]?.functionDeclarations?.length ?? 0} tools)`
23209
+ );
23210
+ const streamStartTime = Date.now();
22433
23211
  const stream = await this.client.models.generateContentStream({
22434
23212
  model: options.model,
22435
23213
  contents: googleRequest.contents,
@@ -22440,13 +23218,27 @@ var GoogleTextProvider = class extends BaseTextProvider {
22440
23218
  ...googleRequest.generationConfig
22441
23219
  }
22442
23220
  });
23221
+ console.log(
23222
+ `[GoogleTextProvider] streamGenerate: Google stream opened (${Date.now() - streamStartTime}ms)`
23223
+ );
22443
23224
  this.streamConverter.reset();
22444
- yield* this.streamConverter.convertStream(stream, options.model);
23225
+ let chunkCount = 0;
23226
+ for await (const event of this.streamConverter.convertStream(stream, options.model)) {
23227
+ chunkCount++;
23228
+ yield event;
23229
+ }
23230
+ console.log(
23231
+ `[GoogleTextProvider] streamGenerate: stream complete (${chunkCount} events, ${Date.now() - streamStartTime}ms total)`
23232
+ );
22445
23233
  if (!this.streamConverter.hasToolCalls()) {
22446
23234
  this.converter.clearMappings();
22447
23235
  this.streamConverter.clear();
22448
23236
  }
22449
23237
  } catch (error) {
23238
+ console.error(
23239
+ `[GoogleTextProvider] streamGenerate error (model=${options.model}):`,
23240
+ error.message || error
23241
+ );
22450
23242
  this.converter.clearMappings();
22451
23243
  this.streamConverter.clear();
22452
23244
  this.handleError(error, options.model);
@@ -22533,6 +23325,10 @@ var VertexAITextProvider = class extends BaseTextProvider {
22533
23325
  async generate(options) {
22534
23326
  try {
22535
23327
  const googleRequest = await this.converter.convertRequest(options);
23328
+ console.log(
23329
+ `[VertexAITextProvider] generate: calling Vertex AI (model=${options.model}, contents=${googleRequest.contents?.length ?? 0} messages, tools=${googleRequest.tools?.[0]?.functionDeclarations?.length ?? 0} tools)`
23330
+ );
23331
+ const genStartTime = Date.now();
22536
23332
  const result = await this.client.models.generateContent({
22537
23333
  model: options.model,
22538
23334
  contents: googleRequest.contents,
@@ -22543,8 +23339,12 @@ var VertexAITextProvider = class extends BaseTextProvider {
22543
23339
  ...googleRequest.generationConfig
22544
23340
  }
22545
23341
  });
23342
+ console.log(
23343
+ `[VertexAITextProvider] generate: response received (${Date.now() - genStartTime}ms)`
23344
+ );
22546
23345
  return this.converter.convertResponse(result);
22547
23346
  } catch (error) {
23347
+ console.error(`[VertexAITextProvider] generate error (model=${options.model}):`, error.message || error);
22548
23348
  this.handleError(error, options.model);
22549
23349
  throw error;
22550
23350
  }
@@ -22555,6 +23355,10 @@ var VertexAITextProvider = class extends BaseTextProvider {
22555
23355
  async *streamGenerate(options) {
22556
23356
  try {
22557
23357
  const googleRequest = await this.converter.convertRequest(options);
23358
+ console.log(
23359
+ `[VertexAITextProvider] streamGenerate: calling Vertex AI (model=${options.model}, contents=${googleRequest.contents?.length ?? 0} messages, tools=${googleRequest.tools?.[0]?.functionDeclarations?.length ?? 0} tools)`
23360
+ );
23361
+ const streamStartTime = Date.now();
22558
23362
  const stream = await this.client.models.generateContentStream({
22559
23363
  model: options.model,
22560
23364
  contents: googleRequest.contents,
@@ -22565,9 +23369,23 @@ var VertexAITextProvider = class extends BaseTextProvider {
22565
23369
  ...googleRequest.generationConfig
22566
23370
  }
22567
23371
  });
23372
+ console.log(
23373
+ `[VertexAITextProvider] streamGenerate: Vertex AI stream opened (${Date.now() - streamStartTime}ms)`
23374
+ );
22568
23375
  const streamConverter = new GoogleStreamConverter();
22569
- yield* streamConverter.convertStream(stream, options.model);
23376
+ let chunkCount = 0;
23377
+ for await (const event of streamConverter.convertStream(stream, options.model)) {
23378
+ chunkCount++;
23379
+ yield event;
23380
+ }
23381
+ console.log(
23382
+ `[VertexAITextProvider] streamGenerate: stream complete (${chunkCount} events, ${Date.now() - streamStartTime}ms total)`
23383
+ );
22570
23384
  } catch (error) {
23385
+ console.error(
23386
+ `[VertexAITextProvider] streamGenerate error (model=${options.model}):`,
23387
+ error.message || error
23388
+ );
22571
23389
  this.handleError(error, options.model);
22572
23390
  throw error;
22573
23391
  }
@@ -24508,6 +25326,20 @@ var Agent = class _Agent extends BaseAgent {
24508
25326
  timestamp: /* @__PURE__ */ new Date(),
24509
25327
  duration: totalDuration
24510
25328
  });
25329
+ const hasTextOutput = response.output_text?.trim() || response.output?.some(
25330
+ (item) => "content" in item && Array.isArray(item.content) && item.content.some((c) => c.type === "output_text" /* OUTPUT_TEXT */ && c.text?.trim())
25331
+ );
25332
+ if (!hasTextOutput) {
25333
+ console.warn(
25334
+ `[Agent] WARNING: ${methodName} completed with zero text output (executionId=${executionId}, iterations=${this.executionContext?.metrics.iterationCount ?? "?"}, tokens=${response.usage?.total_tokens ?? 0})`
25335
+ );
25336
+ this.emit("execution:empty_output", {
25337
+ executionId,
25338
+ timestamp: /* @__PURE__ */ new Date(),
25339
+ duration: totalDuration,
25340
+ usage: response.usage
25341
+ });
25342
+ }
24511
25343
  const duration = Date.now() - startTime;
24512
25344
  this._logger.info({ duration }, `Agent ${methodName} completed`);
24513
25345
  metrics.timing(`agent.${methodName}.duration`, duration, { model: this.model, connector: this.connector.name });
@@ -24562,6 +25394,17 @@ var Agent = class _Agent extends BaseAgent {
24562
25394
  }
24563
25395
  const iterationStartTime = Date.now();
24564
25396
  const prepared = await this._agentContext.prepare();
25397
+ const b1 = prepared.budget;
25398
+ const bd1 = b1.breakdown;
25399
+ const bp1 = [
25400
+ `sysPrompt=${bd1.systemPrompt}`,
25401
+ `PI=${bd1.persistentInstructions}`,
25402
+ bd1.pluginInstructions ? `pluginInstr=${bd1.pluginInstructions}` : "",
25403
+ ...Object.entries(bd1.pluginContents || {}).map(([k, v]) => `plugin:${k}=${v}`)
25404
+ ].filter(Boolean).join(" ");
25405
+ console.log(
25406
+ `[Agent] [Context] iteration=${iteration} tokens: ${b1.totalUsed}/${b1.maxTokens} (${b1.utilizationPercent.toFixed(1)}%) tools=${b1.toolsTokens} conversation=${b1.conversationTokens} system=${b1.systemMessageTokens} input=${b1.currentInputTokens}` + (bp1 ? ` | ${bp1}` : "") + (prepared.compacted ? ` COMPACTED: ${prepared.compactionLog.join("; ")}` : "")
25407
+ );
24565
25408
  const response = await this.generateWithHooks(prepared.input, iteration, executionId);
24566
25409
  const toolCalls = this.extractToolCalls(response.output);
24567
25410
  this._agentContext.addAssistantResponse(response.output);
@@ -24676,13 +25519,23 @@ var Agent = class _Agent extends BaseAgent {
24676
25519
  * Build placeholder response for streaming finalization
24677
25520
  */
24678
25521
  _buildPlaceholderResponse(executionId, startTime, streamState) {
25522
+ const outputText = streamState.getAllText();
25523
+ const output = [];
25524
+ if (outputText && outputText.trim()) {
25525
+ output.push({
25526
+ type: "message",
25527
+ role: "assistant" /* ASSISTANT */,
25528
+ content: [{ type: "output_text" /* OUTPUT_TEXT */, text: outputText }]
25529
+ });
25530
+ }
24679
25531
  return {
24680
25532
  id: executionId,
24681
25533
  object: "response",
24682
25534
  created_at: Math.floor(startTime / 1e3),
24683
25535
  status: "completed",
24684
25536
  model: this.model,
24685
- output: [],
25537
+ output,
25538
+ output_text: outputText || void 0,
24686
25539
  usage: streamState.usage
24687
25540
  };
24688
25541
  }
@@ -24702,6 +25555,17 @@ var Agent = class _Agent extends BaseAgent {
24702
25555
  break;
24703
25556
  }
24704
25557
  const prepared = await this._agentContext.prepare();
25558
+ const b2 = prepared.budget;
25559
+ const bd2 = b2.breakdown;
25560
+ const bp2 = [
25561
+ `sysPrompt=${bd2.systemPrompt}`,
25562
+ `PI=${bd2.persistentInstructions}`,
25563
+ bd2.pluginInstructions ? `pluginInstr=${bd2.pluginInstructions}` : "",
25564
+ ...Object.entries(bd2.pluginContents || {}).map(([k, v]) => `plugin:${k}=${v}`)
25565
+ ].filter(Boolean).join(" ");
25566
+ console.log(
25567
+ `[Agent] [Context] iteration=${iteration} tokens: ${b2.totalUsed}/${b2.maxTokens} (${b2.utilizationPercent.toFixed(1)}%) tools=${b2.toolsTokens} conversation=${b2.conversationTokens} system=${b2.systemMessageTokens} input=${b2.currentInputTokens}` + (bp2 ? ` | ${bp2}` : "") + (prepared.compacted ? ` COMPACTED: ${prepared.compactionLog.join("; ")}` : "")
25568
+ );
24705
25569
  const iterationStreamState = new StreamState(executionId, this.model);
24706
25570
  const toolCallsMap = /* @__PURE__ */ new Map();
24707
25571
  yield* this.streamGenerateWithHooks(
@@ -33972,13 +34836,13 @@ var TTS_MODEL_REGISTRY = {
33972
34836
  name: "gemini-2.5-flash-preview-tts",
33973
34837
  displayName: "Gemini 2.5 Flash TTS",
33974
34838
  provider: Vendor.Google,
33975
- description: "Google Gemini 2.5 Flash TTS - optimized for low latency",
34839
+ description: "Google Gemini 2.5 Flash TTS - optimized for low latency, 30 voices, 70+ languages",
33976
34840
  isActive: true,
33977
34841
  releaseDate: "2025-01-01",
33978
34842
  sources: {
33979
34843
  documentation: "https://ai.google.dev/gemini-api/docs/speech-generation",
33980
34844
  pricing: "https://ai.google.dev/pricing",
33981
- lastVerified: "2026-01-25"
34845
+ lastVerified: "2026-03-04"
33982
34846
  },
33983
34847
  capabilities: {
33984
34848
  voices: GEMINI_VOICES,
@@ -33997,20 +34861,27 @@ var TTS_MODEL_REGISTRY = {
33997
34861
  wordTimestamps: false
33998
34862
  },
33999
34863
  limits: { maxInputLength: 32e3 }
34000
- // 32k tokens
34864
+ // 32k token context window
34865
+ },
34866
+ pricing: {
34867
+ perMInputTokens: 0.5,
34868
+ // $0.50 per 1M input tokens
34869
+ perMOutputTokens: 10,
34870
+ // $10.00 per 1M output tokens
34871
+ currency: "USD"
34001
34872
  }
34002
34873
  },
34003
34874
  "gemini-2.5-pro-preview-tts": {
34004
34875
  name: "gemini-2.5-pro-preview-tts",
34005
34876
  displayName: "Gemini 2.5 Pro TTS",
34006
34877
  provider: Vendor.Google,
34007
- description: "Google Gemini 2.5 Pro TTS - optimized for quality",
34878
+ description: "Google Gemini 2.5 Pro TTS - optimized for quality, 30 voices, 70+ languages",
34008
34879
  isActive: true,
34009
34880
  releaseDate: "2025-01-01",
34010
34881
  sources: {
34011
34882
  documentation: "https://ai.google.dev/gemini-api/docs/speech-generation",
34012
34883
  pricing: "https://ai.google.dev/pricing",
34013
- lastVerified: "2026-01-25"
34884
+ lastVerified: "2026-03-04"
34014
34885
  },
34015
34886
  capabilities: {
34016
34887
  voices: GEMINI_VOICES,
@@ -34029,7 +34900,14 @@ var TTS_MODEL_REGISTRY = {
34029
34900
  wordTimestamps: false
34030
34901
  },
34031
34902
  limits: { maxInputLength: 32e3 }
34032
- // 32k tokens
34903
+ // 32k token context window
34904
+ },
34905
+ pricing: {
34906
+ perMInputTokens: 1,
34907
+ // $1.00 per 1M input tokens
34908
+ perMOutputTokens: 20,
34909
+ // $20.00 per 1M output tokens
34910
+ currency: "USD"
34033
34911
  }
34034
34912
  }
34035
34913
  };
@@ -34042,10 +34920,18 @@ function getTTSModelsWithFeature(feature) {
34042
34920
  (model) => model.isActive && model.capabilities.features[feature]
34043
34921
  );
34044
34922
  }
34045
- function calculateTTSCost(modelName, characterCount) {
34923
+ function calculateTTSCost(modelName, characterCount, options) {
34046
34924
  const model = getTTSModelInfo(modelName);
34047
34925
  if (!model?.pricing) return null;
34048
- return characterCount / 1e3 * model.pricing.per1kCharacters;
34926
+ if (model.pricing.per1kCharacters) {
34927
+ return characterCount / 1e3 * model.pricing.per1kCharacters;
34928
+ }
34929
+ if (model.pricing.perMInputTokens && options?.inputTokens != null) {
34930
+ const inputCost = options.inputTokens / 1e6 * model.pricing.perMInputTokens;
34931
+ const outputCost = options.outputTokens ? options.outputTokens / 1e6 * (model.pricing.perMOutputTokens ?? 0) : 0;
34932
+ return inputCost + outputCost;
34933
+ }
34934
+ return null;
34049
34935
  }
34050
34936
  var TextToSpeech = class _TextToSpeech {
34051
34937
  provider;
@@ -35491,7 +36377,13 @@ var IMAGE_MODELS = {
35491
36377
  /** Imagen 4.0 Ultra: Highest quality */
35492
36378
  IMAGEN_4_ULTRA: "imagen-4.0-ultra-generate-001",
35493
36379
  /** Imagen 4.0 Fast: Optimized for speed */
35494
- IMAGEN_4_FAST: "imagen-4.0-fast-generate-001"
36380
+ IMAGEN_4_FAST: "imagen-4.0-fast-generate-001",
36381
+ /** Nano Banana 2: Gemini 3.1 Flash native image gen with 4K support */
36382
+ GEMINI_3_1_FLASH_IMAGE: "gemini-3.1-flash-image-preview",
36383
+ /** Nano Banana Pro: Gemini 3 Pro professional design engine with reasoning */
36384
+ GEMINI_3_PRO_IMAGE: "gemini-3-pro-image-preview",
36385
+ /** Nano Banana: Gemini 2.5 Flash native image gen/editing */
36386
+ GEMINI_2_5_FLASH_IMAGE: "gemini-2.5-flash-image"
35495
36387
  },
35496
36388
  [Vendor.Grok]: {
35497
36389
  /** Grok Imagine Image: xAI image generation with editing support */
@@ -35675,7 +36567,7 @@ var IMAGE_MODEL_REGISTRY = {
35675
36567
  sources: {
35676
36568
  documentation: "https://ai.google.dev/gemini-api/docs/imagen",
35677
36569
  pricing: "https://ai.google.dev/pricing",
35678
- lastVerified: "2026-01-25"
36570
+ lastVerified: "2026-03-04"
35679
36571
  },
35680
36572
  capabilities: {
35681
36573
  sizes: ["1024x1024"],
@@ -35786,7 +36678,7 @@ var IMAGE_MODEL_REGISTRY = {
35786
36678
  sources: {
35787
36679
  documentation: "https://ai.google.dev/gemini-api/docs/imagen",
35788
36680
  pricing: "https://ai.google.dev/pricing",
35789
- lastVerified: "2026-01-25"
36681
+ lastVerified: "2026-03-04"
35790
36682
  },
35791
36683
  capabilities: {
35792
36684
  sizes: ["1024x1024"],
@@ -35883,7 +36775,8 @@ var IMAGE_MODEL_REGISTRY = {
35883
36775
  }
35884
36776
  },
35885
36777
  pricing: {
35886
- perImage: 0.08,
36778
+ perImage: 0.06,
36779
+ // Updated per official pricing page (was $0.08)
35887
36780
  currency: "USD"
35888
36781
  }
35889
36782
  },
@@ -35897,7 +36790,7 @@ var IMAGE_MODEL_REGISTRY = {
35897
36790
  sources: {
35898
36791
  documentation: "https://ai.google.dev/gemini-api/docs/imagen",
35899
36792
  pricing: "https://ai.google.dev/pricing",
35900
- lastVerified: "2026-01-25"
36793
+ lastVerified: "2026-03-04"
35901
36794
  },
35902
36795
  capabilities: {
35903
36796
  sizes: ["1024x1024"],
@@ -35998,6 +36891,141 @@ var IMAGE_MODEL_REGISTRY = {
35998
36891
  currency: "USD"
35999
36892
  }
36000
36893
  },
36894
+ // ======================== Google Nano Banana (Gemini Native Image) ========================
36895
+ "gemini-3.1-flash-image-preview": {
36896
+ name: "gemini-3.1-flash-image-preview",
36897
+ displayName: "Nano Banana 2 (Gemini 3.1 Flash Image)",
36898
+ provider: Vendor.Google,
36899
+ description: "High-efficiency native image generation and editing with 4K support and thinking capabilities",
36900
+ isActive: true,
36901
+ releaseDate: "2026-02-01",
36902
+ sources: {
36903
+ documentation: "https://ai.google.dev/gemini-api/docs/models/gemini-3.1-flash-image-preview",
36904
+ pricing: "https://ai.google.dev/pricing",
36905
+ lastVerified: "2026-03-04"
36906
+ },
36907
+ capabilities: {
36908
+ sizes: ["512x512", "1024x1024", "1536x1536", "auto"],
36909
+ aspectRatios: ["1:1", "1:4", "4:1", "1:8", "8:1"],
36910
+ maxImagesPerRequest: 4,
36911
+ outputFormats: ["png", "jpeg"],
36912
+ features: {
36913
+ generation: true,
36914
+ editing: true,
36915
+ variations: false,
36916
+ styleControl: false,
36917
+ qualityControl: true,
36918
+ // Multiple resolution tiers: 0.5K, 1K, 2K, 4K
36919
+ transparency: false,
36920
+ promptRevision: false
36921
+ },
36922
+ limits: { maxPromptLength: 131072 },
36923
+ // 131K input tokens
36924
+ vendorOptions: {
36925
+ outputImageResolution: {
36926
+ type: "enum",
36927
+ label: "Resolution",
36928
+ description: "Output image resolution tier",
36929
+ enum: ["0.5K", "1K", "2K", "4K"],
36930
+ default: "1K",
36931
+ controlType: "select"
36932
+ }
36933
+ }
36934
+ },
36935
+ pricing: {
36936
+ // Per-image, varies by resolution: $0.045 (512px), $0.067 (1K), $0.101 (2K), $0.151 (4K)
36937
+ perImageStandard: 0.067,
36938
+ // 1K default
36939
+ perImageHD: 0.151,
36940
+ // 4K
36941
+ currency: "USD"
36942
+ }
36943
+ },
36944
+ "gemini-3-pro-image-preview": {
36945
+ name: "gemini-3-pro-image-preview",
36946
+ displayName: "Nano Banana Pro (Gemini 3 Pro Image)",
36947
+ provider: Vendor.Google,
36948
+ description: "Professional design engine with reasoning for studio-quality 4K visuals, complex layouts, and precise text rendering",
36949
+ isActive: true,
36950
+ releaseDate: "2025-11-01",
36951
+ sources: {
36952
+ documentation: "https://ai.google.dev/gemini-api/docs/models/gemini-3-pro-image-preview",
36953
+ pricing: "https://ai.google.dev/pricing",
36954
+ lastVerified: "2026-03-04"
36955
+ },
36956
+ capabilities: {
36957
+ sizes: ["1024x1024", "auto"],
36958
+ aspectRatios: ["1:1", "3:4", "4:3", "9:16", "16:9"],
36959
+ maxImagesPerRequest: 4,
36960
+ outputFormats: ["png", "jpeg"],
36961
+ features: {
36962
+ generation: true,
36963
+ editing: true,
36964
+ variations: false,
36965
+ styleControl: true,
36966
+ // Reasoning-driven design
36967
+ qualityControl: true,
36968
+ // 1K, 2K, 4K tiers
36969
+ transparency: false,
36970
+ promptRevision: false
36971
+ },
36972
+ limits: { maxPromptLength: 65536 },
36973
+ // 65K input tokens
36974
+ vendorOptions: {
36975
+ outputImageResolution: {
36976
+ type: "enum",
36977
+ label: "Resolution",
36978
+ description: "Output image resolution tier",
36979
+ enum: ["1K", "2K", "4K"],
36980
+ default: "1K",
36981
+ controlType: "select"
36982
+ }
36983
+ }
36984
+ },
36985
+ pricing: {
36986
+ // $0.134 per 1K/2K image, $0.24 per 4K image
36987
+ perImageStandard: 0.134,
36988
+ // 1K/2K
36989
+ perImageHD: 0.24,
36990
+ // 4K
36991
+ currency: "USD"
36992
+ }
36993
+ },
36994
+ "gemini-2.5-flash-image": {
36995
+ name: "gemini-2.5-flash-image",
36996
+ displayName: "Nano Banana (Gemini 2.5 Flash Image)",
36997
+ provider: Vendor.Google,
36998
+ description: "Native image generation and editing designed for fast, creative workflows",
36999
+ isActive: true,
37000
+ releaseDate: "2025-10-01",
37001
+ sources: {
37002
+ documentation: "https://ai.google.dev/gemini-api/docs/models/gemini-2.5-flash-image",
37003
+ pricing: "https://ai.google.dev/pricing",
37004
+ lastVerified: "2026-03-04"
37005
+ },
37006
+ capabilities: {
37007
+ sizes: ["1024x1024", "auto"],
37008
+ aspectRatios: ["1:1", "3:4", "4:3", "9:16", "16:9"],
37009
+ maxImagesPerRequest: 4,
37010
+ outputFormats: ["png", "jpeg"],
37011
+ features: {
37012
+ generation: true,
37013
+ editing: true,
37014
+ variations: false,
37015
+ styleControl: false,
37016
+ qualityControl: false,
37017
+ transparency: false,
37018
+ promptRevision: false
37019
+ },
37020
+ limits: { maxPromptLength: 65536 }
37021
+ // 65K input tokens
37022
+ },
37023
+ pricing: {
37024
+ perImage: 0.039,
37025
+ // $0.039 per image
37026
+ currency: "USD"
37027
+ }
37028
+ },
36001
37029
  // ======================== xAI Grok ========================
36002
37030
  "grok-imagine-image": {
36003
37031
  name: "grok-imagine-image",
@@ -36009,11 +37037,11 @@ var IMAGE_MODEL_REGISTRY = {
36009
37037
  sources: {
36010
37038
  documentation: "https://docs.x.ai/docs/guides/image-generation",
36011
37039
  pricing: "https://docs.x.ai/docs/models",
36012
- lastVerified: "2026-02-01"
37040
+ lastVerified: "2026-03-04"
36013
37041
  },
36014
37042
  capabilities: {
36015
37043
  sizes: ["1024x1024"],
36016
- aspectRatios: ["1:1", "4:3", "3:4", "16:9", "9:16", "3:2", "2:3"],
37044
+ aspectRatios: ["1:1", "4:3", "3:4", "16:9", "9:16", "3:2", "2:3", "2:1", "1:2"],
36017
37045
  maxImagesPerRequest: 10,
36018
37046
  outputFormats: ["png", "jpeg"],
36019
37047
  features: {
@@ -37269,9 +38297,9 @@ var OPENAI_SOURCES = {
37269
38297
  lastVerified: "2026-01-25"
37270
38298
  };
37271
38299
  var GOOGLE_SOURCES = {
37272
- documentation: "https://docs.cloud.google.com/vertex-ai/generative-ai/docs/video/overview",
37273
- apiReference: "https://docs.cloud.google.com/vertex-ai/generative-ai/docs/model-reference/veo-video-generation",
37274
- lastVerified: "2026-01-25"
38300
+ documentation: "https://ai.google.dev/gemini-api/docs/video",
38301
+ apiReference: "https://ai.google.dev/gemini-api/docs/models/veo",
38302
+ lastVerified: "2026-03-04"
37275
38303
  };
37276
38304
  var GROK_SOURCES = {
37277
38305
  documentation: "https://docs.x.ai/docs/guides/video-generations",
@@ -37345,14 +38373,16 @@ var VIDEO_MODEL_REGISTRY = {
37345
38373
  sources: GOOGLE_SOURCES,
37346
38374
  capabilities: {
37347
38375
  durations: [5, 6, 7, 8],
37348
- resolutions: [],
37349
- // Veo 2.0 uses aspectRatio only, no resolution control
38376
+ resolutions: ["720p"],
38377
+ // Veo 2 only supports 720p
37350
38378
  aspectRatios: ["16:9", "9:16"],
37351
38379
  maxFps: 24,
37352
38380
  audio: false,
37353
- imageToVideo: true,
38381
+ imageToVideo: false,
38382
+ // Veo 2 does not support reference images
37354
38383
  videoExtension: false,
37355
38384
  frameControl: true,
38385
+ // First/last frame interpolation supported
37356
38386
  features: {
37357
38387
  upscaling: false,
37358
38388
  styleControl: false,
@@ -37361,7 +38391,8 @@ var VIDEO_MODEL_REGISTRY = {
37361
38391
  }
37362
38392
  },
37363
38393
  pricing: {
37364
- perSecond: 0.03,
38394
+ perSecond: 0.35,
38395
+ // Updated per official pricing page (was $0.03)
37365
38396
  currency: "USD"
37366
38397
  }
37367
38398
  },
@@ -37373,14 +38404,18 @@ var VIDEO_MODEL_REGISTRY = {
37373
38404
  sources: GOOGLE_SOURCES,
37374
38405
  capabilities: {
37375
38406
  durations: [4, 6, 8],
37376
- resolutions: ["720p"],
37377
- // Fast model only supports 720p
38407
+ resolutions: ["720p", "1080p", "4k"],
38408
+ // 1080p/4k require 8s duration
37378
38409
  aspectRatios: ["16:9", "9:16"],
37379
38410
  maxFps: 24,
37380
38411
  audio: true,
38412
+ // Native audio generation
37381
38413
  imageToVideo: true,
37382
- videoExtension: false,
37383
- frameControl: false,
38414
+ // Up to 3 reference images
38415
+ videoExtension: true,
38416
+ // Supported (720p only)
38417
+ frameControl: true,
38418
+ // First/last frame interpolation
37384
38419
  features: {
37385
38420
  upscaling: false,
37386
38421
  styleControl: false,
@@ -37389,7 +38424,8 @@ var VIDEO_MODEL_REGISTRY = {
37389
38424
  }
37390
38425
  },
37391
38426
  pricing: {
37392
- perSecond: 0.75,
38427
+ perSecond: 0.15,
38428
+ // $0.15 for 720p/1080p, $0.35 for 4K
37393
38429
  currency: "USD"
37394
38430
  }
37395
38431
  },
@@ -37406,8 +38442,11 @@ var VIDEO_MODEL_REGISTRY = {
37406
38442
  aspectRatios: ["16:9", "9:16"],
37407
38443
  maxFps: 30,
37408
38444
  audio: true,
38445
+ // Native audio generation
37409
38446
  imageToVideo: true,
38447
+ // Up to 3 reference images
37410
38448
  videoExtension: true,
38449
+ // Supported (720p only)
37411
38450
  frameControl: true,
37412
38451
  features: {
37413
38452
  upscaling: true,
@@ -37417,7 +38456,8 @@ var VIDEO_MODEL_REGISTRY = {
37417
38456
  }
37418
38457
  },
37419
38458
  pricing: {
37420
- perSecond: 0.75,
38459
+ perSecond: 0.4,
38460
+ // $0.40 for 720p/1080p, $0.60 for 4K
37421
38461
  currency: "USD"
37422
38462
  }
37423
38463
  },
@@ -42320,6 +43360,14 @@ var SERVICE_DEFINITIONS = [
42320
43360
  baseURL: "https://aws.amazon.com",
42321
43361
  docsURL: "https://docs.aws.amazon.com/"
42322
43362
  },
43363
+ {
43364
+ id: "cloudflare",
43365
+ name: "Cloudflare",
43366
+ category: "cloud",
43367
+ urlPattern: /api\.cloudflare\.com/i,
43368
+ baseURL: "https://api.cloudflare.com/client/v4",
43369
+ docsURL: "https://developers.cloudflare.com/api/"
43370
+ },
42323
43371
  // ============ Storage ============
42324
43372
  {
42325
43373
  id: "dropbox",
@@ -42363,6 +43411,14 @@ var SERVICE_DEFINITIONS = [
42363
43411
  baseURL: "https://api.postmarkapp.com",
42364
43412
  docsURL: "https://postmarkapp.com/developer"
42365
43413
  },
43414
+ {
43415
+ id: "mailgun",
43416
+ name: "Mailgun",
43417
+ category: "email",
43418
+ urlPattern: /api\.mailgun\.net|api\.eu\.mailgun\.net/i,
43419
+ baseURL: "https://api.mailgun.net/v3",
43420
+ docsURL: "https://documentation.mailgun.com/docs/mailgun/api-reference/"
43421
+ },
42366
43422
  // ============ Monitoring & Observability ============
42367
43423
  {
42368
43424
  id: "datadog",
@@ -45102,6 +46158,43 @@ var awsTemplate = {
45102
46158
  ]
45103
46159
  };
45104
46160
 
46161
+ // src/connectors/vendors/templates/cloudflare.ts
46162
+ var cloudflareTemplate = {
46163
+ id: "cloudflare",
46164
+ name: "Cloudflare",
46165
+ serviceType: "cloudflare",
46166
+ baseURL: "https://api.cloudflare.com/client/v4",
46167
+ docsURL: "https://developers.cloudflare.com/api/",
46168
+ credentialsSetupURL: "https://dash.cloudflare.com/profile/api-tokens",
46169
+ category: "cloud",
46170
+ notes: "API Tokens (recommended) are scoped and more secure. Global API Key requires email and has full account access.",
46171
+ authTemplates: [
46172
+ {
46173
+ id: "api-token",
46174
+ name: "API Token",
46175
+ type: "api_key",
46176
+ description: "Scoped API token (recommended). Create at dash.cloudflare.com > My Profile > API Tokens",
46177
+ requiredFields: ["apiKey"],
46178
+ defaults: {
46179
+ type: "api_key",
46180
+ headerName: "Authorization",
46181
+ headerPrefix: "Bearer"
46182
+ }
46183
+ },
46184
+ {
46185
+ id: "global-api-key",
46186
+ name: "Global API Key",
46187
+ type: "api_key",
46188
+ description: "Legacy global API key + email. Has full account access. Prefer API Tokens for least-privilege access",
46189
+ requiredFields: ["apiKey", "username"],
46190
+ defaults: {
46191
+ type: "api_key",
46192
+ headerName: "X-Auth-Key"
46193
+ }
46194
+ }
46195
+ ]
46196
+ };
46197
+
45105
46198
  // src/connectors/vendors/templates/dropbox.ts
45106
46199
  var dropboxTemplate = {
45107
46200
  id: "dropbox",
@@ -45290,6 +46383,30 @@ var postmarkTemplate = {
45290
46383
  }
45291
46384
  ]
45292
46385
  };
46386
+ var mailgunTemplate = {
46387
+ id: "mailgun",
46388
+ name: "Mailgun",
46389
+ serviceType: "mailgun",
46390
+ baseURL: "https://api.mailgun.net/v3",
46391
+ docsURL: "https://documentation.mailgun.com/docs/mailgun/api-reference/",
46392
+ credentialsSetupURL: "https://app.mailgun.com/settings/api_security",
46393
+ category: "email",
46394
+ notes: "EU region uses api.eu.mailgun.net. Most endpoints require /v3/<domain> in the path.",
46395
+ authTemplates: [
46396
+ {
46397
+ id: "api-key",
46398
+ name: "API Key",
46399
+ type: "api_key",
46400
+ description: "Private API key for full account access. Find at Settings > API Security",
46401
+ requiredFields: ["apiKey"],
46402
+ defaults: {
46403
+ type: "api_key",
46404
+ headerName: "Authorization",
46405
+ headerPrefix: "Basic"
46406
+ }
46407
+ }
46408
+ ]
46409
+ };
45293
46410
 
45294
46411
  // src/connectors/vendors/templates/monitoring.ts
45295
46412
  var datadogTemplate = {
@@ -45738,6 +46855,7 @@ var allVendorTemplates = [
45738
46855
  rampTemplate,
45739
46856
  // Cloud
45740
46857
  awsTemplate,
46858
+ cloudflareTemplate,
45741
46859
  // Storage
45742
46860
  dropboxTemplate,
45743
46861
  boxTemplate,
@@ -45745,6 +46863,7 @@ var allVendorTemplates = [
45745
46863
  sendgridTemplate,
45746
46864
  mailchimpTemplate,
45747
46865
  postmarkTemplate,
46866
+ mailgunTemplate,
45748
46867
  // Monitoring
45749
46868
  datadogTemplate,
45750
46869
  pagerdutyTemplate,
@@ -49102,7 +50221,8 @@ SANDBOX API:
49102
50221
  4. connectors.get(name) \u2014 Connector info: { displayName, description, baseURL, serviceType }
49103
50222
 
49104
50223
  VARIABLES:
49105
- \u2022 input \u2014 data passed via the "input" parameter (default: {})
50224
+ \u2022 input \u2014 data passed via the "input" parameter (default: {}). Always a parsed object/array, never a string.
50225
+ CRITICAL: You MUST pass actual data values directly. Template placeholders ({{results}}, {{param.name}}, etc.) are NOT supported and will be passed as literal strings. If you need data from a previous tool call, include the actual returned data in the input object.
49106
50226
  \u2022 output \u2014 SET THIS to return your result to the caller
49107
50227
 
49108
50228
  GLOBALS: console.log/error/warn, JSON, Math, Date, Buffer, Promise, Array, Object, String, Number, Boolean, setTimeout, setInterval, URL, URLSearchParams, RegExp, Map, Set, Error, TextEncoder, TextDecoder
@@ -49125,7 +50245,8 @@ const resp = await authenticatedFetch('/chat.postMessage', {
49125
50245
  }, 'slack');
49126
50246
  output = await resp.json();
49127
50247
  ${accountIdExamples}
49128
- // Data processing (no API needed)
50248
+ // Data processing \u2014 pass actual data via the input parameter, NOT template references
50249
+ // e.g. call with: { "code": "...", "input": { "data": [{"score": 0.9}, {"score": 0.5}] } }
49129
50250
  const items = input.data;
49130
50251
  output = items.filter(i => i.score > 0.8).sort((a, b) => b.score - a.score);
49131
50252
 
@@ -49149,7 +50270,7 @@ function createExecuteJavaScriptTool(options) {
49149
50270
  description: 'JavaScript code to execute. Set the "output" variable with your result. Code is auto-wrapped in async IIFE \u2014 you can use await directly. For explicit async control, wrap in (async () => { ... })().'
49150
50271
  },
49151
50272
  input: {
49152
- description: 'Optional data available as the "input" variable in your code. Can be any JSON value.'
50273
+ description: 'Optional data available as the "input" variable in your code. IMPORTANT: Pass actual data directly as a JSON object/array. Template placeholders like {{results}} or {{param.name}} are NOT supported here and will be passed as literal strings. You must include the actual data values inline. Correct: "input": {"deals": [{"id":"1"}, ...]}. Wrong: "input": {"deals": "{{results}}"}.'
49153
50274
  },
49154
50275
  timeout: {
49155
50276
  type: "number",
@@ -49172,9 +50293,19 @@ function createExecuteJavaScriptTool(options) {
49172
50293
  try {
49173
50294
  const timeout = Math.min(Math.max(args.timeout || defaultTimeout, 0), maxTimeout);
49174
50295
  const registry = context?.connectorRegistry ?? Connector.asRegistry();
50296
+ let resolvedInput = args.input;
50297
+ if (typeof resolvedInput === "string") {
50298
+ const trimmed = resolvedInput.trim();
50299
+ if (trimmed.startsWith("{") && trimmed.endsWith("}") || trimmed.startsWith("[") && trimmed.endsWith("]")) {
50300
+ try {
50301
+ resolvedInput = JSON.parse(trimmed);
50302
+ } catch {
50303
+ }
50304
+ }
50305
+ }
49175
50306
  const result = await executeInVM(
49176
50307
  args.code,
49177
- args.input,
50308
+ resolvedInput,
49178
50309
  timeout,
49179
50310
  logs,
49180
50311
  context?.userId,