@everworker/oneringai 0.4.4 → 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
@@ -10331,6 +10331,9 @@ var ToolCatalogRegistry = class {
10331
10331
  * Get the ConnectorTools module (lazy-loaded, cached).
10332
10332
  * Returns null if ConnectorTools is not available.
10333
10333
  * Uses false sentinel to prevent retrying after first failure.
10334
+ *
10335
+ * NOTE: The dynamic require() path fails in bundled environments (Meteor, Webpack).
10336
+ * Call setConnectorToolsModule() at app startup to inject the module explicitly.
10334
10337
  */
10335
10338
  static getConnectorToolsModule() {
10336
10339
  if (this._connectorToolsModule === null) {
@@ -10342,6 +10345,21 @@ var ToolCatalogRegistry = class {
10342
10345
  }
10343
10346
  return this._connectorToolsModule || null;
10344
10347
  }
10348
+ /**
10349
+ * Explicitly set the ConnectorTools module reference.
10350
+ *
10351
+ * Use this in bundled environments (Meteor, Webpack, etc.) where the lazy
10352
+ * require('../../tools/connector/ConnectorTools.js') fails due to path resolution.
10353
+ *
10354
+ * @example
10355
+ * ```typescript
10356
+ * import { ToolCatalogRegistry, ConnectorTools } from '@everworker/oneringai';
10357
+ * ToolCatalogRegistry.setConnectorToolsModule({ ConnectorTools });
10358
+ * ```
10359
+ */
10360
+ static setConnectorToolsModule(mod) {
10361
+ this._connectorToolsModule = mod;
10362
+ }
10345
10363
  // ========================================================================
10346
10364
  // Registration
10347
10365
  // ========================================================================
@@ -12613,18 +12631,30 @@ function isVendor(value) {
12613
12631
  // src/domain/entities/Model.ts
12614
12632
  var LLM_MODELS = {
12615
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",
12616
12637
  // GPT-5.2 Series (Current Flagship)
12617
12638
  GPT_5_2: "gpt-5.2",
12618
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",
12619
12648
  // GPT-5 Series
12620
12649
  GPT_5: "gpt-5",
12621
12650
  GPT_5_MINI: "gpt-5-mini",
12622
12651
  GPT_5_NANO: "gpt-5-nano",
12652
+ GPT_5_CHAT: "gpt-5-chat-latest",
12623
12653
  // GPT-4.1 Series
12624
12654
  GPT_4_1: "gpt-4.1",
12625
12655
  GPT_4_1_MINI: "gpt-4.1-mini",
12626
12656
  GPT_4_1_NANO: "gpt-4.1-nano",
12627
- // GPT-4o Series (Legacy, Audio Capable)
12657
+ // GPT-4o Series (Legacy)
12628
12658
  GPT_4O: "gpt-4o",
12629
12659
  GPT_4O_MINI: "gpt-4o-mini",
12630
12660
  // Reasoning Models (o-series)
@@ -12632,18 +12662,26 @@ var LLM_MODELS = {
12632
12662
  O1: "o1"
12633
12663
  },
12634
12664
  [Vendor.Anthropic]: {
12635
- // 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
12636
12669
  CLAUDE_OPUS_4_5: "claude-opus-4-5-20251101",
12637
12670
  CLAUDE_SONNET_4_5: "claude-sonnet-4-5-20250929",
12638
12671
  CLAUDE_HAIKU_4_5: "claude-haiku-4-5-20251001",
12639
12672
  // Claude 4.x Legacy
12640
12673
  CLAUDE_OPUS_4_1: "claude-opus-4-1-20250805",
12674
+ CLAUDE_OPUS_4: "claude-opus-4-20250514",
12641
12675
  CLAUDE_SONNET_4: "claude-sonnet-4-20250514",
12642
12676
  CLAUDE_SONNET_3_7: "claude-3-7-sonnet-20250219",
12643
- // Claude 3.x Legacy
12677
+ // Claude 3.x Legacy (Deprecated)
12644
12678
  CLAUDE_HAIKU_3: "claude-3-haiku-20240307"
12645
12679
  },
12646
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",
12647
12685
  // Gemini 3 Series (Preview)
12648
12686
  GEMINI_3_FLASH_PREVIEW: "gemini-3-flash-preview",
12649
12687
  GEMINI_3_PRO_PREVIEW: "gemini-3-pro-preview",
@@ -12675,12 +12713,88 @@ var MODEL_REGISTRY = {
12675
12713
  // ============================================================================
12676
12714
  // OpenAI Models (Verified from platform.openai.com)
12677
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
+ },
12678
12791
  // GPT-5.2 Series (Current Flagship)
12679
12792
  "gpt-5.2": {
12680
12793
  name: "gpt-5.2",
12681
12794
  provider: Vendor.OpenAI,
12682
12795
  description: "Flagship model for coding and agentic tasks. Reasoning.effort: none, low, medium, high, xhigh",
12683
12796
  isActive: true,
12797
+ preferred: true,
12684
12798
  releaseDate: "2025-12-01",
12685
12799
  knowledgeCutoff: "2025-08-31",
12686
12800
  features: {
@@ -12706,7 +12820,8 @@ var MODEL_REGISTRY = {
12706
12820
  tokens: 4e5,
12707
12821
  text: true,
12708
12822
  image: true,
12709
- cpm: 1.75
12823
+ cpm: 1.75,
12824
+ cpmCached: 0.175
12710
12825
  },
12711
12826
  output: {
12712
12827
  tokens: 128e3,
@@ -12725,7 +12840,7 @@ var MODEL_REGISTRY = {
12725
12840
  features: {
12726
12841
  reasoning: true,
12727
12842
  streaming: true,
12728
- structuredOutput: true,
12843
+ structuredOutput: false,
12729
12844
  functionCalling: true,
12730
12845
  fineTuning: false,
12731
12846
  predictedOutputs: false,
@@ -12754,13 +12869,88 @@ var MODEL_REGISTRY = {
12754
12869
  }
12755
12870
  }
12756
12871
  },
12757
- // GPT-5 Series
12758
- "gpt-5": {
12759
- name: "gpt-5",
12872
+ "gpt-5.2-codex": {
12873
+ name: "gpt-5.2-codex",
12760
12874
  provider: Vendor.OpenAI,
12761
- description: "Previous intelligent reasoning model for coding and agentic tasks. Reasoning.effort: minimal, low, medium, high",
12875
+ description: "GPT-5.2 codex for coding and agentic tasks. Reasoning.effort: low, medium, high, xhigh",
12762
12876
  isActive: true,
12763
- releaseDate: "2025-08-01",
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",
12764
12954
  knowledgeCutoff: "2024-09-30",
12765
12955
  features: {
12766
12956
  reasoning: true,
@@ -12785,7 +12975,8 @@ var MODEL_REGISTRY = {
12785
12975
  tokens: 4e5,
12786
12976
  text: true,
12787
12977
  image: true,
12788
- cpm: 1.25
12978
+ cpm: 1.25,
12979
+ cpmCached: 0.125
12789
12980
  },
12790
12981
  output: {
12791
12982
  tokens: 128e3,
@@ -12794,13 +12985,13 @@ var MODEL_REGISTRY = {
12794
12985
  }
12795
12986
  }
12796
12987
  },
12797
- "gpt-5-mini": {
12798
- name: "gpt-5-mini",
12988
+ "gpt-5.1-codex": {
12989
+ name: "gpt-5.1-codex",
12799
12990
  provider: Vendor.OpenAI,
12800
- description: "Faster, cost-efficient version of GPT-5 for well-defined tasks and precise prompts",
12991
+ description: "GPT-5.1 codex for coding and agentic tasks with reasoning",
12801
12992
  isActive: true,
12802
- releaseDate: "2025-08-01",
12803
- knowledgeCutoff: "2024-05-31",
12993
+ releaseDate: "2025-10-01",
12994
+ knowledgeCutoff: "2024-09-30",
12804
12995
  features: {
12805
12996
  reasoning: true,
12806
12997
  streaming: true,
@@ -12824,7 +13015,88 @@ var MODEL_REGISTRY = {
12824
13015
  tokens: 4e5,
12825
13016
  text: true,
12826
13017
  image: true,
12827
- cpm: 0.25
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
12828
13100
  },
12829
13101
  output: {
12830
13102
  tokens: 128e3,
@@ -12833,13 +13105,48 @@ var MODEL_REGISTRY = {
12833
13105
  }
12834
13106
  }
12835
13107
  },
12836
- "gpt-5-nano": {
12837
- name: "gpt-5-nano",
13108
+ "gpt-5.1-chat-latest": {
13109
+ name: "gpt-5.1-chat-latest",
12838
13110
  provider: Vendor.OpenAI,
12839
- description: "Fastest, most cost-efficient GPT-5. Great for summarization and classification tasks",
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
+ },
13142
+ // GPT-5 Series
13143
+ "gpt-5": {
13144
+ name: "gpt-5",
13145
+ provider: Vendor.OpenAI,
13146
+ description: "Previous intelligent reasoning model for coding and agentic tasks. Reasoning.effort: minimal, low, medium, high",
12840
13147
  isActive: true,
12841
13148
  releaseDate: "2025-08-01",
12842
- knowledgeCutoff: "2024-05-31",
13149
+ knowledgeCutoff: "2024-09-30",
12843
13150
  features: {
12844
13151
  reasoning: true,
12845
13152
  streaming: true,
@@ -12863,7 +13170,88 @@ var MODEL_REGISTRY = {
12863
13170
  tokens: 4e5,
12864
13171
  text: true,
12865
13172
  image: true,
12866
- cpm: 0.05
13173
+ cpm: 1.25,
13174
+ cpmCached: 0.125
13175
+ },
13176
+ output: {
13177
+ tokens: 128e3,
13178
+ text: true,
13179
+ cpm: 10
13180
+ }
13181
+ }
13182
+ },
13183
+ "gpt-5-mini": {
13184
+ name: "gpt-5-mini",
13185
+ provider: Vendor.OpenAI,
13186
+ description: "Faster, cost-efficient version of GPT-5 for well-defined tasks and precise prompts",
13187
+ isActive: true,
13188
+ releaseDate: "2025-08-01",
13189
+ knowledgeCutoff: "2024-05-31",
13190
+ features: {
13191
+ reasoning: true,
13192
+ streaming: true,
13193
+ structuredOutput: true,
13194
+ functionCalling: true,
13195
+ fineTuning: false,
13196
+ predictedOutputs: false,
13197
+ realtime: false,
13198
+ vision: true,
13199
+ audio: false,
13200
+ video: false,
13201
+ batchAPI: true,
13202
+ promptCaching: true,
13203
+ parameters: {
13204
+ temperature: false,
13205
+ topP: false,
13206
+ frequencyPenalty: false,
13207
+ presencePenalty: false
13208
+ },
13209
+ input: {
13210
+ tokens: 4e5,
13211
+ text: true,
13212
+ image: true,
13213
+ cpm: 0.25,
13214
+ cpmCached: 0.025
13215
+ },
13216
+ output: {
13217
+ tokens: 128e3,
13218
+ text: true,
13219
+ cpm: 2
13220
+ }
13221
+ }
13222
+ },
13223
+ "gpt-5-nano": {
13224
+ name: "gpt-5-nano",
13225
+ provider: Vendor.OpenAI,
13226
+ description: "Fastest, most cost-efficient GPT-5. Great for summarization and classification tasks",
13227
+ isActive: true,
13228
+ releaseDate: "2025-08-01",
13229
+ knowledgeCutoff: "2024-05-31",
13230
+ features: {
13231
+ reasoning: true,
13232
+ streaming: true,
13233
+ structuredOutput: true,
13234
+ functionCalling: true,
13235
+ fineTuning: false,
13236
+ predictedOutputs: false,
13237
+ realtime: false,
13238
+ vision: true,
13239
+ audio: false,
13240
+ video: false,
13241
+ batchAPI: true,
13242
+ promptCaching: true,
13243
+ parameters: {
13244
+ temperature: false,
13245
+ topP: false,
13246
+ frequencyPenalty: false,
13247
+ presencePenalty: false
13248
+ },
13249
+ input: {
13250
+ tokens: 4e5,
13251
+ text: true,
13252
+ image: true,
13253
+ cpm: 0.05,
13254
+ cpmCached: 5e-3
12867
13255
  },
12868
13256
  output: {
12869
13257
  tokens: 128e3,
@@ -12872,6 +13260,40 @@ var MODEL_REGISTRY = {
12872
13260
  }
12873
13261
  }
12874
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
+ },
12875
13297
  // GPT-4.1 Series
12876
13298
  "gpt-4.1": {
12877
13299
  name: "gpt-4.1",
@@ -12879,7 +13301,7 @@ var MODEL_REGISTRY = {
12879
13301
  description: "GPT-4.1 specialized for coding with 1M token context window",
12880
13302
  isActive: true,
12881
13303
  releaseDate: "2025-04-14",
12882
- knowledgeCutoff: "2025-04-01",
13304
+ knowledgeCutoff: "2024-06-01",
12883
13305
  features: {
12884
13306
  reasoning: false,
12885
13307
  streaming: true,
@@ -12897,7 +13319,8 @@ var MODEL_REGISTRY = {
12897
13319
  tokens: 1e6,
12898
13320
  text: true,
12899
13321
  image: true,
12900
- cpm: 2
13322
+ cpm: 2,
13323
+ cpmCached: 0.5
12901
13324
  },
12902
13325
  output: {
12903
13326
  tokens: 32768,
@@ -12912,7 +13335,7 @@ var MODEL_REGISTRY = {
12912
13335
  description: "Efficient GPT-4.1 model, beats GPT-4o in many benchmarks at 83% lower cost",
12913
13336
  isActive: true,
12914
13337
  releaseDate: "2025-04-14",
12915
- knowledgeCutoff: "2025-04-01",
13338
+ knowledgeCutoff: "2024-06-01",
12916
13339
  features: {
12917
13340
  reasoning: false,
12918
13341
  streaming: true,
@@ -12930,7 +13353,8 @@ var MODEL_REGISTRY = {
12930
13353
  tokens: 1e6,
12931
13354
  text: true,
12932
13355
  image: true,
12933
- cpm: 0.4
13356
+ cpm: 0.4,
13357
+ cpmCached: 0.1
12934
13358
  },
12935
13359
  output: {
12936
13360
  tokens: 16384,
@@ -12945,7 +13369,7 @@ var MODEL_REGISTRY = {
12945
13369
  description: "Fastest and cheapest model with 1M context. 80.1% MMLU, ideal for classification/autocompletion",
12946
13370
  isActive: true,
12947
13371
  releaseDate: "2025-04-14",
12948
- knowledgeCutoff: "2025-04-01",
13372
+ knowledgeCutoff: "2024-06-01",
12949
13373
  features: {
12950
13374
  reasoning: false,
12951
13375
  streaming: true,
@@ -12963,7 +13387,8 @@ var MODEL_REGISTRY = {
12963
13387
  tokens: 1e6,
12964
13388
  text: true,
12965
13389
  image: true,
12966
- cpm: 0.1
13390
+ cpm: 0.1,
13391
+ cpmCached: 0.025
12967
13392
  },
12968
13393
  output: {
12969
13394
  tokens: 16384,
@@ -12972,14 +13397,14 @@ var MODEL_REGISTRY = {
12972
13397
  }
12973
13398
  }
12974
13399
  },
12975
- // GPT-4o Series (Legacy, Audio Capable)
13400
+ // GPT-4o Series (Legacy)
12976
13401
  "gpt-4o": {
12977
13402
  name: "gpt-4o",
12978
13403
  provider: Vendor.OpenAI,
12979
- description: "Versatile omni model with audio support. Legacy but still available",
13404
+ description: "Versatile omni model. Legacy but still available",
12980
13405
  isActive: true,
12981
13406
  releaseDate: "2024-05-13",
12982
- knowledgeCutoff: "2024-04-01",
13407
+ knowledgeCutoff: "2023-10-01",
12983
13408
  features: {
12984
13409
  reasoning: false,
12985
13410
  streaming: true,
@@ -12989,7 +13414,7 @@ var MODEL_REGISTRY = {
12989
13414
  predictedOutputs: true,
12990
13415
  realtime: true,
12991
13416
  vision: true,
12992
- audio: true,
13417
+ audio: false,
12993
13418
  video: false,
12994
13419
  batchAPI: true,
12995
13420
  promptCaching: true,
@@ -12997,13 +13422,12 @@ var MODEL_REGISTRY = {
12997
13422
  tokens: 128e3,
12998
13423
  text: true,
12999
13424
  image: true,
13000
- audio: true,
13001
- cpm: 2.5
13425
+ cpm: 2.5,
13426
+ cpmCached: 1.25
13002
13427
  },
13003
13428
  output: {
13004
13429
  tokens: 16384,
13005
13430
  text: true,
13006
- audio: true,
13007
13431
  cpm: 10
13008
13432
  }
13009
13433
  }
@@ -13011,10 +13435,10 @@ var MODEL_REGISTRY = {
13011
13435
  "gpt-4o-mini": {
13012
13436
  name: "gpt-4o-mini",
13013
13437
  provider: Vendor.OpenAI,
13014
- description: "Fast, affordable omni model with audio support",
13438
+ description: "Fast, affordable omni model",
13015
13439
  isActive: true,
13016
13440
  releaseDate: "2024-07-18",
13017
- knowledgeCutoff: "2024-04-01",
13441
+ knowledgeCutoff: "2023-10-01",
13018
13442
  features: {
13019
13443
  reasoning: false,
13020
13444
  streaming: true,
@@ -13024,7 +13448,7 @@ var MODEL_REGISTRY = {
13024
13448
  predictedOutputs: false,
13025
13449
  realtime: true,
13026
13450
  vision: true,
13027
- audio: true,
13451
+ audio: false,
13028
13452
  video: false,
13029
13453
  batchAPI: true,
13030
13454
  promptCaching: true,
@@ -13032,13 +13456,12 @@ var MODEL_REGISTRY = {
13032
13456
  tokens: 128e3,
13033
13457
  text: true,
13034
13458
  image: true,
13035
- audio: true,
13036
- cpm: 0.15
13459
+ cpm: 0.15,
13460
+ cpmCached: 0.075
13037
13461
  },
13038
13462
  output: {
13039
13463
  tokens: 16384,
13040
13464
  text: true,
13041
- audio: true,
13042
13465
  cpm: 0.6
13043
13466
  }
13044
13467
  }
@@ -13050,7 +13473,7 @@ var MODEL_REGISTRY = {
13050
13473
  description: "Fast reasoning model tailored for coding, math, and science",
13051
13474
  isActive: true,
13052
13475
  releaseDate: "2025-01-31",
13053
- knowledgeCutoff: "2024-10-01",
13476
+ knowledgeCutoff: "2023-10-01",
13054
13477
  features: {
13055
13478
  reasoning: true,
13056
13479
  streaming: true,
@@ -13059,11 +13482,11 @@ var MODEL_REGISTRY = {
13059
13482
  fineTuning: false,
13060
13483
  predictedOutputs: false,
13061
13484
  realtime: false,
13062
- vision: true,
13485
+ vision: false,
13063
13486
  audio: false,
13064
13487
  video: false,
13065
13488
  batchAPI: true,
13066
- promptCaching: false,
13489
+ promptCaching: true,
13067
13490
  parameters: {
13068
13491
  temperature: false,
13069
13492
  topP: false,
@@ -13073,8 +13496,8 @@ var MODEL_REGISTRY = {
13073
13496
  input: {
13074
13497
  tokens: 2e5,
13075
13498
  text: true,
13076
- image: true,
13077
- cpm: 1.1
13499
+ cpm: 1.1,
13500
+ cpmCached: 0.55
13078
13501
  },
13079
13502
  output: {
13080
13503
  tokens: 1e5,
@@ -13089,7 +13512,7 @@ var MODEL_REGISTRY = {
13089
13512
  description: "Advanced reasoning model for complex problems",
13090
13513
  isActive: true,
13091
13514
  releaseDate: "2024-12-17",
13092
- knowledgeCutoff: "2024-10-01",
13515
+ knowledgeCutoff: "2023-10-01",
13093
13516
  features: {
13094
13517
  reasoning: true,
13095
13518
  streaming: true,
@@ -13102,7 +13525,7 @@ var MODEL_REGISTRY = {
13102
13525
  audio: false,
13103
13526
  video: false,
13104
13527
  batchAPI: true,
13105
- promptCaching: false,
13528
+ promptCaching: true,
13106
13529
  parameters: {
13107
13530
  temperature: false,
13108
13531
  topP: false,
@@ -13113,7 +13536,8 @@ var MODEL_REGISTRY = {
13113
13536
  tokens: 2e5,
13114
13537
  text: true,
13115
13538
  image: true,
13116
- cpm: 15
13539
+ cpm: 15,
13540
+ cpmCached: 7.5
13117
13541
  },
13118
13542
  output: {
13119
13543
  tokens: 1e5,
@@ -13123,13 +13547,88 @@ var MODEL_REGISTRY = {
13123
13547
  }
13124
13548
  },
13125
13549
  // ============================================================================
13126
- // Anthropic Models (Verified from platform.claude.com)
13550
+ // Anthropic Models (Verified from platform.claude.com - March 2026)
13127
13551
  // ============================================================================
13128
- // 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
13129
13628
  "claude-opus-4-5-20251101": {
13130
13629
  name: "claude-opus-4-5-20251101",
13131
13630
  provider: Vendor.Anthropic,
13132
- description: "Premium model combining maximum intelligence with practical performance",
13631
+ description: "Legacy Opus 4.5. Premium model combining maximum intelligence with practical performance",
13133
13632
  isActive: true,
13134
13633
  releaseDate: "2025-11-01",
13135
13634
  knowledgeCutoff: "2025-05-01",
@@ -13164,7 +13663,7 @@ var MODEL_REGISTRY = {
13164
13663
  "claude-sonnet-4-5-20250929": {
13165
13664
  name: "claude-sonnet-4-5-20250929",
13166
13665
  provider: Vendor.Anthropic,
13167
- 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",
13168
13667
  isActive: true,
13169
13668
  releaseDate: "2025-09-29",
13170
13669
  knowledgeCutoff: "2025-01-01",
@@ -13184,6 +13683,7 @@ var MODEL_REGISTRY = {
13184
13683
  promptCaching: true,
13185
13684
  input: {
13186
13685
  tokens: 2e5,
13686
+ // 1M with beta header
13187
13687
  text: true,
13188
13688
  image: true,
13189
13689
  cpm: 3,
@@ -13267,10 +13767,45 @@ var MODEL_REGISTRY = {
13267
13767
  }
13268
13768
  }
13269
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
+ },
13270
13805
  "claude-sonnet-4-20250514": {
13271
13806
  name: "claude-sonnet-4-20250514",
13272
13807
  provider: Vendor.Anthropic,
13273
- description: "Legacy Sonnet 4. Default for most users, supports 1M context beta",
13808
+ description: "Legacy Sonnet 4. Supports 1M context beta",
13274
13809
  isActive: true,
13275
13810
  releaseDate: "2025-05-14",
13276
13811
  knowledgeCutoff: "2025-01-01",
@@ -13306,7 +13841,7 @@ var MODEL_REGISTRY = {
13306
13841
  "claude-3-7-sonnet-20250219": {
13307
13842
  name: "claude-3-7-sonnet-20250219",
13308
13843
  provider: Vendor.Anthropic,
13309
- description: "Claude 3.7 Sonnet with extended thinking, supports 128K output beta",
13844
+ description: "Deprecated. Claude 3.7 Sonnet with extended thinking",
13310
13845
  isActive: true,
13311
13846
  releaseDate: "2025-02-19",
13312
13847
  knowledgeCutoff: "2024-10-01",
@@ -13333,17 +13868,16 @@ var MODEL_REGISTRY = {
13333
13868
  },
13334
13869
  output: {
13335
13870
  tokens: 64e3,
13336
- // 128K with beta header
13337
13871
  text: true,
13338
13872
  cpm: 15
13339
13873
  }
13340
13874
  }
13341
13875
  },
13342
- // Claude 3.x Legacy
13876
+ // Claude 3.x Legacy (Deprecated - retiring April 19, 2026)
13343
13877
  "claude-3-haiku-20240307": {
13344
13878
  name: "claude-3-haiku-20240307",
13345
13879
  provider: Vendor.Anthropic,
13346
- description: "Fast legacy model. Recommend migrating to Haiku 4.5",
13880
+ description: "Deprecated. Retiring April 19, 2026. Migrate to Haiku 4.5",
13347
13881
  isActive: true,
13348
13882
  releaseDate: "2024-03-07",
13349
13883
  knowledgeCutoff: "2023-08-01",
@@ -13376,16 +13910,124 @@ var MODEL_REGISTRY = {
13376
13910
  }
13377
13911
  },
13378
13912
  // ============================================================================
13379
- // Google Models (Verified from ai.google.dev)
13913
+ // Google Models (Verified from ai.google.dev - March 2026)
13380
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
+ },
13381
14022
  // Gemini 3 Series (Preview)
13382
14023
  "gemini-3-flash-preview": {
13383
14024
  name: "gemini-3-flash-preview",
13384
14025
  provider: Vendor.Google,
13385
- description: "Pro-grade reasoning with Flash-level latency and efficiency",
14026
+ description: "Most powerful agentic and coding model with frontier-class reasoning",
13386
14027
  isActive: true,
13387
- releaseDate: "2025-11-18",
13388
- knowledgeCutoff: "2025-08-01",
14028
+ preferred: true,
14029
+ releaseDate: "2025-12-01",
14030
+ knowledgeCutoff: "2025-01-01",
13389
14031
  features: {
13390
14032
  reasoning: true,
13391
14033
  streaming: true,
@@ -13400,27 +14042,28 @@ var MODEL_REGISTRY = {
13400
14042
  batchAPI: true,
13401
14043
  promptCaching: true,
13402
14044
  input: {
13403
- tokens: 1e6,
14045
+ tokens: 1048576,
13404
14046
  text: true,
13405
14047
  image: true,
13406
14048
  audio: true,
13407
14049
  video: true,
13408
- cpm: 0.15
14050
+ cpm: 0.5,
14051
+ cpmCached: 0.05
13409
14052
  },
13410
14053
  output: {
13411
14054
  tokens: 65536,
13412
14055
  text: true,
13413
- cpm: 0.6
14056
+ cpm: 3
13414
14057
  }
13415
14058
  }
13416
14059
  },
13417
14060
  "gemini-3-pro-preview": {
13418
14061
  name: "gemini-3-pro-preview",
13419
14062
  provider: Vendor.Google,
13420
- description: "Most advanced reasoning Gemini model for complex tasks",
14063
+ description: "Deprecated. Shutting down March 9, 2026. Migrate to gemini-3.1-pro-preview",
13421
14064
  isActive: true,
13422
14065
  releaseDate: "2025-11-18",
13423
- knowledgeCutoff: "2025-08-01",
14066
+ knowledgeCutoff: "2025-01-01",
13424
14067
  features: {
13425
14068
  reasoning: true,
13426
14069
  streaming: true,
@@ -13435,7 +14078,7 @@ var MODEL_REGISTRY = {
13435
14078
  batchAPI: true,
13436
14079
  promptCaching: true,
13437
14080
  input: {
13438
- tokens: 1e6,
14081
+ tokens: 1048576,
13439
14082
  text: true,
13440
14083
  image: true,
13441
14084
  audio: true,
@@ -13452,14 +14095,14 @@ var MODEL_REGISTRY = {
13452
14095
  "gemini-3-pro-image-preview": {
13453
14096
  name: "gemini-3-pro-image-preview",
13454
14097
  provider: Vendor.Google,
13455
- description: "Highest quality image generation model",
14098
+ description: "Professional-grade image generation and editing with reasoning",
13456
14099
  isActive: true,
13457
14100
  releaseDate: "2025-11-18",
13458
- knowledgeCutoff: "2025-08-01",
14101
+ knowledgeCutoff: "2025-01-01",
13459
14102
  features: {
13460
14103
  reasoning: true,
13461
14104
  streaming: true,
13462
- structuredOutput: false,
14105
+ structuredOutput: true,
13463
14106
  functionCalling: false,
13464
14107
  fineTuning: false,
13465
14108
  predictedOutputs: false,
@@ -13468,15 +14111,15 @@ var MODEL_REGISTRY = {
13468
14111
  audio: false,
13469
14112
  video: false,
13470
14113
  batchAPI: true,
13471
- promptCaching: true,
14114
+ promptCaching: false,
13472
14115
  input: {
13473
- tokens: 1e6,
14116
+ tokens: 65536,
13474
14117
  text: true,
13475
14118
  image: true,
13476
14119
  cpm: 1.25
13477
14120
  },
13478
14121
  output: {
13479
- tokens: 65536,
14122
+ tokens: 32768,
13480
14123
  text: true,
13481
14124
  image: true,
13482
14125
  cpm: 10
@@ -13487,7 +14130,7 @@ var MODEL_REGISTRY = {
13487
14130
  "gemini-2.5-pro": {
13488
14131
  name: "gemini-2.5-pro",
13489
14132
  provider: Vendor.Google,
13490
- description: "Advanced multimodal model built for deep reasoning and agents",
14133
+ description: "Most advanced model for complex tasks with deep reasoning and coding",
13491
14134
  isActive: true,
13492
14135
  releaseDate: "2025-03-01",
13493
14136
  knowledgeCutoff: "2025-01-01",
@@ -13505,12 +14148,13 @@ var MODEL_REGISTRY = {
13505
14148
  batchAPI: true,
13506
14149
  promptCaching: true,
13507
14150
  input: {
13508
- tokens: 1e6,
14151
+ tokens: 1048576,
13509
14152
  text: true,
13510
14153
  image: true,
13511
14154
  audio: true,
13512
14155
  video: true,
13513
- cpm: 1.25
14156
+ cpm: 1.25,
14157
+ cpmCached: 0.125
13514
14158
  },
13515
14159
  output: {
13516
14160
  tokens: 65536,
@@ -13522,7 +14166,7 @@ var MODEL_REGISTRY = {
13522
14166
  "gemini-2.5-flash": {
13523
14167
  name: "gemini-2.5-flash",
13524
14168
  provider: Vendor.Google,
13525
- description: "Fast, cost-effective model with excellent reasoning",
14169
+ description: "Best price-performance for low-latency, high-volume tasks with reasoning",
13526
14170
  isActive: true,
13527
14171
  releaseDate: "2025-06-17",
13528
14172
  knowledgeCutoff: "2025-01-01",
@@ -13540,24 +14184,25 @@ var MODEL_REGISTRY = {
13540
14184
  batchAPI: true,
13541
14185
  promptCaching: true,
13542
14186
  input: {
13543
- tokens: 1e6,
14187
+ tokens: 1048576,
13544
14188
  text: true,
13545
14189
  image: true,
13546
14190
  audio: true,
13547
14191
  video: true,
13548
- cpm: 0.15
14192
+ cpm: 0.3,
14193
+ cpmCached: 0.03
13549
14194
  },
13550
14195
  output: {
13551
14196
  tokens: 65536,
13552
14197
  text: true,
13553
- cpm: 0.6
14198
+ cpm: 2.5
13554
14199
  }
13555
14200
  }
13556
14201
  },
13557
14202
  "gemini-2.5-flash-lite": {
13558
14203
  name: "gemini-2.5-flash-lite",
13559
14204
  provider: Vendor.Google,
13560
- description: "Lowest latency for high-volume tasks, summarization, classification",
14205
+ description: "Fastest and most budget-friendly multimodal model in the 2.5 family",
13561
14206
  isActive: true,
13562
14207
  releaseDate: "2025-06-17",
13563
14208
  knowledgeCutoff: "2025-01-01",
@@ -13575,31 +14220,31 @@ var MODEL_REGISTRY = {
13575
14220
  batchAPI: true,
13576
14221
  promptCaching: true,
13577
14222
  input: {
13578
- tokens: 1e6,
14223
+ tokens: 1048576,
13579
14224
  text: true,
13580
14225
  image: true,
13581
14226
  audio: true,
13582
14227
  video: true,
13583
- cpm: 0.075
14228
+ cpm: 0.1
13584
14229
  },
13585
14230
  output: {
13586
14231
  tokens: 65536,
13587
14232
  text: true,
13588
- cpm: 0.3
14233
+ cpm: 0.4
13589
14234
  }
13590
14235
  }
13591
14236
  },
13592
14237
  "gemini-2.5-flash-image": {
13593
14238
  name: "gemini-2.5-flash-image",
13594
14239
  provider: Vendor.Google,
13595
- description: "Image generation and editing model",
14240
+ description: "Fast native image generation and editing (Nano Banana)",
13596
14241
  isActive: true,
13597
- releaseDate: "2025-09-01",
13598
- knowledgeCutoff: "2025-01-01",
14242
+ releaseDate: "2025-10-01",
14243
+ knowledgeCutoff: "2025-06-01",
13599
14244
  features: {
13600
- reasoning: true,
14245
+ reasoning: false,
13601
14246
  streaming: true,
13602
- structuredOutput: false,
14247
+ structuredOutput: true,
13603
14248
  functionCalling: false,
13604
14249
  fineTuning: false,
13605
14250
  predictedOutputs: false,
@@ -13610,13 +14255,13 @@ var MODEL_REGISTRY = {
13610
14255
  batchAPI: true,
13611
14256
  promptCaching: true,
13612
14257
  input: {
13613
- tokens: 1e6,
14258
+ tokens: 65536,
13614
14259
  text: true,
13615
14260
  image: true,
13616
14261
  cpm: 0.15
13617
14262
  },
13618
14263
  output: {
13619
- tokens: 65536,
14264
+ tokens: 32768,
13620
14265
  text: true,
13621
14266
  image: true,
13622
14267
  cpm: 0.6
@@ -13624,7 +14269,7 @@ var MODEL_REGISTRY = {
13624
14269
  }
13625
14270
  },
13626
14271
  // ============================================================================
13627
- // xAI Grok Models (Verified from docs.x.ai - January 2026)
14272
+ // xAI Grok Models (Verified from docs.x.ai - March 2026)
13628
14273
  // ============================================================================
13629
14274
  // Grok 4.1 Series (2M context, fast)
13630
14275
  "grok-4-1-fast-reasoning": {
@@ -13645,13 +14290,14 @@ var MODEL_REGISTRY = {
13645
14290
  vision: true,
13646
14291
  audio: false,
13647
14292
  video: false,
13648
- batchAPI: false,
13649
- promptCaching: false,
14293
+ batchAPI: true,
14294
+ promptCaching: true,
13650
14295
  input: {
13651
14296
  tokens: 2e6,
13652
14297
  text: true,
13653
14298
  image: true,
13654
- cpm: 0.2
14299
+ cpm: 0.2,
14300
+ cpmCached: 0.05
13655
14301
  },
13656
14302
  output: {
13657
14303
  tokens: 65536,
@@ -13678,13 +14324,14 @@ var MODEL_REGISTRY = {
13678
14324
  vision: true,
13679
14325
  audio: false,
13680
14326
  video: false,
13681
- batchAPI: false,
13682
- promptCaching: false,
14327
+ batchAPI: true,
14328
+ promptCaching: true,
13683
14329
  input: {
13684
14330
  tokens: 2e6,
13685
14331
  text: true,
13686
14332
  image: true,
13687
- cpm: 0.2
14333
+ cpm: 0.2,
14334
+ cpmCached: 0.05
13688
14335
  },
13689
14336
  output: {
13690
14337
  tokens: 65536,
@@ -13712,12 +14359,13 @@ var MODEL_REGISTRY = {
13712
14359
  vision: false,
13713
14360
  audio: false,
13714
14361
  video: false,
13715
- batchAPI: false,
13716
- promptCaching: false,
14362
+ batchAPI: true,
14363
+ promptCaching: true,
13717
14364
  input: {
13718
14365
  tokens: 256e3,
13719
14366
  text: true,
13720
- cpm: 0.2
14367
+ cpm: 0.2,
14368
+ cpmCached: 0.02
13721
14369
  },
13722
14370
  output: {
13723
14371
  tokens: 32768,
@@ -13730,7 +14378,7 @@ var MODEL_REGISTRY = {
13730
14378
  "grok-4-fast-reasoning": {
13731
14379
  name: "grok-4-fast-reasoning",
13732
14380
  provider: Vendor.Grok,
13733
- description: "Fast Grok 4 with reasoning capabilities, 2M context window",
14381
+ description: "Fast Grok 4 with reasoning capabilities, 2M context window, vision support",
13734
14382
  isActive: true,
13735
14383
  releaseDate: "2025-09-01",
13736
14384
  knowledgeCutoff: "2024-11-01",
@@ -13742,15 +14390,17 @@ var MODEL_REGISTRY = {
13742
14390
  fineTuning: false,
13743
14391
  predictedOutputs: false,
13744
14392
  realtime: false,
13745
- vision: false,
14393
+ vision: true,
13746
14394
  audio: false,
13747
14395
  video: false,
13748
- batchAPI: false,
13749
- promptCaching: false,
14396
+ batchAPI: true,
14397
+ promptCaching: true,
13750
14398
  input: {
13751
14399
  tokens: 2e6,
13752
14400
  text: true,
13753
- cpm: 0.2
14401
+ image: true,
14402
+ cpm: 0.2,
14403
+ cpmCached: 0.05
13754
14404
  },
13755
14405
  output: {
13756
14406
  tokens: 65536,
@@ -13777,13 +14427,14 @@ var MODEL_REGISTRY = {
13777
14427
  vision: true,
13778
14428
  audio: false,
13779
14429
  video: false,
13780
- batchAPI: false,
13781
- promptCaching: false,
14430
+ batchAPI: true,
14431
+ promptCaching: true,
13782
14432
  input: {
13783
14433
  tokens: 2e6,
13784
14434
  text: true,
13785
14435
  image: true,
13786
- cpm: 0.2
14436
+ cpm: 0.2,
14437
+ cpmCached: 0.05
13787
14438
  },
13788
14439
  output: {
13789
14440
  tokens: 65536,
@@ -13795,12 +14446,12 @@ var MODEL_REGISTRY = {
13795
14446
  "grok-4-0709": {
13796
14447
  name: "grok-4-0709",
13797
14448
  provider: Vendor.Grok,
13798
- 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",
13799
14450
  isActive: true,
13800
14451
  releaseDate: "2025-07-09",
13801
14452
  knowledgeCutoff: "2024-11-01",
13802
14453
  features: {
13803
- reasoning: false,
14454
+ reasoning: true,
13804
14455
  streaming: true,
13805
14456
  structuredOutput: true,
13806
14457
  functionCalling: true,
@@ -13810,13 +14461,14 @@ var MODEL_REGISTRY = {
13810
14461
  vision: true,
13811
14462
  audio: false,
13812
14463
  video: false,
13813
- batchAPI: false,
13814
- promptCaching: false,
14464
+ batchAPI: true,
14465
+ promptCaching: true,
13815
14466
  input: {
13816
14467
  tokens: 256e3,
13817
14468
  text: true,
13818
14469
  image: true,
13819
- cpm: 3
14470
+ cpm: 3,
14471
+ cpmCached: 0.75
13820
14472
  },
13821
14473
  output: {
13822
14474
  tokens: 32768,
@@ -13829,12 +14481,12 @@ var MODEL_REGISTRY = {
13829
14481
  "grok-3-mini": {
13830
14482
  name: "grok-3-mini",
13831
14483
  provider: Vendor.Grok,
13832
- description: "Lightweight, cost-efficient model for simpler tasks, 131K context",
14484
+ description: "Lightweight, cost-efficient model with reasoning, 131K context",
13833
14485
  isActive: true,
13834
14486
  releaseDate: "2025-06-01",
13835
14487
  knowledgeCutoff: "2024-11-01",
13836
14488
  features: {
13837
- reasoning: false,
14489
+ reasoning: true,
13838
14490
  streaming: true,
13839
14491
  structuredOutput: true,
13840
14492
  functionCalling: true,
@@ -13844,12 +14496,13 @@ var MODEL_REGISTRY = {
13844
14496
  vision: false,
13845
14497
  audio: false,
13846
14498
  video: false,
13847
- batchAPI: false,
13848
- promptCaching: false,
14499
+ batchAPI: true,
14500
+ promptCaching: true,
13849
14501
  input: {
13850
14502
  tokens: 131072,
13851
14503
  text: true,
13852
- cpm: 0.3
14504
+ cpm: 0.3,
14505
+ cpmCached: 0.07
13853
14506
  },
13854
14507
  output: {
13855
14508
  tokens: 32768,
@@ -13876,12 +14529,13 @@ var MODEL_REGISTRY = {
13876
14529
  vision: false,
13877
14530
  audio: false,
13878
14531
  video: false,
13879
- batchAPI: false,
13880
- promptCaching: false,
14532
+ batchAPI: true,
14533
+ promptCaching: true,
13881
14534
  input: {
13882
14535
  tokens: 131072,
13883
14536
  text: true,
13884
- cpm: 3
14537
+ cpm: 3,
14538
+ cpmCached: 0.75
13885
14539
  },
13886
14540
  output: {
13887
14541
  tokens: 32768,
@@ -13890,11 +14544,11 @@ var MODEL_REGISTRY = {
13890
14544
  }
13891
14545
  }
13892
14546
  },
13893
- // Grok 2 Series (Vision)
14547
+ // Grok 2 Series (Legacy - not in current docs)
13894
14548
  "grok-2-vision-1212": {
13895
14549
  name: "grok-2-vision-1212",
13896
14550
  provider: Vendor.Grok,
13897
- description: "Vision-capable model for image understanding, 32K context",
14551
+ description: "Legacy vision model for image understanding, 32K context. Not in current xAI docs",
13898
14552
  isActive: true,
13899
14553
  releaseDate: "2024-12-12",
13900
14554
  knowledgeCutoff: "2024-11-01",
@@ -17040,27 +17694,6 @@ ${formatValue(entry.value)}`).join("\n\n")
17040
17694
  // src/core/context-nextgen/plugins/ToolCatalogPluginNextGen.ts
17041
17695
  init_Logger();
17042
17696
  var DEFAULT_MAX_LOADED = 10;
17043
- var TOOL_CATALOG_INSTRUCTIONS = `## Tool Catalog
17044
-
17045
- 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:
17046
-
17047
- **tool_catalog_search** \u2014 Browse available tool categories and search for specific tools.
17048
- - No params \u2192 list all available categories with descriptions
17049
- - \`category\` \u2192 list tools in that category
17050
- - \`query\` \u2192 keyword search across categories and tools
17051
-
17052
- **tool_catalog_load** \u2014 Load a category's tools so you can use them.
17053
- - Tools become available immediately after loading.
17054
- - If you need tools from a category, load it first.
17055
-
17056
- **tool_catalog_unload** \u2014 Unload a category to free token budget.
17057
- - Unloaded tools are no longer sent to you.
17058
- - Use when you're done with a category.
17059
-
17060
- **Best practices:**
17061
- - Search first to find the right category before loading.
17062
- - Unload categories you no longer need to keep context lean.
17063
- - Categories marked [LOADED] are already available.`;
17064
17697
  var catalogSearchDefinition = {
17065
17698
  type: "function",
17066
17699
  function: {
@@ -17119,6 +17752,8 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17119
17752
  name = "tool_catalog";
17120
17753
  /** category name → array of tool names that were loaded */
17121
17754
  _loadedCategories = /* @__PURE__ */ new Map();
17755
+ /** Categories that cannot be unloaded */
17756
+ _pinnedCategories = /* @__PURE__ */ new Set();
17122
17757
  /** Reference to the ToolManager for registering/disabling tools */
17123
17758
  _toolManager = null;
17124
17759
  /** Cached connector categories — discovered once in setToolManager() */
@@ -17134,12 +17769,17 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17134
17769
  maxLoadedCategories: DEFAULT_MAX_LOADED,
17135
17770
  ...config
17136
17771
  };
17772
+ if (this._config.pinned?.length) {
17773
+ for (const cat of this._config.pinned) {
17774
+ this._pinnedCategories.add(cat);
17775
+ }
17776
+ }
17137
17777
  }
17138
17778
  // ========================================================================
17139
17779
  // Plugin Interface
17140
17780
  // ========================================================================
17141
17781
  getInstructions() {
17142
- return TOOL_CATALOG_INSTRUCTIONS;
17782
+ return this.buildInstructions();
17143
17783
  }
17144
17784
  async getContent() {
17145
17785
  const categories = this.getAllowedCategories();
@@ -17150,15 +17790,15 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17150
17790
  if (loaded.length > 0) {
17151
17791
  lines.push(`**Loaded:** ${loaded.join(", ")}`);
17152
17792
  }
17153
- lines.push(`**Available categories:** ${categories.length}`);
17793
+ lines.push(`**Available categories:** ${categories.length + this.getConnectorCategories().length}`);
17154
17794
  for (const cat of categories) {
17155
17795
  const tools = ToolCatalogRegistry.getToolsInCategory(cat.name);
17156
- const marker = this._loadedCategories.has(cat.name) ? " [LOADED]" : "";
17157
- 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}`);
17158
17798
  }
17159
17799
  for (const cc of this.getConnectorCategories()) {
17160
- const marker = this._loadedCategories.has(cc.name) ? " [LOADED]" : "";
17161
- 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}`);
17162
17802
  }
17163
17803
  const content = lines.join("\n");
17164
17804
  this.updateTokenCache(this.estimator.estimateTokens(content));
@@ -17169,7 +17809,8 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17169
17809
  loadedCategories: Array.from(this._loadedCategories.entries()).map(([name, tools]) => ({
17170
17810
  category: name,
17171
17811
  toolCount: tools.length,
17172
- tools
17812
+ tools,
17813
+ pinned: this._pinnedCategories.has(name)
17173
17814
  }))
17174
17815
  };
17175
17816
  }
@@ -17196,11 +17837,14 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17196
17837
  return [searchTool, loadTool, unloadTool];
17197
17838
  }
17198
17839
  isCompactable() {
17199
- 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;
17200
17844
  }
17201
17845
  async compact(targetTokensToFree) {
17202
17846
  if (!this._toolManager || this._loadedCategories.size === 0) return 0;
17203
- const categoriesByLastUsed = this.getCategoriesSortedByLastUsed();
17847
+ const categoriesByLastUsed = this.getCategoriesSortedByLastUsed().filter((cat) => !this._pinnedCategories.has(cat));
17204
17848
  let freed = 0;
17205
17849
  for (const category of categoriesByLastUsed) {
17206
17850
  if (freed >= targetTokensToFree) break;
@@ -17241,6 +17885,7 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17241
17885
  }
17242
17886
  destroy() {
17243
17887
  this._loadedCategories.clear();
17888
+ this._pinnedCategories.clear();
17244
17889
  this._toolManager = null;
17245
17890
  this._connectorCategories = null;
17246
17891
  this._destroyed = true;
@@ -17254,11 +17899,20 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17254
17899
  setToolManager(tm) {
17255
17900
  this._toolManager = tm;
17256
17901
  this._connectorCategories = ToolCatalogRegistry.discoverConnectorCategories({
17257
- scope: this._config.categoryScope,
17258
17902
  identities: this._config.identities
17259
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
+ }
17260
17913
  if (this._config.autoLoadCategories?.length) {
17261
17914
  for (const category of this._config.autoLoadCategories) {
17915
+ if (this._pinnedCategories.has(category)) continue;
17262
17916
  const result = this.executeLoad(category);
17263
17917
  if (result.error) {
17264
17918
  exports.logger.warn(
@@ -17273,6 +17927,10 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17273
17927
  get loadedCategories() {
17274
17928
  return Array.from(this._loadedCategories.keys());
17275
17929
  }
17930
+ /** Get set of pinned category names */
17931
+ get pinnedCategories() {
17932
+ return this._pinnedCategories;
17933
+ }
17276
17934
  // ========================================================================
17277
17935
  // Metatool Implementations
17278
17936
  // ========================================================================
@@ -17293,6 +17951,7 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17293
17951
  return {
17294
17952
  category,
17295
17953
  loaded,
17954
+ pinned: this._pinnedCategories.has(category),
17296
17955
  tools: tools.map((t) => ({
17297
17956
  name: t.name,
17298
17957
  displayName: t.displayName,
@@ -17314,7 +17973,8 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17314
17973
  displayName: cat.displayName,
17315
17974
  description: cat.description,
17316
17975
  toolCount: tools.length,
17317
- loaded: this._loadedCategories.has(cat.name)
17976
+ loaded: this._loadedCategories.has(cat.name),
17977
+ pinned: this._pinnedCategories.has(cat.name)
17318
17978
  });
17319
17979
  }
17320
17980
  for (const cc of connectorCats) {
@@ -17323,7 +17983,8 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17323
17983
  displayName: cc.displayName,
17324
17984
  description: cc.description,
17325
17985
  toolCount: cc.toolCount,
17326
- loaded: this._loadedCategories.has(cc.name)
17986
+ loaded: this._loadedCategories.has(cc.name),
17987
+ pinned: this._pinnedCategories.has(cc.name)
17327
17988
  });
17328
17989
  }
17329
17990
  return { categories: result };
@@ -17333,20 +17994,28 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17333
17994
  if (!this._toolManager) {
17334
17995
  return { error: "ToolManager not connected. Plugin not properly initialized." };
17335
17996
  }
17336
- if (!ToolCatalogRegistry.isCategoryAllowed(category, this._config.categoryScope)) {
17337
- 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
+ }
17338
18007
  }
17339
18008
  if (this._loadedCategories.has(category)) {
17340
18009
  const toolNames2 = this._loadedCategories.get(category);
17341
18010
  return { loaded: toolNames2.length, tools: toolNames2, alreadyLoaded: true };
17342
18011
  }
17343
- 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) {
17344
18014
  return {
17345
18015
  error: `Maximum loaded categories (${this._config.maxLoadedCategories}) reached. Unload a category first.`,
17346
18016
  loaded: Array.from(this._loadedCategories.keys())
17347
18017
  };
17348
18018
  }
17349
- const isConnector = ToolCatalogRegistry.parseConnectorCategory(category) !== null;
17350
18019
  let tools;
17351
18020
  if (isConnector) {
17352
18021
  tools = ToolCatalogRegistry.resolveConnectorCategoryTools(category);
@@ -17383,6 +18052,9 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17383
18052
  if (!this._toolManager) {
17384
18053
  return { error: "ToolManager not connected." };
17385
18054
  }
18055
+ if (this._pinnedCategories.has(category)) {
18056
+ return { error: `Category '${category}' is pinned and cannot be unloaded.` };
18057
+ }
17386
18058
  const toolNames = this._loadedCategories.get(category);
17387
18059
  if (!toolNames) {
17388
18060
  return { unloaded: 0, message: `Category '${category}' is not loaded.` };
@@ -17408,6 +18080,61 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17408
18080
  getConnectorCategories() {
17409
18081
  return this._connectorCategories ?? [];
17410
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
+ }
17411
18138
  keywordSearch(query) {
17412
18139
  const lq = query.toLowerCase();
17413
18140
  const results = [];
@@ -17445,12 +18172,17 @@ var ToolCatalogPluginNextGen = class extends BasePluginNextGen {
17445
18172
  return { query, results, totalMatches: results.length };
17446
18173
  }
17447
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
+ }
17448
18179
  const connectorName = ToolCatalogRegistry.parseConnectorCategory(category);
17449
18180
  const tools = ToolCatalogRegistry.resolveConnectorCategoryTools(category);
17450
18181
  const loaded = this._loadedCategories.has(category);
17451
18182
  return {
17452
18183
  category,
17453
18184
  loaded,
18185
+ pinned: this._pinnedCategories.has(category),
17454
18186
  connectorName,
17455
18187
  tools: tools.map((t) => ({
17456
18188
  name: t.name,
@@ -20537,9 +21269,17 @@ var OpenAITextProvider = class extends BaseTextProvider {
20537
21269
  ...options.metadata && { metadata: options.metadata }
20538
21270
  };
20539
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();
20540
21276
  const response = await this.client.responses.create(params);
21277
+ console.log(
21278
+ `[OpenAITextProvider] generate: response received (${Date.now() - genStartTime}ms)`
21279
+ );
20541
21280
  return this.converter.convertResponse(response);
20542
21281
  } catch (error) {
21282
+ console.error(`[OpenAITextProvider] generate error (model=${options.model}):`, error.message || error);
20543
21283
  this.handleError(error, options.model);
20544
21284
  throw error;
20545
21285
  }
@@ -20579,9 +21319,27 @@ var OpenAITextProvider = class extends BaseTextProvider {
20579
21319
  stream: true
20580
21320
  };
20581
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();
20582
21326
  const stream = await this.client.responses.create(params);
20583
- 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
+ );
20584
21338
  } catch (error) {
21339
+ console.error(
21340
+ `[OpenAITextProvider] streamGenerate error (model=${options.model}):`,
21341
+ error.message || error
21342
+ );
20585
21343
  this.handleError(error, options.model);
20586
21344
  throw error;
20587
21345
  }
@@ -21587,12 +22345,20 @@ var AnthropicTextProvider = class extends BaseTextProvider {
21587
22345
  return this.executeWithCircuitBreaker(async () => {
21588
22346
  try {
21589
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();
21590
22352
  const anthropicResponse = await this.client.messages.create({
21591
22353
  ...anthropicRequest,
21592
22354
  stream: false
21593
22355
  });
22356
+ console.log(
22357
+ `[AnthropicTextProvider] generate: response received (${Date.now() - genStartTime}ms)`
22358
+ );
21594
22359
  return this.converter.convertResponse(anthropicResponse);
21595
22360
  } catch (error) {
22361
+ console.error(`[AnthropicTextProvider] generate error (model=${options.model}):`, error.message || error);
21596
22362
  this.handleError(error, options.model);
21597
22363
  throw error;
21598
22364
  }
@@ -21604,13 +22370,31 @@ var AnthropicTextProvider = class extends BaseTextProvider {
21604
22370
  async *streamGenerate(options) {
21605
22371
  try {
21606
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();
21607
22377
  const stream = await this.client.messages.create({
21608
22378
  ...anthropicRequest,
21609
22379
  stream: true
21610
22380
  });
22381
+ console.log(
22382
+ `[AnthropicTextProvider] streamGenerate: Anthropic stream opened (${Date.now() - streamStartTime}ms)`
22383
+ );
21611
22384
  this.streamConverter.reset();
21612
- 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
+ );
21613
22393
  } catch (error) {
22394
+ console.error(
22395
+ `[AnthropicTextProvider] streamGenerate error (model=${options.model}):`,
22396
+ error.message || error
22397
+ );
21614
22398
  this.handleError(error, options.model);
21615
22399
  throw error;
21616
22400
  } finally {
@@ -22404,6 +23188,10 @@ var GoogleTextProvider = class extends BaseTextProvider {
22404
23188
  // First message only
22405
23189
  }, null, 2));
22406
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();
22407
23195
  const result = await this.client.models.generateContent({
22408
23196
  model: options.model,
22409
23197
  contents: googleRequest.contents,
@@ -22414,6 +23202,9 @@ var GoogleTextProvider = class extends BaseTextProvider {
22414
23202
  ...googleRequest.generationConfig
22415
23203
  }
22416
23204
  });
23205
+ console.log(
23206
+ `[GoogleTextProvider] generate: response received (${Date.now() - genStartTime}ms)`
23207
+ );
22417
23208
  if (process.env.DEBUG_GOOGLE) {
22418
23209
  console.error("[DEBUG] Google Response:", JSON.stringify({
22419
23210
  candidates: result.candidates?.map((c) => ({
@@ -22432,6 +23223,7 @@ var GoogleTextProvider = class extends BaseTextProvider {
22432
23223
  }
22433
23224
  return response;
22434
23225
  } catch (error) {
23226
+ console.error(`[GoogleTextProvider] generate error (model=${options.model}):`, error.message || error);
22435
23227
  this.converter.clearMappings();
22436
23228
  this.handleError(error, options.model);
22437
23229
  throw error;
@@ -22444,6 +23236,10 @@ var GoogleTextProvider = class extends BaseTextProvider {
22444
23236
  async *streamGenerate(options) {
22445
23237
  try {
22446
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();
22447
23243
  const stream = await this.client.models.generateContentStream({
22448
23244
  model: options.model,
22449
23245
  contents: googleRequest.contents,
@@ -22454,13 +23250,27 @@ var GoogleTextProvider = class extends BaseTextProvider {
22454
23250
  ...googleRequest.generationConfig
22455
23251
  }
22456
23252
  });
23253
+ console.log(
23254
+ `[GoogleTextProvider] streamGenerate: Google stream opened (${Date.now() - streamStartTime}ms)`
23255
+ );
22457
23256
  this.streamConverter.reset();
22458
- 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
+ );
22459
23265
  if (!this.streamConverter.hasToolCalls()) {
22460
23266
  this.converter.clearMappings();
22461
23267
  this.streamConverter.clear();
22462
23268
  }
22463
23269
  } catch (error) {
23270
+ console.error(
23271
+ `[GoogleTextProvider] streamGenerate error (model=${options.model}):`,
23272
+ error.message || error
23273
+ );
22464
23274
  this.converter.clearMappings();
22465
23275
  this.streamConverter.clear();
22466
23276
  this.handleError(error, options.model);
@@ -22547,6 +23357,10 @@ var VertexAITextProvider = class extends BaseTextProvider {
22547
23357
  async generate(options) {
22548
23358
  try {
22549
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();
22550
23364
  const result = await this.client.models.generateContent({
22551
23365
  model: options.model,
22552
23366
  contents: googleRequest.contents,
@@ -22557,8 +23371,12 @@ var VertexAITextProvider = class extends BaseTextProvider {
22557
23371
  ...googleRequest.generationConfig
22558
23372
  }
22559
23373
  });
23374
+ console.log(
23375
+ `[VertexAITextProvider] generate: response received (${Date.now() - genStartTime}ms)`
23376
+ );
22560
23377
  return this.converter.convertResponse(result);
22561
23378
  } catch (error) {
23379
+ console.error(`[VertexAITextProvider] generate error (model=${options.model}):`, error.message || error);
22562
23380
  this.handleError(error, options.model);
22563
23381
  throw error;
22564
23382
  }
@@ -22569,6 +23387,10 @@ var VertexAITextProvider = class extends BaseTextProvider {
22569
23387
  async *streamGenerate(options) {
22570
23388
  try {
22571
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();
22572
23394
  const stream = await this.client.models.generateContentStream({
22573
23395
  model: options.model,
22574
23396
  contents: googleRequest.contents,
@@ -22579,9 +23401,23 @@ var VertexAITextProvider = class extends BaseTextProvider {
22579
23401
  ...googleRequest.generationConfig
22580
23402
  }
22581
23403
  });
23404
+ console.log(
23405
+ `[VertexAITextProvider] streamGenerate: Vertex AI stream opened (${Date.now() - streamStartTime}ms)`
23406
+ );
22582
23407
  const streamConverter = new GoogleStreamConverter();
22583
- 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
+ );
22584
23416
  } catch (error) {
23417
+ console.error(
23418
+ `[VertexAITextProvider] streamGenerate error (model=${options.model}):`,
23419
+ error.message || error
23420
+ );
22585
23421
  this.handleError(error, options.model);
22586
23422
  throw error;
22587
23423
  }
@@ -24522,6 +25358,20 @@ var Agent = class _Agent extends BaseAgent {
24522
25358
  timestamp: /* @__PURE__ */ new Date(),
24523
25359
  duration: totalDuration
24524
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
+ }
24525
25375
  const duration = Date.now() - startTime;
24526
25376
  this._logger.info({ duration }, `Agent ${methodName} completed`);
24527
25377
  exports.metrics.timing(`agent.${methodName}.duration`, duration, { model: this.model, connector: this.connector.name });
@@ -24576,6 +25426,17 @@ var Agent = class _Agent extends BaseAgent {
24576
25426
  }
24577
25427
  const iterationStartTime = Date.now();
24578
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
+ );
24579
25440
  const response = await this.generateWithHooks(prepared.input, iteration, executionId);
24580
25441
  const toolCalls = this.extractToolCalls(response.output);
24581
25442
  this._agentContext.addAssistantResponse(response.output);
@@ -24690,13 +25551,23 @@ var Agent = class _Agent extends BaseAgent {
24690
25551
  * Build placeholder response for streaming finalization
24691
25552
  */
24692
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
+ }
24693
25563
  return {
24694
25564
  id: executionId,
24695
25565
  object: "response",
24696
25566
  created_at: Math.floor(startTime / 1e3),
24697
25567
  status: "completed",
24698
25568
  model: this.model,
24699
- output: [],
25569
+ output,
25570
+ output_text: outputText || void 0,
24700
25571
  usage: streamState.usage
24701
25572
  };
24702
25573
  }
@@ -24716,6 +25587,17 @@ var Agent = class _Agent extends BaseAgent {
24716
25587
  break;
24717
25588
  }
24718
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
+ );
24719
25601
  const iterationStreamState = new StreamState(executionId, this.model);
24720
25602
  const toolCallsMap = /* @__PURE__ */ new Map();
24721
25603
  yield* this.streamGenerateWithHooks(
@@ -33986,13 +34868,13 @@ var TTS_MODEL_REGISTRY = {
33986
34868
  name: "gemini-2.5-flash-preview-tts",
33987
34869
  displayName: "Gemini 2.5 Flash TTS",
33988
34870
  provider: Vendor.Google,
33989
- 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",
33990
34872
  isActive: true,
33991
34873
  releaseDate: "2025-01-01",
33992
34874
  sources: {
33993
34875
  documentation: "https://ai.google.dev/gemini-api/docs/speech-generation",
33994
34876
  pricing: "https://ai.google.dev/pricing",
33995
- lastVerified: "2026-01-25"
34877
+ lastVerified: "2026-03-04"
33996
34878
  },
33997
34879
  capabilities: {
33998
34880
  voices: GEMINI_VOICES,
@@ -34011,20 +34893,27 @@ var TTS_MODEL_REGISTRY = {
34011
34893
  wordTimestamps: false
34012
34894
  },
34013
34895
  limits: { maxInputLength: 32e3 }
34014
- // 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"
34015
34904
  }
34016
34905
  },
34017
34906
  "gemini-2.5-pro-preview-tts": {
34018
34907
  name: "gemini-2.5-pro-preview-tts",
34019
34908
  displayName: "Gemini 2.5 Pro TTS",
34020
34909
  provider: Vendor.Google,
34021
- 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",
34022
34911
  isActive: true,
34023
34912
  releaseDate: "2025-01-01",
34024
34913
  sources: {
34025
34914
  documentation: "https://ai.google.dev/gemini-api/docs/speech-generation",
34026
34915
  pricing: "https://ai.google.dev/pricing",
34027
- lastVerified: "2026-01-25"
34916
+ lastVerified: "2026-03-04"
34028
34917
  },
34029
34918
  capabilities: {
34030
34919
  voices: GEMINI_VOICES,
@@ -34043,7 +34932,14 @@ var TTS_MODEL_REGISTRY = {
34043
34932
  wordTimestamps: false
34044
34933
  },
34045
34934
  limits: { maxInputLength: 32e3 }
34046
- // 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"
34047
34943
  }
34048
34944
  }
34049
34945
  };
@@ -34056,10 +34952,18 @@ function getTTSModelsWithFeature(feature) {
34056
34952
  (model) => model.isActive && model.capabilities.features[feature]
34057
34953
  );
34058
34954
  }
34059
- function calculateTTSCost(modelName, characterCount) {
34955
+ function calculateTTSCost(modelName, characterCount, options) {
34060
34956
  const model = getTTSModelInfo(modelName);
34061
34957
  if (!model?.pricing) return null;
34062
- 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;
34063
34967
  }
34064
34968
  var TextToSpeech = class _TextToSpeech {
34065
34969
  provider;
@@ -35505,7 +36409,13 @@ var IMAGE_MODELS = {
35505
36409
  /** Imagen 4.0 Ultra: Highest quality */
35506
36410
  IMAGEN_4_ULTRA: "imagen-4.0-ultra-generate-001",
35507
36411
  /** Imagen 4.0 Fast: Optimized for speed */
35508
- 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"
35509
36419
  },
35510
36420
  [Vendor.Grok]: {
35511
36421
  /** Grok Imagine Image: xAI image generation with editing support */
@@ -35689,7 +36599,7 @@ var IMAGE_MODEL_REGISTRY = {
35689
36599
  sources: {
35690
36600
  documentation: "https://ai.google.dev/gemini-api/docs/imagen",
35691
36601
  pricing: "https://ai.google.dev/pricing",
35692
- lastVerified: "2026-01-25"
36602
+ lastVerified: "2026-03-04"
35693
36603
  },
35694
36604
  capabilities: {
35695
36605
  sizes: ["1024x1024"],
@@ -35800,7 +36710,7 @@ var IMAGE_MODEL_REGISTRY = {
35800
36710
  sources: {
35801
36711
  documentation: "https://ai.google.dev/gemini-api/docs/imagen",
35802
36712
  pricing: "https://ai.google.dev/pricing",
35803
- lastVerified: "2026-01-25"
36713
+ lastVerified: "2026-03-04"
35804
36714
  },
35805
36715
  capabilities: {
35806
36716
  sizes: ["1024x1024"],
@@ -35897,7 +36807,8 @@ var IMAGE_MODEL_REGISTRY = {
35897
36807
  }
35898
36808
  },
35899
36809
  pricing: {
35900
- perImage: 0.08,
36810
+ perImage: 0.06,
36811
+ // Updated per official pricing page (was $0.08)
35901
36812
  currency: "USD"
35902
36813
  }
35903
36814
  },
@@ -35911,7 +36822,7 @@ var IMAGE_MODEL_REGISTRY = {
35911
36822
  sources: {
35912
36823
  documentation: "https://ai.google.dev/gemini-api/docs/imagen",
35913
36824
  pricing: "https://ai.google.dev/pricing",
35914
- lastVerified: "2026-01-25"
36825
+ lastVerified: "2026-03-04"
35915
36826
  },
35916
36827
  capabilities: {
35917
36828
  sizes: ["1024x1024"],
@@ -36012,6 +36923,141 @@ var IMAGE_MODEL_REGISTRY = {
36012
36923
  currency: "USD"
36013
36924
  }
36014
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
+ },
36015
37061
  // ======================== xAI Grok ========================
36016
37062
  "grok-imagine-image": {
36017
37063
  name: "grok-imagine-image",
@@ -36023,11 +37069,11 @@ var IMAGE_MODEL_REGISTRY = {
36023
37069
  sources: {
36024
37070
  documentation: "https://docs.x.ai/docs/guides/image-generation",
36025
37071
  pricing: "https://docs.x.ai/docs/models",
36026
- lastVerified: "2026-02-01"
37072
+ lastVerified: "2026-03-04"
36027
37073
  },
36028
37074
  capabilities: {
36029
37075
  sizes: ["1024x1024"],
36030
- 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"],
36031
37077
  maxImagesPerRequest: 10,
36032
37078
  outputFormats: ["png", "jpeg"],
36033
37079
  features: {
@@ -37283,9 +38329,9 @@ var OPENAI_SOURCES = {
37283
38329
  lastVerified: "2026-01-25"
37284
38330
  };
37285
38331
  var GOOGLE_SOURCES = {
37286
- documentation: "https://docs.cloud.google.com/vertex-ai/generative-ai/docs/video/overview",
37287
- apiReference: "https://docs.cloud.google.com/vertex-ai/generative-ai/docs/model-reference/veo-video-generation",
37288
- 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"
37289
38335
  };
37290
38336
  var GROK_SOURCES = {
37291
38337
  documentation: "https://docs.x.ai/docs/guides/video-generations",
@@ -37359,14 +38405,16 @@ var VIDEO_MODEL_REGISTRY = {
37359
38405
  sources: GOOGLE_SOURCES,
37360
38406
  capabilities: {
37361
38407
  durations: [5, 6, 7, 8],
37362
- resolutions: [],
37363
- // Veo 2.0 uses aspectRatio only, no resolution control
38408
+ resolutions: ["720p"],
38409
+ // Veo 2 only supports 720p
37364
38410
  aspectRatios: ["16:9", "9:16"],
37365
38411
  maxFps: 24,
37366
38412
  audio: false,
37367
- imageToVideo: true,
38413
+ imageToVideo: false,
38414
+ // Veo 2 does not support reference images
37368
38415
  videoExtension: false,
37369
38416
  frameControl: true,
38417
+ // First/last frame interpolation supported
37370
38418
  features: {
37371
38419
  upscaling: false,
37372
38420
  styleControl: false,
@@ -37375,7 +38423,8 @@ var VIDEO_MODEL_REGISTRY = {
37375
38423
  }
37376
38424
  },
37377
38425
  pricing: {
37378
- perSecond: 0.03,
38426
+ perSecond: 0.35,
38427
+ // Updated per official pricing page (was $0.03)
37379
38428
  currency: "USD"
37380
38429
  }
37381
38430
  },
@@ -37387,14 +38436,18 @@ var VIDEO_MODEL_REGISTRY = {
37387
38436
  sources: GOOGLE_SOURCES,
37388
38437
  capabilities: {
37389
38438
  durations: [4, 6, 8],
37390
- resolutions: ["720p"],
37391
- // Fast model only supports 720p
38439
+ resolutions: ["720p", "1080p", "4k"],
38440
+ // 1080p/4k require 8s duration
37392
38441
  aspectRatios: ["16:9", "9:16"],
37393
38442
  maxFps: 24,
37394
38443
  audio: true,
38444
+ // Native audio generation
37395
38445
  imageToVideo: true,
37396
- videoExtension: false,
37397
- frameControl: false,
38446
+ // Up to 3 reference images
38447
+ videoExtension: true,
38448
+ // Supported (720p only)
38449
+ frameControl: true,
38450
+ // First/last frame interpolation
37398
38451
  features: {
37399
38452
  upscaling: false,
37400
38453
  styleControl: false,
@@ -37403,7 +38456,8 @@ var VIDEO_MODEL_REGISTRY = {
37403
38456
  }
37404
38457
  },
37405
38458
  pricing: {
37406
- perSecond: 0.75,
38459
+ perSecond: 0.15,
38460
+ // $0.15 for 720p/1080p, $0.35 for 4K
37407
38461
  currency: "USD"
37408
38462
  }
37409
38463
  },
@@ -37420,8 +38474,11 @@ var VIDEO_MODEL_REGISTRY = {
37420
38474
  aspectRatios: ["16:9", "9:16"],
37421
38475
  maxFps: 30,
37422
38476
  audio: true,
38477
+ // Native audio generation
37423
38478
  imageToVideo: true,
38479
+ // Up to 3 reference images
37424
38480
  videoExtension: true,
38481
+ // Supported (720p only)
37425
38482
  frameControl: true,
37426
38483
  features: {
37427
38484
  upscaling: true,
@@ -37431,7 +38488,8 @@ var VIDEO_MODEL_REGISTRY = {
37431
38488
  }
37432
38489
  },
37433
38490
  pricing: {
37434
- perSecond: 0.75,
38491
+ perSecond: 0.4,
38492
+ // $0.40 for 720p/1080p, $0.60 for 4K
37435
38493
  currency: "USD"
37436
38494
  }
37437
38495
  },
@@ -42334,6 +43392,14 @@ var SERVICE_DEFINITIONS = [
42334
43392
  baseURL: "https://aws.amazon.com",
42335
43393
  docsURL: "https://docs.aws.amazon.com/"
42336
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
+ },
42337
43403
  // ============ Storage ============
42338
43404
  {
42339
43405
  id: "dropbox",
@@ -42377,6 +43443,14 @@ var SERVICE_DEFINITIONS = [
42377
43443
  baseURL: "https://api.postmarkapp.com",
42378
43444
  docsURL: "https://postmarkapp.com/developer"
42379
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
+ },
42380
43454
  // ============ Monitoring & Observability ============
42381
43455
  {
42382
43456
  id: "datadog",
@@ -45116,6 +46190,43 @@ var awsTemplate = {
45116
46190
  ]
45117
46191
  };
45118
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
+
45119
46230
  // src/connectors/vendors/templates/dropbox.ts
45120
46231
  var dropboxTemplate = {
45121
46232
  id: "dropbox",
@@ -45304,6 +46415,30 @@ var postmarkTemplate = {
45304
46415
  }
45305
46416
  ]
45306
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
+ };
45307
46442
 
45308
46443
  // src/connectors/vendors/templates/monitoring.ts
45309
46444
  var datadogTemplate = {
@@ -45752,6 +46887,7 @@ var allVendorTemplates = [
45752
46887
  rampTemplate,
45753
46888
  // Cloud
45754
46889
  awsTemplate,
46890
+ cloudflareTemplate,
45755
46891
  // Storage
45756
46892
  dropboxTemplate,
45757
46893
  boxTemplate,
@@ -45759,6 +46895,7 @@ var allVendorTemplates = [
45759
46895
  sendgridTemplate,
45760
46896
  mailchimpTemplate,
45761
46897
  postmarkTemplate,
46898
+ mailgunTemplate,
45762
46899
  // Monitoring
45763
46900
  datadogTemplate,
45764
46901
  pagerdutyTemplate,
@@ -49116,7 +50253,8 @@ SANDBOX API:
49116
50253
  4. connectors.get(name) \u2014 Connector info: { displayName, description, baseURL, serviceType }
49117
50254
 
49118
50255
  VARIABLES:
49119
- \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.
49120
50258
  \u2022 output \u2014 SET THIS to return your result to the caller
49121
50259
 
49122
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
@@ -49139,7 +50277,8 @@ const resp = await authenticatedFetch('/chat.postMessage', {
49139
50277
  }, 'slack');
49140
50278
  output = await resp.json();
49141
50279
  ${accountIdExamples}
49142
- // 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}] } }
49143
50282
  const items = input.data;
49144
50283
  output = items.filter(i => i.score > 0.8).sort((a, b) => b.score - a.score);
49145
50284
 
@@ -49163,7 +50302,7 @@ function createExecuteJavaScriptTool(options) {
49163
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 () => { ... })().'
49164
50303
  },
49165
50304
  input: {
49166
- 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}}"}.'
49167
50306
  },
49168
50307
  timeout: {
49169
50308
  type: "number",
@@ -49186,9 +50325,19 @@ function createExecuteJavaScriptTool(options) {
49186
50325
  try {
49187
50326
  const timeout = Math.min(Math.max(args.timeout || defaultTimeout, 0), maxTimeout);
49188
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
+ }
49189
50338
  const result = await executeInVM(
49190
50339
  args.code,
49191
- args.input,
50340
+ resolvedInput,
49192
50341
  timeout,
49193
50342
  logs,
49194
50343
  context?.userId,