@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.cjs CHANGED
@@ -12631,18 +12631,30 @@ function isVendor(value) {
12631
12631
  // src/domain/entities/Model.ts
12632
12632
  var LLM_MODELS = {
12633
12633
  [Vendor.OpenAI]: {
12634
+ // GPT-5.3 Series
12635
+ GPT_5_3_CODEX: "gpt-5.3-codex",
12636
+ GPT_5_3_CHAT: "gpt-5.3-chat-latest",
12634
12637
  // GPT-5.2 Series (Current Flagship)
12635
12638
  GPT_5_2: "gpt-5.2",
12636
12639
  GPT_5_2_PRO: "gpt-5.2-pro",
12640
+ GPT_5_2_CODEX: "gpt-5.2-codex",
12641
+ GPT_5_2_CHAT: "gpt-5.2-chat-latest",
12642
+ // GPT-5.1 Series
12643
+ GPT_5_1: "gpt-5.1",
12644
+ GPT_5_1_CODEX: "gpt-5.1-codex",
12645
+ GPT_5_1_CODEX_MAX: "gpt-5.1-codex-max",
12646
+ GPT_5_1_CODEX_MINI: "gpt-5.1-codex-mini",
12647
+ GPT_5_1_CHAT: "gpt-5.1-chat-latest",
12637
12648
  // GPT-5 Series
12638
12649
  GPT_5: "gpt-5",
12639
12650
  GPT_5_MINI: "gpt-5-mini",
12640
12651
  GPT_5_NANO: "gpt-5-nano",
12652
+ GPT_5_CHAT: "gpt-5-chat-latest",
12641
12653
  // GPT-4.1 Series
12642
12654
  GPT_4_1: "gpt-4.1",
12643
12655
  GPT_4_1_MINI: "gpt-4.1-mini",
12644
12656
  GPT_4_1_NANO: "gpt-4.1-nano",
12645
- // GPT-4o Series (Legacy, Audio Capable)
12657
+ // GPT-4o Series (Legacy)
12646
12658
  GPT_4O: "gpt-4o",
12647
12659
  GPT_4O_MINI: "gpt-4o-mini",
12648
12660
  // Reasoning Models (o-series)
@@ -12650,18 +12662,26 @@ var LLM_MODELS = {
12650
12662
  O1: "o1"
12651
12663
  },
12652
12664
  [Vendor.Anthropic]: {
12653
- // Claude 4.5 Series (Current)
12665
+ // Claude 4.6 Series (Current)
12666
+ CLAUDE_OPUS_4_6: "claude-opus-4-6",
12667
+ CLAUDE_SONNET_4_6: "claude-sonnet-4-6",
12668
+ // Claude 4.5 Series
12654
12669
  CLAUDE_OPUS_4_5: "claude-opus-4-5-20251101",
12655
12670
  CLAUDE_SONNET_4_5: "claude-sonnet-4-5-20250929",
12656
12671
  CLAUDE_HAIKU_4_5: "claude-haiku-4-5-20251001",
12657
12672
  // Claude 4.x Legacy
12658
12673
  CLAUDE_OPUS_4_1: "claude-opus-4-1-20250805",
12674
+ CLAUDE_OPUS_4: "claude-opus-4-20250514",
12659
12675
  CLAUDE_SONNET_4: "claude-sonnet-4-20250514",
12660
12676
  CLAUDE_SONNET_3_7: "claude-3-7-sonnet-20250219",
12661
- // Claude 3.x Legacy
12677
+ // Claude 3.x Legacy (Deprecated)
12662
12678
  CLAUDE_HAIKU_3: "claude-3-haiku-20240307"
12663
12679
  },
12664
12680
  [Vendor.Google]: {
12681
+ // Gemini 3.1 Series (Preview)
12682
+ GEMINI_3_1_PRO_PREVIEW: "gemini-3.1-pro-preview",
12683
+ GEMINI_3_1_FLASH_LITE_PREVIEW: "gemini-3.1-flash-lite-preview",
12684
+ GEMINI_3_1_FLASH_IMAGE_PREVIEW: "gemini-3.1-flash-image-preview",
12665
12685
  // Gemini 3 Series (Preview)
12666
12686
  GEMINI_3_FLASH_PREVIEW: "gemini-3-flash-preview",
12667
12687
  GEMINI_3_PRO_PREVIEW: "gemini-3-pro-preview",
@@ -12693,12 +12713,88 @@ var MODEL_REGISTRY = {
12693
12713
  // ============================================================================
12694
12714
  // OpenAI Models (Verified from platform.openai.com)
12695
12715
  // ============================================================================
12716
+ // GPT-5.3 Series
12717
+ "gpt-5.3-codex": {
12718
+ name: "gpt-5.3-codex",
12719
+ provider: Vendor.OpenAI,
12720
+ description: "Latest codex model for coding and agentic tasks. Reasoning.effort: low, medium, high, xhigh",
12721
+ isActive: true,
12722
+ releaseDate: "2026-02-01",
12723
+ knowledgeCutoff: "2025-08-31",
12724
+ features: {
12725
+ reasoning: true,
12726
+ streaming: true,
12727
+ structuredOutput: true,
12728
+ functionCalling: true,
12729
+ fineTuning: false,
12730
+ predictedOutputs: false,
12731
+ realtime: false,
12732
+ vision: true,
12733
+ audio: false,
12734
+ video: false,
12735
+ batchAPI: true,
12736
+ promptCaching: true,
12737
+ parameters: {
12738
+ temperature: false,
12739
+ topP: false,
12740
+ frequencyPenalty: false,
12741
+ presencePenalty: false
12742
+ },
12743
+ input: {
12744
+ tokens: 4e5,
12745
+ text: true,
12746
+ image: true,
12747
+ cpm: 1.75,
12748
+ cpmCached: 0.175
12749
+ },
12750
+ output: {
12751
+ tokens: 128e3,
12752
+ text: true,
12753
+ cpm: 14
12754
+ }
12755
+ }
12756
+ },
12757
+ "gpt-5.3-chat-latest": {
12758
+ name: "gpt-5.3-chat-latest",
12759
+ provider: Vendor.OpenAI,
12760
+ description: "Latest GPT-5.3 chat model for general-purpose use",
12761
+ isActive: true,
12762
+ releaseDate: "2026-02-01",
12763
+ knowledgeCutoff: "2025-08-31",
12764
+ features: {
12765
+ reasoning: false,
12766
+ streaming: true,
12767
+ structuredOutput: true,
12768
+ functionCalling: true,
12769
+ fineTuning: false,
12770
+ predictedOutputs: false,
12771
+ realtime: false,
12772
+ vision: true,
12773
+ audio: false,
12774
+ video: false,
12775
+ batchAPI: true,
12776
+ promptCaching: true,
12777
+ input: {
12778
+ tokens: 128e3,
12779
+ text: true,
12780
+ image: true,
12781
+ cpm: 1.75,
12782
+ cpmCached: 0.175
12783
+ },
12784
+ output: {
12785
+ tokens: 16e3,
12786
+ text: true,
12787
+ cpm: 14
12788
+ }
12789
+ }
12790
+ },
12696
12791
  // GPT-5.2 Series (Current Flagship)
12697
12792
  "gpt-5.2": {
12698
12793
  name: "gpt-5.2",
12699
12794
  provider: Vendor.OpenAI,
12700
12795
  description: "Flagship model for coding and agentic tasks. Reasoning.effort: none, low, medium, high, xhigh",
12701
12796
  isActive: true,
12797
+ preferred: true,
12702
12798
  releaseDate: "2025-12-01",
12703
12799
  knowledgeCutoff: "2025-08-31",
12704
12800
  features: {
@@ -12724,7 +12820,8 @@ var MODEL_REGISTRY = {
12724
12820
  tokens: 4e5,
12725
12821
  text: true,
12726
12822
  image: true,
12727
- cpm: 1.75
12823
+ cpm: 1.75,
12824
+ cpmCached: 0.175
12728
12825
  },
12729
12826
  output: {
12730
12827
  tokens: 128e3,
@@ -12743,7 +12840,7 @@ var MODEL_REGISTRY = {
12743
12840
  features: {
12744
12841
  reasoning: true,
12745
12842
  streaming: true,
12746
- structuredOutput: true,
12843
+ structuredOutput: false,
12747
12844
  functionCalling: true,
12748
12845
  fineTuning: false,
12749
12846
  predictedOutputs: false,
@@ -12772,6 +12869,276 @@ var MODEL_REGISTRY = {
12772
12869
  }
12773
12870
  }
12774
12871
  },
12872
+ "gpt-5.2-codex": {
12873
+ name: "gpt-5.2-codex",
12874
+ provider: Vendor.OpenAI,
12875
+ description: "GPT-5.2 codex for coding and agentic tasks. Reasoning.effort: low, medium, high, xhigh",
12876
+ isActive: true,
12877
+ preferred: true,
12878
+ releaseDate: "2025-12-01",
12879
+ knowledgeCutoff: "2025-08-31",
12880
+ features: {
12881
+ reasoning: true,
12882
+ streaming: true,
12883
+ structuredOutput: true,
12884
+ functionCalling: true,
12885
+ fineTuning: false,
12886
+ predictedOutputs: false,
12887
+ realtime: false,
12888
+ vision: true,
12889
+ audio: false,
12890
+ video: false,
12891
+ batchAPI: true,
12892
+ promptCaching: true,
12893
+ parameters: {
12894
+ temperature: false,
12895
+ topP: false,
12896
+ frequencyPenalty: false,
12897
+ presencePenalty: false
12898
+ },
12899
+ input: {
12900
+ tokens: 4e5,
12901
+ text: true,
12902
+ image: true,
12903
+ cpm: 1.75,
12904
+ cpmCached: 0.175
12905
+ },
12906
+ output: {
12907
+ tokens: 128e3,
12908
+ text: true,
12909
+ cpm: 14
12910
+ }
12911
+ }
12912
+ },
12913
+ "gpt-5.2-chat-latest": {
12914
+ name: "gpt-5.2-chat-latest",
12915
+ provider: Vendor.OpenAI,
12916
+ description: "GPT-5.2 chat model for general-purpose use",
12917
+ isActive: true,
12918
+ releaseDate: "2025-12-01",
12919
+ knowledgeCutoff: "2025-08-31",
12920
+ features: {
12921
+ reasoning: false,
12922
+ streaming: true,
12923
+ structuredOutput: true,
12924
+ functionCalling: true,
12925
+ fineTuning: false,
12926
+ predictedOutputs: false,
12927
+ realtime: false,
12928
+ vision: true,
12929
+ audio: false,
12930
+ video: false,
12931
+ batchAPI: true,
12932
+ promptCaching: true,
12933
+ input: {
12934
+ tokens: 128e3,
12935
+ text: true,
12936
+ image: true,
12937
+ cpm: 1.75,
12938
+ cpmCached: 0.175
12939
+ },
12940
+ output: {
12941
+ tokens: 16e3,
12942
+ text: true,
12943
+ cpm: 14
12944
+ }
12945
+ }
12946
+ },
12947
+ // GPT-5.1 Series
12948
+ "gpt-5.1": {
12949
+ name: "gpt-5.1",
12950
+ provider: Vendor.OpenAI,
12951
+ description: "Intelligent reasoning model for coding and agentic tasks. Reasoning.effort: none, low, medium, high",
12952
+ isActive: true,
12953
+ releaseDate: "2025-10-01",
12954
+ knowledgeCutoff: "2024-09-30",
12955
+ features: {
12956
+ reasoning: true,
12957
+ streaming: true,
12958
+ structuredOutput: true,
12959
+ functionCalling: true,
12960
+ fineTuning: false,
12961
+ predictedOutputs: false,
12962
+ realtime: false,
12963
+ vision: true,
12964
+ audio: false,
12965
+ video: false,
12966
+ batchAPI: true,
12967
+ promptCaching: true,
12968
+ parameters: {
12969
+ temperature: false,
12970
+ topP: false,
12971
+ frequencyPenalty: false,
12972
+ presencePenalty: false
12973
+ },
12974
+ input: {
12975
+ tokens: 4e5,
12976
+ text: true,
12977
+ image: true,
12978
+ cpm: 1.25,
12979
+ cpmCached: 0.125
12980
+ },
12981
+ output: {
12982
+ tokens: 128e3,
12983
+ text: true,
12984
+ cpm: 10
12985
+ }
12986
+ }
12987
+ },
12988
+ "gpt-5.1-codex": {
12989
+ name: "gpt-5.1-codex",
12990
+ provider: Vendor.OpenAI,
12991
+ description: "GPT-5.1 codex for coding and agentic tasks with reasoning",
12992
+ isActive: true,
12993
+ releaseDate: "2025-10-01",
12994
+ knowledgeCutoff: "2024-09-30",
12995
+ features: {
12996
+ reasoning: true,
12997
+ streaming: true,
12998
+ structuredOutput: true,
12999
+ functionCalling: true,
13000
+ fineTuning: false,
13001
+ predictedOutputs: false,
13002
+ realtime: false,
13003
+ vision: true,
13004
+ audio: false,
13005
+ video: false,
13006
+ batchAPI: true,
13007
+ promptCaching: true,
13008
+ parameters: {
13009
+ temperature: false,
13010
+ topP: false,
13011
+ frequencyPenalty: false,
13012
+ presencePenalty: false
13013
+ },
13014
+ input: {
13015
+ tokens: 4e5,
13016
+ text: true,
13017
+ image: true,
13018
+ cpm: 1.25,
13019
+ cpmCached: 0.125
13020
+ },
13021
+ output: {
13022
+ tokens: 128e3,
13023
+ text: true,
13024
+ cpm: 10
13025
+ }
13026
+ }
13027
+ },
13028
+ "gpt-5.1-codex-max": {
13029
+ name: "gpt-5.1-codex-max",
13030
+ provider: Vendor.OpenAI,
13031
+ description: "GPT-5.1 codex max for maximum reasoning depth on coding tasks",
13032
+ isActive: true,
13033
+ releaseDate: "2025-10-01",
13034
+ knowledgeCutoff: "2024-09-30",
13035
+ features: {
13036
+ reasoning: true,
13037
+ streaming: true,
13038
+ structuredOutput: true,
13039
+ functionCalling: true,
13040
+ fineTuning: false,
13041
+ predictedOutputs: false,
13042
+ realtime: false,
13043
+ vision: true,
13044
+ audio: false,
13045
+ video: false,
13046
+ batchAPI: true,
13047
+ promptCaching: true,
13048
+ parameters: {
13049
+ temperature: false,
13050
+ topP: false,
13051
+ frequencyPenalty: false,
13052
+ presencePenalty: false
13053
+ },
13054
+ input: {
13055
+ tokens: 4e5,
13056
+ text: true,
13057
+ image: true,
13058
+ cpm: 1.25,
13059
+ cpmCached: 0.125
13060
+ },
13061
+ output: {
13062
+ tokens: 128e3,
13063
+ text: true,
13064
+ cpm: 10
13065
+ }
13066
+ }
13067
+ },
13068
+ "gpt-5.1-codex-mini": {
13069
+ name: "gpt-5.1-codex-mini",
13070
+ provider: Vendor.OpenAI,
13071
+ description: "GPT-5.1 codex mini for cost-efficient coding tasks",
13072
+ isActive: true,
13073
+ releaseDate: "2025-10-01",
13074
+ knowledgeCutoff: "2024-09-30",
13075
+ features: {
13076
+ reasoning: true,
13077
+ streaming: true,
13078
+ structuredOutput: true,
13079
+ functionCalling: true,
13080
+ fineTuning: false,
13081
+ predictedOutputs: false,
13082
+ realtime: false,
13083
+ vision: true,
13084
+ audio: false,
13085
+ video: false,
13086
+ batchAPI: true,
13087
+ promptCaching: true,
13088
+ parameters: {
13089
+ temperature: false,
13090
+ topP: false,
13091
+ frequencyPenalty: false,
13092
+ presencePenalty: false
13093
+ },
13094
+ input: {
13095
+ tokens: 4e5,
13096
+ text: true,
13097
+ image: true,
13098
+ cpm: 0.25,
13099
+ cpmCached: 0.025
13100
+ },
13101
+ output: {
13102
+ tokens: 128e3,
13103
+ text: true,
13104
+ cpm: 2
13105
+ }
13106
+ }
13107
+ },
13108
+ "gpt-5.1-chat-latest": {
13109
+ name: "gpt-5.1-chat-latest",
13110
+ provider: Vendor.OpenAI,
13111
+ description: "GPT-5.1 chat model for general-purpose use",
13112
+ isActive: true,
13113
+ releaseDate: "2025-10-01",
13114
+ knowledgeCutoff: "2024-09-30",
13115
+ features: {
13116
+ reasoning: false,
13117
+ streaming: true,
13118
+ structuredOutput: true,
13119
+ functionCalling: true,
13120
+ fineTuning: false,
13121
+ predictedOutputs: false,
13122
+ realtime: false,
13123
+ vision: true,
13124
+ audio: false,
13125
+ video: false,
13126
+ batchAPI: true,
13127
+ promptCaching: true,
13128
+ input: {
13129
+ tokens: 128e3,
13130
+ text: true,
13131
+ image: true,
13132
+ cpm: 1.25,
13133
+ cpmCached: 0.125
13134
+ },
13135
+ output: {
13136
+ tokens: 16e3,
13137
+ text: true,
13138
+ cpm: 10
13139
+ }
13140
+ }
13141
+ },
12775
13142
  // GPT-5 Series
12776
13143
  "gpt-5": {
12777
13144
  name: "gpt-5",
@@ -12803,7 +13170,8 @@ var MODEL_REGISTRY = {
12803
13170
  tokens: 4e5,
12804
13171
  text: true,
12805
13172
  image: true,
12806
- cpm: 1.25
13173
+ cpm: 1.25,
13174
+ cpmCached: 0.125
12807
13175
  },
12808
13176
  output: {
12809
13177
  tokens: 128e3,
@@ -12842,7 +13210,8 @@ var MODEL_REGISTRY = {
12842
13210
  tokens: 4e5,
12843
13211
  text: true,
12844
13212
  image: true,
12845
- cpm: 0.25
13213
+ cpm: 0.25,
13214
+ cpmCached: 0.025
12846
13215
  },
12847
13216
  output: {
12848
13217
  tokens: 128e3,
@@ -12881,7 +13250,8 @@ var MODEL_REGISTRY = {
12881
13250
  tokens: 4e5,
12882
13251
  text: true,
12883
13252
  image: true,
12884
- cpm: 0.05
13253
+ cpm: 0.05,
13254
+ cpmCached: 5e-3
12885
13255
  },
12886
13256
  output: {
12887
13257
  tokens: 128e3,
@@ -12890,6 +13260,40 @@ var MODEL_REGISTRY = {
12890
13260
  }
12891
13261
  }
12892
13262
  },
13263
+ "gpt-5-chat-latest": {
13264
+ name: "gpt-5-chat-latest",
13265
+ provider: Vendor.OpenAI,
13266
+ description: "GPT-5 chat model for general-purpose use",
13267
+ isActive: true,
13268
+ releaseDate: "2025-08-01",
13269
+ knowledgeCutoff: "2024-09-30",
13270
+ features: {
13271
+ reasoning: false,
13272
+ streaming: true,
13273
+ structuredOutput: true,
13274
+ functionCalling: true,
13275
+ fineTuning: false,
13276
+ predictedOutputs: false,
13277
+ realtime: false,
13278
+ vision: true,
13279
+ audio: false,
13280
+ video: false,
13281
+ batchAPI: true,
13282
+ promptCaching: true,
13283
+ input: {
13284
+ tokens: 128e3,
13285
+ text: true,
13286
+ image: true,
13287
+ cpm: 1.25,
13288
+ cpmCached: 0.125
13289
+ },
13290
+ output: {
13291
+ tokens: 16e3,
13292
+ text: true,
13293
+ cpm: 10
13294
+ }
13295
+ }
13296
+ },
12893
13297
  // GPT-4.1 Series
12894
13298
  "gpt-4.1": {
12895
13299
  name: "gpt-4.1",
@@ -12897,7 +13301,7 @@ var MODEL_REGISTRY = {
12897
13301
  description: "GPT-4.1 specialized for coding with 1M token context window",
12898
13302
  isActive: true,
12899
13303
  releaseDate: "2025-04-14",
12900
- knowledgeCutoff: "2025-04-01",
13304
+ knowledgeCutoff: "2024-06-01",
12901
13305
  features: {
12902
13306
  reasoning: false,
12903
13307
  streaming: true,
@@ -12915,7 +13319,8 @@ var MODEL_REGISTRY = {
12915
13319
  tokens: 1e6,
12916
13320
  text: true,
12917
13321
  image: true,
12918
- cpm: 2
13322
+ cpm: 2,
13323
+ cpmCached: 0.5
12919
13324
  },
12920
13325
  output: {
12921
13326
  tokens: 32768,
@@ -12930,7 +13335,7 @@ var MODEL_REGISTRY = {
12930
13335
  description: "Efficient GPT-4.1 model, beats GPT-4o in many benchmarks at 83% lower cost",
12931
13336
  isActive: true,
12932
13337
  releaseDate: "2025-04-14",
12933
- knowledgeCutoff: "2025-04-01",
13338
+ knowledgeCutoff: "2024-06-01",
12934
13339
  features: {
12935
13340
  reasoning: false,
12936
13341
  streaming: true,
@@ -12948,7 +13353,8 @@ var MODEL_REGISTRY = {
12948
13353
  tokens: 1e6,
12949
13354
  text: true,
12950
13355
  image: true,
12951
- cpm: 0.4
13356
+ cpm: 0.4,
13357
+ cpmCached: 0.1
12952
13358
  },
12953
13359
  output: {
12954
13360
  tokens: 16384,
@@ -12963,7 +13369,7 @@ var MODEL_REGISTRY = {
12963
13369
  description: "Fastest and cheapest model with 1M context. 80.1% MMLU, ideal for classification/autocompletion",
12964
13370
  isActive: true,
12965
13371
  releaseDate: "2025-04-14",
12966
- knowledgeCutoff: "2025-04-01",
13372
+ knowledgeCutoff: "2024-06-01",
12967
13373
  features: {
12968
13374
  reasoning: false,
12969
13375
  streaming: true,
@@ -12981,7 +13387,8 @@ var MODEL_REGISTRY = {
12981
13387
  tokens: 1e6,
12982
13388
  text: true,
12983
13389
  image: true,
12984
- cpm: 0.1
13390
+ cpm: 0.1,
13391
+ cpmCached: 0.025
12985
13392
  },
12986
13393
  output: {
12987
13394
  tokens: 16384,
@@ -12990,14 +13397,14 @@ var MODEL_REGISTRY = {
12990
13397
  }
12991
13398
  }
12992
13399
  },
12993
- // GPT-4o Series (Legacy, Audio Capable)
13400
+ // GPT-4o Series (Legacy)
12994
13401
  "gpt-4o": {
12995
13402
  name: "gpt-4o",
12996
13403
  provider: Vendor.OpenAI,
12997
- description: "Versatile omni model with audio support. Legacy but still available",
13404
+ description: "Versatile omni model. Legacy but still available",
12998
13405
  isActive: true,
12999
13406
  releaseDate: "2024-05-13",
13000
- knowledgeCutoff: "2024-04-01",
13407
+ knowledgeCutoff: "2023-10-01",
13001
13408
  features: {
13002
13409
  reasoning: false,
13003
13410
  streaming: true,
@@ -13007,7 +13414,7 @@ var MODEL_REGISTRY = {
13007
13414
  predictedOutputs: true,
13008
13415
  realtime: true,
13009
13416
  vision: true,
13010
- audio: true,
13417
+ audio: false,
13011
13418
  video: false,
13012
13419
  batchAPI: true,
13013
13420
  promptCaching: true,
@@ -13015,13 +13422,12 @@ var MODEL_REGISTRY = {
13015
13422
  tokens: 128e3,
13016
13423
  text: true,
13017
13424
  image: true,
13018
- audio: true,
13019
- cpm: 2.5
13425
+ cpm: 2.5,
13426
+ cpmCached: 1.25
13020
13427
  },
13021
13428
  output: {
13022
13429
  tokens: 16384,
13023
13430
  text: true,
13024
- audio: true,
13025
13431
  cpm: 10
13026
13432
  }
13027
13433
  }
@@ -13029,10 +13435,10 @@ var MODEL_REGISTRY = {
13029
13435
  "gpt-4o-mini": {
13030
13436
  name: "gpt-4o-mini",
13031
13437
  provider: Vendor.OpenAI,
13032
- description: "Fast, affordable omni model with audio support",
13438
+ description: "Fast, affordable omni model",
13033
13439
  isActive: true,
13034
13440
  releaseDate: "2024-07-18",
13035
- knowledgeCutoff: "2024-04-01",
13441
+ knowledgeCutoff: "2023-10-01",
13036
13442
  features: {
13037
13443
  reasoning: false,
13038
13444
  streaming: true,
@@ -13042,7 +13448,7 @@ var MODEL_REGISTRY = {
13042
13448
  predictedOutputs: false,
13043
13449
  realtime: true,
13044
13450
  vision: true,
13045
- audio: true,
13451
+ audio: false,
13046
13452
  video: false,
13047
13453
  batchAPI: true,
13048
13454
  promptCaching: true,
@@ -13050,13 +13456,12 @@ var MODEL_REGISTRY = {
13050
13456
  tokens: 128e3,
13051
13457
  text: true,
13052
13458
  image: true,
13053
- audio: true,
13054
- cpm: 0.15
13459
+ cpm: 0.15,
13460
+ cpmCached: 0.075
13055
13461
  },
13056
13462
  output: {
13057
13463
  tokens: 16384,
13058
13464
  text: true,
13059
- audio: true,
13060
13465
  cpm: 0.6
13061
13466
  }
13062
13467
  }
@@ -13068,7 +13473,7 @@ var MODEL_REGISTRY = {
13068
13473
  description: "Fast reasoning model tailored for coding, math, and science",
13069
13474
  isActive: true,
13070
13475
  releaseDate: "2025-01-31",
13071
- knowledgeCutoff: "2024-10-01",
13476
+ knowledgeCutoff: "2023-10-01",
13072
13477
  features: {
13073
13478
  reasoning: true,
13074
13479
  streaming: true,
@@ -13077,11 +13482,11 @@ var MODEL_REGISTRY = {
13077
13482
  fineTuning: false,
13078
13483
  predictedOutputs: false,
13079
13484
  realtime: false,
13080
- vision: true,
13485
+ vision: false,
13081
13486
  audio: false,
13082
13487
  video: false,
13083
13488
  batchAPI: true,
13084
- promptCaching: false,
13489
+ promptCaching: true,
13085
13490
  parameters: {
13086
13491
  temperature: false,
13087
13492
  topP: false,
@@ -13091,8 +13496,8 @@ var MODEL_REGISTRY = {
13091
13496
  input: {
13092
13497
  tokens: 2e5,
13093
13498
  text: true,
13094
- image: true,
13095
- cpm: 1.1
13499
+ cpm: 1.1,
13500
+ cpmCached: 0.55
13096
13501
  },
13097
13502
  output: {
13098
13503
  tokens: 1e5,
@@ -13107,7 +13512,7 @@ var MODEL_REGISTRY = {
13107
13512
  description: "Advanced reasoning model for complex problems",
13108
13513
  isActive: true,
13109
13514
  releaseDate: "2024-12-17",
13110
- knowledgeCutoff: "2024-10-01",
13515
+ knowledgeCutoff: "2023-10-01",
13111
13516
  features: {
13112
13517
  reasoning: true,
13113
13518
  streaming: true,
@@ -13120,7 +13525,7 @@ var MODEL_REGISTRY = {
13120
13525
  audio: false,
13121
13526
  video: false,
13122
13527
  batchAPI: true,
13123
- promptCaching: false,
13528
+ promptCaching: true,
13124
13529
  parameters: {
13125
13530
  temperature: false,
13126
13531
  topP: false,
@@ -13131,7 +13536,8 @@ var MODEL_REGISTRY = {
13131
13536
  tokens: 2e5,
13132
13537
  text: true,
13133
13538
  image: true,
13134
- cpm: 15
13539
+ cpm: 15,
13540
+ cpmCached: 7.5
13135
13541
  },
13136
13542
  output: {
13137
13543
  tokens: 1e5,
@@ -13141,13 +13547,88 @@ var MODEL_REGISTRY = {
13141
13547
  }
13142
13548
  },
13143
13549
  // ============================================================================
13144
- // Anthropic Models (Verified from platform.claude.com)
13550
+ // Anthropic Models (Verified from platform.claude.com - March 2026)
13145
13551
  // ============================================================================
13146
- // Claude 4.5 Series (Current)
13552
+ // Claude 4.6 Series (Current)
13553
+ "claude-opus-4-6": {
13554
+ name: "claude-opus-4-6",
13555
+ provider: Vendor.Anthropic,
13556
+ description: "The most intelligent model for building agents and coding. 128K output, adaptive thinking",
13557
+ isActive: true,
13558
+ preferred: true,
13559
+ releaseDate: "2026-02-01",
13560
+ knowledgeCutoff: "2025-05-01",
13561
+ features: {
13562
+ reasoning: false,
13563
+ streaming: true,
13564
+ structuredOutput: true,
13565
+ functionCalling: true,
13566
+ fineTuning: false,
13567
+ predictedOutputs: false,
13568
+ realtime: false,
13569
+ vision: true,
13570
+ audio: false,
13571
+ video: false,
13572
+ extendedThinking: true,
13573
+ batchAPI: true,
13574
+ promptCaching: true,
13575
+ input: {
13576
+ tokens: 2e5,
13577
+ // 1M with beta header
13578
+ text: true,
13579
+ image: true,
13580
+ cpm: 5,
13581
+ cpmCached: 0.5
13582
+ },
13583
+ output: {
13584
+ tokens: 128e3,
13585
+ text: true,
13586
+ cpm: 25
13587
+ }
13588
+ }
13589
+ },
13590
+ "claude-sonnet-4-6": {
13591
+ name: "claude-sonnet-4-6",
13592
+ provider: Vendor.Anthropic,
13593
+ description: "Best combination of speed and intelligence. Adaptive thinking, 1M context beta",
13594
+ isActive: true,
13595
+ preferred: true,
13596
+ releaseDate: "2026-02-01",
13597
+ knowledgeCutoff: "2025-08-01",
13598
+ features: {
13599
+ reasoning: false,
13600
+ streaming: true,
13601
+ structuredOutput: true,
13602
+ functionCalling: true,
13603
+ fineTuning: false,
13604
+ predictedOutputs: false,
13605
+ realtime: false,
13606
+ vision: true,
13607
+ audio: false,
13608
+ video: false,
13609
+ extendedThinking: true,
13610
+ batchAPI: true,
13611
+ promptCaching: true,
13612
+ input: {
13613
+ tokens: 2e5,
13614
+ // 1M with beta header
13615
+ text: true,
13616
+ image: true,
13617
+ cpm: 3,
13618
+ cpmCached: 0.3
13619
+ },
13620
+ output: {
13621
+ tokens: 64e3,
13622
+ text: true,
13623
+ cpm: 15
13624
+ }
13625
+ }
13626
+ },
13627
+ // Claude 4.5 Series
13147
13628
  "claude-opus-4-5-20251101": {
13148
13629
  name: "claude-opus-4-5-20251101",
13149
13630
  provider: Vendor.Anthropic,
13150
- description: "Premium model combining maximum intelligence with practical performance",
13631
+ description: "Legacy Opus 4.5. Premium model combining maximum intelligence with practical performance",
13151
13632
  isActive: true,
13152
13633
  releaseDate: "2025-11-01",
13153
13634
  knowledgeCutoff: "2025-05-01",
@@ -13182,7 +13663,7 @@ var MODEL_REGISTRY = {
13182
13663
  "claude-sonnet-4-5-20250929": {
13183
13664
  name: "claude-sonnet-4-5-20250929",
13184
13665
  provider: Vendor.Anthropic,
13185
- description: "Smart model for complex agents and coding. Best balance of intelligence, speed, cost",
13666
+ description: "Legacy Sonnet 4.5. Smart model for complex agents and coding",
13186
13667
  isActive: true,
13187
13668
  releaseDate: "2025-09-29",
13188
13669
  knowledgeCutoff: "2025-01-01",
@@ -13202,6 +13683,7 @@ var MODEL_REGISTRY = {
13202
13683
  promptCaching: true,
13203
13684
  input: {
13204
13685
  tokens: 2e5,
13686
+ // 1M with beta header
13205
13687
  text: true,
13206
13688
  image: true,
13207
13689
  cpm: 3,
@@ -13285,10 +13767,45 @@ var MODEL_REGISTRY = {
13285
13767
  }
13286
13768
  }
13287
13769
  },
13770
+ "claude-opus-4-20250514": {
13771
+ name: "claude-opus-4-20250514",
13772
+ provider: Vendor.Anthropic,
13773
+ description: "Legacy Opus 4. Agentic tasks and reasoning",
13774
+ isActive: true,
13775
+ releaseDate: "2025-05-14",
13776
+ knowledgeCutoff: "2025-01-01",
13777
+ features: {
13778
+ reasoning: false,
13779
+ streaming: true,
13780
+ structuredOutput: true,
13781
+ functionCalling: true,
13782
+ fineTuning: false,
13783
+ predictedOutputs: false,
13784
+ realtime: false,
13785
+ vision: true,
13786
+ audio: false,
13787
+ video: false,
13788
+ extendedThinking: true,
13789
+ batchAPI: true,
13790
+ promptCaching: true,
13791
+ input: {
13792
+ tokens: 2e5,
13793
+ text: true,
13794
+ image: true,
13795
+ cpm: 15,
13796
+ cpmCached: 1.5
13797
+ },
13798
+ output: {
13799
+ tokens: 32e3,
13800
+ text: true,
13801
+ cpm: 75
13802
+ }
13803
+ }
13804
+ },
13288
13805
  "claude-sonnet-4-20250514": {
13289
13806
  name: "claude-sonnet-4-20250514",
13290
13807
  provider: Vendor.Anthropic,
13291
- description: "Legacy Sonnet 4. Default for most users, supports 1M context beta",
13808
+ description: "Legacy Sonnet 4. Supports 1M context beta",
13292
13809
  isActive: true,
13293
13810
  releaseDate: "2025-05-14",
13294
13811
  knowledgeCutoff: "2025-01-01",
@@ -13324,7 +13841,7 @@ var MODEL_REGISTRY = {
13324
13841
  "claude-3-7-sonnet-20250219": {
13325
13842
  name: "claude-3-7-sonnet-20250219",
13326
13843
  provider: Vendor.Anthropic,
13327
- description: "Claude 3.7 Sonnet with extended thinking, supports 128K output beta",
13844
+ description: "Deprecated. Claude 3.7 Sonnet with extended thinking",
13328
13845
  isActive: true,
13329
13846
  releaseDate: "2025-02-19",
13330
13847
  knowledgeCutoff: "2024-10-01",
@@ -13351,17 +13868,16 @@ var MODEL_REGISTRY = {
13351
13868
  },
13352
13869
  output: {
13353
13870
  tokens: 64e3,
13354
- // 128K with beta header
13355
13871
  text: true,
13356
13872
  cpm: 15
13357
13873
  }
13358
13874
  }
13359
13875
  },
13360
- // Claude 3.x Legacy
13876
+ // Claude 3.x Legacy (Deprecated - retiring April 19, 2026)
13361
13877
  "claude-3-haiku-20240307": {
13362
13878
  name: "claude-3-haiku-20240307",
13363
13879
  provider: Vendor.Anthropic,
13364
- description: "Fast legacy model. Recommend migrating to Haiku 4.5",
13880
+ description: "Deprecated. Retiring April 19, 2026. Migrate to Haiku 4.5",
13365
13881
  isActive: true,
13366
13882
  releaseDate: "2024-03-07",
13367
13883
  knowledgeCutoff: "2023-08-01",
@@ -13394,16 +13910,124 @@ var MODEL_REGISTRY = {
13394
13910
  }
13395
13911
  },
13396
13912
  // ============================================================================
13397
- // Google Models (Verified from ai.google.dev)
13913
+ // Google Models (Verified from ai.google.dev - March 2026)
13398
13914
  // ============================================================================
13915
+ // Gemini 3.1 Series (Preview)
13916
+ "gemini-3.1-pro-preview": {
13917
+ name: "gemini-3.1-pro-preview",
13918
+ provider: Vendor.Google,
13919
+ description: "Advanced intelligence with powerful agentic and coding capabilities. Replaces gemini-3-pro-preview",
13920
+ isActive: true,
13921
+ preferred: true,
13922
+ releaseDate: "2026-02-01",
13923
+ knowledgeCutoff: "2025-01-01",
13924
+ features: {
13925
+ reasoning: true,
13926
+ streaming: true,
13927
+ structuredOutput: true,
13928
+ functionCalling: true,
13929
+ fineTuning: false,
13930
+ predictedOutputs: false,
13931
+ realtime: false,
13932
+ vision: true,
13933
+ audio: true,
13934
+ video: true,
13935
+ batchAPI: true,
13936
+ promptCaching: true,
13937
+ input: {
13938
+ tokens: 1048576,
13939
+ text: true,
13940
+ image: true,
13941
+ audio: true,
13942
+ video: true,
13943
+ cpm: 2,
13944
+ cpmCached: 0.2
13945
+ },
13946
+ output: {
13947
+ tokens: 65536,
13948
+ text: true,
13949
+ cpm: 12
13950
+ }
13951
+ }
13952
+ },
13953
+ "gemini-3.1-flash-lite-preview": {
13954
+ name: "gemini-3.1-flash-lite-preview",
13955
+ provider: Vendor.Google,
13956
+ description: "High performance, budget-friendly for high-volume agentic tasks and data extraction",
13957
+ isActive: true,
13958
+ releaseDate: "2026-03-01",
13959
+ knowledgeCutoff: "2025-01-01",
13960
+ features: {
13961
+ reasoning: true,
13962
+ streaming: true,
13963
+ structuredOutput: true,
13964
+ functionCalling: true,
13965
+ fineTuning: false,
13966
+ predictedOutputs: false,
13967
+ realtime: false,
13968
+ vision: true,
13969
+ audio: true,
13970
+ video: true,
13971
+ batchAPI: true,
13972
+ promptCaching: true,
13973
+ input: {
13974
+ tokens: 1048576,
13975
+ text: true,
13976
+ image: true,
13977
+ audio: true,
13978
+ video: true,
13979
+ cpm: 0.25
13980
+ },
13981
+ output: {
13982
+ tokens: 65536,
13983
+ text: true,
13984
+ cpm: 1.5
13985
+ }
13986
+ }
13987
+ },
13988
+ "gemini-3.1-flash-image-preview": {
13989
+ name: "gemini-3.1-flash-image-preview",
13990
+ provider: Vendor.Google,
13991
+ description: "High-efficiency image generation with up to 4K output, search grounding support",
13992
+ isActive: true,
13993
+ releaseDate: "2026-02-01",
13994
+ knowledgeCutoff: "2025-01-01",
13995
+ features: {
13996
+ reasoning: true,
13997
+ streaming: true,
13998
+ structuredOutput: false,
13999
+ functionCalling: false,
14000
+ fineTuning: false,
14001
+ predictedOutputs: false,
14002
+ realtime: false,
14003
+ vision: true,
14004
+ audio: false,
14005
+ video: false,
14006
+ batchAPI: true,
14007
+ promptCaching: false,
14008
+ input: {
14009
+ tokens: 131072,
14010
+ text: true,
14011
+ image: true,
14012
+ cpm: 0.25
14013
+ },
14014
+ output: {
14015
+ tokens: 32768,
14016
+ text: true,
14017
+ image: true,
14018
+ cpm: 1.5
14019
+ }
14020
+ }
14021
+ },
13399
14022
  // Gemini 3 Series (Preview)
13400
14023
  "gemini-3-flash-preview": {
13401
14024
  name: "gemini-3-flash-preview",
13402
14025
  provider: Vendor.Google,
13403
- description: "Pro-grade reasoning with Flash-level latency and efficiency",
14026
+ description: "Most powerful agentic and coding model with frontier-class reasoning",
13404
14027
  isActive: true,
13405
- releaseDate: "2025-11-18",
13406
- knowledgeCutoff: "2025-08-01",
14028
+ preferred: true,
14029
+ releaseDate: "2025-12-01",
14030
+ knowledgeCutoff: "2025-01-01",
13407
14031
  features: {
13408
14032
  reasoning: true,
13409
14033
  streaming: true,
@@ -13418,27 +14042,28 @@ var MODEL_REGISTRY = {
13418
14042
  batchAPI: true,
13419
14043
  promptCaching: true,
13420
14044
  input: {
13421
- tokens: 1e6,
14045
+ tokens: 1048576,
13422
14046
  text: true,
13423
14047
  image: true,
13424
14048
  audio: true,
13425
14049
  video: true,
13426
- cpm: 0.15
14050
+ cpm: 0.5,
14051
+ cpmCached: 0.05
13427
14052
  },
13428
14053
  output: {
13429
14054
  tokens: 65536,
13430
14055
  text: true,
13431
- cpm: 0.6
14056
+ cpm: 3
13432
14057
  }
13433
14058
  }
13434
14059
  },
13435
14060
  "gemini-3-pro-preview": {
13436
14061
  name: "gemini-3-pro-preview",
13437
14062
  provider: Vendor.Google,
13438
- description: "Most advanced reasoning Gemini model for complex tasks",
14063
+ description: "Deprecated. Shutting down March 9, 2026. Migrate to gemini-3.1-pro-preview",
13439
14064
  isActive: true,
13440
14065
  releaseDate: "2025-11-18",
13441
- knowledgeCutoff: "2025-08-01",
14066
+ knowledgeCutoff: "2025-01-01",
13442
14067
  features: {
13443
14068
  reasoning: true,
13444
14069
  streaming: true,
@@ -13453,7 +14078,7 @@ var MODEL_REGISTRY = {
13453
14078
  batchAPI: true,
13454
14079
  promptCaching: true,
13455
14080
  input: {
13456
- tokens: 1e6,
14081
+ tokens: 1048576,
13457
14082
  text: true,
13458
14083
  image: true,
13459
14084
  audio: true,
@@ -13470,14 +14095,14 @@ var MODEL_REGISTRY = {
13470
14095
  "gemini-3-pro-image-preview": {
13471
14096
  name: "gemini-3-pro-image-preview",
13472
14097
  provider: Vendor.Google,
13473
- description: "Highest quality image generation model",
14098
+ description: "Professional-grade image generation and editing with reasoning",
13474
14099
  isActive: true,
13475
14100
  releaseDate: "2025-11-18",
13476
- knowledgeCutoff: "2025-08-01",
14101
+ knowledgeCutoff: "2025-01-01",
13477
14102
  features: {
13478
14103
  reasoning: true,
13479
14104
  streaming: true,
13480
- structuredOutput: false,
14105
+ structuredOutput: true,
13481
14106
  functionCalling: false,
13482
14107
  fineTuning: false,
13483
14108
  predictedOutputs: false,
@@ -13486,15 +14111,15 @@ var MODEL_REGISTRY = {
13486
14111
  audio: false,
13487
14112
  video: false,
13488
14113
  batchAPI: true,
13489
- promptCaching: true,
14114
+ promptCaching: false,
13490
14115
  input: {
13491
- tokens: 1e6,
14116
+ tokens: 65536,
13492
14117
  text: true,
13493
14118
  image: true,
13494
14119
  cpm: 1.25
13495
14120
  },
13496
14121
  output: {
13497
- tokens: 65536,
14122
+ tokens: 32768,
13498
14123
  text: true,
13499
14124
  image: true,
13500
14125
  cpm: 10
@@ -13505,7 +14130,7 @@ var MODEL_REGISTRY = {
13505
14130
  "gemini-2.5-pro": {
13506
14131
  name: "gemini-2.5-pro",
13507
14132
  provider: Vendor.Google,
13508
- description: "Advanced multimodal model built for deep reasoning and agents",
14133
+ description: "Most advanced model for complex tasks with deep reasoning and coding",
13509
14134
  isActive: true,
13510
14135
  releaseDate: "2025-03-01",
13511
14136
  knowledgeCutoff: "2025-01-01",
@@ -13523,12 +14148,13 @@ var MODEL_REGISTRY = {
13523
14148
  batchAPI: true,
13524
14149
  promptCaching: true,
13525
14150
  input: {
13526
- tokens: 1e6,
14151
+ tokens: 1048576,
13527
14152
  text: true,
13528
14153
  image: true,
13529
14154
  audio: true,
13530
14155
  video: true,
13531
- cpm: 1.25
14156
+ cpm: 1.25,
14157
+ cpmCached: 0.125
13532
14158
  },
13533
14159
  output: {
13534
14160
  tokens: 65536,
@@ -13540,7 +14166,7 @@ var MODEL_REGISTRY = {
13540
14166
  "gemini-2.5-flash": {
13541
14167
  name: "gemini-2.5-flash",
13542
14168
  provider: Vendor.Google,
13543
- description: "Fast, cost-effective model with excellent reasoning",
14169
+ description: "Best price-performance for low-latency, high-volume tasks with reasoning",
13544
14170
  isActive: true,
13545
14171
  releaseDate: "2025-06-17",
13546
14172
  knowledgeCutoff: "2025-01-01",
@@ -13558,24 +14184,25 @@ var MODEL_REGISTRY = {
13558
14184
  batchAPI: true,
13559
14185
  promptCaching: true,
13560
14186
  input: {
13561
- tokens: 1e6,
14187
+ tokens: 1048576,
13562
14188
  text: true,
13563
14189
  image: true,
13564
14190
  audio: true,
13565
14191
  video: true,
13566
- cpm: 0.15
14192
+ cpm: 0.3,
14193
+ cpmCached: 0.03
13567
14194
  },
13568
14195
  output: {
13569
14196
  tokens: 65536,
13570
14197
  text: true,
13571
- cpm: 0.6
14198
+ cpm: 2.5
13572
14199
  }
13573
14200
  }
13574
14201
  },
13575
14202
  "gemini-2.5-flash-lite": {
13576
14203
  name: "gemini-2.5-flash-lite",
13577
14204
  provider: Vendor.Google,
13578
- description: "Lowest latency for high-volume tasks, summarization, classification",
14205
+ description: "Fastest and most budget-friendly multimodal model in the 2.5 family",
13579
14206
  isActive: true,
13580
14207
  releaseDate: "2025-06-17",
13581
14208
  knowledgeCutoff: "2025-01-01",
@@ -13593,31 +14220,31 @@ var MODEL_REGISTRY = {
13593
14220
  batchAPI: true,
13594
14221
  promptCaching: true,
13595
14222
  input: {
13596
- tokens: 1e6,
14223
+ tokens: 1048576,
13597
14224
  text: true,
13598
14225
  image: true,
13599
14226
  audio: true,
13600
14227
  video: true,
13601
- cpm: 0.075
14228
+ cpm: 0.1
13602
14229
  },
13603
14230
  output: {
13604
14231
  tokens: 65536,
13605
14232
  text: true,
13606
- cpm: 0.3
14233
+ cpm: 0.4
13607
14234
  }
13608
14235
  }
13609
14236
  },
13610
14237
  "gemini-2.5-flash-image": {
13611
14238
  name: "gemini-2.5-flash-image",
13612
14239
  provider: Vendor.Google,
13613
- description: "Image generation and editing model",
14240
+ description: "Fast native image generation and editing (Nano Banana)",
13614
14241
  isActive: true,
13615
- releaseDate: "2025-09-01",
13616
- knowledgeCutoff: "2025-01-01",
14242
+ releaseDate: "2025-10-01",
14243
+ knowledgeCutoff: "2025-06-01",
13617
14244
  features: {
13618
- reasoning: true,
14245
+ reasoning: false,
13619
14246
  streaming: true,
13620
- structuredOutput: false,
14247
+ structuredOutput: true,
13621
14248
  functionCalling: false,
13622
14249
  fineTuning: false,
13623
14250
  predictedOutputs: false,
@@ -13628,13 +14255,13 @@ var MODEL_REGISTRY = {
13628
14255
  batchAPI: true,
13629
14256
  promptCaching: true,
13630
14257
  input: {
13631
- tokens: 1e6,
14258
+ tokens: 65536,
13632
14259
  text: true,
13633
14260
  image: true,
13634
14261
  cpm: 0.15
13635
14262
  },
13636
14263
  output: {
13637
- tokens: 65536,
14264
+ tokens: 32768,
13638
14265
  text: true,
13639
14266
  image: true,
13640
14267
  cpm: 0.6
@@ -13642,7 +14269,7 @@ var MODEL_REGISTRY = {
13642
14269
  }
13643
14270
  },
13644
14271
  // ============================================================================
13645
- // xAI Grok Models (Verified from docs.x.ai - January 2026)
14272
+ // xAI Grok Models (Verified from docs.x.ai - March 2026)
13646
14273
  // ============================================================================
13647
14274
  // Grok 4.1 Series (2M context, fast)
13648
14275
  "grok-4-1-fast-reasoning": {
@@ -13663,13 +14290,14 @@ var MODEL_REGISTRY = {
13663
14290
  vision: true,
13664
14291
  audio: false,
13665
14292
  video: false,
13666
- batchAPI: false,
13667
- promptCaching: false,
14293
+ batchAPI: true,
14294
+ promptCaching: true,
13668
14295
  input: {
13669
14296
  tokens: 2e6,
13670
14297
  text: true,
13671
14298
  image: true,
13672
- cpm: 0.2
14299
+ cpm: 0.2,
14300
+ cpmCached: 0.05
13673
14301
  },
13674
14302
  output: {
13675
14303
  tokens: 65536,
@@ -13696,13 +14324,14 @@ var MODEL_REGISTRY = {
13696
14324
  vision: true,
13697
14325
  audio: false,
13698
14326
  video: false,
13699
- batchAPI: false,
13700
- promptCaching: false,
14327
+ batchAPI: true,
14328
+ promptCaching: true,
13701
14329
  input: {
13702
14330
  tokens: 2e6,
13703
14331
  text: true,
13704
14332
  image: true,
13705
- cpm: 0.2
14333
+ cpm: 0.2,
14334
+ cpmCached: 0.05
13706
14335
  },
13707
14336
  output: {
13708
14337
  tokens: 65536,
@@ -13730,12 +14359,13 @@ var MODEL_REGISTRY = {
13730
14359
  vision: false,
13731
14360
  audio: false,
13732
14361
  video: false,
13733
- batchAPI: false,
13734
- promptCaching: false,
14362
+ batchAPI: true,
14363
+ promptCaching: true,
13735
14364
  input: {
13736
14365
  tokens: 256e3,
13737
14366
  text: true,
13738
- cpm: 0.2
14367
+ cpm: 0.2,
14368
+ cpmCached: 0.02
13739
14369
  },
13740
14370
  output: {
13741
14371
  tokens: 32768,
@@ -13748,7 +14378,7 @@ var MODEL_REGISTRY = {
13748
14378
  "grok-4-fast-reasoning": {
13749
14379
  name: "grok-4-fast-reasoning",
13750
14380
  provider: Vendor.Grok,
13751
- description: "Fast Grok 4 with reasoning capabilities, 2M context window",
14381
+ description: "Fast Grok 4 with reasoning capabilities, 2M context window, vision support",
13752
14382
  isActive: true,
13753
14383
  releaseDate: "2025-09-01",
13754
14384
  knowledgeCutoff: "2024-11-01",
@@ -13760,15 +14390,17 @@ var MODEL_REGISTRY = {
13760
14390
  fineTuning: false,
13761
14391
  predictedOutputs: false,
13762
14392
  realtime: false,
13763
- vision: false,
14393
+ vision: true,
13764
14394
  audio: false,
13765
14395
  video: false,
13766
- batchAPI: false,
13767
- promptCaching: false,
14396
+ batchAPI: true,
14397
+ promptCaching: true,
13768
14398
  input: {
13769
14399
  tokens: 2e6,
13770
14400
  text: true,
13771
- cpm: 0.2
14401
+ image: true,
14402
+ cpm: 0.2,
14403
+ cpmCached: 0.05
13772
14404
  },
13773
14405
  output: {
13774
14406
  tokens: 65536,
@@ -13795,13 +14427,14 @@ var MODEL_REGISTRY = {
13795
14427
  vision: true,
13796
14428
  audio: false,
13797
14429
  video: false,
13798
- batchAPI: false,
13799
- promptCaching: false,
14430
+ batchAPI: true,
14431
+ promptCaching: true,
13800
14432
  input: {
13801
14433
  tokens: 2e6,
13802
14434
  text: true,
13803
14435
  image: true,
13804
- cpm: 0.2
14436
+ cpm: 0.2,
14437
+ cpmCached: 0.05
13805
14438
  },
13806
14439
  output: {
13807
14440
  tokens: 65536,
@@ -13813,12 +14446,12 @@ var MODEL_REGISTRY = {
13813
14446
  "grok-4-0709": {
13814
14447
  name: "grok-4-0709",
13815
14448
  provider: Vendor.Grok,
13816
- description: "Grok 4 flagship model (July 2025 release), 256K context, vision support",
14449
+ description: "Grok 4 flagship model (July 2025 release), 256K context, vision support, reasoning",
13817
14450
  isActive: true,
13818
14451
  releaseDate: "2025-07-09",
13819
14452
  knowledgeCutoff: "2024-11-01",
13820
14453
  features: {
13821
- reasoning: false,
14454
+ reasoning: true,
13822
14455
  streaming: true,
13823
14456
  structuredOutput: true,
13824
14457
  functionCalling: true,
@@ -13828,13 +14461,14 @@ var MODEL_REGISTRY = {
13828
14461
  vision: true,
13829
14462
  audio: false,
13830
14463
  video: false,
13831
- batchAPI: false,
13832
- promptCaching: false,
14464
+ batchAPI: true,
14465
+ promptCaching: true,
13833
14466
  input: {
13834
14467
  tokens: 256e3,
13835
14468
  text: true,
13836
14469
  image: true,
13837
- cpm: 3
14470
+ cpm: 3,
14471
+ cpmCached: 0.75
13838
14472
  },
13839
14473
  output: {
13840
14474
  tokens: 32768,
@@ -13847,12 +14481,12 @@ var MODEL_REGISTRY = {
13847
14481
  "grok-3-mini": {
13848
14482
  name: "grok-3-mini",
13849
14483
  provider: Vendor.Grok,
13850
- description: "Lightweight, cost-efficient model for simpler tasks, 131K context",
14484
+ description: "Lightweight, cost-efficient model with reasoning, 131K context",
13851
14485
  isActive: true,
13852
14486
  releaseDate: "2025-06-01",
13853
14487
  knowledgeCutoff: "2024-11-01",
13854
14488
  features: {
13855
- reasoning: false,
14489
+ reasoning: true,
13856
14490
  streaming: true,
13857
14491
  structuredOutput: true,
13858
14492
  functionCalling: true,
@@ -13862,12 +14496,13 @@ var MODEL_REGISTRY = {
13862
14496
  vision: false,
13863
14497
  audio: false,
13864
14498
  video: false,
13865
- batchAPI: false,
13866
- promptCaching: false,
14499
+ batchAPI: true,
14500
+ promptCaching: true,
13867
14501
  input: {
13868
14502
  tokens: 131072,
13869
14503
  text: true,
13870
- cpm: 0.3
14504
+ cpm: 0.3,
14505
+ cpmCached: 0.07
13871
14506
  },
13872
14507
  output: {
13873
14508
  tokens: 32768,
@@ -13894,12 +14529,13 @@ var MODEL_REGISTRY = {
13894
14529
  vision: false,
13895
14530
  audio: false,
13896
14531
  video: false,
13897
- batchAPI: false,
13898
- promptCaching: false,
14532
+ batchAPI: true,
14533
+ promptCaching: true,
13899
14534
  input: {
13900
14535
  tokens: 131072,
13901
14536
  text: true,
13902
- cpm: 3
14537
+ cpm: 3,
14538
+ cpmCached: 0.75
13903
14539
  },
13904
14540
  output: {
13905
14541
  tokens: 32768,
@@ -13908,11 +14544,11 @@ var MODEL_REGISTRY = {
13908
14544
  }
13909
14545
  }
13910
14546
  },
13911
- // Grok 2 Series (Vision)
14547
+ // Grok 2 Series (Legacy - not in current docs)
13912
14548
  "grok-2-vision-1212": {
13913
14549
  name: "grok-2-vision-1212",
13914
14550
  provider: Vendor.Grok,
13915
- description: "Vision-capable model for image understanding, 32K context",
14551
+ description: "Legacy vision model for image understanding, 32K context. Not in current xAI docs",
13916
14552
  isActive: true,
13917
14553
  releaseDate: "2024-12-12",
13918
14554
  knowledgeCutoff: "2024-11-01",
@@ -17058,27 +17694,6 @@ ${formatValue(entry.value)}`).join("\n\n")
17058
17694
  // src/core/context-nextgen/plugins/ToolCatalogPluginNextGen.ts
17059
17695
  init_Logger();
17060
17696
  var DEFAULT_MAX_LOADED = 10;
17061
- var TOOL_CATALOG_INSTRUCTIONS = `## Tool Catalog
17062
-
17063
- 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:
17064
-
17065
- **tool_catalog_search** \u2014 Browse available tool categories and search for specific tools.
17066
- - No params \u2192 list all available categories with descriptions
17067
- - \`category\` \u2192 list tools in that category
17068
- - \`query\` \u2192 keyword search across categories and tools
17069
-
17070
- **tool_catalog_load** \u2014 Load a category's tools so you can use them.
17071
- - Tools become available immediately after loading.
17072
- - If you need tools from a category, load it first.
17073
-
17074
- **tool_catalog_unload** \u2014 Unload a category to free token budget.
17075
- - Unloaded tools are no longer sent to you.
17076
- - Use when you're done with a category.
17077
-
17078
- **Best practices:**
17079
- - Search first to find the right category before loading.
17080
- - Unload categories you no longer need to keep context lean.
17081
- - Categories marked [LOADED] are already available.`;
17082
17697
  var catalogSearchDefinition = {
17083
17698
  type: "function",
17084
17699
  function: {
@@ -17137,6 +17752,8 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17137
17752
  name = "tool_catalog";
17138
17753
  /** category name → array of tool names that were loaded */
17139
17754
  _loadedCategories = /* @__PURE__ */ new Map();
17755
+ /** Categories that cannot be unloaded */
17756
+ _pinnedCategories = /* @__PURE__ */ new Set();
17140
17757
  /** Reference to the ToolManager for registering/disabling tools */
17141
17758
  _toolManager = null;
17142
17759
  /** Cached connector categories — discovered once in setToolManager() */
@@ -17152,12 +17769,17 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17152
17769
  maxLoadedCategories: DEFAULT_MAX_LOADED,
17153
17770
  ...config
17154
17771
  };
17772
+ if (this._config.pinned?.length) {
17773
+ for (const cat of this._config.pinned) {
17774
+ this._pinnedCategories.add(cat);
17775
+ }
17776
+ }
17155
17777
  }
17156
17778
  // ========================================================================
17157
17779
  // Plugin Interface
17158
17780
  // ========================================================================
17159
17781
  getInstructions() {
17160
- return TOOL_CATALOG_INSTRUCTIONS;
17782
+ return this.buildInstructions();
17161
17783
  }
17162
17784
  async getContent() {
17163
17785
  const categories = this.getAllowedCategories();
@@ -17168,15 +17790,15 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17168
17790
  if (loaded.length > 0) {
17169
17791
  lines.push(`**Loaded:** ${loaded.join(", ")}`);
17170
17792
  }
17171
- lines.push(`**Available categories:** ${categories.length}`);
17793
+ lines.push(`**Available categories:** ${categories.length + this.getConnectorCategories().length}`);
17172
17794
  for (const cat of categories) {
17173
17795
  const tools = ToolCatalogRegistry.getToolsInCategory(cat.name);
17174
- const marker = this._loadedCategories.has(cat.name) ? " [LOADED]" : "";
17175
- lines.push(`- **${cat.displayName}** (${tools.length} tools)${marker}: ${cat.description}`);
17796
+ const markers = this.getCategoryMarkers(cat.name);
17797
+ lines.push(`- **${cat.displayName}** (${tools.length} tools)${markers}: ${cat.description}`);
17176
17798
  }
17177
17799
  for (const cc of this.getConnectorCategories()) {
17178
- const marker = this._loadedCategories.has(cc.name) ? " [LOADED]" : "";
17179
- lines.push(`- **${cc.displayName}** (${cc.toolCount} tools)${marker}: ${cc.description}`);
17800
+ const markers = this.getCategoryMarkers(cc.name);
17801
+ lines.push(`- **${cc.displayName}** (${cc.toolCount} tools)${markers}: ${cc.description}`);
17180
17802
  }
17181
17803
  const content = lines.join("\n");
17182
17804
  this.updateTokenCache(this.estimator.estimateTokens(content));
@@ -17187,7 +17809,8 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17187
17809
  loadedCategories: Array.from(this._loadedCategories.entries()).map(([name, tools]) => ({
17188
17810
  category: name,
17189
17811
  toolCount: tools.length,
17190
- tools
17812
+ tools,
17813
+ pinned: this._pinnedCategories.has(name)
17191
17814
  }))
17192
17815
  };
17193
17816
  }
@@ -17214,11 +17837,14 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17214
17837
  return [searchTool, loadTool, unloadTool];
17215
17838
  }
17216
17839
  isCompactable() {
17217
- return this._loadedCategories.size > 0;
17840
+ for (const category of this._loadedCategories.keys()) {
17841
+ if (!this._pinnedCategories.has(category)) return true;
17842
+ }
17843
+ return false;
17218
17844
  }
17219
17845
  async compact(targetTokensToFree) {
17220
17846
  if (!this._toolManager || this._loadedCategories.size === 0) return 0;
17221
- const categoriesByLastUsed = this.getCategoriesSortedByLastUsed();
17847
+ const categoriesByLastUsed = this.getCategoriesSortedByLastUsed().filter((cat) => !this._pinnedCategories.has(cat));
17222
17848
  let freed = 0;
17223
17849
  for (const category of categoriesByLastUsed) {
17224
17850
  if (freed >= targetTokensToFree) break;
@@ -17259,6 +17885,7 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17259
17885
  }
17260
17886
  destroy() {
17261
17887
  this._loadedCategories.clear();
17888
+ this._pinnedCategories.clear();
17262
17889
  this._toolManager = null;
17263
17890
  this._connectorCategories = null;
17264
17891
  this._destroyed = true;
@@ -17272,11 +17899,20 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17272
17899
  setToolManager(tm) {
17273
17900
  this._toolManager = tm;
17274
17901
  this._connectorCategories = ToolCatalogRegistry.discoverConnectorCategories({
17275
- scope: this._config.categoryScope,
17276
17902
  identities: this._config.identities
17277
17903
  });
17904
+ for (const category of this._pinnedCategories) {
17905
+ const result = this.executeLoad(category);
17906
+ if (result.error) {
17907
+ exports.logger.warn(
17908
+ { category, error: result.error },
17909
+ `[ToolCatalogPlugin] Failed to load pinned category '${category}'`
17910
+ );
17911
+ }
17912
+ }
17278
17913
  if (this._config.autoLoadCategories?.length) {
17279
17914
  for (const category of this._config.autoLoadCategories) {
17915
+ if (this._pinnedCategories.has(category)) continue;
17280
17916
  const result = this.executeLoad(category);
17281
17917
  if (result.error) {
17282
17918
  exports.logger.warn(
@@ -17291,6 +17927,10 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17291
17927
  get loadedCategories() {
17292
17928
  return Array.from(this._loadedCategories.keys());
17293
17929
  }
17930
+ /** Get set of pinned category names */
17931
+ get pinnedCategories() {
17932
+ return this._pinnedCategories;
17933
+ }
17294
17934
  // ========================================================================
17295
17935
  // Metatool Implementations
17296
17936
  // ========================================================================
@@ -17311,6 +17951,7 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17311
17951
  return {
17312
17952
  category,
17313
17953
  loaded,
17954
+ pinned: this._pinnedCategories.has(category),
17314
17955
  tools: tools.map((t) => ({
17315
17956
  name: t.name,
17316
17957
  displayName: t.displayName,
@@ -17332,7 +17973,8 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17332
17973
  displayName: cat.displayName,
17333
17974
  description: cat.description,
17334
17975
  toolCount: tools.length,
17335
- loaded: this._loadedCategories.has(cat.name)
17976
+ loaded: this._loadedCategories.has(cat.name),
17977
+ pinned: this._pinnedCategories.has(cat.name)
17336
17978
  });
17337
17979
  }
17338
17980
  for (const cc of connectorCats) {
@@ -17341,7 +17983,8 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17341
17983
  displayName: cc.displayName,
17342
17984
  description: cc.description,
17343
17985
  toolCount: cc.toolCount,
17344
- loaded: this._loadedCategories.has(cc.name)
17986
+ loaded: this._loadedCategories.has(cc.name),
17987
+ pinned: this._pinnedCategories.has(cc.name)
17345
17988
  });
17346
17989
  }
17347
17990
  return { categories: result };
@@ -17351,20 +17994,28 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17351
17994
  if (!this._toolManager) {
17352
17995
  return { error: "ToolManager not connected. Plugin not properly initialized." };
17353
17996
  }
17354
- if (!ToolCatalogRegistry.isCategoryAllowed(category, this._config.categoryScope)) {
17355
- return { error: `Category '${category}' is not available for this agent.` };
17997
+ const isConnector = ToolCatalogRegistry.parseConnectorCategory(category) !== null;
17998
+ if (isConnector) {
17999
+ const allowed = this.getConnectorCategories().some((cc) => cc.name === category);
18000
+ if (!allowed) {
18001
+ return { error: `Category '${category}' is not available for this agent.` };
18002
+ }
18003
+ } else {
18004
+ if (!ToolCatalogRegistry.isCategoryAllowed(category, this._config.categoryScope)) {
18005
+ return { error: `Category '${category}' is not available for this agent.` };
18006
+ }
17356
18007
  }
17357
18008
  if (this._loadedCategories.has(category)) {
17358
18009
  const toolNames2 = this._loadedCategories.get(category);
17359
18010
  return { loaded: toolNames2.length, tools: toolNames2, alreadyLoaded: true };
17360
18011
  }
17361
- if (this._loadedCategories.size >= this._config.maxLoadedCategories) {
18012
+ const nonPinnedLoaded = this._loadedCategories.size - this._pinnedCategories.size;
18013
+ if (!this._pinnedCategories.has(category) && nonPinnedLoaded >= this._config.maxLoadedCategories) {
17362
18014
  return {
17363
18015
  error: `Maximum loaded categories (${this._config.maxLoadedCategories}) reached. Unload a category first.`,
17364
18016
  loaded: Array.from(this._loadedCategories.keys())
17365
18017
  };
17366
18018
  }
17367
- const isConnector = ToolCatalogRegistry.parseConnectorCategory(category) !== null;
17368
18019
  let tools;
17369
18020
  if (isConnector) {
17370
18021
  tools = ToolCatalogRegistry.resolveConnectorCategoryTools(category);
@@ -17401,6 +18052,9 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17401
18052
  if (!this._toolManager) {
17402
18053
  return { error: "ToolManager not connected." };
17403
18054
  }
18055
+ if (this._pinnedCategories.has(category)) {
18056
+ return { error: `Category '${category}' is pinned and cannot be unloaded.` };
18057
+ }
17404
18058
  const toolNames = this._loadedCategories.get(category);
17405
18059
  if (!toolNames) {
17406
18060
  return { unloaded: 0, message: `Category '${category}' is not loaded.` };
@@ -17426,6 +18080,61 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17426
18080
  getConnectorCategories() {
17427
18081
  return this._connectorCategories ?? [];
17428
18082
  }
18083
+ /**
18084
+ * Build status markers for a category (e.g., " [PINNED]", " [LOADED]", " [PINNED] [LOADED]")
18085
+ */
18086
+ getCategoryMarkers(name) {
18087
+ const parts = [];
18088
+ if (this._pinnedCategories.has(name)) parts.push("[PINNED]");
18089
+ if (this._loadedCategories.has(name)) parts.push("[LOADED]");
18090
+ return parts.length > 0 ? " " + parts.join(" ") : "";
18091
+ }
18092
+ /**
18093
+ * Build dynamic instructions that include the list of available categories.
18094
+ */
18095
+ buildInstructions() {
18096
+ const lines = [];
18097
+ lines.push("## Tool Catalog");
18098
+ lines.push("");
18099
+ lines.push("Your core tools (memory, context, instructions, etc.) are always available.");
18100
+ lines.push("Additional tool categories can be loaded on demand from the catalog below.");
18101
+ lines.push("");
18102
+ lines.push("**tool_catalog_search** \u2014 Browse available tool categories and search for specific tools.");
18103
+ lines.push(" - No params \u2192 list all available categories with descriptions");
18104
+ lines.push(" - `category` \u2192 list tools in that category");
18105
+ lines.push(" - `query` \u2192 keyword search across categories and tools");
18106
+ lines.push("");
18107
+ lines.push("**tool_catalog_load** \u2014 Load a category's tools so you can use them.");
18108
+ lines.push(" - Tools become available immediately after loading.");
18109
+ lines.push(" - If you need tools from a category, load it first.");
18110
+ lines.push("");
18111
+ lines.push("**tool_catalog_unload** \u2014 Unload a category to free token budget.");
18112
+ lines.push(" - Unloaded tools are no longer sent to you.");
18113
+ lines.push(" - Use when you're done with a category.");
18114
+ lines.push(" - Pinned categories cannot be unloaded.");
18115
+ lines.push("");
18116
+ const builtIn = this.getAllowedCategories();
18117
+ const connectors = this.getConnectorCategories();
18118
+ if (builtIn.length > 0 || connectors.length > 0) {
18119
+ lines.push("**Available categories:**");
18120
+ for (const cat of builtIn) {
18121
+ const tools = ToolCatalogRegistry.getToolsInCategory(cat.name);
18122
+ const pinned = this._pinnedCategories.has(cat.name) ? " [PINNED]" : "";
18123
+ lines.push(`- ${cat.name} (${tools.length} tools)${pinned}: ${cat.description}`);
18124
+ }
18125
+ for (const cc of connectors) {
18126
+ const pinned = this._pinnedCategories.has(cc.name) ? " [PINNED]" : "";
18127
+ lines.push(`- ${cc.name} (${cc.toolCount} tools)${pinned}: ${cc.description}`);
18128
+ }
18129
+ lines.push("");
18130
+ }
18131
+ lines.push("**Best practices:**");
18132
+ lines.push("- Search first to find the right category before loading.");
18133
+ lines.push("- Unload categories you no longer need to keep context lean.");
18134
+ lines.push("- Categories marked [LOADED] are already available.");
18135
+ lines.push("- Categories marked [PINNED] are always available and cannot be unloaded.");
18136
+ return lines.join("\n");
18137
+ }
17429
18138
  keywordSearch(query) {
17430
18139
  const lq = query.toLowerCase();
17431
18140
  const results = [];
@@ -17463,12 +18172,17 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17463
18172
  return { query, results, totalMatches: results.length };
17464
18173
  }
17465
18174
  searchConnectorCategory(category) {
18175
+ const allowed = this.getConnectorCategories().some((cc) => cc.name === category);
18176
+ if (!allowed) {
18177
+ return { error: `Category '${category}' is not available for this agent.` };
18178
+ }
17466
18179
  const connectorName = ToolCatalogRegistry.parseConnectorCategory(category);
17467
18180
  const tools = ToolCatalogRegistry.resolveConnectorCategoryTools(category);
17468
18181
  const loaded = this._loadedCategories.has(category);
17469
18182
  return {
17470
18183
  category,
17471
18184
  loaded,
18185
+ pinned: this._pinnedCategories.has(category),
17472
18186
  connectorName,
17473
18187
  tools: tools.map((t) => ({
17474
18188
  name: t.name,
@@ -20555,9 +21269,17 @@ var OpenAITextProvider = class extends BaseTextProvider {
20555
21269
  ...options.metadata && { metadata: options.metadata }
20556
21270
  };
20557
21271
  this.applyReasoningConfig(params, options);
21272
+ console.log(
21273
+ `[OpenAITextProvider] generate: calling OpenAI API (model=${options.model}, tools=${params.tools?.length ?? 0})`
21274
+ );
21275
+ const genStartTime = Date.now();
20558
21276
  const response = await this.client.responses.create(params);
21277
+ console.log(
21278
+ `[OpenAITextProvider] generate: response received (${Date.now() - genStartTime}ms)`
21279
+ );
20559
21280
  return this.converter.convertResponse(response);
20560
21281
  } catch (error) {
21282
+ console.error(`[OpenAITextProvider] generate error (model=${options.model}):`, error.message || error);
20561
21283
  this.handleError(error, options.model);
20562
21284
  throw error;
20563
21285
  }
@@ -20597,9 +21319,27 @@ var OpenAITextProvider = class extends BaseTextProvider {
20597
21319
  stream: true
20598
21320
  };
20599
21321
  this.applyReasoningConfig(params, options);
21322
+ console.log(
21323
+ `[OpenAITextProvider] streamGenerate: calling OpenAI API (model=${options.model}, tools=${params.tools?.length ?? 0})`
21324
+ );
21325
+ const streamStartTime = Date.now();
20600
21326
  const stream = await this.client.responses.create(params);
20601
- yield* this.streamConverter.convertStream(stream);
21327
+ console.log(
21328
+ `[OpenAITextProvider] streamGenerate: OpenAI stream opened (${Date.now() - streamStartTime}ms)`
21329
+ );
21330
+ let chunkCount = 0;
21331
+ for await (const event of this.streamConverter.convertStream(stream)) {
21332
+ chunkCount++;
21333
+ yield event;
21334
+ }
21335
+ console.log(
21336
+ `[OpenAITextProvider] streamGenerate: stream complete (${chunkCount} events, ${Date.now() - streamStartTime}ms total)`
21337
+ );
20602
21338
  } catch (error) {
21339
+ console.error(
21340
+ `[OpenAITextProvider] streamGenerate error (model=${options.model}):`,
21341
+ error.message || error
21342
+ );
20603
21343
  this.handleError(error, options.model);
20604
21344
  throw error;
20605
21345
  }
@@ -21605,12 +22345,20 @@ var AnthropicTextProvider = class extends BaseTextProvider {
21605
22345
  return this.executeWithCircuitBreaker(async () => {
21606
22346
  try {
21607
22347
  const anthropicRequest = this.converter.convertRequest(options);
22348
+ console.log(
22349
+ `[AnthropicTextProvider] generate: calling Anthropic API (model=${options.model}, messages=${anthropicRequest.messages?.length ?? 0}, tools=${anthropicRequest.tools?.length ?? 0})`
22350
+ );
22351
+ const genStartTime = Date.now();
21608
22352
  const anthropicResponse = await this.client.messages.create({
21609
22353
  ...anthropicRequest,
21610
22354
  stream: false
21611
22355
  });
22356
+ console.log(
22357
+ `[AnthropicTextProvider] generate: response received (${Date.now() - genStartTime}ms)`
22358
+ );
21612
22359
  return this.converter.convertResponse(anthropicResponse);
21613
22360
  } catch (error) {
22361
+ console.error(`[AnthropicTextProvider] generate error (model=${options.model}):`, error.message || error);
21614
22362
  this.handleError(error, options.model);
21615
22363
  throw error;
21616
22364
  }
@@ -21622,13 +22370,31 @@ var AnthropicTextProvider = class extends BaseTextProvider {
21622
22370
  async *streamGenerate(options) {
21623
22371
  try {
21624
22372
  const anthropicRequest = this.converter.convertRequest(options);
22373
+ console.log(
22374
+ `[AnthropicTextProvider] streamGenerate: calling Anthropic API (model=${options.model}, messages=${anthropicRequest.messages?.length ?? 0}, tools=${anthropicRequest.tools?.length ?? 0})`
22375
+ );
22376
+ const streamStartTime = Date.now();
21625
22377
  const stream = await this.client.messages.create({
21626
22378
  ...anthropicRequest,
21627
22379
  stream: true
21628
22380
  });
22381
+ console.log(
22382
+ `[AnthropicTextProvider] streamGenerate: Anthropic stream opened (${Date.now() - streamStartTime}ms)`
22383
+ );
21629
22384
  this.streamConverter.reset();
21630
- yield* this.streamConverter.convertStream(stream, options.model);
22385
+ let chunkCount = 0;
22386
+ for await (const event of this.streamConverter.convertStream(stream, options.model)) {
22387
+ chunkCount++;
22388
+ yield event;
22389
+ }
22390
+ console.log(
22391
+ `[AnthropicTextProvider] streamGenerate: stream complete (${chunkCount} events, ${Date.now() - streamStartTime}ms total)`
22392
+ );
21631
22393
  } catch (error) {
22394
+ console.error(
22395
+ `[AnthropicTextProvider] streamGenerate error (model=${options.model}):`,
22396
+ error.message || error
22397
+ );
21632
22398
  this.handleError(error, options.model);
21633
22399
  throw error;
21634
22400
  } finally {
@@ -22422,6 +23188,10 @@ var GoogleTextProvider = class extends BaseTextProvider {
22422
23188
  // First message only
22423
23189
  }, null, 2));
22424
23190
  }
23191
+ console.log(
23192
+ `[GoogleTextProvider] generate: calling Google API (model=${options.model}, contents=${googleRequest.contents?.length ?? 0} messages, tools=${googleRequest.tools?.[0]?.functionDeclarations?.length ?? 0} tools)`
23193
+ );
23194
+ const genStartTime = Date.now();
22425
23195
  const result = await this.client.models.generateContent({
22426
23196
  model: options.model,
22427
23197
  contents: googleRequest.contents,
@@ -22432,6 +23202,9 @@ var GoogleTextProvider = class extends BaseTextProvider {
22432
23202
  ...googleRequest.generationConfig
22433
23203
  }
22434
23204
  });
23205
+ console.log(
23206
+ `[GoogleTextProvider] generate: response received (${Date.now() - genStartTime}ms)`
23207
+ );
22435
23208
  if (process.env.DEBUG_GOOGLE) {
22436
23209
  console.error("[DEBUG] Google Response:", JSON.stringify({
22437
23210
  candidates: result.candidates?.map((c) => ({
@@ -22450,6 +23223,7 @@ var GoogleTextProvider = class extends BaseTextProvider {
22450
23223
  }
22451
23224
  return response;
22452
23225
  } catch (error) {
23226
+ console.error(`[GoogleTextProvider] generate error (model=${options.model}):`, error.message || error);
22453
23227
  this.converter.clearMappings();
22454
23228
  this.handleError(error, options.model);
22455
23229
  throw error;
@@ -22462,6 +23236,10 @@ var GoogleTextProvider = class extends BaseTextProvider {
22462
23236
  async *streamGenerate(options) {
22463
23237
  try {
22464
23238
  const googleRequest = await this.converter.convertRequest(options);
23239
+ console.log(
23240
+ `[GoogleTextProvider] streamGenerate: calling Google API (model=${options.model}, contents=${googleRequest.contents?.length ?? 0} messages, tools=${googleRequest.tools?.[0]?.functionDeclarations?.length ?? 0} tools)`
23241
+ );
23242
+ const streamStartTime = Date.now();
22465
23243
  const stream = await this.client.models.generateContentStream({
22466
23244
  model: options.model,
22467
23245
  contents: googleRequest.contents,
@@ -22472,13 +23250,27 @@ var GoogleTextProvider = class extends BaseTextProvider {
22472
23250
  ...googleRequest.generationConfig
22473
23251
  }
22474
23252
  });
23253
+ console.log(
23254
+ `[GoogleTextProvider] streamGenerate: Google stream opened (${Date.now() - streamStartTime}ms)`
23255
+ );
22475
23256
  this.streamConverter.reset();
22476
- yield* this.streamConverter.convertStream(stream, options.model);
23257
+ let chunkCount = 0;
23258
+ for await (const event of this.streamConverter.convertStream(stream, options.model)) {
23259
+ chunkCount++;
23260
+ yield event;
23261
+ }
23262
+ console.log(
23263
+ `[GoogleTextProvider] streamGenerate: stream complete (${chunkCount} events, ${Date.now() - streamStartTime}ms total)`
23264
+ );
22477
23265
  if (!this.streamConverter.hasToolCalls()) {
22478
23266
  this.converter.clearMappings();
22479
23267
  this.streamConverter.clear();
22480
23268
  }
22481
23269
  } catch (error) {
23270
+ console.error(
23271
+ `[GoogleTextProvider] streamGenerate error (model=${options.model}):`,
23272
+ error.message || error
23273
+ );
22482
23274
  this.converter.clearMappings();
22483
23275
  this.streamConverter.clear();
22484
23276
  this.handleError(error, options.model);
@@ -22565,6 +23357,10 @@ var VertexAITextProvider = class extends BaseTextProvider {
22565
23357
  async generate(options) {
22566
23358
  try {
22567
23359
  const googleRequest = await this.converter.convertRequest(options);
23360
+ console.log(
23361
+ `[VertexAITextProvider] generate: calling Vertex AI (model=${options.model}, contents=${googleRequest.contents?.length ?? 0} messages, tools=${googleRequest.tools?.[0]?.functionDeclarations?.length ?? 0} tools)`
23362
+ );
23363
+ const genStartTime = Date.now();
22568
23364
  const result = await this.client.models.generateContent({
22569
23365
  model: options.model,
22570
23366
  contents: googleRequest.contents,
@@ -22575,8 +23371,12 @@ var VertexAITextProvider = class extends BaseTextProvider {
22575
23371
  ...googleRequest.generationConfig
22576
23372
  }
22577
23373
  });
23374
+ console.log(
23375
+ `[VertexAITextProvider] generate: response received (${Date.now() - genStartTime}ms)`
23376
+ );
22578
23377
  return this.converter.convertResponse(result);
22579
23378
  } catch (error) {
23379
+ console.error(`[VertexAITextProvider] generate error (model=${options.model}):`, error.message || error);
22580
23380
  this.handleError(error, options.model);
22581
23381
  throw error;
22582
23382
  }
@@ -22587,6 +23387,10 @@ var VertexAITextProvider = class extends BaseTextProvider {
22587
23387
  async *streamGenerate(options) {
22588
23388
  try {
22589
23389
  const googleRequest = await this.converter.convertRequest(options);
23390
+ console.log(
23391
+ `[VertexAITextProvider] streamGenerate: calling Vertex AI (model=${options.model}, contents=${googleRequest.contents?.length ?? 0} messages, tools=${googleRequest.tools?.[0]?.functionDeclarations?.length ?? 0} tools)`
23392
+ );
23393
+ const streamStartTime = Date.now();
22590
23394
  const stream = await this.client.models.generateContentStream({
22591
23395
  model: options.model,
22592
23396
  contents: googleRequest.contents,
@@ -22597,9 +23401,23 @@ var VertexAITextProvider = class extends BaseTextProvider {
22597
23401
  ...googleRequest.generationConfig
22598
23402
  }
22599
23403
  });
23404
+ console.log(
23405
+ `[VertexAITextProvider] streamGenerate: Vertex AI stream opened (${Date.now() - streamStartTime}ms)`
23406
+ );
22600
23407
  const streamConverter = new GoogleStreamConverter();
22601
- yield* streamConverter.convertStream(stream, options.model);
23408
+ let chunkCount = 0;
23409
+ for await (const event of streamConverter.convertStream(stream, options.model)) {
23410
+ chunkCount++;
23411
+ yield event;
23412
+ }
23413
+ console.log(
23414
+ `[VertexAITextProvider] streamGenerate: stream complete (${chunkCount} events, ${Date.now() - streamStartTime}ms total)`
23415
+ );
22602
23416
  } catch (error) {
23417
+ console.error(
23418
+ `[VertexAITextProvider] streamGenerate error (model=${options.model}):`,
23419
+ error.message || error
23420
+ );
22603
23421
  this.handleError(error, options.model);
22604
23422
  throw error;
22605
23423
  }
@@ -24540,6 +25358,20 @@ var Agent = class _Agent extends BaseAgent {
24540
25358
  timestamp: /* @__PURE__ */ new Date(),
24541
25359
  duration: totalDuration
24542
25360
  });
25361
+ const hasTextOutput = response.output_text?.trim() || response.output?.some(
25362
+ (item) => "content" in item && Array.isArray(item.content) && item.content.some((c) => c.type === "output_text" /* OUTPUT_TEXT */ && c.text?.trim())
25363
+ );
25364
+ if (!hasTextOutput) {
25365
+ console.warn(
25366
+ `[Agent] WARNING: ${methodName} completed with zero text output (executionId=${executionId}, iterations=${this.executionContext?.metrics.iterationCount ?? "?"}, tokens=${response.usage?.total_tokens ?? 0})`
25367
+ );
25368
+ this.emit("execution:empty_output", {
25369
+ executionId,
25370
+ timestamp: /* @__PURE__ */ new Date(),
25371
+ duration: totalDuration,
25372
+ usage: response.usage
25373
+ });
25374
+ }
24543
25375
  const duration = Date.now() - startTime;
24544
25376
  this._logger.info({ duration }, `Agent ${methodName} completed`);
24545
25377
  exports.metrics.timing(`agent.${methodName}.duration`, duration, { model: this.model, connector: this.connector.name });
@@ -24594,6 +25426,17 @@ var Agent = class _Agent extends BaseAgent {
24594
25426
  }
24595
25427
  const iterationStartTime = Date.now();
24596
25428
  const prepared = await this._agentContext.prepare();
25429
+ const b1 = prepared.budget;
25430
+ const bd1 = b1.breakdown;
25431
+ const bp1 = [
25432
+ `sysPrompt=${bd1.systemPrompt}`,
25433
+ `PI=${bd1.persistentInstructions}`,
25434
+ bd1.pluginInstructions ? `pluginInstr=${bd1.pluginInstructions}` : "",
25435
+ ...Object.entries(bd1.pluginContents || {}).map(([k, v]) => `plugin:${k}=${v}`)
25436
+ ].filter(Boolean).join(" ");
25437
+ console.log(
25438
+ `[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("; ")}` : "")
25439
+ );
24597
25440
  const response = await this.generateWithHooks(prepared.input, iteration, executionId);
24598
25441
  const toolCalls = this.extractToolCalls(response.output);
24599
25442
  this._agentContext.addAssistantResponse(response.output);
@@ -24708,13 +25551,23 @@ var Agent = class _Agent extends BaseAgent {
24708
25551
  * Build placeholder response for streaming finalization
24709
25552
  */
24710
25553
  _buildPlaceholderResponse(executionId, startTime, streamState) {
25554
+ const outputText = streamState.getAllText();
25555
+ const output = [];
25556
+ if (outputText && outputText.trim()) {
25557
+ output.push({
25558
+ type: "message",
25559
+ role: "assistant" /* ASSISTANT */,
25560
+ content: [{ type: "output_text" /* OUTPUT_TEXT */, text: outputText }]
25561
+ });
25562
+ }
24711
25563
  return {
24712
25564
  id: executionId,
24713
25565
  object: "response",
24714
25566
  created_at: Math.floor(startTime / 1e3),
24715
25567
  status: "completed",
24716
25568
  model: this.model,
24717
- output: [],
25569
+ output,
25570
+ output_text: outputText || void 0,
24718
25571
  usage: streamState.usage
24719
25572
  };
24720
25573
  }
@@ -24734,6 +25587,17 @@ var Agent = class _Agent extends BaseAgent {
24734
25587
  break;
24735
25588
  }
24736
25589
  const prepared = await this._agentContext.prepare();
25590
+ const b2 = prepared.budget;
25591
+ const bd2 = b2.breakdown;
25592
+ const bp2 = [
25593
+ `sysPrompt=${bd2.systemPrompt}`,
25594
+ `PI=${bd2.persistentInstructions}`,
25595
+ bd2.pluginInstructions ? `pluginInstr=${bd2.pluginInstructions}` : "",
25596
+ ...Object.entries(bd2.pluginContents || {}).map(([k, v]) => `plugin:${k}=${v}`)
25597
+ ].filter(Boolean).join(" ");
25598
+ console.log(
25599
+ `[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("; ")}` : "")
25600
+ );
24737
25601
  const iterationStreamState = new StreamState(executionId, this.model);
24738
25602
  const toolCallsMap = /* @__PURE__ */ new Map();
24739
25603
  yield* this.streamGenerateWithHooks(
@@ -34004,13 +34868,13 @@ var TTS_MODEL_REGISTRY = {
34004
34868
  name: "gemini-2.5-flash-preview-tts",
34005
34869
  displayName: "Gemini 2.5 Flash TTS",
34006
34870
  provider: Vendor.Google,
34007
- description: "Google Gemini 2.5 Flash TTS - optimized for low latency",
34871
+ description: "Google Gemini 2.5 Flash TTS - optimized for low latency, 30 voices, 70+ languages",
34008
34872
  isActive: true,
34009
34873
  releaseDate: "2025-01-01",
34010
34874
  sources: {
34011
34875
  documentation: "https://ai.google.dev/gemini-api/docs/speech-generation",
34012
34876
  pricing: "https://ai.google.dev/pricing",
34013
- lastVerified: "2026-01-25"
34877
+ lastVerified: "2026-03-04"
34014
34878
  },
34015
34879
  capabilities: {
34016
34880
  voices: GEMINI_VOICES,
@@ -34029,20 +34893,27 @@ var TTS_MODEL_REGISTRY = {
34029
34893
  wordTimestamps: false
34030
34894
  },
34031
34895
  limits: { maxInputLength: 32e3 }
34032
- // 32k tokens
34896
+ // 32k token context window
34897
+ },
34898
+ pricing: {
34899
+ perMInputTokens: 0.5,
34900
+ // $0.50 per 1M input tokens
34901
+ perMOutputTokens: 10,
34902
+ // $10.00 per 1M output tokens
34903
+ currency: "USD"
34033
34904
  }
34034
34905
  },
34035
34906
  "gemini-2.5-pro-preview-tts": {
34036
34907
  name: "gemini-2.5-pro-preview-tts",
34037
34908
  displayName: "Gemini 2.5 Pro TTS",
34038
34909
  provider: Vendor.Google,
34039
- description: "Google Gemini 2.5 Pro TTS - optimized for quality",
34910
+ description: "Google Gemini 2.5 Pro TTS - optimized for quality, 30 voices, 70+ languages",
34040
34911
  isActive: true,
34041
34912
  releaseDate: "2025-01-01",
34042
34913
  sources: {
34043
34914
  documentation: "https://ai.google.dev/gemini-api/docs/speech-generation",
34044
34915
  pricing: "https://ai.google.dev/pricing",
34045
- lastVerified: "2026-01-25"
34916
+ lastVerified: "2026-03-04"
34046
34917
  },
34047
34918
  capabilities: {
34048
34919
  voices: GEMINI_VOICES,
@@ -34061,7 +34932,14 @@ var TTS_MODEL_REGISTRY = {
34061
34932
  wordTimestamps: false
34062
34933
  },
34063
34934
  limits: { maxInputLength: 32e3 }
34064
- // 32k tokens
34935
+ // 32k token context window
34936
+ },
34937
+ pricing: {
34938
+ perMInputTokens: 1,
34939
+ // $1.00 per 1M input tokens
34940
+ perMOutputTokens: 20,
34941
+ // $20.00 per 1M output tokens
34942
+ currency: "USD"
34065
34943
  }
34066
34944
  }
34067
34945
  };
@@ -34074,10 +34952,18 @@ function getTTSModelsWithFeature(feature) {
34074
34952
  (model) => model.isActive && model.capabilities.features[feature]
34075
34953
  );
34076
34954
  }
34077
- function calculateTTSCost(modelName, characterCount) {
34955
+ function calculateTTSCost(modelName, characterCount, options) {
34078
34956
  const model = getTTSModelInfo(modelName);
34079
34957
  if (!model?.pricing) return null;
34080
- return characterCount / 1e3 * model.pricing.per1kCharacters;
34958
+ if (model.pricing.per1kCharacters) {
34959
+ return characterCount / 1e3 * model.pricing.per1kCharacters;
34960
+ }
34961
+ if (model.pricing.perMInputTokens && options?.inputTokens != null) {
34962
+ const inputCost = options.inputTokens / 1e6 * model.pricing.perMInputTokens;
34963
+ const outputCost = options.outputTokens ? options.outputTokens / 1e6 * (model.pricing.perMOutputTokens ?? 0) : 0;
34964
+ return inputCost + outputCost;
34965
+ }
34966
+ return null;
34081
34967
  }
34082
34968
  var TextToSpeech = class _TextToSpeech {
34083
34969
  provider;
@@ -35523,7 +36409,13 @@ var IMAGE_MODELS = {
35523
36409
  /** Imagen 4.0 Ultra: Highest quality */
35524
36410
  IMAGEN_4_ULTRA: "imagen-4.0-ultra-generate-001",
35525
36411
  /** Imagen 4.0 Fast: Optimized for speed */
35526
- IMAGEN_4_FAST: "imagen-4.0-fast-generate-001"
36412
+ IMAGEN_4_FAST: "imagen-4.0-fast-generate-001",
36413
+ /** Nano Banana 2: Gemini 3.1 Flash native image gen with 4K support */
36414
+ GEMINI_3_1_FLASH_IMAGE: "gemini-3.1-flash-image-preview",
36415
+ /** Nano Banana Pro: Gemini 3 Pro professional design engine with reasoning */
36416
+ GEMINI_3_PRO_IMAGE: "gemini-3-pro-image-preview",
36417
+ /** Nano Banana: Gemini 2.5 Flash native image gen/editing */
36418
+ GEMINI_2_5_FLASH_IMAGE: "gemini-2.5-flash-image"
35527
36419
  },
35528
36420
  [Vendor.Grok]: {
35529
36421
  /** Grok Imagine Image: xAI image generation with editing support */
@@ -35707,7 +36599,7 @@ var IMAGE_MODEL_REGISTRY = {
35707
36599
  sources: {
35708
36600
  documentation: "https://ai.google.dev/gemini-api/docs/imagen",
35709
36601
  pricing: "https://ai.google.dev/pricing",
35710
- lastVerified: "2026-01-25"
36602
+ lastVerified: "2026-03-04"
35711
36603
  },
35712
36604
  capabilities: {
35713
36605
  sizes: ["1024x1024"],
@@ -35818,7 +36710,7 @@ var IMAGE_MODEL_REGISTRY = {
35818
36710
  sources: {
35819
36711
  documentation: "https://ai.google.dev/gemini-api/docs/imagen",
35820
36712
  pricing: "https://ai.google.dev/pricing",
35821
- lastVerified: "2026-01-25"
36713
+ lastVerified: "2026-03-04"
35822
36714
  },
35823
36715
  capabilities: {
35824
36716
  sizes: ["1024x1024"],
@@ -35915,7 +36807,8 @@ var IMAGE_MODEL_REGISTRY = {
35915
36807
  }
35916
36808
  },
35917
36809
  pricing: {
35918
- perImage: 0.08,
36810
+ perImage: 0.06,
36811
+ // Updated per official pricing page (was $0.08)
35919
36812
  currency: "USD"
35920
36813
  }
35921
36814
  },
@@ -35929,7 +36822,7 @@ var IMAGE_MODEL_REGISTRY = {
35929
36822
  sources: {
35930
36823
  documentation: "https://ai.google.dev/gemini-api/docs/imagen",
35931
36824
  pricing: "https://ai.google.dev/pricing",
35932
- lastVerified: "2026-01-25"
36825
+ lastVerified: "2026-03-04"
35933
36826
  },
35934
36827
  capabilities: {
35935
36828
  sizes: ["1024x1024"],
@@ -36030,6 +36923,141 @@ var IMAGE_MODEL_REGISTRY = {
36030
36923
  currency: "USD"
36031
36924
  }
36032
36925
  },
36926
+ // ======================== Google Nano Banana (Gemini Native Image) ========================
36927
+ "gemini-3.1-flash-image-preview": {
36928
+ name: "gemini-3.1-flash-image-preview",
36929
+ displayName: "Nano Banana 2 (Gemini 3.1 Flash Image)",
36930
+ provider: Vendor.Google,
36931
+ description: "High-efficiency native image generation and editing with 4K support and thinking capabilities",
36932
+ isActive: true,
36933
+ releaseDate: "2026-02-01",
36934
+ sources: {
36935
+ documentation: "https://ai.google.dev/gemini-api/docs/models/gemini-3.1-flash-image-preview",
36936
+ pricing: "https://ai.google.dev/pricing",
36937
+ lastVerified: "2026-03-04"
36938
+ },
36939
+ capabilities: {
36940
+ sizes: ["512x512", "1024x1024", "1536x1536", "auto"],
36941
+ aspectRatios: ["1:1", "1:4", "4:1", "1:8", "8:1"],
36942
+ maxImagesPerRequest: 4,
36943
+ outputFormats: ["png", "jpeg"],
36944
+ features: {
36945
+ generation: true,
36946
+ editing: true,
36947
+ variations: false,
36948
+ styleControl: false,
36949
+ qualityControl: true,
36950
+ // Multiple resolution tiers: 0.5K, 1K, 2K, 4K
36951
+ transparency: false,
36952
+ promptRevision: false
36953
+ },
36954
+ limits: { maxPromptLength: 131072 },
36955
+ // 131K input tokens
36956
+ vendorOptions: {
36957
+ outputImageResolution: {
36958
+ type: "enum",
36959
+ label: "Resolution",
36960
+ description: "Output image resolution tier",
36961
+ enum: ["0.5K", "1K", "2K", "4K"],
36962
+ default: "1K",
36963
+ controlType: "select"
36964
+ }
36965
+ }
36966
+ },
36967
+ pricing: {
36968
+ // Per-image, varies by resolution: $0.045 (512px), $0.067 (1K), $0.101 (2K), $0.151 (4K)
36969
+ perImageStandard: 0.067,
36970
+ // 1K default
36971
+ perImageHD: 0.151,
36972
+ // 4K
36973
+ currency: "USD"
36974
+ }
36975
+ },
36976
+ "gemini-3-pro-image-preview": {
36977
+ name: "gemini-3-pro-image-preview",
36978
+ displayName: "Nano Banana Pro (Gemini 3 Pro Image)",
36979
+ provider: Vendor.Google,
36980
+ description: "Professional design engine with reasoning for studio-quality 4K visuals, complex layouts, and precise text rendering",
36981
+ isActive: true,
36982
+ releaseDate: "2025-11-01",
36983
+ sources: {
36984
+ documentation: "https://ai.google.dev/gemini-api/docs/models/gemini-3-pro-image-preview",
36985
+ pricing: "https://ai.google.dev/pricing",
36986
+ lastVerified: "2026-03-04"
36987
+ },
36988
+ capabilities: {
36989
+ sizes: ["1024x1024", "auto"],
36990
+ aspectRatios: ["1:1", "3:4", "4:3", "9:16", "16:9"],
36991
+ maxImagesPerRequest: 4,
36992
+ outputFormats: ["png", "jpeg"],
36993
+ features: {
36994
+ generation: true,
36995
+ editing: true,
36996
+ variations: false,
36997
+ styleControl: true,
36998
+ // Reasoning-driven design
36999
+ qualityControl: true,
37000
+ // 1K, 2K, 4K tiers
37001
+ transparency: false,
37002
+ promptRevision: false
37003
+ },
37004
+ limits: { maxPromptLength: 65536 },
37005
+ // 65K input tokens
37006
+ vendorOptions: {
37007
+ outputImageResolution: {
37008
+ type: "enum",
37009
+ label: "Resolution",
37010
+ description: "Output image resolution tier",
37011
+ enum: ["1K", "2K", "4K"],
37012
+ default: "1K",
37013
+ controlType: "select"
37014
+ }
37015
+ }
37016
+ },
37017
+ pricing: {
37018
+ // $0.134 per 1K/2K image, $0.24 per 4K image
37019
+ perImageStandard: 0.134,
37020
+ // 1K/2K
37021
+ perImageHD: 0.24,
37022
+ // 4K
37023
+ currency: "USD"
37024
+ }
37025
+ },
37026
+ "gemini-2.5-flash-image": {
37027
+ name: "gemini-2.5-flash-image",
37028
+ displayName: "Nano Banana (Gemini 2.5 Flash Image)",
37029
+ provider: Vendor.Google,
37030
+ description: "Native image generation and editing designed for fast, creative workflows",
37031
+ isActive: true,
37032
+ releaseDate: "2025-10-01",
37033
+ sources: {
37034
+ documentation: "https://ai.google.dev/gemini-api/docs/models/gemini-2.5-flash-image",
37035
+ pricing: "https://ai.google.dev/pricing",
37036
+ lastVerified: "2026-03-04"
37037
+ },
37038
+ capabilities: {
37039
+ sizes: ["1024x1024", "auto"],
37040
+ aspectRatios: ["1:1", "3:4", "4:3", "9:16", "16:9"],
37041
+ maxImagesPerRequest: 4,
37042
+ outputFormats: ["png", "jpeg"],
37043
+ features: {
37044
+ generation: true,
37045
+ editing: true,
37046
+ variations: false,
37047
+ styleControl: false,
37048
+ qualityControl: false,
37049
+ transparency: false,
37050
+ promptRevision: false
37051
+ },
37052
+ limits: { maxPromptLength: 65536 }
37053
+ // 65K input tokens
37054
+ },
37055
+ pricing: {
37056
+ perImage: 0.039,
37057
+ // $0.039 per image
37058
+ currency: "USD"
37059
+ }
37060
+ },
36033
37061
  // ======================== xAI Grok ========================
36034
37062
  "grok-imagine-image": {
36035
37063
  name: "grok-imagine-image",
@@ -36041,11 +37069,11 @@ var IMAGE_MODEL_REGISTRY = {
36041
37069
  sources: {
36042
37070
  documentation: "https://docs.x.ai/docs/guides/image-generation",
36043
37071
  pricing: "https://docs.x.ai/docs/models",
36044
- lastVerified: "2026-02-01"
37072
+ lastVerified: "2026-03-04"
36045
37073
  },
36046
37074
  capabilities: {
36047
37075
  sizes: ["1024x1024"],
36048
- aspectRatios: ["1:1", "4:3", "3:4", "16:9", "9:16", "3:2", "2:3"],
37076
+ aspectRatios: ["1:1", "4:3", "3:4", "16:9", "9:16", "3:2", "2:3", "2:1", "1:2"],
36049
37077
  maxImagesPerRequest: 10,
36050
37078
  outputFormats: ["png", "jpeg"],
36051
37079
  features: {
@@ -37301,9 +38329,9 @@ var OPENAI_SOURCES = {
37301
38329
  lastVerified: "2026-01-25"
37302
38330
  };
37303
38331
  var GOOGLE_SOURCES = {
37304
- documentation: "https://docs.cloud.google.com/vertex-ai/generative-ai/docs/video/overview",
37305
- apiReference: "https://docs.cloud.google.com/vertex-ai/generative-ai/docs/model-reference/veo-video-generation",
37306
- lastVerified: "2026-01-25"
38332
+ documentation: "https://ai.google.dev/gemini-api/docs/video",
38333
+ apiReference: "https://ai.google.dev/gemini-api/docs/models/veo",
38334
+ lastVerified: "2026-03-04"
37307
38335
  };
37308
38336
  var GROK_SOURCES = {
37309
38337
  documentation: "https://docs.x.ai/docs/guides/video-generations",
@@ -37377,14 +38405,16 @@ var VIDEO_MODEL_REGISTRY = {
37377
38405
  sources: GOOGLE_SOURCES,
37378
38406
  capabilities: {
37379
38407
  durations: [5, 6, 7, 8],
37380
- resolutions: [],
37381
- // Veo 2.0 uses aspectRatio only, no resolution control
38408
+ resolutions: ["720p"],
38409
+ // Veo 2 only supports 720p
37382
38410
  aspectRatios: ["16:9", "9:16"],
37383
38411
  maxFps: 24,
37384
38412
  audio: false,
37385
- imageToVideo: true,
38413
+ imageToVideo: false,
38414
+ // Veo 2 does not support reference images
37386
38415
  videoExtension: false,
37387
38416
  frameControl: true,
38417
+ // First/last frame interpolation supported
37388
38418
  features: {
37389
38419
  upscaling: false,
37390
38420
  styleControl: false,
@@ -37393,7 +38423,8 @@ var VIDEO_MODEL_REGISTRY = {
37393
38423
  }
37394
38424
  },
37395
38425
  pricing: {
37396
- perSecond: 0.03,
38426
+ perSecond: 0.35,
38427
+ // Updated per official pricing page (was $0.03)
37397
38428
  currency: "USD"
37398
38429
  }
37399
38430
  },
@@ -37405,14 +38436,18 @@ var VIDEO_MODEL_REGISTRY = {
37405
38436
  sources: GOOGLE_SOURCES,
37406
38437
  capabilities: {
37407
38438
  durations: [4, 6, 8],
37408
- resolutions: ["720p"],
37409
- // Fast model only supports 720p
38439
+ resolutions: ["720p", "1080p", "4k"],
38440
+ // 1080p/4k require 8s duration
37410
38441
  aspectRatios: ["16:9", "9:16"],
37411
38442
  maxFps: 24,
37412
38443
  audio: true,
38444
+ // Native audio generation
37413
38445
  imageToVideo: true,
37414
- videoExtension: false,
37415
- frameControl: false,
38446
+ // Up to 3 reference images
38447
+ videoExtension: true,
38448
+ // Supported (720p only)
38449
+ frameControl: true,
38450
+ // First/last frame interpolation
37416
38451
  features: {
37417
38452
  upscaling: false,
37418
38453
  styleControl: false,
@@ -37421,7 +38456,8 @@ var VIDEO_MODEL_REGISTRY = {
37421
38456
  }
37422
38457
  },
37423
38458
  pricing: {
37424
- perSecond: 0.75,
38459
+ perSecond: 0.15,
38460
+ // $0.15 for 720p/1080p, $0.35 for 4K
37425
38461
  currency: "USD"
37426
38462
  }
37427
38463
  },
@@ -37438,8 +38474,11 @@ var VIDEO_MODEL_REGISTRY = {
37438
38474
  aspectRatios: ["16:9", "9:16"],
37439
38475
  maxFps: 30,
37440
38476
  audio: true,
38477
+ // Native audio generation
37441
38478
  imageToVideo: true,
38479
+ // Up to 3 reference images
37442
38480
  videoExtension: true,
38481
+ // Supported (720p only)
37443
38482
  frameControl: true,
37444
38483
  features: {
37445
38484
  upscaling: true,
@@ -37449,7 +38488,8 @@ var VIDEO_MODEL_REGISTRY = {
37449
38488
  }
37450
38489
  },
37451
38490
  pricing: {
37452
- perSecond: 0.75,
38491
+ perSecond: 0.4,
38492
+ // $0.40 for 720p/1080p, $0.60 for 4K
37453
38493
  currency: "USD"
37454
38494
  }
37455
38495
  },
@@ -42352,6 +43392,14 @@ var SERVICE_DEFINITIONS = [
42352
43392
  baseURL: "https://aws.amazon.com",
42353
43393
  docsURL: "https://docs.aws.amazon.com/"
42354
43394
  },
43395
+ {
43396
+ id: "cloudflare",
43397
+ name: "Cloudflare",
43398
+ category: "cloud",
43399
+ urlPattern: /api\.cloudflare\.com/i,
43400
+ baseURL: "https://api.cloudflare.com/client/v4",
43401
+ docsURL: "https://developers.cloudflare.com/api/"
43402
+ },
42355
43403
  // ============ Storage ============
42356
43404
  {
42357
43405
  id: "dropbox",
@@ -42395,6 +43443,14 @@ var SERVICE_DEFINITIONS = [
42395
43443
  baseURL: "https://api.postmarkapp.com",
42396
43444
  docsURL: "https://postmarkapp.com/developer"
42397
43445
  },
43446
+ {
43447
+ id: "mailgun",
43448
+ name: "Mailgun",
43449
+ category: "email",
43450
+ urlPattern: /api\.mailgun\.net|api\.eu\.mailgun\.net/i,
43451
+ baseURL: "https://api.mailgun.net/v3",
43452
+ docsURL: "https://documentation.mailgun.com/docs/mailgun/api-reference/"
43453
+ },
42398
43454
  // ============ Monitoring & Observability ============
42399
43455
  {
42400
43456
  id: "datadog",
@@ -45134,6 +46190,43 @@ var awsTemplate = {
45134
46190
  ]
45135
46191
  };
45136
46192
 
46193
+ // src/connectors/vendors/templates/cloudflare.ts
46194
+ var cloudflareTemplate = {
46195
+ id: "cloudflare",
46196
+ name: "Cloudflare",
46197
+ serviceType: "cloudflare",
46198
+ baseURL: "https://api.cloudflare.com/client/v4",
46199
+ docsURL: "https://developers.cloudflare.com/api/",
46200
+ credentialsSetupURL: "https://dash.cloudflare.com/profile/api-tokens",
46201
+ category: "cloud",
46202
+ notes: "API Tokens (recommended) are scoped and more secure. Global API Key requires email and has full account access.",
46203
+ authTemplates: [
46204
+ {
46205
+ id: "api-token",
46206
+ name: "API Token",
46207
+ type: "api_key",
46208
+ description: "Scoped API token (recommended). Create at dash.cloudflare.com > My Profile > API Tokens",
46209
+ requiredFields: ["apiKey"],
46210
+ defaults: {
46211
+ type: "api_key",
46212
+ headerName: "Authorization",
46213
+ headerPrefix: "Bearer"
46214
+ }
46215
+ },
46216
+ {
46217
+ id: "global-api-key",
46218
+ name: "Global API Key",
46219
+ type: "api_key",
46220
+ description: "Legacy global API key + email. Has full account access. Prefer API Tokens for least-privilege access",
46221
+ requiredFields: ["apiKey", "username"],
46222
+ defaults: {
46223
+ type: "api_key",
46224
+ headerName: "X-Auth-Key"
46225
+ }
46226
+ }
46227
+ ]
46228
+ };
46229
+
45137
46230
  // src/connectors/vendors/templates/dropbox.ts
45138
46231
  var dropboxTemplate = {
45139
46232
  id: "dropbox",
@@ -45322,6 +46415,30 @@ var postmarkTemplate = {
45322
46415
  }
45323
46416
  ]
45324
46417
  };
46418
+ var mailgunTemplate = {
46419
+ id: "mailgun",
46420
+ name: "Mailgun",
46421
+ serviceType: "mailgun",
46422
+ baseURL: "https://api.mailgun.net/v3",
46423
+ docsURL: "https://documentation.mailgun.com/docs/mailgun/api-reference/",
46424
+ credentialsSetupURL: "https://app.mailgun.com/settings/api_security",
46425
+ category: "email",
46426
+ notes: "EU region uses api.eu.mailgun.net. Most endpoints require /v3/<domain> in the path.",
46427
+ authTemplates: [
46428
+ {
46429
+ id: "api-key",
46430
+ name: "API Key",
46431
+ type: "api_key",
46432
+ description: "Private API key for full account access. Find at Settings > API Security",
46433
+ requiredFields: ["apiKey"],
46434
+ defaults: {
46435
+ type: "api_key",
46436
+ headerName: "Authorization",
46437
+ headerPrefix: "Basic"
46438
+ }
46439
+ }
46440
+ ]
46441
+ };
45325
46442
 
45326
46443
  // src/connectors/vendors/templates/monitoring.ts
45327
46444
  var datadogTemplate = {
@@ -45770,6 +46887,7 @@ var allVendorTemplates = [
45770
46887
  rampTemplate,
45771
46888
  // Cloud
45772
46889
  awsTemplate,
46890
+ cloudflareTemplate,
45773
46891
  // Storage
45774
46892
  dropboxTemplate,
45775
46893
  boxTemplate,
@@ -45777,6 +46895,7 @@ var allVendorTemplates = [
45777
46895
  sendgridTemplate,
45778
46896
  mailchimpTemplate,
45779
46897
  postmarkTemplate,
46898
+ mailgunTemplate,
45780
46899
  // Monitoring
45781
46900
  datadogTemplate,
45782
46901
  pagerdutyTemplate,
@@ -49134,7 +50253,8 @@ SANDBOX API:
49134
50253
  4. connectors.get(name) \u2014 Connector info: { displayName, description, baseURL, serviceType }
49135
50254
 
49136
50255
  VARIABLES:
49137
- \u2022 input \u2014 data passed via the "input" parameter (default: {})
50256
+ \u2022 input \u2014 data passed via the "input" parameter (default: {}). Always a parsed object/array, never a string.
50257
+ 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.
49138
50258
  \u2022 output \u2014 SET THIS to return your result to the caller
49139
50259
 
49140
50260
  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
@@ -49157,7 +50277,8 @@ const resp = await authenticatedFetch('/chat.postMessage', {
49157
50277
  }, 'slack');
49158
50278
  output = await resp.json();
49159
50279
  ${accountIdExamples}
49160
- // Data processing (no API needed)
50280
+ // Data processing \u2014 pass actual data via the input parameter, NOT template references
50281
+ // e.g. call with: { "code": "...", "input": { "data": [{"score": 0.9}, {"score": 0.5}] } }
49161
50282
  const items = input.data;
49162
50283
  output = items.filter(i => i.score > 0.8).sort((a, b) => b.score - a.score);
49163
50284
 
@@ -49181,7 +50302,7 @@ function createExecuteJavaScriptTool(options) {
49181
50302
  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 () => { ... })().'
49182
50303
  },
49183
50304
  input: {
49184
- description: 'Optional data available as the "input" variable in your code. Can be any JSON value.'
50305
+ 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}}"}.'
49185
50306
  },
49186
50307
  timeout: {
49187
50308
  type: "number",
@@ -49204,9 +50325,19 @@ function createExecuteJavaScriptTool(options) {
49204
50325
  try {
49205
50326
  const timeout = Math.min(Math.max(args.timeout || defaultTimeout, 0), maxTimeout);
49206
50327
  const registry = context?.connectorRegistry ?? exports.Connector.asRegistry();
50328
+ let resolvedInput = args.input;
50329
+ if (typeof resolvedInput === "string") {
50330
+ const trimmed = resolvedInput.trim();
50331
+ if (trimmed.startsWith("{") && trimmed.endsWith("}") || trimmed.startsWith("[") && trimmed.endsWith("]")) {
50332
+ try {
50333
+ resolvedInput = JSON.parse(trimmed);
50334
+ } catch {
50335
+ }
50336
+ }
50337
+ }
49207
50338
  const result = await executeInVM(
49208
50339
  args.code,
49209
- args.input,
50340
+ resolvedInput,
49210
50341
  timeout,
49211
50342
  logs,
49212
50343
  context?.userId,