@roo-code/types 1.54.0 → 1.56.0

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
@@ -57,6 +57,7 @@ __export(index_exports, {
57
57
  LITELLM_COMPUTER_USE_MODELS: () => LITELLM_COMPUTER_USE_MODELS,
58
58
  LMSTUDIO_DEFAULT_TEMPERATURE: () => LMSTUDIO_DEFAULT_TEMPERATURE,
59
59
  MISTRAL_DEFAULT_TEMPERATURE: () => MISTRAL_DEFAULT_TEMPERATURE,
60
+ MODELS_BY_PROVIDER: () => MODELS_BY_PROVIDER,
60
61
  MODEL_ID_KEYS: () => MODEL_ID_KEYS,
61
62
  MOONSHOT_DEFAULT_TEMPERATURE: () => MOONSHOT_DEFAULT_TEMPERATURE,
62
63
  OPENAI_AZURE_AI_INFERENCE_PATH: () => OPENAI_AZURE_AI_INFERENCE_PATH,
@@ -69,6 +70,7 @@ __export(index_exports, {
69
70
  PROVIDER_SETTINGS_KEYS: () => PROVIDER_SETTINGS_KEYS,
70
71
  RooCodeEventName: () => RooCodeEventName,
71
72
  SECRET_STATE_KEYS: () => SECRET_STATE_KEYS,
73
+ SINGLE_FILE_READ_MODELS: () => SINGLE_FILE_READ_MODELS,
72
74
  TaskCommandName: () => TaskCommandName,
73
75
  TaskStatus: () => TaskStatus,
74
76
  TelemetryEventName: () => TelemetryEventName,
@@ -115,7 +117,8 @@ __export(index_exports, {
115
117
  experimentIds: () => experimentIds,
116
118
  experimentIdsSchema: () => experimentIdsSchema,
117
119
  experimentsSchema: () => experimentsSchema,
118
- extendedReasoningEffortsSchema: () => extendedReasoningEffortsSchema,
120
+ featherlessDefaultModelId: () => featherlessDefaultModelId,
121
+ featherlessModels: () => featherlessModels,
119
122
  fireworksDefaultModelId: () => fireworksDefaultModelId,
120
123
  fireworksModels: () => fireworksModels,
121
124
  followUpDataSchema: () => followUpDataSchema,
@@ -186,6 +189,7 @@ __export(index_exports, {
186
189
  providerSettingsSchema: () => providerSettingsSchema,
187
190
  providerSettingsSchemaDiscriminated: () => providerSettingsSchemaDiscriminated,
188
191
  providerSettingsWithIdSchema: () => providerSettingsWithIdSchema,
192
+ reasoningEffortWithMinimalSchema: () => reasoningEffortWithMinimalSchema,
189
193
  reasoningEfforts: () => reasoningEfforts,
190
194
  reasoningEffortsSchema: () => reasoningEffortsSchema,
191
195
  requestyDefaultModelId: () => requestyDefaultModelId,
@@ -198,6 +202,7 @@ __export(index_exports, {
198
202
  rooModels: () => rooModels,
199
203
  sambaNovaDefaultModelId: () => sambaNovaDefaultModelId,
200
204
  sambaNovaModels: () => sambaNovaModels,
205
+ shouldUseSingleFileRead: () => shouldUseSingleFileRead,
201
206
  staticAppPropertiesSchema: () => staticAppPropertiesSchema,
202
207
  suggestionItemSchema: () => suggestionItemSchema,
203
208
  taskCommandSchema: () => taskCommandSchema,
@@ -617,6 +622,7 @@ var import_zod8 = require("zod");
617
622
  var import_zod7 = require("zod");
618
623
  var reasoningEfforts = ["low", "medium", "high"];
619
624
  var reasoningEffortsSchema = import_zod7.z.enum(reasoningEfforts);
625
+ var reasoningEffortWithMinimalSchema = import_zod7.z.union([reasoningEffortsSchema, import_zod7.z.literal("minimal")]);
620
626
  var verbosityLevels = ["low", "medium", "high"];
621
627
  var verbosityLevelsSchema = import_zod7.z.enum(verbosityLevels);
622
628
  var modelParameters = ["max_tokens", "temperature", "reasoning", "include_reasoning"];
@@ -655,1076 +661,6 @@ var modelInfoSchema = import_zod7.z.object({
655
661
  ).optional()
656
662
  });
657
663
 
658
- // src/provider-settings.ts
659
- var BEDROCK_CLAUDE_SONNET_4_MODEL_ID = "anthropic.claude-sonnet-4-20250514-v1:0";
660
- var extendedReasoningEffortsSchema = import_zod8.z.union([reasoningEffortsSchema, import_zod8.z.literal("minimal")]);
661
- var providerNames = [
662
- "anthropic",
663
- "claude-code",
664
- "glama",
665
- "openrouter",
666
- "bedrock",
667
- "vertex",
668
- "openai",
669
- "ollama",
670
- "vscode-lm",
671
- "lmstudio",
672
- "gemini",
673
- "gemini-cli",
674
- "openai-native",
675
- "mistral",
676
- "moonshot",
677
- "deepseek",
678
- "doubao",
679
- "unbound",
680
- "requesty",
681
- "human-relay",
682
- "fake-ai",
683
- "xai",
684
- "groq",
685
- "chutes",
686
- "litellm",
687
- "huggingface",
688
- "cerebras",
689
- "sambanova",
690
- "zai",
691
- "fireworks",
692
- "io-intelligence",
693
- "roo"
694
- ];
695
- var providerNamesSchema = import_zod8.z.enum(providerNames);
696
- var providerSettingsEntrySchema = import_zod8.z.object({
697
- id: import_zod8.z.string(),
698
- name: import_zod8.z.string(),
699
- apiProvider: providerNamesSchema.optional()
700
- });
701
- var DEFAULT_CONSECUTIVE_MISTAKE_LIMIT = 3;
702
- var baseProviderSettingsSchema = import_zod8.z.object({
703
- includeMaxTokens: import_zod8.z.boolean().optional(),
704
- diffEnabled: import_zod8.z.boolean().optional(),
705
- todoListEnabled: import_zod8.z.boolean().optional(),
706
- fuzzyMatchThreshold: import_zod8.z.number().optional(),
707
- modelTemperature: import_zod8.z.number().nullish(),
708
- rateLimitSeconds: import_zod8.z.number().optional(),
709
- consecutiveMistakeLimit: import_zod8.z.number().min(0).optional(),
710
- // Model reasoning.
711
- enableReasoningEffort: import_zod8.z.boolean().optional(),
712
- reasoningEffort: extendedReasoningEffortsSchema.optional(),
713
- modelMaxTokens: import_zod8.z.number().optional(),
714
- modelMaxThinkingTokens: import_zod8.z.number().optional(),
715
- // Model verbosity.
716
- verbosity: verbosityLevelsSchema.optional()
717
- });
718
- var apiModelIdProviderModelSchema = baseProviderSettingsSchema.extend({
719
- apiModelId: import_zod8.z.string().optional()
720
- });
721
- var anthropicSchema = apiModelIdProviderModelSchema.extend({
722
- apiKey: import_zod8.z.string().optional(),
723
- anthropicBaseUrl: import_zod8.z.string().optional(),
724
- anthropicUseAuthToken: import_zod8.z.boolean().optional(),
725
- anthropicBeta1MContext: import_zod8.z.boolean().optional()
726
- // Enable 'context-1m-2025-08-07' beta for 1M context window
727
- });
728
- var claudeCodeSchema = apiModelIdProviderModelSchema.extend({
729
- claudeCodePath: import_zod8.z.string().optional(),
730
- claudeCodeMaxOutputTokens: import_zod8.z.number().int().min(1).max(2e5).optional()
731
- });
732
- var glamaSchema = baseProviderSettingsSchema.extend({
733
- glamaModelId: import_zod8.z.string().optional(),
734
- glamaApiKey: import_zod8.z.string().optional()
735
- });
736
- var openRouterSchema = baseProviderSettingsSchema.extend({
737
- openRouterApiKey: import_zod8.z.string().optional(),
738
- openRouterModelId: import_zod8.z.string().optional(),
739
- openRouterBaseUrl: import_zod8.z.string().optional(),
740
- openRouterSpecificProvider: import_zod8.z.string().optional(),
741
- openRouterUseMiddleOutTransform: import_zod8.z.boolean().optional()
742
- });
743
- var bedrockSchema = apiModelIdProviderModelSchema.extend({
744
- awsAccessKey: import_zod8.z.string().optional(),
745
- awsSecretKey: import_zod8.z.string().optional(),
746
- awsSessionToken: import_zod8.z.string().optional(),
747
- awsRegion: import_zod8.z.string().optional(),
748
- awsUseCrossRegionInference: import_zod8.z.boolean().optional(),
749
- awsUsePromptCache: import_zod8.z.boolean().optional(),
750
- awsProfile: import_zod8.z.string().optional(),
751
- awsUseProfile: import_zod8.z.boolean().optional(),
752
- awsApiKey: import_zod8.z.string().optional(),
753
- awsUseApiKey: import_zod8.z.boolean().optional(),
754
- awsCustomArn: import_zod8.z.string().optional(),
755
- awsModelContextWindow: import_zod8.z.number().optional(),
756
- awsBedrockEndpointEnabled: import_zod8.z.boolean().optional(),
757
- awsBedrockEndpoint: import_zod8.z.string().optional(),
758
- awsBedrock1MContext: import_zod8.z.boolean().optional()
759
- // Enable 'context-1m-2025-08-07' beta for 1M context window
760
- });
761
- var vertexSchema = apiModelIdProviderModelSchema.extend({
762
- vertexKeyFile: import_zod8.z.string().optional(),
763
- vertexJsonCredentials: import_zod8.z.string().optional(),
764
- vertexProjectId: import_zod8.z.string().optional(),
765
- vertexRegion: import_zod8.z.string().optional()
766
- });
767
- var openAiSchema = baseProviderSettingsSchema.extend({
768
- openAiBaseUrl: import_zod8.z.string().optional(),
769
- openAiApiKey: import_zod8.z.string().optional(),
770
- openAiLegacyFormat: import_zod8.z.boolean().optional(),
771
- openAiR1FormatEnabled: import_zod8.z.boolean().optional(),
772
- openAiModelId: import_zod8.z.string().optional(),
773
- openAiCustomModelInfo: modelInfoSchema.nullish(),
774
- openAiUseAzure: import_zod8.z.boolean().optional(),
775
- azureApiVersion: import_zod8.z.string().optional(),
776
- openAiStreamingEnabled: import_zod8.z.boolean().optional(),
777
- openAiHostHeader: import_zod8.z.string().optional(),
778
- // Keep temporarily for backward compatibility during migration.
779
- openAiHeaders: import_zod8.z.record(import_zod8.z.string(), import_zod8.z.string()).optional()
780
- });
781
- var ollamaSchema = baseProviderSettingsSchema.extend({
782
- ollamaModelId: import_zod8.z.string().optional(),
783
- ollamaBaseUrl: import_zod8.z.string().optional()
784
- });
785
- var vsCodeLmSchema = baseProviderSettingsSchema.extend({
786
- vsCodeLmModelSelector: import_zod8.z.object({
787
- vendor: import_zod8.z.string().optional(),
788
- family: import_zod8.z.string().optional(),
789
- version: import_zod8.z.string().optional(),
790
- id: import_zod8.z.string().optional()
791
- }).optional()
792
- });
793
- var lmStudioSchema = baseProviderSettingsSchema.extend({
794
- lmStudioModelId: import_zod8.z.string().optional(),
795
- lmStudioBaseUrl: import_zod8.z.string().optional(),
796
- lmStudioDraftModelId: import_zod8.z.string().optional(),
797
- lmStudioSpeculativeDecodingEnabled: import_zod8.z.boolean().optional()
798
- });
799
- var geminiSchema = apiModelIdProviderModelSchema.extend({
800
- geminiApiKey: import_zod8.z.string().optional(),
801
- googleGeminiBaseUrl: import_zod8.z.string().optional(),
802
- enableUrlContext: import_zod8.z.boolean().optional(),
803
- enableGrounding: import_zod8.z.boolean().optional()
804
- });
805
- var geminiCliSchema = apiModelIdProviderModelSchema.extend({
806
- geminiCliOAuthPath: import_zod8.z.string().optional(),
807
- geminiCliProjectId: import_zod8.z.string().optional()
808
- });
809
- var openAiNativeSchema = apiModelIdProviderModelSchema.extend({
810
- openAiNativeApiKey: import_zod8.z.string().optional(),
811
- openAiNativeBaseUrl: import_zod8.z.string().optional()
812
- });
813
- var mistralSchema = apiModelIdProviderModelSchema.extend({
814
- mistralApiKey: import_zod8.z.string().optional(),
815
- mistralCodestralUrl: import_zod8.z.string().optional()
816
- });
817
- var deepSeekSchema = apiModelIdProviderModelSchema.extend({
818
- deepSeekBaseUrl: import_zod8.z.string().optional(),
819
- deepSeekApiKey: import_zod8.z.string().optional()
820
- });
821
- var doubaoSchema = apiModelIdProviderModelSchema.extend({
822
- doubaoBaseUrl: import_zod8.z.string().optional(),
823
- doubaoApiKey: import_zod8.z.string().optional()
824
- });
825
- var moonshotSchema = apiModelIdProviderModelSchema.extend({
826
- moonshotBaseUrl: import_zod8.z.union([import_zod8.z.literal("https://api.moonshot.ai/v1"), import_zod8.z.literal("https://api.moonshot.cn/v1")]).optional(),
827
- moonshotApiKey: import_zod8.z.string().optional()
828
- });
829
- var unboundSchema = baseProviderSettingsSchema.extend({
830
- unboundApiKey: import_zod8.z.string().optional(),
831
- unboundModelId: import_zod8.z.string().optional()
832
- });
833
- var requestySchema = baseProviderSettingsSchema.extend({
834
- requestyBaseUrl: import_zod8.z.string().optional(),
835
- requestyApiKey: import_zod8.z.string().optional(),
836
- requestyModelId: import_zod8.z.string().optional()
837
- });
838
- var humanRelaySchema = baseProviderSettingsSchema;
839
- var fakeAiSchema = baseProviderSettingsSchema.extend({
840
- fakeAi: import_zod8.z.unknown().optional()
841
- });
842
- var xaiSchema = apiModelIdProviderModelSchema.extend({
843
- xaiApiKey: import_zod8.z.string().optional()
844
- });
845
- var groqSchema = apiModelIdProviderModelSchema.extend({
846
- groqApiKey: import_zod8.z.string().optional()
847
- });
848
- var huggingFaceSchema = baseProviderSettingsSchema.extend({
849
- huggingFaceApiKey: import_zod8.z.string().optional(),
850
- huggingFaceModelId: import_zod8.z.string().optional(),
851
- huggingFaceInferenceProvider: import_zod8.z.string().optional()
852
- });
853
- var chutesSchema = apiModelIdProviderModelSchema.extend({
854
- chutesApiKey: import_zod8.z.string().optional()
855
- });
856
- var litellmSchema = baseProviderSettingsSchema.extend({
857
- litellmBaseUrl: import_zod8.z.string().optional(),
858
- litellmApiKey: import_zod8.z.string().optional(),
859
- litellmModelId: import_zod8.z.string().optional(),
860
- litellmUsePromptCache: import_zod8.z.boolean().optional()
861
- });
862
- var cerebrasSchema = apiModelIdProviderModelSchema.extend({
863
- cerebrasApiKey: import_zod8.z.string().optional()
864
- });
865
- var sambaNovaSchema = apiModelIdProviderModelSchema.extend({
866
- sambaNovaApiKey: import_zod8.z.string().optional()
867
- });
868
- var zaiSchema = apiModelIdProviderModelSchema.extend({
869
- zaiApiKey: import_zod8.z.string().optional(),
870
- zaiApiLine: import_zod8.z.union([import_zod8.z.literal("china"), import_zod8.z.literal("international")]).optional()
871
- });
872
- var fireworksSchema = apiModelIdProviderModelSchema.extend({
873
- fireworksApiKey: import_zod8.z.string().optional()
874
- });
875
- var ioIntelligenceSchema = apiModelIdProviderModelSchema.extend({
876
- ioIntelligenceModelId: import_zod8.z.string().optional(),
877
- ioIntelligenceApiKey: import_zod8.z.string().optional()
878
- });
879
- var rooSchema = apiModelIdProviderModelSchema.extend({
880
- // No additional fields needed - uses cloud authentication
881
- });
882
- var defaultSchema = import_zod8.z.object({
883
- apiProvider: import_zod8.z.undefined()
884
- });
885
- var providerSettingsSchemaDiscriminated = import_zod8.z.discriminatedUnion("apiProvider", [
886
- anthropicSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("anthropic") })),
887
- claudeCodeSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("claude-code") })),
888
- glamaSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("glama") })),
889
- openRouterSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("openrouter") })),
890
- bedrockSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("bedrock") })),
891
- vertexSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("vertex") })),
892
- openAiSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("openai") })),
893
- ollamaSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("ollama") })),
894
- vsCodeLmSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("vscode-lm") })),
895
- lmStudioSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("lmstudio") })),
896
- geminiSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("gemini") })),
897
- geminiCliSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("gemini-cli") })),
898
- openAiNativeSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("openai-native") })),
899
- mistralSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("mistral") })),
900
- deepSeekSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("deepseek") })),
901
- doubaoSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("doubao") })),
902
- moonshotSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("moonshot") })),
903
- unboundSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("unbound") })),
904
- requestySchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("requesty") })),
905
- humanRelaySchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("human-relay") })),
906
- fakeAiSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("fake-ai") })),
907
- xaiSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("xai") })),
908
- groqSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("groq") })),
909
- huggingFaceSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("huggingface") })),
910
- chutesSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("chutes") })),
911
- litellmSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("litellm") })),
912
- cerebrasSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("cerebras") })),
913
- sambaNovaSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("sambanova") })),
914
- zaiSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("zai") })),
915
- fireworksSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("fireworks") })),
916
- ioIntelligenceSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("io-intelligence") })),
917
- rooSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("roo") })),
918
- defaultSchema
919
- ]);
920
- var providerSettingsSchema = import_zod8.z.object({
921
- apiProvider: providerNamesSchema.optional(),
922
- ...anthropicSchema.shape,
923
- ...claudeCodeSchema.shape,
924
- ...glamaSchema.shape,
925
- ...openRouterSchema.shape,
926
- ...bedrockSchema.shape,
927
- ...vertexSchema.shape,
928
- ...openAiSchema.shape,
929
- ...ollamaSchema.shape,
930
- ...vsCodeLmSchema.shape,
931
- ...lmStudioSchema.shape,
932
- ...geminiSchema.shape,
933
- ...geminiCliSchema.shape,
934
- ...openAiNativeSchema.shape,
935
- ...mistralSchema.shape,
936
- ...deepSeekSchema.shape,
937
- ...doubaoSchema.shape,
938
- ...moonshotSchema.shape,
939
- ...unboundSchema.shape,
940
- ...requestySchema.shape,
941
- ...humanRelaySchema.shape,
942
- ...fakeAiSchema.shape,
943
- ...xaiSchema.shape,
944
- ...groqSchema.shape,
945
- ...huggingFaceSchema.shape,
946
- ...chutesSchema.shape,
947
- ...litellmSchema.shape,
948
- ...cerebrasSchema.shape,
949
- ...sambaNovaSchema.shape,
950
- ...zaiSchema.shape,
951
- ...fireworksSchema.shape,
952
- ...ioIntelligenceSchema.shape,
953
- ...rooSchema.shape,
954
- ...codebaseIndexProviderSchema.shape
955
- });
956
- var providerSettingsWithIdSchema = providerSettingsSchema.extend({ id: import_zod8.z.string().optional() });
957
- var discriminatedProviderSettingsWithIdSchema = providerSettingsSchemaDiscriminated.and(
958
- import_zod8.z.object({ id: import_zod8.z.string().optional() })
959
- );
960
- var PROVIDER_SETTINGS_KEYS = providerSettingsSchema.keyof().options;
961
- var MODEL_ID_KEYS = [
962
- "apiModelId",
963
- "glamaModelId",
964
- "openRouterModelId",
965
- "openAiModelId",
966
- "ollamaModelId",
967
- "lmStudioModelId",
968
- "lmStudioDraftModelId",
969
- "unboundModelId",
970
- "requestyModelId",
971
- "litellmModelId",
972
- "huggingFaceModelId",
973
- "ioIntelligenceModelId"
974
- ];
975
- var getModelId = (settings) => {
976
- const modelIdKey = MODEL_ID_KEYS.find((key) => settings[key]);
977
- return modelIdKey ? settings[modelIdKey] : void 0;
978
- };
979
- var ANTHROPIC_STYLE_PROVIDERS = ["anthropic", "claude-code", "bedrock"];
980
- var getApiProtocol = (provider, modelId) => {
981
- if (provider && ANTHROPIC_STYLE_PROVIDERS.includes(provider)) {
982
- return "anthropic";
983
- }
984
- if (provider && provider === "vertex" && modelId && modelId.toLowerCase().includes("claude")) {
985
- return "anthropic";
986
- }
987
- return "openai";
988
- };
989
-
990
- // src/history.ts
991
- var import_zod9 = require("zod");
992
- var historyItemSchema = import_zod9.z.object({
993
- id: import_zod9.z.string(),
994
- number: import_zod9.z.number(),
995
- ts: import_zod9.z.number(),
996
- task: import_zod9.z.string(),
997
- tokensIn: import_zod9.z.number(),
998
- tokensOut: import_zod9.z.number(),
999
- cacheWrites: import_zod9.z.number().optional(),
1000
- cacheReads: import_zod9.z.number().optional(),
1001
- totalCost: import_zod9.z.number(),
1002
- size: import_zod9.z.number().optional(),
1003
- workspace: import_zod9.z.string().optional(),
1004
- mode: import_zod9.z.string().optional()
1005
- });
1006
-
1007
- // src/telemetry.ts
1008
- var import_zod10 = require("zod");
1009
- var telemetrySettings = ["unset", "enabled", "disabled"];
1010
- var telemetrySettingsSchema = import_zod10.z.enum(telemetrySettings);
1011
- var TelemetryEventName = /* @__PURE__ */ ((TelemetryEventName2) => {
1012
- TelemetryEventName2["TASK_CREATED"] = "Task Created";
1013
- TelemetryEventName2["TASK_RESTARTED"] = "Task Reopened";
1014
- TelemetryEventName2["TASK_COMPLETED"] = "Task Completed";
1015
- TelemetryEventName2["TASK_MESSAGE"] = "Task Message";
1016
- TelemetryEventName2["TASK_CONVERSATION_MESSAGE"] = "Conversation Message";
1017
- TelemetryEventName2["LLM_COMPLETION"] = "LLM Completion";
1018
- TelemetryEventName2["MODE_SWITCH"] = "Mode Switched";
1019
- TelemetryEventName2["MODE_SELECTOR_OPENED"] = "Mode Selector Opened";
1020
- TelemetryEventName2["TOOL_USED"] = "Tool Used";
1021
- TelemetryEventName2["CHECKPOINT_CREATED"] = "Checkpoint Created";
1022
- TelemetryEventName2["CHECKPOINT_RESTORED"] = "Checkpoint Restored";
1023
- TelemetryEventName2["CHECKPOINT_DIFFED"] = "Checkpoint Diffed";
1024
- TelemetryEventName2["TAB_SHOWN"] = "Tab Shown";
1025
- TelemetryEventName2["MODE_SETTINGS_CHANGED"] = "Mode Setting Changed";
1026
- TelemetryEventName2["CUSTOM_MODE_CREATED"] = "Custom Mode Created";
1027
- TelemetryEventName2["CONTEXT_CONDENSED"] = "Context Condensed";
1028
- TelemetryEventName2["SLIDING_WINDOW_TRUNCATION"] = "Sliding Window Truncation";
1029
- TelemetryEventName2["CODE_ACTION_USED"] = "Code Action Used";
1030
- TelemetryEventName2["PROMPT_ENHANCED"] = "Prompt Enhanced";
1031
- TelemetryEventName2["TITLE_BUTTON_CLICKED"] = "Title Button Clicked";
1032
- TelemetryEventName2["AUTHENTICATION_INITIATED"] = "Authentication Initiated";
1033
- TelemetryEventName2["MARKETPLACE_ITEM_INSTALLED"] = "Marketplace Item Installed";
1034
- TelemetryEventName2["MARKETPLACE_ITEM_REMOVED"] = "Marketplace Item Removed";
1035
- TelemetryEventName2["MARKETPLACE_TAB_VIEWED"] = "Marketplace Tab Viewed";
1036
- TelemetryEventName2["MARKETPLACE_INSTALL_BUTTON_CLICKED"] = "Marketplace Install Button Clicked";
1037
- TelemetryEventName2["SHARE_BUTTON_CLICKED"] = "Share Button Clicked";
1038
- TelemetryEventName2["SHARE_ORGANIZATION_CLICKED"] = "Share Organization Clicked";
1039
- TelemetryEventName2["SHARE_PUBLIC_CLICKED"] = "Share Public Clicked";
1040
- TelemetryEventName2["SHARE_CONNECT_TO_CLOUD_CLICKED"] = "Share Connect To Cloud Clicked";
1041
- TelemetryEventName2["ACCOUNT_CONNECT_CLICKED"] = "Account Connect Clicked";
1042
- TelemetryEventName2["ACCOUNT_CONNECT_SUCCESS"] = "Account Connect Success";
1043
- TelemetryEventName2["ACCOUNT_LOGOUT_CLICKED"] = "Account Logout Clicked";
1044
- TelemetryEventName2["ACCOUNT_LOGOUT_SUCCESS"] = "Account Logout Success";
1045
- TelemetryEventName2["SCHEMA_VALIDATION_ERROR"] = "Schema Validation Error";
1046
- TelemetryEventName2["DIFF_APPLICATION_ERROR"] = "Diff Application Error";
1047
- TelemetryEventName2["SHELL_INTEGRATION_ERROR"] = "Shell Integration Error";
1048
- TelemetryEventName2["CONSECUTIVE_MISTAKE_ERROR"] = "Consecutive Mistake Error";
1049
- TelemetryEventName2["CODE_INDEX_ERROR"] = "Code Index Error";
1050
- return TelemetryEventName2;
1051
- })(TelemetryEventName || {});
1052
- var staticAppPropertiesSchema = import_zod10.z.object({
1053
- appName: import_zod10.z.string(),
1054
- appVersion: import_zod10.z.string(),
1055
- vscodeVersion: import_zod10.z.string(),
1056
- platform: import_zod10.z.string(),
1057
- editorName: import_zod10.z.string()
1058
- });
1059
- var dynamicAppPropertiesSchema = import_zod10.z.object({
1060
- language: import_zod10.z.string(),
1061
- mode: import_zod10.z.string()
1062
- });
1063
- var cloudAppPropertiesSchema = import_zod10.z.object({
1064
- cloudIsAuthenticated: import_zod10.z.boolean().optional()
1065
- });
1066
- var appPropertiesSchema = import_zod10.z.object({
1067
- ...staticAppPropertiesSchema.shape,
1068
- ...dynamicAppPropertiesSchema.shape,
1069
- ...cloudAppPropertiesSchema.shape
1070
- });
1071
- var taskPropertiesSchema = import_zod10.z.object({
1072
- taskId: import_zod10.z.string().optional(),
1073
- apiProvider: import_zod10.z.enum(providerNames).optional(),
1074
- modelId: import_zod10.z.string().optional(),
1075
- diffStrategy: import_zod10.z.string().optional(),
1076
- isSubtask: import_zod10.z.boolean().optional(),
1077
- todos: import_zod10.z.object({
1078
- total: import_zod10.z.number(),
1079
- completed: import_zod10.z.number(),
1080
- inProgress: import_zod10.z.number(),
1081
- pending: import_zod10.z.number()
1082
- }).optional()
1083
- });
1084
- var gitPropertiesSchema = import_zod10.z.object({
1085
- repositoryUrl: import_zod10.z.string().optional(),
1086
- repositoryName: import_zod10.z.string().optional(),
1087
- defaultBranch: import_zod10.z.string().optional()
1088
- });
1089
- var telemetryPropertiesSchema = import_zod10.z.object({
1090
- ...appPropertiesSchema.shape,
1091
- ...taskPropertiesSchema.shape,
1092
- ...gitPropertiesSchema.shape
1093
- });
1094
- var rooCodeTelemetryEventSchema = import_zod10.z.discriminatedUnion("type", [
1095
- import_zod10.z.object({
1096
- type: import_zod10.z.enum([
1097
- "Task Created" /* TASK_CREATED */,
1098
- "Task Reopened" /* TASK_RESTARTED */,
1099
- "Task Completed" /* TASK_COMPLETED */,
1100
- "Conversation Message" /* TASK_CONVERSATION_MESSAGE */,
1101
- "Mode Switched" /* MODE_SWITCH */,
1102
- "Mode Selector Opened" /* MODE_SELECTOR_OPENED */,
1103
- "Tool Used" /* TOOL_USED */,
1104
- "Checkpoint Created" /* CHECKPOINT_CREATED */,
1105
- "Checkpoint Restored" /* CHECKPOINT_RESTORED */,
1106
- "Checkpoint Diffed" /* CHECKPOINT_DIFFED */,
1107
- "Code Action Used" /* CODE_ACTION_USED */,
1108
- "Prompt Enhanced" /* PROMPT_ENHANCED */,
1109
- "Title Button Clicked" /* TITLE_BUTTON_CLICKED */,
1110
- "Authentication Initiated" /* AUTHENTICATION_INITIATED */,
1111
- "Marketplace Item Installed" /* MARKETPLACE_ITEM_INSTALLED */,
1112
- "Marketplace Item Removed" /* MARKETPLACE_ITEM_REMOVED */,
1113
- "Marketplace Tab Viewed" /* MARKETPLACE_TAB_VIEWED */,
1114
- "Marketplace Install Button Clicked" /* MARKETPLACE_INSTALL_BUTTON_CLICKED */,
1115
- "Share Button Clicked" /* SHARE_BUTTON_CLICKED */,
1116
- "Share Organization Clicked" /* SHARE_ORGANIZATION_CLICKED */,
1117
- "Share Public Clicked" /* SHARE_PUBLIC_CLICKED */,
1118
- "Share Connect To Cloud Clicked" /* SHARE_CONNECT_TO_CLOUD_CLICKED */,
1119
- "Account Connect Clicked" /* ACCOUNT_CONNECT_CLICKED */,
1120
- "Account Connect Success" /* ACCOUNT_CONNECT_SUCCESS */,
1121
- "Account Logout Clicked" /* ACCOUNT_LOGOUT_CLICKED */,
1122
- "Account Logout Success" /* ACCOUNT_LOGOUT_SUCCESS */,
1123
- "Schema Validation Error" /* SCHEMA_VALIDATION_ERROR */,
1124
- "Diff Application Error" /* DIFF_APPLICATION_ERROR */,
1125
- "Shell Integration Error" /* SHELL_INTEGRATION_ERROR */,
1126
- "Consecutive Mistake Error" /* CONSECUTIVE_MISTAKE_ERROR */,
1127
- "Code Index Error" /* CODE_INDEX_ERROR */,
1128
- "Context Condensed" /* CONTEXT_CONDENSED */,
1129
- "Sliding Window Truncation" /* SLIDING_WINDOW_TRUNCATION */,
1130
- "Tab Shown" /* TAB_SHOWN */,
1131
- "Mode Setting Changed" /* MODE_SETTINGS_CHANGED */,
1132
- "Custom Mode Created" /* CUSTOM_MODE_CREATED */
1133
- ]),
1134
- properties: telemetryPropertiesSchema
1135
- }),
1136
- import_zod10.z.object({
1137
- type: import_zod10.z.literal("Task Message" /* TASK_MESSAGE */),
1138
- properties: import_zod10.z.object({
1139
- ...telemetryPropertiesSchema.shape,
1140
- taskId: import_zod10.z.string(),
1141
- message: clineMessageSchema
1142
- })
1143
- }),
1144
- import_zod10.z.object({
1145
- type: import_zod10.z.literal("LLM Completion" /* LLM_COMPLETION */),
1146
- properties: import_zod10.z.object({
1147
- ...telemetryPropertiesSchema.shape,
1148
- inputTokens: import_zod10.z.number(),
1149
- outputTokens: import_zod10.z.number(),
1150
- cacheReadTokens: import_zod10.z.number().optional(),
1151
- cacheWriteTokens: import_zod10.z.number().optional(),
1152
- cost: import_zod10.z.number().optional()
1153
- })
1154
- })
1155
- ]);
1156
-
1157
- // src/mode.ts
1158
- var import_zod11 = require("zod");
1159
- var groupOptionsSchema = import_zod11.z.object({
1160
- fileRegex: import_zod11.z.string().optional().refine(
1161
- (pattern) => {
1162
- if (!pattern) {
1163
- return true;
1164
- }
1165
- try {
1166
- new RegExp(pattern);
1167
- return true;
1168
- } catch {
1169
- return false;
1170
- }
1171
- },
1172
- { message: "Invalid regular expression pattern" }
1173
- ),
1174
- description: import_zod11.z.string().optional()
1175
- });
1176
- var groupEntrySchema = import_zod11.z.union([toolGroupsSchema, import_zod11.z.tuple([toolGroupsSchema, groupOptionsSchema])]);
1177
- var groupEntryArraySchema = import_zod11.z.array(groupEntrySchema).refine(
1178
- (groups) => {
1179
- const seen = /* @__PURE__ */ new Set();
1180
- return groups.every((group) => {
1181
- const groupName = Array.isArray(group) ? group[0] : group;
1182
- if (seen.has(groupName)) {
1183
- return false;
1184
- }
1185
- seen.add(groupName);
1186
- return true;
1187
- });
1188
- },
1189
- { message: "Duplicate groups are not allowed" }
1190
- );
1191
- var modeConfigSchema = import_zod11.z.object({
1192
- slug: import_zod11.z.string().regex(/^[a-zA-Z0-9-]+$/, "Slug must contain only letters numbers and dashes"),
1193
- name: import_zod11.z.string().min(1, "Name is required"),
1194
- roleDefinition: import_zod11.z.string().min(1, "Role definition is required"),
1195
- whenToUse: import_zod11.z.string().optional(),
1196
- description: import_zod11.z.string().optional(),
1197
- customInstructions: import_zod11.z.string().optional(),
1198
- groups: groupEntryArraySchema,
1199
- source: import_zod11.z.enum(["global", "project"]).optional()
1200
- });
1201
- var customModesSettingsSchema = import_zod11.z.object({
1202
- customModes: import_zod11.z.array(modeConfigSchema).refine(
1203
- (modes) => {
1204
- const slugs = /* @__PURE__ */ new Set();
1205
- return modes.every((mode) => {
1206
- if (slugs.has(mode.slug)) {
1207
- return false;
1208
- }
1209
- slugs.add(mode.slug);
1210
- return true;
1211
- });
1212
- },
1213
- {
1214
- message: "Duplicate mode slugs are not allowed"
1215
- }
1216
- )
1217
- });
1218
- var promptComponentSchema = import_zod11.z.object({
1219
- roleDefinition: import_zod11.z.string().optional(),
1220
- whenToUse: import_zod11.z.string().optional(),
1221
- description: import_zod11.z.string().optional(),
1222
- customInstructions: import_zod11.z.string().optional()
1223
- });
1224
- var customModePromptsSchema = import_zod11.z.record(import_zod11.z.string(), promptComponentSchema.optional());
1225
- var customSupportPromptsSchema = import_zod11.z.record(import_zod11.z.string(), import_zod11.z.string().optional());
1226
- var DEFAULT_MODES = [
1227
- {
1228
- slug: "architect",
1229
- name: "\u{1F3D7}\uFE0F Architect",
1230
- roleDefinition: "You are Roo, an experienced technical leader who is inquisitive and an excellent planner. Your goal is to gather information and get context to create a detailed plan for accomplishing the user's task, which the user will review and approve before they switch into another mode to implement the solution.",
1231
- whenToUse: "Use this mode when you need to plan, design, or strategize before implementation. Perfect for breaking down complex problems, creating technical specifications, designing system architecture, or brainstorming solutions before coding.",
1232
- description: "Plan and design before implementation",
1233
- groups: ["read", ["edit", { fileRegex: "\\.md$", description: "Markdown files only" }], "browser", "mcp"],
1234
- customInstructions: "1. Do some information gathering (using provided tools) to get more context about the task.\n\n2. You should also ask the user clarifying questions to get a better understanding of the task.\n\n3. Once you've gained more context about the user's request, break down the task into clear, actionable steps and create a todo list using the `update_todo_list` tool. Each todo item should be:\n - Specific and actionable\n - Listed in logical execution order\n - Focused on a single, well-defined outcome\n - Clear enough that another mode could execute it independently\n\n **Note:** If the `update_todo_list` tool is not available, write the plan to a markdown file (e.g., `plan.md` or `todo.md`) instead.\n\n4. As you gather more information or discover new requirements, update the todo list to reflect the current understanding of what needs to be accomplished.\n\n5. Ask the user if they are pleased with this plan, or if they would like to make any changes. Think of this as a brainstorming session where you can discuss the task and refine the todo list.\n\n6. Include Mermaid diagrams if they help clarify complex workflows or system architecture. Please avoid using double quotes (\"\") and parentheses () inside square brackets ([]) in Mermaid diagrams, as this can cause parsing errors.\n\n7. Use the switch_mode tool to request that the user switch to another mode to implement the solution.\n\n**IMPORTANT: Focus on creating clear, actionable todo lists rather than lengthy markdown documents. Use the todo list as your primary planning tool to track and organize the work that needs to be done.**"
1235
- },
1236
- {
1237
- slug: "code",
1238
- name: "\u{1F4BB} Code",
1239
- roleDefinition: "You are Roo, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.",
1240
- whenToUse: "Use this mode when you need to write, modify, or refactor code. Ideal for implementing features, fixing bugs, creating new files, or making code improvements across any programming language or framework.",
1241
- description: "Write, modify, and refactor code",
1242
- groups: ["read", "edit", "browser", "command", "mcp"]
1243
- },
1244
- {
1245
- slug: "ask",
1246
- name: "\u2753 Ask",
1247
- roleDefinition: "You are Roo, a knowledgeable technical assistant focused on answering questions and providing information about software development, technology, and related topics.",
1248
- whenToUse: "Use this mode when you need explanations, documentation, or answers to technical questions. Best for understanding concepts, analyzing existing code, getting recommendations, or learning about technologies without making changes.",
1249
- description: "Get answers and explanations",
1250
- groups: ["read", "browser", "mcp"],
1251
- customInstructions: "You can analyze code, explain concepts, and access external resources. Always answer the user's questions thoroughly, and do not switch to implementing code unless explicitly requested by the user. Include Mermaid diagrams when they clarify your response."
1252
- },
1253
- {
1254
- slug: "debug",
1255
- name: "\u{1FAB2} Debug",
1256
- roleDefinition: "You are Roo, an expert software debugger specializing in systematic problem diagnosis and resolution.",
1257
- whenToUse: "Use this mode when you're troubleshooting issues, investigating errors, or diagnosing problems. Specialized in systematic debugging, adding logging, analyzing stack traces, and identifying root causes before applying fixes.",
1258
- description: "Diagnose and fix software issues",
1259
- groups: ["read", "edit", "browser", "command", "mcp"],
1260
- customInstructions: "Reflect on 5-7 different possible sources of the problem, distill those down to 1-2 most likely sources, and then add logs to validate your assumptions. Explicitly ask the user to confirm the diagnosis before fixing the problem."
1261
- },
1262
- {
1263
- slug: "orchestrator",
1264
- name: "\u{1FA83} Orchestrator",
1265
- roleDefinition: "You are Roo, a strategic workflow orchestrator who coordinates complex tasks by delegating them to appropriate specialized modes. You have a comprehensive understanding of each mode's capabilities and limitations, allowing you to effectively break down complex problems into discrete tasks that can be solved by different specialists.",
1266
- whenToUse: "Use this mode for complex, multi-step projects that require coordination across different specialties. Ideal when you need to break down large tasks into subtasks, manage workflows, or coordinate work that spans multiple domains or expertise areas.",
1267
- description: "Coordinate tasks across multiple modes",
1268
- groups: [],
1269
- customInstructions: "Your role is to coordinate complex workflows by delegating tasks to specialized modes. As an orchestrator, you should:\n\n1. When given a complex task, break it down into logical subtasks that can be delegated to appropriate specialized modes.\n\n2. For each subtask, use the `new_task` tool to delegate. Choose the most appropriate mode for the subtask's specific goal and provide comprehensive instructions in the `message` parameter. These instructions must include:\n * All necessary context from the parent task or previous subtasks required to complete the work.\n * A clearly defined scope, specifying exactly what the subtask should accomplish.\n * An explicit statement that the subtask should *only* perform the work outlined in these instructions and not deviate.\n * An instruction for the subtask to signal completion by using the `attempt_completion` tool, providing a concise yet thorough summary of the outcome in the `result` parameter, keeping in mind that this summary will be the source of truth used to keep track of what was completed on this project.\n * A statement that these specific instructions supersede any conflicting general instructions the subtask's mode might have.\n\n3. Track and manage the progress of all subtasks. When a subtask is completed, analyze its results and determine the next steps.\n\n4. Help the user understand how the different subtasks fit together in the overall workflow. Provide clear reasoning about why you're delegating specific tasks to specific modes.\n\n5. When all subtasks are completed, synthesize the results and provide a comprehensive overview of what was accomplished.\n\n6. Ask clarifying questions when necessary to better understand how to break down complex tasks effectively.\n\n7. Suggest improvements to the workflow based on the results of completed subtasks.\n\nUse subtasks to maintain clarity. If a request significantly shifts focus or requires a different expertise (mode), consider creating a subtask rather than overloading the current one."
1270
- }
1271
- ];
1272
-
1273
- // src/vscode.ts
1274
- var import_zod12 = require("zod");
1275
- var codeActionIds = ["explainCode", "fixCode", "improveCode", "addToContext", "newTask"];
1276
- var terminalActionIds = ["terminalAddToContext", "terminalFixCommand", "terminalExplainCommand"];
1277
- var commandIds = [
1278
- "activationCompleted",
1279
- "plusButtonClicked",
1280
- "promptsButtonClicked",
1281
- "mcpButtonClicked",
1282
- "historyButtonClicked",
1283
- "marketplaceButtonClicked",
1284
- "popoutButtonClicked",
1285
- "accountButtonClicked",
1286
- "settingsButtonClicked",
1287
- "openInNewTab",
1288
- "showHumanRelayDialog",
1289
- "registerHumanRelayCallback",
1290
- "unregisterHumanRelayCallback",
1291
- "handleHumanRelayResponse",
1292
- "newTask",
1293
- "setCustomStoragePath",
1294
- "importSettings",
1295
- "focusInput",
1296
- "acceptInput",
1297
- "focusPanel"
1298
- ];
1299
- var languages = [
1300
- "ca",
1301
- "de",
1302
- "en",
1303
- "es",
1304
- "fr",
1305
- "hi",
1306
- "id",
1307
- "it",
1308
- "ja",
1309
- "ko",
1310
- "nl",
1311
- "pl",
1312
- "pt-BR",
1313
- "ru",
1314
- "tr",
1315
- "vi",
1316
- "zh-CN",
1317
- "zh-TW"
1318
- ];
1319
- var languagesSchema = import_zod12.z.enum(languages);
1320
- var isLanguage = (value) => languages.includes(value);
1321
-
1322
- // src/global-settings.ts
1323
- var DEFAULT_WRITE_DELAY_MS = 1e3;
1324
- var DEFAULT_TERMINAL_OUTPUT_CHARACTER_LIMIT = 5e4;
1325
- var globalSettingsSchema = import_zod13.z.object({
1326
- currentApiConfigName: import_zod13.z.string().optional(),
1327
- listApiConfigMeta: import_zod13.z.array(providerSettingsEntrySchema).optional(),
1328
- pinnedApiConfigs: import_zod13.z.record(import_zod13.z.string(), import_zod13.z.boolean()).optional(),
1329
- lastShownAnnouncementId: import_zod13.z.string().optional(),
1330
- customInstructions: import_zod13.z.string().optional(),
1331
- taskHistory: import_zod13.z.array(historyItemSchema).optional(),
1332
- condensingApiConfigId: import_zod13.z.string().optional(),
1333
- customCondensingPrompt: import_zod13.z.string().optional(),
1334
- autoApprovalEnabled: import_zod13.z.boolean().optional(),
1335
- alwaysAllowReadOnly: import_zod13.z.boolean().optional(),
1336
- alwaysAllowReadOnlyOutsideWorkspace: import_zod13.z.boolean().optional(),
1337
- alwaysAllowWrite: import_zod13.z.boolean().optional(),
1338
- alwaysAllowWriteOutsideWorkspace: import_zod13.z.boolean().optional(),
1339
- alwaysAllowWriteProtected: import_zod13.z.boolean().optional(),
1340
- writeDelayMs: import_zod13.z.number().min(0).optional(),
1341
- alwaysAllowBrowser: import_zod13.z.boolean().optional(),
1342
- alwaysApproveResubmit: import_zod13.z.boolean().optional(),
1343
- requestDelaySeconds: import_zod13.z.number().optional(),
1344
- alwaysAllowMcp: import_zod13.z.boolean().optional(),
1345
- alwaysAllowModeSwitch: import_zod13.z.boolean().optional(),
1346
- alwaysAllowSubtasks: import_zod13.z.boolean().optional(),
1347
- alwaysAllowExecute: import_zod13.z.boolean().optional(),
1348
- alwaysAllowFollowupQuestions: import_zod13.z.boolean().optional(),
1349
- followupAutoApproveTimeoutMs: import_zod13.z.number().optional(),
1350
- alwaysAllowUpdateTodoList: import_zod13.z.boolean().optional(),
1351
- allowedCommands: import_zod13.z.array(import_zod13.z.string()).optional(),
1352
- deniedCommands: import_zod13.z.array(import_zod13.z.string()).optional(),
1353
- commandExecutionTimeout: import_zod13.z.number().optional(),
1354
- commandTimeoutAllowlist: import_zod13.z.array(import_zod13.z.string()).optional(),
1355
- preventCompletionWithOpenTodos: import_zod13.z.boolean().optional(),
1356
- allowedMaxRequests: import_zod13.z.number().nullish(),
1357
- allowedMaxCost: import_zod13.z.number().nullish(),
1358
- autoCondenseContext: import_zod13.z.boolean().optional(),
1359
- autoCondenseContextPercent: import_zod13.z.number().optional(),
1360
- maxConcurrentFileReads: import_zod13.z.number().optional(),
1361
- /**
1362
- * Whether to include diagnostic messages (errors, warnings) in tool outputs
1363
- * @default true
1364
- */
1365
- includeDiagnosticMessages: import_zod13.z.boolean().optional(),
1366
- /**
1367
- * Maximum number of diagnostic messages to include in tool outputs
1368
- * @default 50
1369
- */
1370
- maxDiagnosticMessages: import_zod13.z.number().optional(),
1371
- browserToolEnabled: import_zod13.z.boolean().optional(),
1372
- browserViewportSize: import_zod13.z.string().optional(),
1373
- screenshotQuality: import_zod13.z.number().optional(),
1374
- remoteBrowserEnabled: import_zod13.z.boolean().optional(),
1375
- remoteBrowserHost: import_zod13.z.string().optional(),
1376
- cachedChromeHostUrl: import_zod13.z.string().optional(),
1377
- enableCheckpoints: import_zod13.z.boolean().optional(),
1378
- ttsEnabled: import_zod13.z.boolean().optional(),
1379
- ttsSpeed: import_zod13.z.number().optional(),
1380
- soundEnabled: import_zod13.z.boolean().optional(),
1381
- soundVolume: import_zod13.z.number().optional(),
1382
- maxOpenTabsContext: import_zod13.z.number().optional(),
1383
- maxWorkspaceFiles: import_zod13.z.number().optional(),
1384
- showRooIgnoredFiles: import_zod13.z.boolean().optional(),
1385
- maxReadFileLine: import_zod13.z.number().optional(),
1386
- maxImageFileSize: import_zod13.z.number().optional(),
1387
- maxTotalImageSize: import_zod13.z.number().optional(),
1388
- terminalOutputLineLimit: import_zod13.z.number().optional(),
1389
- terminalOutputCharacterLimit: import_zod13.z.number().optional(),
1390
- terminalShellIntegrationTimeout: import_zod13.z.number().optional(),
1391
- terminalShellIntegrationDisabled: import_zod13.z.boolean().optional(),
1392
- terminalCommandDelay: import_zod13.z.number().optional(),
1393
- terminalPowershellCounter: import_zod13.z.boolean().optional(),
1394
- terminalZshClearEolMark: import_zod13.z.boolean().optional(),
1395
- terminalZshOhMy: import_zod13.z.boolean().optional(),
1396
- terminalZshP10k: import_zod13.z.boolean().optional(),
1397
- terminalZdotdir: import_zod13.z.boolean().optional(),
1398
- terminalCompressProgressBar: import_zod13.z.boolean().optional(),
1399
- diagnosticsEnabled: import_zod13.z.boolean().optional(),
1400
- rateLimitSeconds: import_zod13.z.number().optional(),
1401
- diffEnabled: import_zod13.z.boolean().optional(),
1402
- fuzzyMatchThreshold: import_zod13.z.number().optional(),
1403
- experiments: experimentsSchema.optional(),
1404
- codebaseIndexModels: codebaseIndexModelsSchema.optional(),
1405
- codebaseIndexConfig: codebaseIndexConfigSchema.optional(),
1406
- language: languagesSchema.optional(),
1407
- telemetrySetting: telemetrySettingsSchema.optional(),
1408
- mcpEnabled: import_zod13.z.boolean().optional(),
1409
- enableMcpServerCreation: import_zod13.z.boolean().optional(),
1410
- remoteControlEnabled: import_zod13.z.boolean().optional(),
1411
- mode: import_zod13.z.string().optional(),
1412
- modeApiConfigs: import_zod13.z.record(import_zod13.z.string(), import_zod13.z.string()).optional(),
1413
- customModes: import_zod13.z.array(modeConfigSchema).optional(),
1414
- customModePrompts: customModePromptsSchema.optional(),
1415
- customSupportPrompts: customSupportPromptsSchema.optional(),
1416
- enhancementApiConfigId: import_zod13.z.string().optional(),
1417
- includeTaskHistoryInEnhance: import_zod13.z.boolean().optional(),
1418
- historyPreviewCollapsed: import_zod13.z.boolean().optional(),
1419
- profileThresholds: import_zod13.z.record(import_zod13.z.string(), import_zod13.z.number()).optional(),
1420
- hasOpenedModeSelector: import_zod13.z.boolean().optional(),
1421
- lastModeExportPath: import_zod13.z.string().optional(),
1422
- lastModeImportPath: import_zod13.z.string().optional()
1423
- });
1424
- var GLOBAL_SETTINGS_KEYS = globalSettingsSchema.keyof().options;
1425
- var rooCodeSettingsSchema = providerSettingsSchema.merge(globalSettingsSchema);
1426
- var SECRET_STATE_KEYS = [
1427
- "apiKey",
1428
- "glamaApiKey",
1429
- "openRouterApiKey",
1430
- "awsAccessKey",
1431
- "awsApiKey",
1432
- "awsSecretKey",
1433
- "awsSessionToken",
1434
- "openAiApiKey",
1435
- "geminiApiKey",
1436
- "openAiNativeApiKey",
1437
- "cerebrasApiKey",
1438
- "deepSeekApiKey",
1439
- "moonshotApiKey",
1440
- "mistralApiKey",
1441
- "unboundApiKey",
1442
- "requestyApiKey",
1443
- "xaiApiKey",
1444
- "groqApiKey",
1445
- "chutesApiKey",
1446
- "litellmApiKey",
1447
- "codeIndexOpenAiKey",
1448
- "codeIndexQdrantApiKey",
1449
- "codebaseIndexOpenAiCompatibleApiKey",
1450
- "codebaseIndexGeminiApiKey",
1451
- "codebaseIndexMistralApiKey",
1452
- "huggingFaceApiKey",
1453
- "sambaNovaApiKey",
1454
- "fireworksApiKey",
1455
- "ioIntelligenceApiKey"
1456
- ];
1457
- var isSecretStateKey = (key) => SECRET_STATE_KEYS.includes(key);
1458
- var GLOBAL_STATE_KEYS = [...GLOBAL_SETTINGS_KEYS, ...PROVIDER_SETTINGS_KEYS].filter(
1459
- (key) => !SECRET_STATE_KEYS.includes(key)
1460
- );
1461
- var isGlobalStateKey = (key) => GLOBAL_STATE_KEYS.includes(key);
1462
- var EVALS_SETTINGS = {
1463
- apiProvider: "openrouter",
1464
- openRouterUseMiddleOutTransform: false,
1465
- lastShownAnnouncementId: "jul-09-2025-3-23-0",
1466
- pinnedApiConfigs: {},
1467
- autoApprovalEnabled: true,
1468
- alwaysAllowReadOnly: true,
1469
- alwaysAllowReadOnlyOutsideWorkspace: false,
1470
- alwaysAllowWrite: true,
1471
- alwaysAllowWriteOutsideWorkspace: false,
1472
- alwaysAllowWriteProtected: false,
1473
- writeDelayMs: 1e3,
1474
- alwaysAllowBrowser: true,
1475
- alwaysApproveResubmit: true,
1476
- requestDelaySeconds: 10,
1477
- alwaysAllowMcp: true,
1478
- alwaysAllowModeSwitch: true,
1479
- alwaysAllowSubtasks: true,
1480
- alwaysAllowExecute: true,
1481
- alwaysAllowFollowupQuestions: true,
1482
- alwaysAllowUpdateTodoList: true,
1483
- followupAutoApproveTimeoutMs: 0,
1484
- allowedCommands: ["*"],
1485
- commandExecutionTimeout: 20,
1486
- commandTimeoutAllowlist: [],
1487
- preventCompletionWithOpenTodos: false,
1488
- browserToolEnabled: false,
1489
- browserViewportSize: "900x600",
1490
- screenshotQuality: 75,
1491
- remoteBrowserEnabled: false,
1492
- ttsEnabled: false,
1493
- ttsSpeed: 1,
1494
- soundEnabled: false,
1495
- soundVolume: 0.5,
1496
- terminalOutputLineLimit: 500,
1497
- terminalOutputCharacterLimit: DEFAULT_TERMINAL_OUTPUT_CHARACTER_LIMIT,
1498
- terminalShellIntegrationTimeout: 3e4,
1499
- terminalCommandDelay: 0,
1500
- terminalPowershellCounter: false,
1501
- terminalZshOhMy: true,
1502
- terminalZshClearEolMark: true,
1503
- terminalZshP10k: false,
1504
- terminalZdotdir: true,
1505
- terminalCompressProgressBar: true,
1506
- terminalShellIntegrationDisabled: true,
1507
- diagnosticsEnabled: true,
1508
- diffEnabled: true,
1509
- fuzzyMatchThreshold: 1,
1510
- enableCheckpoints: false,
1511
- rateLimitSeconds: 0,
1512
- maxOpenTabsContext: 20,
1513
- maxWorkspaceFiles: 200,
1514
- showRooIgnoredFiles: true,
1515
- maxReadFileLine: -1,
1516
- // -1 to enable full file reading.
1517
- includeDiagnosticMessages: true,
1518
- maxDiagnosticMessages: 50,
1519
- language: "en",
1520
- telemetrySetting: "enabled",
1521
- mcpEnabled: false,
1522
- remoteControlEnabled: false,
1523
- mode: "code",
1524
- // "architect",
1525
- customModes: []
1526
- };
1527
- var EVALS_TIMEOUT = 5 * 60 * 1e3;
1528
-
1529
- // src/ipc.ts
1530
- var import_zod14 = require("zod");
1531
- var IpcMessageType = /* @__PURE__ */ ((IpcMessageType2) => {
1532
- IpcMessageType2["Connect"] = "Connect";
1533
- IpcMessageType2["Disconnect"] = "Disconnect";
1534
- IpcMessageType2["Ack"] = "Ack";
1535
- IpcMessageType2["TaskCommand"] = "TaskCommand";
1536
- IpcMessageType2["TaskEvent"] = "TaskEvent";
1537
- return IpcMessageType2;
1538
- })(IpcMessageType || {});
1539
- var IpcOrigin = /* @__PURE__ */ ((IpcOrigin2) => {
1540
- IpcOrigin2["Client"] = "client";
1541
- IpcOrigin2["Server"] = "server";
1542
- return IpcOrigin2;
1543
- })(IpcOrigin || {});
1544
- var ackSchema = import_zod14.z.object({
1545
- clientId: import_zod14.z.string(),
1546
- pid: import_zod14.z.number(),
1547
- ppid: import_zod14.z.number()
1548
- });
1549
- var TaskCommandName = /* @__PURE__ */ ((TaskCommandName2) => {
1550
- TaskCommandName2["StartNewTask"] = "StartNewTask";
1551
- TaskCommandName2["CancelTask"] = "CancelTask";
1552
- TaskCommandName2["CloseTask"] = "CloseTask";
1553
- TaskCommandName2["ResumeTask"] = "ResumeTask";
1554
- return TaskCommandName2;
1555
- })(TaskCommandName || {});
1556
- var taskCommandSchema = import_zod14.z.discriminatedUnion("commandName", [
1557
- import_zod14.z.object({
1558
- commandName: import_zod14.z.literal("StartNewTask" /* StartNewTask */),
1559
- data: import_zod14.z.object({
1560
- configuration: rooCodeSettingsSchema,
1561
- text: import_zod14.z.string(),
1562
- images: import_zod14.z.array(import_zod14.z.string()).optional(),
1563
- newTab: import_zod14.z.boolean().optional()
1564
- })
1565
- }),
1566
- import_zod14.z.object({
1567
- commandName: import_zod14.z.literal("CancelTask" /* CancelTask */),
1568
- data: import_zod14.z.string()
1569
- }),
1570
- import_zod14.z.object({
1571
- commandName: import_zod14.z.literal("CloseTask" /* CloseTask */),
1572
- data: import_zod14.z.string()
1573
- }),
1574
- import_zod14.z.object({
1575
- commandName: import_zod14.z.literal("ResumeTask" /* ResumeTask */),
1576
- data: import_zod14.z.string()
1577
- })
1578
- ]);
1579
- var ipcMessageSchema = import_zod14.z.discriminatedUnion("type", [
1580
- import_zod14.z.object({
1581
- type: import_zod14.z.literal("Ack" /* Ack */),
1582
- origin: import_zod14.z.literal("server" /* Server */),
1583
- data: ackSchema
1584
- }),
1585
- import_zod14.z.object({
1586
- type: import_zod14.z.literal("TaskCommand" /* TaskCommand */),
1587
- origin: import_zod14.z.literal("client" /* Client */),
1588
- clientId: import_zod14.z.string(),
1589
- data: taskCommandSchema
1590
- }),
1591
- import_zod14.z.object({
1592
- type: import_zod14.z.literal("TaskEvent" /* TaskEvent */),
1593
- origin: import_zod14.z.literal("server" /* Server */),
1594
- relayClientId: import_zod14.z.string().optional(),
1595
- data: taskEventSchema
1596
- })
1597
- ]);
1598
-
1599
- // src/marketplace.ts
1600
- var import_zod15 = require("zod");
1601
- var mcpParameterSchema = import_zod15.z.object({
1602
- name: import_zod15.z.string().min(1),
1603
- key: import_zod15.z.string().min(1),
1604
- placeholder: import_zod15.z.string().optional(),
1605
- optional: import_zod15.z.boolean().optional().default(false)
1606
- });
1607
- var mcpInstallationMethodSchema = import_zod15.z.object({
1608
- name: import_zod15.z.string().min(1),
1609
- content: import_zod15.z.string().min(1),
1610
- parameters: import_zod15.z.array(mcpParameterSchema).optional(),
1611
- prerequisites: import_zod15.z.array(import_zod15.z.string()).optional()
1612
- });
1613
- var marketplaceItemTypeSchema = import_zod15.z.enum(["mode", "mcp"]);
1614
- var baseMarketplaceItemSchema = import_zod15.z.object({
1615
- id: import_zod15.z.string().min(1),
1616
- name: import_zod15.z.string().min(1, "Name is required"),
1617
- description: import_zod15.z.string(),
1618
- author: import_zod15.z.string().optional(),
1619
- authorUrl: import_zod15.z.string().url("Author URL must be a valid URL").optional(),
1620
- tags: import_zod15.z.array(import_zod15.z.string()).optional(),
1621
- prerequisites: import_zod15.z.array(import_zod15.z.string()).optional()
1622
- });
1623
- var modeMarketplaceItemSchema = baseMarketplaceItemSchema.extend({
1624
- content: import_zod15.z.string().min(1)
1625
- // YAML content for modes
1626
- });
1627
- var mcpMarketplaceItemSchema = baseMarketplaceItemSchema.extend({
1628
- url: import_zod15.z.string().url(),
1629
- // Required url field
1630
- content: import_zod15.z.union([import_zod15.z.string().min(1), import_zod15.z.array(mcpInstallationMethodSchema)]),
1631
- // Single config or array of methods
1632
- parameters: import_zod15.z.array(mcpParameterSchema).optional()
1633
- });
1634
- var marketplaceItemSchema = import_zod15.z.discriminatedUnion("type", [
1635
- // Mode marketplace item
1636
- modeMarketplaceItemSchema.extend({
1637
- type: import_zod15.z.literal("mode")
1638
- }),
1639
- // MCP marketplace item
1640
- mcpMarketplaceItemSchema.extend({
1641
- type: import_zod15.z.literal("mcp")
1642
- })
1643
- ]);
1644
- var installMarketplaceItemOptionsSchema = import_zod15.z.object({
1645
- target: import_zod15.z.enum(["global", "project"]).optional().default("project"),
1646
- parameters: import_zod15.z.record(import_zod15.z.string(), import_zod15.z.any()).optional()
1647
- });
1648
-
1649
- // src/mcp.ts
1650
- var import_zod16 = require("zod");
1651
- var mcpExecutionStatusSchema = import_zod16.z.discriminatedUnion("status", [
1652
- import_zod16.z.object({
1653
- executionId: import_zod16.z.string(),
1654
- status: import_zod16.z.literal("started"),
1655
- serverName: import_zod16.z.string(),
1656
- toolName: import_zod16.z.string()
1657
- }),
1658
- import_zod16.z.object({
1659
- executionId: import_zod16.z.string(),
1660
- status: import_zod16.z.literal("output"),
1661
- response: import_zod16.z.string()
1662
- }),
1663
- import_zod16.z.object({
1664
- executionId: import_zod16.z.string(),
1665
- status: import_zod16.z.literal("completed"),
1666
- response: import_zod16.z.string().optional()
1667
- }),
1668
- import_zod16.z.object({
1669
- executionId: import_zod16.z.string(),
1670
- status: import_zod16.z.literal("error"),
1671
- error: import_zod16.z.string().optional()
1672
- })
1673
- ]);
1674
-
1675
- // src/task.ts
1676
- var import_zod17 = require("zod");
1677
- var TaskStatus = /* @__PURE__ */ ((TaskStatus2) => {
1678
- TaskStatus2["Running"] = "running";
1679
- TaskStatus2["Interactive"] = "interactive";
1680
- TaskStatus2["Resumable"] = "resumable";
1681
- TaskStatus2["Idle"] = "idle";
1682
- TaskStatus2["None"] = "none";
1683
- return TaskStatus2;
1684
- })(TaskStatus || {});
1685
- var taskMetadataSchema = import_zod17.z.object({
1686
- task: import_zod17.z.string().optional(),
1687
- images: import_zod17.z.array(import_zod17.z.string()).optional()
1688
- });
1689
-
1690
- // src/todo.ts
1691
- var import_zod18 = require("zod");
1692
- var todoStatusSchema = import_zod18.z.enum(["pending", "in_progress", "completed"]);
1693
- var todoItemSchema = import_zod18.z.object({
1694
- id: import_zod18.z.string(),
1695
- content: import_zod18.z.string(),
1696
- status: todoStatusSchema
1697
- });
1698
-
1699
- // src/terminal.ts
1700
- var import_zod19 = require("zod");
1701
- var commandExecutionStatusSchema = import_zod19.z.discriminatedUnion("status", [
1702
- import_zod19.z.object({
1703
- executionId: import_zod19.z.string(),
1704
- status: import_zod19.z.literal("started"),
1705
- pid: import_zod19.z.number().optional(),
1706
- command: import_zod19.z.string()
1707
- }),
1708
- import_zod19.z.object({
1709
- executionId: import_zod19.z.string(),
1710
- status: import_zod19.z.literal("output"),
1711
- output: import_zod19.z.string()
1712
- }),
1713
- import_zod19.z.object({
1714
- executionId: import_zod19.z.string(),
1715
- status: import_zod19.z.literal("exited"),
1716
- exitCode: import_zod19.z.number().optional()
1717
- }),
1718
- import_zod19.z.object({
1719
- executionId: import_zod19.z.string(),
1720
- status: import_zod19.z.literal("fallback")
1721
- }),
1722
- import_zod19.z.object({
1723
- executionId: import_zod19.z.string(),
1724
- status: import_zod19.z.literal("timeout")
1725
- })
1726
- ]);
1727
-
1728
664
  // src/providers/anthropic.ts
1729
665
  var anthropicDefaultModelId = "claude-sonnet-4-20250514";
1730
666
  var anthropicModels = {
@@ -2306,6 +1242,7 @@ var BEDROCK_REGIONS = [
2306
1242
  { value: "us-gov-east-1", label: "us-gov-east-1" },
2307
1243
  { value: "us-gov-west-1", label: "us-gov-west-1" }
2308
1244
  ].sort((a, b) => a.value.localeCompare(b.value));
1245
+ var BEDROCK_CLAUDE_SONNET_4_MODEL_ID = "anthropic.claude-sonnet-4-20250514-v1:0";
2309
1246
 
2310
1247
  // src/providers/cerebras.ts
2311
1248
  var cerebrasDefaultModelId = "qwen-3-coder-480b-free";
@@ -2700,34 +1637,223 @@ var deepSeekModels = {
2700
1637
  maxTokens: 8192,
2701
1638
  contextWindow: 64e3,
2702
1639
  supportsImages: false,
2703
- supportsPromptCache: true,
2704
- inputPrice: 0.27,
2705
- // $0.27 per million tokens (cache miss)
2706
- outputPrice: 1.1,
2707
- // $1.10 per million tokens
2708
- cacheWritesPrice: 0.27,
2709
- // $0.27 per million tokens (cache miss)
2710
- cacheReadsPrice: 0.07,
2711
- // $0.07 per million tokens (cache hit).
2712
- description: `DeepSeek-V3 achieves a significant breakthrough in inference speed over previous models. It tops the leaderboard among open-source models and rivals the most advanced closed-source models globally.`
1640
+ supportsPromptCache: true,
1641
+ inputPrice: 0.27,
1642
+ // $0.27 per million tokens (cache miss)
1643
+ outputPrice: 1.1,
1644
+ // $1.10 per million tokens
1645
+ cacheWritesPrice: 0.27,
1646
+ // $0.27 per million tokens (cache miss)
1647
+ cacheReadsPrice: 0.07,
1648
+ // $0.07 per million tokens (cache hit).
1649
+ description: `DeepSeek-V3 achieves a significant breakthrough in inference speed over previous models. It tops the leaderboard among open-source models and rivals the most advanced closed-source models globally.`
1650
+ },
1651
+ "deepseek-reasoner": {
1652
+ maxTokens: 8192,
1653
+ contextWindow: 64e3,
1654
+ supportsImages: false,
1655
+ supportsPromptCache: true,
1656
+ inputPrice: 0.55,
1657
+ // $0.55 per million tokens (cache miss)
1658
+ outputPrice: 2.19,
1659
+ // $2.19 per million tokens
1660
+ cacheWritesPrice: 0.55,
1661
+ // $0.55 per million tokens (cache miss)
1662
+ cacheReadsPrice: 0.14,
1663
+ // $0.14 per million tokens (cache hit)
1664
+ description: `DeepSeek-R1 achieves performance comparable to OpenAI-o1 across math, code, and reasoning tasks. Supports Chain of Thought reasoning with up to 32K tokens.`
1665
+ }
1666
+ };
1667
+ var DEEP_SEEK_DEFAULT_TEMPERATURE = 0.6;
1668
+
1669
+ // src/providers/doubao.ts
1670
+ var doubaoDefaultModelId = "doubao-seed-1-6-250615";
1671
+ var doubaoModels = {
1672
+ "doubao-seed-1-6-250615": {
1673
+ maxTokens: 32768,
1674
+ contextWindow: 128e3,
1675
+ supportsImages: true,
1676
+ supportsPromptCache: true,
1677
+ inputPrice: 1e-4,
1678
+ // $0.0001 per million tokens (cache miss)
1679
+ outputPrice: 4e-4,
1680
+ // $0.0004 per million tokens
1681
+ cacheWritesPrice: 1e-4,
1682
+ // $0.0001 per million tokens (cache miss)
1683
+ cacheReadsPrice: 2e-5,
1684
+ // $0.00002 per million tokens (cache hit)
1685
+ description: `Doubao Seed 1.6 is a powerful model designed for high-performance tasks with extensive context handling.`
1686
+ },
1687
+ "doubao-seed-1-6-thinking-250715": {
1688
+ maxTokens: 32768,
1689
+ contextWindow: 128e3,
1690
+ supportsImages: true,
1691
+ supportsPromptCache: true,
1692
+ inputPrice: 2e-4,
1693
+ // $0.0002 per million tokens
1694
+ outputPrice: 8e-4,
1695
+ // $0.0008 per million tokens
1696
+ cacheWritesPrice: 2e-4,
1697
+ // $0.0002 per million
1698
+ cacheReadsPrice: 4e-5,
1699
+ // $0.00004 per million tokens (cache hit)
1700
+ description: `Doubao Seed 1.6 Thinking is optimized for reasoning tasks, providing enhanced performance in complex problem-solving scenarios.`
1701
+ },
1702
+ "doubao-seed-1-6-flash-250715": {
1703
+ maxTokens: 32768,
1704
+ contextWindow: 128e3,
1705
+ supportsImages: true,
1706
+ supportsPromptCache: true,
1707
+ inputPrice: 15e-5,
1708
+ // $0.00015 per million tokens
1709
+ outputPrice: 6e-4,
1710
+ // $0.0006 per million tokens
1711
+ cacheWritesPrice: 15e-5,
1712
+ // $0.00015 per million
1713
+ cacheReadsPrice: 3e-5,
1714
+ // $0.00003 per million tokens (cache hit)
1715
+ description: `Doubao Seed 1.6 Flash is tailored for speed and efficiency, making it ideal for applications requiring rapid responses.`
1716
+ }
1717
+ };
1718
+ var doubaoDefaultModelInfo = doubaoModels[doubaoDefaultModelId];
1719
+ var DOUBAO_API_BASE_URL = "https://ark.cn-beijing.volces.com/api/v3";
1720
+ var DOUBAO_API_CHAT_PATH = "/chat/completions";
1721
+
1722
+ // src/providers/featherless.ts
1723
+ var featherlessModels = {
1724
+ "deepseek-ai/DeepSeek-V3-0324": {
1725
+ maxTokens: 4096,
1726
+ contextWindow: 32678,
1727
+ supportsImages: false,
1728
+ supportsPromptCache: false,
1729
+ inputPrice: 0,
1730
+ outputPrice: 0,
1731
+ description: "DeepSeek V3 0324 model."
1732
+ },
1733
+ "deepseek-ai/DeepSeek-R1-0528": {
1734
+ maxTokens: 4096,
1735
+ contextWindow: 32678,
1736
+ supportsImages: false,
1737
+ supportsPromptCache: false,
1738
+ inputPrice: 0,
1739
+ outputPrice: 0,
1740
+ description: "DeepSeek R1 0528 model."
1741
+ },
1742
+ "moonshotai/Kimi-K2-Instruct": {
1743
+ maxTokens: 4096,
1744
+ contextWindow: 32678,
1745
+ supportsImages: false,
1746
+ supportsPromptCache: false,
1747
+ inputPrice: 0,
1748
+ outputPrice: 0,
1749
+ description: "Kimi K2 Instruct model."
1750
+ },
1751
+ "openai/gpt-oss-120b": {
1752
+ maxTokens: 4096,
1753
+ contextWindow: 32678,
1754
+ supportsImages: false,
1755
+ supportsPromptCache: false,
1756
+ inputPrice: 0,
1757
+ outputPrice: 0,
1758
+ description: "GPT-OSS 120B model."
1759
+ },
1760
+ "Qwen/Qwen3-Coder-480B-A35B-Instruct": {
1761
+ maxTokens: 4096,
1762
+ contextWindow: 32678,
1763
+ supportsImages: false,
1764
+ supportsPromptCache: false,
1765
+ inputPrice: 0,
1766
+ outputPrice: 0,
1767
+ description: "Qwen3 Coder 480B A35B Instruct model."
1768
+ }
1769
+ };
1770
+ var featherlessDefaultModelId = "deepseek-ai/DeepSeek-R1-0528";
1771
+
1772
+ // src/providers/fireworks.ts
1773
+ var fireworksDefaultModelId = "accounts/fireworks/models/kimi-k2-instruct";
1774
+ var fireworksModels = {
1775
+ "accounts/fireworks/models/kimi-k2-instruct": {
1776
+ maxTokens: 16384,
1777
+ contextWindow: 128e3,
1778
+ supportsImages: false,
1779
+ supportsPromptCache: false,
1780
+ inputPrice: 0.6,
1781
+ outputPrice: 2.5,
1782
+ description: "Kimi K2 is a state-of-the-art mixture-of-experts (MoE) language model with 32 billion activated parameters and 1 trillion total parameters. Trained with the Muon optimizer, Kimi K2 achieves exceptional performance across frontier knowledge, reasoning, and coding tasks while being meticulously optimized for agentic capabilities."
1783
+ },
1784
+ "accounts/fireworks/models/qwen3-235b-a22b-instruct-2507": {
1785
+ maxTokens: 32768,
1786
+ contextWindow: 256e3,
1787
+ supportsImages: false,
1788
+ supportsPromptCache: false,
1789
+ inputPrice: 0.22,
1790
+ outputPrice: 0.88,
1791
+ description: "Latest Qwen3 thinking model, competitive against the best closed source models in Jul 2025."
1792
+ },
1793
+ "accounts/fireworks/models/qwen3-coder-480b-a35b-instruct": {
1794
+ maxTokens: 32768,
1795
+ contextWindow: 256e3,
1796
+ supportsImages: false,
1797
+ supportsPromptCache: false,
1798
+ inputPrice: 0.45,
1799
+ outputPrice: 1.8,
1800
+ description: "Qwen3's most agentic code model to date."
1801
+ },
1802
+ "accounts/fireworks/models/deepseek-r1-0528": {
1803
+ maxTokens: 20480,
1804
+ contextWindow: 16e4,
1805
+ supportsImages: false,
1806
+ supportsPromptCache: false,
1807
+ inputPrice: 3,
1808
+ outputPrice: 8,
1809
+ description: "05/28 updated checkpoint of Deepseek R1. Its overall performance is now approaching that of leading models, such as O3 and Gemini 2.5 Pro. Compared to the previous version, the upgraded model shows significant improvements in handling complex reasoning tasks, and this version also offers a reduced hallucination rate, enhanced support for function calling, and better experience for vibe coding. Note that fine-tuning for this model is only available through contacting fireworks at https://fireworks.ai/company/contact-us."
1810
+ },
1811
+ "accounts/fireworks/models/deepseek-v3": {
1812
+ maxTokens: 16384,
1813
+ contextWindow: 128e3,
1814
+ supportsImages: false,
1815
+ supportsPromptCache: false,
1816
+ inputPrice: 0.9,
1817
+ outputPrice: 0.9,
1818
+ description: "A strong Mixture-of-Experts (MoE) language model with 671B total parameters with 37B activated for each token from Deepseek. Note that fine-tuning for this model is only available through contacting fireworks at https://fireworks.ai/company/contact-us."
1819
+ },
1820
+ "accounts/fireworks/models/glm-4p5": {
1821
+ maxTokens: 16384,
1822
+ contextWindow: 128e3,
1823
+ supportsImages: false,
1824
+ supportsPromptCache: false,
1825
+ inputPrice: 0.55,
1826
+ outputPrice: 2.19,
1827
+ description: "Z.ai GLM-4.5 with 355B total parameters and 32B active parameters. Features unified reasoning, coding, and intelligent agent capabilities."
2713
1828
  },
2714
- "deepseek-reasoner": {
2715
- maxTokens: 8192,
2716
- contextWindow: 64e3,
1829
+ "accounts/fireworks/models/glm-4p5-air": {
1830
+ maxTokens: 16384,
1831
+ contextWindow: 128e3,
2717
1832
  supportsImages: false,
2718
- supportsPromptCache: true,
1833
+ supportsPromptCache: false,
2719
1834
  inputPrice: 0.55,
2720
- // $0.55 per million tokens (cache miss)
2721
1835
  outputPrice: 2.19,
2722
- // $2.19 per million tokens
2723
- cacheWritesPrice: 0.55,
2724
- // $0.55 per million tokens (cache miss)
2725
- cacheReadsPrice: 0.14,
2726
- // $0.14 per million tokens (cache hit)
2727
- description: `DeepSeek-R1 achieves performance comparable to OpenAI-o1 across math, code, and reasoning tasks. Supports Chain of Thought reasoning with up to 32K tokens.`
1836
+ description: "Z.ai GLM-4.5-Air with 106B total parameters and 12B active parameters. Features unified reasoning, coding, and intelligent agent capabilities."
1837
+ },
1838
+ "accounts/fireworks/models/gpt-oss-20b": {
1839
+ maxTokens: 16384,
1840
+ contextWindow: 128e3,
1841
+ supportsImages: false,
1842
+ supportsPromptCache: false,
1843
+ inputPrice: 0.07,
1844
+ outputPrice: 0.3,
1845
+ description: "OpenAI gpt-oss-20b: Compact model for local/edge deployments. Optimized for low-latency and resource-constrained environments with chain-of-thought output, adjustable reasoning, and agentic workflows."
1846
+ },
1847
+ "accounts/fireworks/models/gpt-oss-120b": {
1848
+ maxTokens: 16384,
1849
+ contextWindow: 128e3,
1850
+ supportsImages: false,
1851
+ supportsPromptCache: false,
1852
+ inputPrice: 0.15,
1853
+ outputPrice: 0.6,
1854
+ description: "OpenAI gpt-oss-120b: Production-grade, general-purpose model that fits on a single H100 GPU. Features complex reasoning, configurable effort, full chain-of-thought transparency, and supports function calling, tool use, and structured outputs."
2728
1855
  }
2729
1856
  };
2730
- var DEEP_SEEK_DEFAULT_TEMPERATURE = 0.6;
2731
1857
 
2732
1858
  // src/providers/gemini.ts
2733
1859
  var geminiDefaultModelId = "gemini-2.0-flash-001";
@@ -3710,6 +2836,20 @@ var requestyDefaultModelInfo = {
3710
2836
  description: "The best coding model, optimized by Requesty, and automatically routed to the fastest provider. Claude 4 Sonnet is an advanced large language model with improved reasoning, coding, and problem-solving capabilities."
3711
2837
  };
3712
2838
 
2839
+ // src/providers/roo.ts
2840
+ var rooDefaultModelId = "roo/sonic";
2841
+ var rooModels = {
2842
+ "roo/sonic": {
2843
+ maxTokens: 16384,
2844
+ contextWindow: 262144,
2845
+ supportsImages: false,
2846
+ supportsPromptCache: true,
2847
+ inputPrice: 0,
2848
+ outputPrice: 0,
2849
+ description: "A stealth reasoning model that is blazing fast and excels at agentic coding, accessible for free through Roo Code Cloud for a limited time. (Note: prompts and completions are logged by the model creator and used to improve the model.)"
2850
+ }
2851
+ };
2852
+
3713
2853
  // src/providers/sambanova.ts
3714
2854
  var sambaNovaDefaultModelId = "Meta-Llama-3.3-70B-Instruct";
3715
2855
  var sambaNovaModels = {
@@ -3870,738 +3010,1807 @@ var vertexModels = {
3870
3010
  inputPrice: 2.5,
3871
3011
  outputPrice: 15
3872
3012
  },
3873
- "gemini-2.5-pro-preview-06-05": {
3874
- maxTokens: 65535,
3875
- contextWindow: 1048576,
3013
+ "gemini-2.5-pro-preview-06-05": {
3014
+ maxTokens: 65535,
3015
+ contextWindow: 1048576,
3016
+ supportsImages: true,
3017
+ supportsPromptCache: true,
3018
+ inputPrice: 2.5,
3019
+ outputPrice: 15,
3020
+ maxThinkingTokens: 32768,
3021
+ supportsReasoningBudget: true
3022
+ },
3023
+ "gemini-2.5-pro": {
3024
+ maxTokens: 64e3,
3025
+ contextWindow: 1048576,
3026
+ supportsImages: true,
3027
+ supportsPromptCache: true,
3028
+ inputPrice: 2.5,
3029
+ outputPrice: 15,
3030
+ maxThinkingTokens: 32768,
3031
+ supportsReasoningBudget: true,
3032
+ requiredReasoningBudget: true,
3033
+ tiers: [
3034
+ {
3035
+ contextWindow: 2e5,
3036
+ inputPrice: 1.25,
3037
+ outputPrice: 10,
3038
+ cacheReadsPrice: 0.31
3039
+ },
3040
+ {
3041
+ contextWindow: Infinity,
3042
+ inputPrice: 2.5,
3043
+ outputPrice: 15,
3044
+ cacheReadsPrice: 0.625
3045
+ }
3046
+ ]
3047
+ },
3048
+ "gemini-2.5-pro-exp-03-25": {
3049
+ maxTokens: 65535,
3050
+ contextWindow: 1048576,
3051
+ supportsImages: true,
3052
+ supportsPromptCache: false,
3053
+ inputPrice: 0,
3054
+ outputPrice: 0
3055
+ },
3056
+ "gemini-2.0-pro-exp-02-05": {
3057
+ maxTokens: 8192,
3058
+ contextWindow: 2097152,
3059
+ supportsImages: true,
3060
+ supportsPromptCache: false,
3061
+ inputPrice: 0,
3062
+ outputPrice: 0
3063
+ },
3064
+ "gemini-2.0-flash-001": {
3065
+ maxTokens: 8192,
3066
+ contextWindow: 1048576,
3067
+ supportsImages: true,
3068
+ supportsPromptCache: true,
3069
+ inputPrice: 0.15,
3070
+ outputPrice: 0.6
3071
+ },
3072
+ "gemini-2.0-flash-lite-001": {
3073
+ maxTokens: 8192,
3074
+ contextWindow: 1048576,
3075
+ supportsImages: true,
3076
+ supportsPromptCache: false,
3077
+ inputPrice: 0.075,
3078
+ outputPrice: 0.3
3079
+ },
3080
+ "gemini-2.0-flash-thinking-exp-01-21": {
3081
+ maxTokens: 8192,
3082
+ contextWindow: 32768,
3083
+ supportsImages: true,
3084
+ supportsPromptCache: false,
3085
+ inputPrice: 0,
3086
+ outputPrice: 0
3087
+ },
3088
+ "gemini-1.5-flash-002": {
3089
+ maxTokens: 8192,
3090
+ contextWindow: 1048576,
3091
+ supportsImages: true,
3092
+ supportsPromptCache: true,
3093
+ inputPrice: 0.075,
3094
+ outputPrice: 0.3
3095
+ },
3096
+ "gemini-1.5-pro-002": {
3097
+ maxTokens: 8192,
3098
+ contextWindow: 2097152,
3099
+ supportsImages: true,
3100
+ supportsPromptCache: false,
3101
+ inputPrice: 1.25,
3102
+ outputPrice: 5
3103
+ },
3104
+ "claude-sonnet-4@20250514": {
3105
+ maxTokens: 8192,
3106
+ contextWindow: 2e5,
3107
+ supportsImages: true,
3108
+ supportsComputerUse: true,
3109
+ supportsPromptCache: true,
3110
+ inputPrice: 3,
3111
+ outputPrice: 15,
3112
+ cacheWritesPrice: 3.75,
3113
+ cacheReadsPrice: 0.3,
3114
+ supportsReasoningBudget: true
3115
+ },
3116
+ "claude-opus-4-1@20250805": {
3117
+ maxTokens: 8192,
3118
+ contextWindow: 2e5,
3119
+ supportsImages: true,
3120
+ supportsComputerUse: true,
3121
+ supportsPromptCache: true,
3122
+ inputPrice: 15,
3123
+ outputPrice: 75,
3124
+ cacheWritesPrice: 18.75,
3125
+ cacheReadsPrice: 1.5,
3126
+ supportsReasoningBudget: true
3127
+ },
3128
+ "claude-opus-4@20250514": {
3129
+ maxTokens: 8192,
3130
+ contextWindow: 2e5,
3131
+ supportsImages: true,
3132
+ supportsComputerUse: true,
3133
+ supportsPromptCache: true,
3134
+ inputPrice: 15,
3135
+ outputPrice: 75,
3136
+ cacheWritesPrice: 18.75,
3137
+ cacheReadsPrice: 1.5
3138
+ },
3139
+ "claude-3-7-sonnet@20250219:thinking": {
3140
+ maxTokens: 64e3,
3141
+ contextWindow: 2e5,
3142
+ supportsImages: true,
3143
+ supportsComputerUse: true,
3144
+ supportsPromptCache: true,
3145
+ inputPrice: 3,
3146
+ outputPrice: 15,
3147
+ cacheWritesPrice: 3.75,
3148
+ cacheReadsPrice: 0.3,
3149
+ supportsReasoningBudget: true,
3150
+ requiredReasoningBudget: true
3151
+ },
3152
+ "claude-3-7-sonnet@20250219": {
3153
+ maxTokens: 8192,
3154
+ contextWindow: 2e5,
3155
+ supportsImages: true,
3156
+ supportsComputerUse: true,
3157
+ supportsPromptCache: true,
3158
+ inputPrice: 3,
3159
+ outputPrice: 15,
3160
+ cacheWritesPrice: 3.75,
3161
+ cacheReadsPrice: 0.3
3162
+ },
3163
+ "claude-3-5-sonnet-v2@20241022": {
3164
+ maxTokens: 8192,
3165
+ contextWindow: 2e5,
3166
+ supportsImages: true,
3167
+ supportsComputerUse: true,
3168
+ supportsPromptCache: true,
3169
+ inputPrice: 3,
3170
+ outputPrice: 15,
3171
+ cacheWritesPrice: 3.75,
3172
+ cacheReadsPrice: 0.3
3173
+ },
3174
+ "claude-3-5-sonnet@20240620": {
3175
+ maxTokens: 8192,
3176
+ contextWindow: 2e5,
3177
+ supportsImages: true,
3178
+ supportsPromptCache: true,
3179
+ inputPrice: 3,
3180
+ outputPrice: 15,
3181
+ cacheWritesPrice: 3.75,
3182
+ cacheReadsPrice: 0.3
3183
+ },
3184
+ "claude-3-5-haiku@20241022": {
3185
+ maxTokens: 8192,
3186
+ contextWindow: 2e5,
3187
+ supportsImages: false,
3188
+ supportsPromptCache: true,
3189
+ inputPrice: 1,
3190
+ outputPrice: 5,
3191
+ cacheWritesPrice: 1.25,
3192
+ cacheReadsPrice: 0.1
3193
+ },
3194
+ "claude-3-opus@20240229": {
3195
+ maxTokens: 4096,
3196
+ contextWindow: 2e5,
3197
+ supportsImages: true,
3198
+ supportsPromptCache: true,
3199
+ inputPrice: 15,
3200
+ outputPrice: 75,
3201
+ cacheWritesPrice: 18.75,
3202
+ cacheReadsPrice: 1.5
3203
+ },
3204
+ "claude-3-haiku@20240307": {
3205
+ maxTokens: 4096,
3206
+ contextWindow: 2e5,
3876
3207
  supportsImages: true,
3877
3208
  supportsPromptCache: true,
3878
- inputPrice: 2.5,
3879
- outputPrice: 15,
3880
- maxThinkingTokens: 32768,
3881
- supportsReasoningBudget: true
3209
+ inputPrice: 0.25,
3210
+ outputPrice: 1.25,
3211
+ cacheWritesPrice: 0.3,
3212
+ cacheReadsPrice: 0.03
3882
3213
  },
3883
- "gemini-2.5-pro": {
3214
+ "gemini-2.5-flash-lite-preview-06-17": {
3884
3215
  maxTokens: 64e3,
3885
3216
  contextWindow: 1048576,
3886
3217
  supportsImages: true,
3887
3218
  supportsPromptCache: true,
3888
- inputPrice: 2.5,
3889
- outputPrice: 15,
3890
- maxThinkingTokens: 32768,
3891
- supportsReasoningBudget: true,
3892
- requiredReasoningBudget: true,
3893
- tiers: [
3894
- {
3895
- contextWindow: 2e5,
3896
- inputPrice: 1.25,
3897
- outputPrice: 10,
3898
- cacheReadsPrice: 0.31
3899
- },
3900
- {
3901
- contextWindow: Infinity,
3902
- inputPrice: 2.5,
3903
- outputPrice: 15,
3904
- cacheReadsPrice: 0.625
3905
- }
3906
- ]
3219
+ inputPrice: 0.1,
3220
+ outputPrice: 0.4,
3221
+ cacheReadsPrice: 0.025,
3222
+ cacheWritesPrice: 1,
3223
+ maxThinkingTokens: 24576,
3224
+ supportsReasoningBudget: true
3907
3225
  },
3908
- "gemini-2.5-pro-exp-03-25": {
3909
- maxTokens: 65535,
3910
- contextWindow: 1048576,
3911
- supportsImages: true,
3226
+ "llama-4-maverick-17b-128e-instruct-maas": {
3227
+ maxTokens: 8192,
3228
+ contextWindow: 131072,
3229
+ supportsImages: false,
3230
+ supportsPromptCache: false,
3231
+ inputPrice: 0.35,
3232
+ outputPrice: 1.15,
3233
+ description: "Meta Llama 4 Maverick 17B Instruct model, 128K context."
3234
+ }
3235
+ };
3236
+ var VERTEX_REGIONS = [
3237
+ { value: "global", label: "global" },
3238
+ { value: "us-central1", label: "us-central1" },
3239
+ { value: "us-east1", label: "us-east1" },
3240
+ { value: "us-east4", label: "us-east4" },
3241
+ { value: "us-east5", label: "us-east5" },
3242
+ { value: "us-west1", label: "us-west1" },
3243
+ { value: "us-west2", label: "us-west2" },
3244
+ { value: "us-west3", label: "us-west3" },
3245
+ { value: "us-west4", label: "us-west4" },
3246
+ { value: "northamerica-northeast1", label: "northamerica-northeast1" },
3247
+ { value: "northamerica-northeast2", label: "northamerica-northeast2" },
3248
+ { value: "southamerica-east1", label: "southamerica-east1" },
3249
+ { value: "europe-west1", label: "europe-west1" },
3250
+ { value: "europe-west2", label: "europe-west2" },
3251
+ { value: "europe-west3", label: "europe-west3" },
3252
+ { value: "europe-west4", label: "europe-west4" },
3253
+ { value: "europe-west6", label: "europe-west6" },
3254
+ { value: "europe-central2", label: "europe-central2" },
3255
+ { value: "asia-east1", label: "asia-east1" },
3256
+ { value: "asia-east2", label: "asia-east2" },
3257
+ { value: "asia-northeast1", label: "asia-northeast1" },
3258
+ { value: "asia-northeast2", label: "asia-northeast2" },
3259
+ { value: "asia-northeast3", label: "asia-northeast3" },
3260
+ { value: "asia-south1", label: "asia-south1" },
3261
+ { value: "asia-south2", label: "asia-south2" },
3262
+ { value: "asia-southeast1", label: "asia-southeast1" },
3263
+ { value: "asia-southeast2", label: "asia-southeast2" },
3264
+ { value: "australia-southeast1", label: "australia-southeast1" },
3265
+ { value: "australia-southeast2", label: "australia-southeast2" },
3266
+ { value: "me-west1", label: "me-west1" },
3267
+ { value: "me-central1", label: "me-central1" },
3268
+ { value: "africa-south1", label: "africa-south1" }
3269
+ ];
3270
+
3271
+ // src/providers/vscode-llm.ts
3272
+ var vscodeLlmDefaultModelId = "claude-3.5-sonnet";
3273
+ var vscodeLlmModels = {
3274
+ "gpt-3.5-turbo": {
3275
+ contextWindow: 12114,
3276
+ supportsImages: false,
3912
3277
  supportsPromptCache: false,
3913
3278
  inputPrice: 0,
3914
- outputPrice: 0
3279
+ outputPrice: 0,
3280
+ family: "gpt-3.5-turbo",
3281
+ version: "gpt-3.5-turbo-0613",
3282
+ name: "GPT 3.5 Turbo",
3283
+ supportsToolCalling: true,
3284
+ maxInputTokens: 12114
3915
3285
  },
3916
- "gemini-2.0-pro-exp-02-05": {
3917
- maxTokens: 8192,
3918
- contextWindow: 2097152,
3919
- supportsImages: true,
3286
+ "gpt-4o-mini": {
3287
+ contextWindow: 12115,
3288
+ supportsImages: false,
3920
3289
  supportsPromptCache: false,
3921
3290
  inputPrice: 0,
3922
- outputPrice: 0
3291
+ outputPrice: 0,
3292
+ family: "gpt-4o-mini",
3293
+ version: "gpt-4o-mini-2024-07-18",
3294
+ name: "GPT-4o mini",
3295
+ supportsToolCalling: true,
3296
+ maxInputTokens: 12115
3923
3297
  },
3924
- "gemini-2.0-flash-001": {
3925
- maxTokens: 8192,
3926
- contextWindow: 1048576,
3927
- supportsImages: true,
3928
- supportsPromptCache: true,
3929
- inputPrice: 0.15,
3930
- outputPrice: 0.6
3298
+ "gpt-4": {
3299
+ contextWindow: 28501,
3300
+ supportsImages: false,
3301
+ supportsPromptCache: false,
3302
+ inputPrice: 0,
3303
+ outputPrice: 0,
3304
+ family: "gpt-4",
3305
+ version: "gpt-4-0613",
3306
+ name: "GPT 4",
3307
+ supportsToolCalling: true,
3308
+ maxInputTokens: 28501
3931
3309
  },
3932
- "gemini-2.0-flash-lite-001": {
3933
- maxTokens: 8192,
3934
- contextWindow: 1048576,
3935
- supportsImages: true,
3310
+ "gpt-4-0125-preview": {
3311
+ contextWindow: 63826,
3312
+ supportsImages: false,
3936
3313
  supportsPromptCache: false,
3937
- inputPrice: 0.075,
3938
- outputPrice: 0.3
3314
+ inputPrice: 0,
3315
+ outputPrice: 0,
3316
+ family: "gpt-4-turbo",
3317
+ version: "gpt-4-0125-preview",
3318
+ name: "GPT 4 Turbo",
3319
+ supportsToolCalling: true,
3320
+ maxInputTokens: 63826
3939
3321
  },
3940
- "gemini-2.0-flash-thinking-exp-01-21": {
3941
- maxTokens: 8192,
3942
- contextWindow: 32768,
3322
+ "gpt-4o": {
3323
+ contextWindow: 63827,
3943
3324
  supportsImages: true,
3944
3325
  supportsPromptCache: false,
3945
3326
  inputPrice: 0,
3946
- outputPrice: 0
3327
+ outputPrice: 0,
3328
+ family: "gpt-4o",
3329
+ version: "gpt-4o-2024-11-20",
3330
+ name: "GPT-4o",
3331
+ supportsToolCalling: true,
3332
+ maxInputTokens: 63827
3947
3333
  },
3948
- "gemini-1.5-flash-002": {
3949
- maxTokens: 8192,
3950
- contextWindow: 1048576,
3334
+ o1: {
3335
+ contextWindow: 19827,
3336
+ supportsImages: false,
3337
+ supportsPromptCache: false,
3338
+ inputPrice: 0,
3339
+ outputPrice: 0,
3340
+ family: "o1-ga",
3341
+ version: "o1-2024-12-17",
3342
+ name: "o1 (Preview)",
3343
+ supportsToolCalling: true,
3344
+ maxInputTokens: 19827
3345
+ },
3346
+ "o3-mini": {
3347
+ contextWindow: 63827,
3348
+ supportsImages: false,
3349
+ supportsPromptCache: false,
3350
+ inputPrice: 0,
3351
+ outputPrice: 0,
3352
+ family: "o3-mini",
3353
+ version: "o3-mini-2025-01-31",
3354
+ name: "o3-mini",
3355
+ supportsToolCalling: true,
3356
+ maxInputTokens: 63827
3357
+ },
3358
+ "claude-3.5-sonnet": {
3359
+ contextWindow: 81638,
3951
3360
  supportsImages: true,
3952
- supportsPromptCache: true,
3953
- inputPrice: 0.075,
3954
- outputPrice: 0.3
3361
+ supportsPromptCache: false,
3362
+ inputPrice: 0,
3363
+ outputPrice: 0,
3364
+ family: "claude-3.5-sonnet",
3365
+ version: "claude-3.5-sonnet",
3366
+ name: "Claude 3.5 Sonnet",
3367
+ supportsToolCalling: true,
3368
+ maxInputTokens: 81638
3955
3369
  },
3956
- "gemini-1.5-pro-002": {
3957
- maxTokens: 8192,
3958
- contextWindow: 2097152,
3370
+ "claude-4-sonnet": {
3371
+ contextWindow: 128e3,
3959
3372
  supportsImages: true,
3960
3373
  supportsPromptCache: false,
3961
- inputPrice: 1.25,
3962
- outputPrice: 5
3374
+ inputPrice: 0,
3375
+ outputPrice: 0,
3376
+ family: "claude-sonnet-4",
3377
+ version: "claude-sonnet-4",
3378
+ name: "Claude Sonnet 4",
3379
+ supportsToolCalling: true,
3380
+ maxInputTokens: 111836
3963
3381
  },
3964
- "claude-sonnet-4@20250514": {
3965
- maxTokens: 8192,
3966
- contextWindow: 2e5,
3382
+ "gemini-2.0-flash-001": {
3383
+ contextWindow: 127827,
3967
3384
  supportsImages: true,
3968
- supportsComputerUse: true,
3969
- supportsPromptCache: true,
3970
- inputPrice: 3,
3971
- outputPrice: 15,
3972
- cacheWritesPrice: 3.75,
3973
- cacheReadsPrice: 0.3,
3974
- supportsReasoningBudget: true
3385
+ supportsPromptCache: false,
3386
+ inputPrice: 0,
3387
+ outputPrice: 0,
3388
+ family: "gemini-2.0-flash",
3389
+ version: "gemini-2.0-flash-001",
3390
+ name: "Gemini 2.0 Flash",
3391
+ supportsToolCalling: false,
3392
+ maxInputTokens: 127827
3975
3393
  },
3976
- "claude-opus-4-1@20250805": {
3977
- maxTokens: 8192,
3978
- contextWindow: 2e5,
3394
+ "gemini-2.5-pro": {
3395
+ contextWindow: 128e3,
3979
3396
  supportsImages: true,
3980
- supportsComputerUse: true,
3981
- supportsPromptCache: true,
3982
- inputPrice: 15,
3983
- outputPrice: 75,
3984
- cacheWritesPrice: 18.75,
3985
- cacheReadsPrice: 1.5,
3986
- supportsReasoningBudget: true
3397
+ supportsPromptCache: false,
3398
+ inputPrice: 0,
3399
+ outputPrice: 0,
3400
+ family: "gemini-2.5-pro",
3401
+ version: "gemini-2.5-pro-preview-03-25",
3402
+ name: "Gemini 2.5 Pro (Preview)",
3403
+ supportsToolCalling: true,
3404
+ maxInputTokens: 108637
3405
+ },
3406
+ "o4-mini": {
3407
+ contextWindow: 128e3,
3408
+ supportsImages: false,
3409
+ supportsPromptCache: false,
3410
+ inputPrice: 0,
3411
+ outputPrice: 0,
3412
+ family: "o4-mini",
3413
+ version: "o4-mini-2025-04-16",
3414
+ name: "o4-mini (Preview)",
3415
+ supportsToolCalling: true,
3416
+ maxInputTokens: 111452
3987
3417
  },
3988
- "claude-opus-4@20250514": {
3989
- maxTokens: 8192,
3990
- contextWindow: 2e5,
3418
+ "gpt-4.1": {
3419
+ contextWindow: 128e3,
3991
3420
  supportsImages: true,
3992
- supportsComputerUse: true,
3993
- supportsPromptCache: true,
3994
- inputPrice: 15,
3995
- outputPrice: 75,
3996
- cacheWritesPrice: 18.75,
3997
- cacheReadsPrice: 1.5
3421
+ supportsPromptCache: false,
3422
+ inputPrice: 0,
3423
+ outputPrice: 0,
3424
+ family: "gpt-4.1",
3425
+ version: "gpt-4.1-2025-04-14",
3426
+ name: "GPT-4.1 (Preview)",
3427
+ supportsToolCalling: true,
3428
+ maxInputTokens: 111452
3998
3429
  },
3999
- "claude-3-7-sonnet@20250219:thinking": {
4000
- maxTokens: 64e3,
4001
- contextWindow: 2e5,
3430
+ "gpt-5-mini": {
3431
+ contextWindow: 128e3,
4002
3432
  supportsImages: true,
4003
- supportsComputerUse: true,
4004
- supportsPromptCache: true,
4005
- inputPrice: 3,
4006
- outputPrice: 15,
4007
- cacheWritesPrice: 3.75,
4008
- cacheReadsPrice: 0.3,
4009
- supportsReasoningBudget: true,
4010
- requiredReasoningBudget: true
3433
+ supportsPromptCache: false,
3434
+ inputPrice: 0,
3435
+ outputPrice: 0,
3436
+ family: "gpt-5-mini",
3437
+ version: "gpt-5-mini",
3438
+ name: "GPT-5 mini (Preview)",
3439
+ supportsToolCalling: true,
3440
+ maxInputTokens: 108637
4011
3441
  },
4012
- "claude-3-7-sonnet@20250219": {
4013
- maxTokens: 8192,
4014
- contextWindow: 2e5,
3442
+ "gpt-5": {
3443
+ contextWindow: 128e3,
4015
3444
  supportsImages: true,
4016
- supportsComputerUse: true,
4017
- supportsPromptCache: true,
4018
- inputPrice: 3,
4019
- outputPrice: 15,
4020
- cacheWritesPrice: 3.75,
4021
- cacheReadsPrice: 0.3
4022
- },
4023
- "claude-3-5-sonnet-v2@20241022": {
3445
+ supportsPromptCache: false,
3446
+ inputPrice: 0,
3447
+ outputPrice: 0,
3448
+ family: "gpt-5",
3449
+ version: "gpt-5",
3450
+ name: "GPT-5 (Preview)",
3451
+ supportsToolCalling: true,
3452
+ maxInputTokens: 108637
3453
+ }
3454
+ };
3455
+
3456
+ // src/providers/xai.ts
3457
+ var xaiDefaultModelId = "grok-4";
3458
+ var xaiModels = {
3459
+ "grok-4": {
4024
3460
  maxTokens: 8192,
4025
- contextWindow: 2e5,
3461
+ contextWindow: 256e3,
4026
3462
  supportsImages: true,
4027
- supportsComputerUse: true,
4028
3463
  supportsPromptCache: true,
4029
3464
  inputPrice: 3,
4030
3465
  outputPrice: 15,
4031
- cacheWritesPrice: 3.75,
4032
- cacheReadsPrice: 0.3
3466
+ cacheWritesPrice: 0.75,
3467
+ cacheReadsPrice: 0.75,
3468
+ description: "xAI's Grok-4 model with 256K context window"
4033
3469
  },
4034
- "claude-3-5-sonnet@20240620": {
3470
+ "grok-3": {
4035
3471
  maxTokens: 8192,
4036
- contextWindow: 2e5,
4037
- supportsImages: true,
3472
+ contextWindow: 131072,
3473
+ supportsImages: false,
4038
3474
  supportsPromptCache: true,
4039
3475
  inputPrice: 3,
4040
3476
  outputPrice: 15,
4041
- cacheWritesPrice: 3.75,
4042
- cacheReadsPrice: 0.3
3477
+ cacheWritesPrice: 0.75,
3478
+ cacheReadsPrice: 0.75,
3479
+ description: "xAI's Grok-3 model with 128K context window"
4043
3480
  },
4044
- "claude-3-5-haiku@20241022": {
3481
+ "grok-3-fast": {
4045
3482
  maxTokens: 8192,
4046
- contextWindow: 2e5,
3483
+ contextWindow: 131072,
4047
3484
  supportsImages: false,
4048
3485
  supportsPromptCache: true,
4049
- inputPrice: 1,
4050
- outputPrice: 5,
3486
+ inputPrice: 5,
3487
+ outputPrice: 25,
4051
3488
  cacheWritesPrice: 1.25,
4052
- cacheReadsPrice: 0.1
3489
+ cacheReadsPrice: 1.25,
3490
+ description: "xAI's Grok-3 fast model with 128K context window"
4053
3491
  },
4054
- "claude-3-opus@20240229": {
4055
- maxTokens: 4096,
4056
- contextWindow: 2e5,
4057
- supportsImages: true,
3492
+ "grok-3-mini": {
3493
+ maxTokens: 8192,
3494
+ contextWindow: 131072,
3495
+ supportsImages: false,
4058
3496
  supportsPromptCache: true,
4059
- inputPrice: 15,
4060
- outputPrice: 75,
4061
- cacheWritesPrice: 18.75,
4062
- cacheReadsPrice: 1.5
3497
+ inputPrice: 0.3,
3498
+ outputPrice: 0.5,
3499
+ cacheWritesPrice: 0.07,
3500
+ cacheReadsPrice: 0.07,
3501
+ description: "xAI's Grok-3 mini model with 128K context window",
3502
+ supportsReasoningEffort: true
4063
3503
  },
4064
- "claude-3-haiku@20240307": {
4065
- maxTokens: 4096,
4066
- contextWindow: 2e5,
4067
- supportsImages: true,
3504
+ "grok-3-mini-fast": {
3505
+ maxTokens: 8192,
3506
+ contextWindow: 131072,
3507
+ supportsImages: false,
4068
3508
  supportsPromptCache: true,
4069
- inputPrice: 0.25,
4070
- outputPrice: 1.25,
4071
- cacheWritesPrice: 0.3,
4072
- cacheReadsPrice: 0.03
3509
+ inputPrice: 0.6,
3510
+ outputPrice: 4,
3511
+ cacheWritesPrice: 0.15,
3512
+ cacheReadsPrice: 0.15,
3513
+ description: "xAI's Grok-3 mini fast model with 128K context window",
3514
+ supportsReasoningEffort: true
4073
3515
  },
4074
- "gemini-2.5-flash-lite-preview-06-17": {
4075
- maxTokens: 64e3,
4076
- contextWindow: 1048576,
3516
+ "grok-2-1212": {
3517
+ maxTokens: 8192,
3518
+ contextWindow: 131072,
3519
+ supportsImages: false,
3520
+ supportsPromptCache: false,
3521
+ inputPrice: 2,
3522
+ outputPrice: 10,
3523
+ description: "xAI's Grok-2 model (version 1212) with 128K context window"
3524
+ },
3525
+ "grok-2-vision-1212": {
3526
+ maxTokens: 8192,
3527
+ contextWindow: 32768,
4077
3528
  supportsImages: true,
3529
+ supportsPromptCache: false,
3530
+ inputPrice: 2,
3531
+ outputPrice: 10,
3532
+ description: "xAI's Grok-2 Vision model (version 1212) with image support and 32K context window"
3533
+ }
3534
+ };
3535
+
3536
+ // src/providers/zai.ts
3537
+ var internationalZAiDefaultModelId = "glm-4.5";
3538
+ var internationalZAiModels = {
3539
+ "glm-4.5": {
3540
+ maxTokens: 98304,
3541
+ contextWindow: 131072,
3542
+ supportsImages: false,
4078
3543
  supportsPromptCache: true,
4079
- inputPrice: 0.1,
4080
- outputPrice: 0.4,
4081
- cacheReadsPrice: 0.025,
4082
- cacheWritesPrice: 1,
4083
- maxThinkingTokens: 24576,
4084
- supportsReasoningBudget: true
3544
+ inputPrice: 0.6,
3545
+ outputPrice: 2.2,
3546
+ cacheWritesPrice: 0,
3547
+ cacheReadsPrice: 0.11,
3548
+ description: "GLM-4.5 is Zhipu's latest featured model. Its comprehensive capabilities in reasoning, coding, and agent reach the state-of-the-art (SOTA) level among open-source models, with a context length of up to 128k."
4085
3549
  },
4086
- "llama-4-maverick-17b-128e-instruct-maas": {
4087
- maxTokens: 8192,
3550
+ "glm-4.5-air": {
3551
+ maxTokens: 98304,
4088
3552
  contextWindow: 131072,
4089
3553
  supportsImages: false,
4090
- supportsPromptCache: false,
4091
- inputPrice: 0.35,
4092
- outputPrice: 1.15,
4093
- description: "Meta Llama 4 Maverick 17B Instruct model, 128K context."
3554
+ supportsPromptCache: true,
3555
+ inputPrice: 0.2,
3556
+ outputPrice: 1.1,
3557
+ cacheWritesPrice: 0,
3558
+ cacheReadsPrice: 0.03,
3559
+ description: "GLM-4.5-Air is the lightweight version of GLM-4.5. It balances performance and cost-effectiveness, and can flexibly switch to hybrid thinking models."
4094
3560
  }
4095
3561
  };
4096
- var VERTEX_REGIONS = [
4097
- { value: "global", label: "global" },
4098
- { value: "us-central1", label: "us-central1" },
4099
- { value: "us-east1", label: "us-east1" },
4100
- { value: "us-east4", label: "us-east4" },
4101
- { value: "us-east5", label: "us-east5" },
4102
- { value: "us-west1", label: "us-west1" },
4103
- { value: "us-west2", label: "us-west2" },
4104
- { value: "us-west3", label: "us-west3" },
4105
- { value: "us-west4", label: "us-west4" },
4106
- { value: "northamerica-northeast1", label: "northamerica-northeast1" },
4107
- { value: "northamerica-northeast2", label: "northamerica-northeast2" },
4108
- { value: "southamerica-east1", label: "southamerica-east1" },
4109
- { value: "europe-west1", label: "europe-west1" },
4110
- { value: "europe-west2", label: "europe-west2" },
4111
- { value: "europe-west3", label: "europe-west3" },
4112
- { value: "europe-west4", label: "europe-west4" },
4113
- { value: "europe-west6", label: "europe-west6" },
4114
- { value: "europe-central2", label: "europe-central2" },
4115
- { value: "asia-east1", label: "asia-east1" },
4116
- { value: "asia-east2", label: "asia-east2" },
4117
- { value: "asia-northeast1", label: "asia-northeast1" },
4118
- { value: "asia-northeast2", label: "asia-northeast2" },
4119
- { value: "asia-northeast3", label: "asia-northeast3" },
4120
- { value: "asia-south1", label: "asia-south1" },
4121
- { value: "asia-south2", label: "asia-south2" },
4122
- { value: "asia-southeast1", label: "asia-southeast1" },
4123
- { value: "asia-southeast2", label: "asia-southeast2" },
4124
- { value: "australia-southeast1", label: "australia-southeast1" },
4125
- { value: "australia-southeast2", label: "australia-southeast2" },
4126
- { value: "me-west1", label: "me-west1" },
4127
- { value: "me-central1", label: "me-central1" },
4128
- { value: "africa-south1", label: "africa-south1" }
3562
+ var mainlandZAiDefaultModelId = "glm-4.5";
3563
+ var mainlandZAiModels = {
3564
+ "glm-4.5": {
3565
+ maxTokens: 98304,
3566
+ contextWindow: 131072,
3567
+ supportsImages: false,
3568
+ supportsPromptCache: true,
3569
+ inputPrice: 0.29,
3570
+ outputPrice: 1.14,
3571
+ cacheWritesPrice: 0,
3572
+ cacheReadsPrice: 0.057,
3573
+ description: "GLM-4.5 is Zhipu's latest featured model. Its comprehensive capabilities in reasoning, coding, and agent reach the state-of-the-art (SOTA) level among open-source models, with a context length of up to 128k.",
3574
+ tiers: [
3575
+ {
3576
+ contextWindow: 32e3,
3577
+ inputPrice: 0.21,
3578
+ outputPrice: 1,
3579
+ cacheReadsPrice: 0.043
3580
+ },
3581
+ {
3582
+ contextWindow: 128e3,
3583
+ inputPrice: 0.29,
3584
+ outputPrice: 1.14,
3585
+ cacheReadsPrice: 0.057
3586
+ },
3587
+ {
3588
+ contextWindow: Infinity,
3589
+ inputPrice: 0.29,
3590
+ outputPrice: 1.14,
3591
+ cacheReadsPrice: 0.057
3592
+ }
3593
+ ]
3594
+ },
3595
+ "glm-4.5-air": {
3596
+ maxTokens: 98304,
3597
+ contextWindow: 131072,
3598
+ supportsImages: false,
3599
+ supportsPromptCache: true,
3600
+ inputPrice: 0.1,
3601
+ outputPrice: 0.6,
3602
+ cacheWritesPrice: 0,
3603
+ cacheReadsPrice: 0.02,
3604
+ description: "GLM-4.5-Air is the lightweight version of GLM-4.5. It balances performance and cost-effectiveness, and can flexibly switch to hybrid thinking models.",
3605
+ tiers: [
3606
+ {
3607
+ contextWindow: 32e3,
3608
+ inputPrice: 0.07,
3609
+ outputPrice: 0.4,
3610
+ cacheReadsPrice: 0.014
3611
+ },
3612
+ {
3613
+ contextWindow: 128e3,
3614
+ inputPrice: 0.1,
3615
+ outputPrice: 0.6,
3616
+ cacheReadsPrice: 0.02
3617
+ },
3618
+ {
3619
+ contextWindow: Infinity,
3620
+ inputPrice: 0.1,
3621
+ outputPrice: 0.6,
3622
+ cacheReadsPrice: 0.02
3623
+ }
3624
+ ]
3625
+ }
3626
+ };
3627
+ var ZAI_DEFAULT_TEMPERATURE = 0;
3628
+
3629
+ // src/provider-settings.ts
3630
+ var providerNames = [
3631
+ "anthropic",
3632
+ "claude-code",
3633
+ "glama",
3634
+ "openrouter",
3635
+ "bedrock",
3636
+ "vertex",
3637
+ "openai",
3638
+ "ollama",
3639
+ "vscode-lm",
3640
+ "lmstudio",
3641
+ "gemini",
3642
+ "gemini-cli",
3643
+ "openai-native",
3644
+ "mistral",
3645
+ "moonshot",
3646
+ "deepseek",
3647
+ "doubao",
3648
+ "unbound",
3649
+ "requesty",
3650
+ "human-relay",
3651
+ "fake-ai",
3652
+ "xai",
3653
+ "groq",
3654
+ "chutes",
3655
+ "litellm",
3656
+ "huggingface",
3657
+ "cerebras",
3658
+ "sambanova",
3659
+ "zai",
3660
+ "fireworks",
3661
+ "featherless",
3662
+ "io-intelligence",
3663
+ "roo"
3664
+ ];
3665
+ var providerNamesSchema = import_zod8.z.enum(providerNames);
3666
+ var providerSettingsEntrySchema = import_zod8.z.object({
3667
+ id: import_zod8.z.string(),
3668
+ name: import_zod8.z.string(),
3669
+ apiProvider: providerNamesSchema.optional()
3670
+ });
3671
+ var DEFAULT_CONSECUTIVE_MISTAKE_LIMIT = 3;
3672
+ var baseProviderSettingsSchema = import_zod8.z.object({
3673
+ includeMaxTokens: import_zod8.z.boolean().optional(),
3674
+ diffEnabled: import_zod8.z.boolean().optional(),
3675
+ todoListEnabled: import_zod8.z.boolean().optional(),
3676
+ fuzzyMatchThreshold: import_zod8.z.number().optional(),
3677
+ modelTemperature: import_zod8.z.number().nullish(),
3678
+ rateLimitSeconds: import_zod8.z.number().optional(),
3679
+ consecutiveMistakeLimit: import_zod8.z.number().min(0).optional(),
3680
+ // Model reasoning.
3681
+ enableReasoningEffort: import_zod8.z.boolean().optional(),
3682
+ reasoningEffort: reasoningEffortWithMinimalSchema.optional(),
3683
+ modelMaxTokens: import_zod8.z.number().optional(),
3684
+ modelMaxThinkingTokens: import_zod8.z.number().optional(),
3685
+ // Model verbosity.
3686
+ verbosity: verbosityLevelsSchema.optional()
3687
+ });
3688
+ var apiModelIdProviderModelSchema = baseProviderSettingsSchema.extend({
3689
+ apiModelId: import_zod8.z.string().optional()
3690
+ });
3691
+ var anthropicSchema = apiModelIdProviderModelSchema.extend({
3692
+ apiKey: import_zod8.z.string().optional(),
3693
+ anthropicBaseUrl: import_zod8.z.string().optional(),
3694
+ anthropicUseAuthToken: import_zod8.z.boolean().optional(),
3695
+ anthropicBeta1MContext: import_zod8.z.boolean().optional()
3696
+ // Enable 'context-1m-2025-08-07' beta for 1M context window
3697
+ });
3698
+ var claudeCodeSchema = apiModelIdProviderModelSchema.extend({
3699
+ claudeCodePath: import_zod8.z.string().optional(),
3700
+ claudeCodeMaxOutputTokens: import_zod8.z.number().int().min(1).max(2e5).optional()
3701
+ });
3702
+ var glamaSchema = baseProviderSettingsSchema.extend({
3703
+ glamaModelId: import_zod8.z.string().optional(),
3704
+ glamaApiKey: import_zod8.z.string().optional()
3705
+ });
3706
+ var openRouterSchema = baseProviderSettingsSchema.extend({
3707
+ openRouterApiKey: import_zod8.z.string().optional(),
3708
+ openRouterModelId: import_zod8.z.string().optional(),
3709
+ openRouterBaseUrl: import_zod8.z.string().optional(),
3710
+ openRouterSpecificProvider: import_zod8.z.string().optional(),
3711
+ openRouterUseMiddleOutTransform: import_zod8.z.boolean().optional()
3712
+ });
3713
+ var bedrockSchema = apiModelIdProviderModelSchema.extend({
3714
+ awsAccessKey: import_zod8.z.string().optional(),
3715
+ awsSecretKey: import_zod8.z.string().optional(),
3716
+ awsSessionToken: import_zod8.z.string().optional(),
3717
+ awsRegion: import_zod8.z.string().optional(),
3718
+ awsUseCrossRegionInference: import_zod8.z.boolean().optional(),
3719
+ awsUsePromptCache: import_zod8.z.boolean().optional(),
3720
+ awsProfile: import_zod8.z.string().optional(),
3721
+ awsUseProfile: import_zod8.z.boolean().optional(),
3722
+ awsApiKey: import_zod8.z.string().optional(),
3723
+ awsUseApiKey: import_zod8.z.boolean().optional(),
3724
+ awsCustomArn: import_zod8.z.string().optional(),
3725
+ awsModelContextWindow: import_zod8.z.number().optional(),
3726
+ awsBedrockEndpointEnabled: import_zod8.z.boolean().optional(),
3727
+ awsBedrockEndpoint: import_zod8.z.string().optional(),
3728
+ awsBedrock1MContext: import_zod8.z.boolean().optional()
3729
+ // Enable 'context-1m-2025-08-07' beta for 1M context window
3730
+ });
3731
+ var vertexSchema = apiModelIdProviderModelSchema.extend({
3732
+ vertexKeyFile: import_zod8.z.string().optional(),
3733
+ vertexJsonCredentials: import_zod8.z.string().optional(),
3734
+ vertexProjectId: import_zod8.z.string().optional(),
3735
+ vertexRegion: import_zod8.z.string().optional()
3736
+ });
3737
+ var openAiSchema = baseProviderSettingsSchema.extend({
3738
+ openAiBaseUrl: import_zod8.z.string().optional(),
3739
+ openAiApiKey: import_zod8.z.string().optional(),
3740
+ openAiLegacyFormat: import_zod8.z.boolean().optional(),
3741
+ openAiR1FormatEnabled: import_zod8.z.boolean().optional(),
3742
+ openAiModelId: import_zod8.z.string().optional(),
3743
+ openAiCustomModelInfo: modelInfoSchema.nullish(),
3744
+ openAiUseAzure: import_zod8.z.boolean().optional(),
3745
+ azureApiVersion: import_zod8.z.string().optional(),
3746
+ openAiStreamingEnabled: import_zod8.z.boolean().optional(),
3747
+ openAiHostHeader: import_zod8.z.string().optional(),
3748
+ // Keep temporarily for backward compatibility during migration.
3749
+ openAiHeaders: import_zod8.z.record(import_zod8.z.string(), import_zod8.z.string()).optional()
3750
+ });
3751
+ var ollamaSchema = baseProviderSettingsSchema.extend({
3752
+ ollamaModelId: import_zod8.z.string().optional(),
3753
+ ollamaBaseUrl: import_zod8.z.string().optional()
3754
+ });
3755
+ var vsCodeLmSchema = baseProviderSettingsSchema.extend({
3756
+ vsCodeLmModelSelector: import_zod8.z.object({
3757
+ vendor: import_zod8.z.string().optional(),
3758
+ family: import_zod8.z.string().optional(),
3759
+ version: import_zod8.z.string().optional(),
3760
+ id: import_zod8.z.string().optional()
3761
+ }).optional()
3762
+ });
3763
+ var lmStudioSchema = baseProviderSettingsSchema.extend({
3764
+ lmStudioModelId: import_zod8.z.string().optional(),
3765
+ lmStudioBaseUrl: import_zod8.z.string().optional(),
3766
+ lmStudioDraftModelId: import_zod8.z.string().optional(),
3767
+ lmStudioSpeculativeDecodingEnabled: import_zod8.z.boolean().optional()
3768
+ });
3769
+ var geminiSchema = apiModelIdProviderModelSchema.extend({
3770
+ geminiApiKey: import_zod8.z.string().optional(),
3771
+ googleGeminiBaseUrl: import_zod8.z.string().optional(),
3772
+ enableUrlContext: import_zod8.z.boolean().optional(),
3773
+ enableGrounding: import_zod8.z.boolean().optional()
3774
+ });
3775
+ var geminiCliSchema = apiModelIdProviderModelSchema.extend({
3776
+ geminiCliOAuthPath: import_zod8.z.string().optional(),
3777
+ geminiCliProjectId: import_zod8.z.string().optional()
3778
+ });
3779
+ var openAiNativeSchema = apiModelIdProviderModelSchema.extend({
3780
+ openAiNativeApiKey: import_zod8.z.string().optional(),
3781
+ openAiNativeBaseUrl: import_zod8.z.string().optional()
3782
+ });
3783
+ var mistralSchema = apiModelIdProviderModelSchema.extend({
3784
+ mistralApiKey: import_zod8.z.string().optional(),
3785
+ mistralCodestralUrl: import_zod8.z.string().optional()
3786
+ });
3787
+ var deepSeekSchema = apiModelIdProviderModelSchema.extend({
3788
+ deepSeekBaseUrl: import_zod8.z.string().optional(),
3789
+ deepSeekApiKey: import_zod8.z.string().optional()
3790
+ });
3791
+ var doubaoSchema = apiModelIdProviderModelSchema.extend({
3792
+ doubaoBaseUrl: import_zod8.z.string().optional(),
3793
+ doubaoApiKey: import_zod8.z.string().optional()
3794
+ });
3795
+ var moonshotSchema = apiModelIdProviderModelSchema.extend({
3796
+ moonshotBaseUrl: import_zod8.z.union([import_zod8.z.literal("https://api.moonshot.ai/v1"), import_zod8.z.literal("https://api.moonshot.cn/v1")]).optional(),
3797
+ moonshotApiKey: import_zod8.z.string().optional()
3798
+ });
3799
+ var unboundSchema = baseProviderSettingsSchema.extend({
3800
+ unboundApiKey: import_zod8.z.string().optional(),
3801
+ unboundModelId: import_zod8.z.string().optional()
3802
+ });
3803
+ var requestySchema = baseProviderSettingsSchema.extend({
3804
+ requestyBaseUrl: import_zod8.z.string().optional(),
3805
+ requestyApiKey: import_zod8.z.string().optional(),
3806
+ requestyModelId: import_zod8.z.string().optional()
3807
+ });
3808
+ var humanRelaySchema = baseProviderSettingsSchema;
3809
+ var fakeAiSchema = baseProviderSettingsSchema.extend({
3810
+ fakeAi: import_zod8.z.unknown().optional()
3811
+ });
3812
+ var xaiSchema = apiModelIdProviderModelSchema.extend({
3813
+ xaiApiKey: import_zod8.z.string().optional()
3814
+ });
3815
+ var groqSchema = apiModelIdProviderModelSchema.extend({
3816
+ groqApiKey: import_zod8.z.string().optional()
3817
+ });
3818
+ var huggingFaceSchema = baseProviderSettingsSchema.extend({
3819
+ huggingFaceApiKey: import_zod8.z.string().optional(),
3820
+ huggingFaceModelId: import_zod8.z.string().optional(),
3821
+ huggingFaceInferenceProvider: import_zod8.z.string().optional()
3822
+ });
3823
+ var chutesSchema = apiModelIdProviderModelSchema.extend({
3824
+ chutesApiKey: import_zod8.z.string().optional()
3825
+ });
3826
+ var litellmSchema = baseProviderSettingsSchema.extend({
3827
+ litellmBaseUrl: import_zod8.z.string().optional(),
3828
+ litellmApiKey: import_zod8.z.string().optional(),
3829
+ litellmModelId: import_zod8.z.string().optional(),
3830
+ litellmUsePromptCache: import_zod8.z.boolean().optional()
3831
+ });
3832
+ var cerebrasSchema = apiModelIdProviderModelSchema.extend({
3833
+ cerebrasApiKey: import_zod8.z.string().optional()
3834
+ });
3835
+ var sambaNovaSchema = apiModelIdProviderModelSchema.extend({
3836
+ sambaNovaApiKey: import_zod8.z.string().optional()
3837
+ });
3838
+ var zaiSchema = apiModelIdProviderModelSchema.extend({
3839
+ zaiApiKey: import_zod8.z.string().optional(),
3840
+ zaiApiLine: import_zod8.z.union([import_zod8.z.literal("china"), import_zod8.z.literal("international")]).optional()
3841
+ });
3842
+ var fireworksSchema = apiModelIdProviderModelSchema.extend({
3843
+ fireworksApiKey: import_zod8.z.string().optional()
3844
+ });
3845
+ var featherlessSchema = apiModelIdProviderModelSchema.extend({
3846
+ featherlessApiKey: import_zod8.z.string().optional()
3847
+ });
3848
+ var ioIntelligenceSchema = apiModelIdProviderModelSchema.extend({
3849
+ ioIntelligenceModelId: import_zod8.z.string().optional(),
3850
+ ioIntelligenceApiKey: import_zod8.z.string().optional()
3851
+ });
3852
+ var rooSchema = apiModelIdProviderModelSchema.extend({
3853
+ // No additional fields needed - uses cloud authentication
3854
+ });
3855
+ var defaultSchema = import_zod8.z.object({
3856
+ apiProvider: import_zod8.z.undefined()
3857
+ });
3858
+ var providerSettingsSchemaDiscriminated = import_zod8.z.discriminatedUnion("apiProvider", [
3859
+ anthropicSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("anthropic") })),
3860
+ claudeCodeSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("claude-code") })),
3861
+ glamaSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("glama") })),
3862
+ openRouterSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("openrouter") })),
3863
+ bedrockSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("bedrock") })),
3864
+ vertexSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("vertex") })),
3865
+ openAiSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("openai") })),
3866
+ ollamaSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("ollama") })),
3867
+ vsCodeLmSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("vscode-lm") })),
3868
+ lmStudioSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("lmstudio") })),
3869
+ geminiSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("gemini") })),
3870
+ geminiCliSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("gemini-cli") })),
3871
+ openAiNativeSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("openai-native") })),
3872
+ mistralSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("mistral") })),
3873
+ deepSeekSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("deepseek") })),
3874
+ doubaoSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("doubao") })),
3875
+ moonshotSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("moonshot") })),
3876
+ unboundSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("unbound") })),
3877
+ requestySchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("requesty") })),
3878
+ humanRelaySchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("human-relay") })),
3879
+ fakeAiSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("fake-ai") })),
3880
+ xaiSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("xai") })),
3881
+ groqSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("groq") })),
3882
+ huggingFaceSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("huggingface") })),
3883
+ chutesSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("chutes") })),
3884
+ litellmSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("litellm") })),
3885
+ cerebrasSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("cerebras") })),
3886
+ sambaNovaSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("sambanova") })),
3887
+ zaiSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("zai") })),
3888
+ fireworksSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("fireworks") })),
3889
+ featherlessSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("featherless") })),
3890
+ ioIntelligenceSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("io-intelligence") })),
3891
+ rooSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("roo") })),
3892
+ defaultSchema
3893
+ ]);
3894
+ var providerSettingsSchema = import_zod8.z.object({
3895
+ apiProvider: providerNamesSchema.optional(),
3896
+ ...anthropicSchema.shape,
3897
+ ...claudeCodeSchema.shape,
3898
+ ...glamaSchema.shape,
3899
+ ...openRouterSchema.shape,
3900
+ ...bedrockSchema.shape,
3901
+ ...vertexSchema.shape,
3902
+ ...openAiSchema.shape,
3903
+ ...ollamaSchema.shape,
3904
+ ...vsCodeLmSchema.shape,
3905
+ ...lmStudioSchema.shape,
3906
+ ...geminiSchema.shape,
3907
+ ...geminiCliSchema.shape,
3908
+ ...openAiNativeSchema.shape,
3909
+ ...mistralSchema.shape,
3910
+ ...deepSeekSchema.shape,
3911
+ ...doubaoSchema.shape,
3912
+ ...moonshotSchema.shape,
3913
+ ...unboundSchema.shape,
3914
+ ...requestySchema.shape,
3915
+ ...humanRelaySchema.shape,
3916
+ ...fakeAiSchema.shape,
3917
+ ...xaiSchema.shape,
3918
+ ...groqSchema.shape,
3919
+ ...huggingFaceSchema.shape,
3920
+ ...chutesSchema.shape,
3921
+ ...litellmSchema.shape,
3922
+ ...cerebrasSchema.shape,
3923
+ ...sambaNovaSchema.shape,
3924
+ ...zaiSchema.shape,
3925
+ ...fireworksSchema.shape,
3926
+ ...featherlessSchema.shape,
3927
+ ...ioIntelligenceSchema.shape,
3928
+ ...rooSchema.shape,
3929
+ ...codebaseIndexProviderSchema.shape
3930
+ });
3931
+ var providerSettingsWithIdSchema = providerSettingsSchema.extend({ id: import_zod8.z.string().optional() });
3932
+ var discriminatedProviderSettingsWithIdSchema = providerSettingsSchemaDiscriminated.and(
3933
+ import_zod8.z.object({ id: import_zod8.z.string().optional() })
3934
+ );
3935
+ var PROVIDER_SETTINGS_KEYS = providerSettingsSchema.keyof().options;
3936
+ var MODEL_ID_KEYS = [
3937
+ "apiModelId",
3938
+ "glamaModelId",
3939
+ "openRouterModelId",
3940
+ "openAiModelId",
3941
+ "ollamaModelId",
3942
+ "lmStudioModelId",
3943
+ "lmStudioDraftModelId",
3944
+ "unboundModelId",
3945
+ "requestyModelId",
3946
+ "litellmModelId",
3947
+ "huggingFaceModelId",
3948
+ "ioIntelligenceModelId"
4129
3949
  ];
4130
-
4131
- // src/providers/vscode-llm.ts
4132
- var vscodeLlmDefaultModelId = "claude-3.5-sonnet";
4133
- var vscodeLlmModels = {
4134
- "gpt-3.5-turbo": {
4135
- contextWindow: 12114,
4136
- supportsImages: false,
4137
- supportsPromptCache: false,
4138
- inputPrice: 0,
4139
- outputPrice: 0,
4140
- family: "gpt-3.5-turbo",
4141
- version: "gpt-3.5-turbo-0613",
4142
- name: "GPT 3.5 Turbo",
4143
- supportsToolCalling: true,
4144
- maxInputTokens: 12114
4145
- },
4146
- "gpt-4o-mini": {
4147
- contextWindow: 12115,
4148
- supportsImages: false,
4149
- supportsPromptCache: false,
4150
- inputPrice: 0,
4151
- outputPrice: 0,
4152
- family: "gpt-4o-mini",
4153
- version: "gpt-4o-mini-2024-07-18",
4154
- name: "GPT-4o mini",
4155
- supportsToolCalling: true,
4156
- maxInputTokens: 12115
4157
- },
4158
- "gpt-4": {
4159
- contextWindow: 28501,
4160
- supportsImages: false,
4161
- supportsPromptCache: false,
4162
- inputPrice: 0,
4163
- outputPrice: 0,
4164
- family: "gpt-4",
4165
- version: "gpt-4-0613",
4166
- name: "GPT 4",
4167
- supportsToolCalling: true,
4168
- maxInputTokens: 28501
4169
- },
4170
- "gpt-4-0125-preview": {
4171
- contextWindow: 63826,
4172
- supportsImages: false,
4173
- supportsPromptCache: false,
4174
- inputPrice: 0,
4175
- outputPrice: 0,
4176
- family: "gpt-4-turbo",
4177
- version: "gpt-4-0125-preview",
4178
- name: "GPT 4 Turbo",
4179
- supportsToolCalling: true,
4180
- maxInputTokens: 63826
4181
- },
4182
- "gpt-4o": {
4183
- contextWindow: 63827,
4184
- supportsImages: true,
4185
- supportsPromptCache: false,
4186
- inputPrice: 0,
4187
- outputPrice: 0,
4188
- family: "gpt-4o",
4189
- version: "gpt-4o-2024-11-20",
4190
- name: "GPT-4o",
4191
- supportsToolCalling: true,
4192
- maxInputTokens: 63827
4193
- },
4194
- o1: {
4195
- contextWindow: 19827,
4196
- supportsImages: false,
4197
- supportsPromptCache: false,
4198
- inputPrice: 0,
4199
- outputPrice: 0,
4200
- family: "o1-ga",
4201
- version: "o1-2024-12-17",
4202
- name: "o1 (Preview)",
4203
- supportsToolCalling: true,
4204
- maxInputTokens: 19827
4205
- },
4206
- "o3-mini": {
4207
- contextWindow: 63827,
4208
- supportsImages: false,
4209
- supportsPromptCache: false,
4210
- inputPrice: 0,
4211
- outputPrice: 0,
4212
- family: "o3-mini",
4213
- version: "o3-mini-2025-01-31",
4214
- name: "o3-mini",
4215
- supportsToolCalling: true,
4216
- maxInputTokens: 63827
4217
- },
4218
- "claude-3.5-sonnet": {
4219
- contextWindow: 81638,
4220
- supportsImages: true,
4221
- supportsPromptCache: false,
4222
- inputPrice: 0,
4223
- outputPrice: 0,
4224
- family: "claude-3.5-sonnet",
4225
- version: "claude-3.5-sonnet",
4226
- name: "Claude 3.5 Sonnet",
4227
- supportsToolCalling: true,
4228
- maxInputTokens: 81638
4229
- },
4230
- "gemini-2.0-flash-001": {
4231
- contextWindow: 127827,
4232
- supportsImages: true,
4233
- supportsPromptCache: false,
4234
- inputPrice: 0,
4235
- outputPrice: 0,
4236
- family: "gemini-2.0-flash",
4237
- version: "gemini-2.0-flash-001",
4238
- name: "Gemini 2.0 Flash",
4239
- supportsToolCalling: false,
4240
- maxInputTokens: 127827
4241
- },
4242
- "gemini-2.5-pro": {
4243
- contextWindow: 63830,
4244
- supportsImages: true,
4245
- supportsPromptCache: false,
4246
- inputPrice: 0,
4247
- outputPrice: 0,
4248
- family: "gemini-2.5-pro",
4249
- version: "gemini-2.5-pro-preview-03-25",
4250
- name: "Gemini 2.5 Pro (Preview)",
4251
- supportsToolCalling: true,
4252
- maxInputTokens: 63830
4253
- },
4254
- "o4-mini": {
4255
- contextWindow: 111446,
4256
- supportsImages: false,
4257
- supportsPromptCache: false,
4258
- inputPrice: 0,
4259
- outputPrice: 0,
4260
- family: "o4-mini",
4261
- version: "o4-mini-2025-04-16",
4262
- name: "o4-mini (Preview)",
4263
- supportsToolCalling: true,
4264
- maxInputTokens: 111446
4265
- },
4266
- "gpt-4.1": {
4267
- contextWindow: 111446,
4268
- supportsImages: true,
4269
- supportsPromptCache: false,
4270
- inputPrice: 0,
4271
- outputPrice: 0,
4272
- family: "gpt-4.1",
4273
- version: "gpt-4.1-2025-04-14",
4274
- name: "GPT-4.1 (Preview)",
4275
- supportsToolCalling: true,
4276
- maxInputTokens: 111446
3950
+ var getModelId = (settings) => {
3951
+ const modelIdKey = MODEL_ID_KEYS.find((key) => settings[key]);
3952
+ return modelIdKey ? settings[modelIdKey] : void 0;
3953
+ };
3954
+ var ANTHROPIC_STYLE_PROVIDERS = ["anthropic", "claude-code", "bedrock"];
3955
+ var getApiProtocol = (provider, modelId) => {
3956
+ if (provider && ANTHROPIC_STYLE_PROVIDERS.includes(provider)) {
3957
+ return "anthropic";
3958
+ }
3959
+ if (provider && provider === "vertex" && modelId && modelId.toLowerCase().includes("claude")) {
3960
+ return "anthropic";
4277
3961
  }
3962
+ return "openai";
4278
3963
  };
3964
+ var MODELS_BY_PROVIDER = {
3965
+ anthropic: {
3966
+ id: "anthropic",
3967
+ label: "Anthropic",
3968
+ models: Object.keys(anthropicModels)
3969
+ },
3970
+ bedrock: {
3971
+ id: "bedrock",
3972
+ label: "Amazon Bedrock",
3973
+ models: Object.keys(bedrockModels)
3974
+ },
3975
+ cerebras: {
3976
+ id: "cerebras",
3977
+ label: "Cerebras",
3978
+ models: Object.keys(cerebrasModels)
3979
+ },
3980
+ chutes: {
3981
+ id: "chutes",
3982
+ label: "Chutes AI",
3983
+ models: Object.keys(chutesModels)
3984
+ },
3985
+ "claude-code": { id: "claude-code", label: "Claude Code", models: Object.keys(claudeCodeModels) },
3986
+ deepseek: {
3987
+ id: "deepseek",
3988
+ label: "DeepSeek",
3989
+ models: Object.keys(deepSeekModels)
3990
+ },
3991
+ doubao: { id: "doubao", label: "Doubao", models: Object.keys(doubaoModels) },
3992
+ featherless: {
3993
+ id: "featherless",
3994
+ label: "Featherless",
3995
+ models: Object.keys(featherlessModels)
3996
+ },
3997
+ fireworks: {
3998
+ id: "fireworks",
3999
+ label: "Fireworks",
4000
+ models: Object.keys(fireworksModels)
4001
+ },
4002
+ gemini: {
4003
+ id: "gemini",
4004
+ label: "Google Gemini",
4005
+ models: Object.keys(geminiModels)
4006
+ },
4007
+ groq: { id: "groq", label: "Groq", models: Object.keys(groqModels) },
4008
+ "io-intelligence": {
4009
+ id: "io-intelligence",
4010
+ label: "IO Intelligence",
4011
+ models: Object.keys(ioIntelligenceModels)
4012
+ },
4013
+ mistral: {
4014
+ id: "mistral",
4015
+ label: "Mistral",
4016
+ models: Object.keys(mistralModels)
4017
+ },
4018
+ moonshot: {
4019
+ id: "moonshot",
4020
+ label: "Moonshot",
4021
+ models: Object.keys(moonshotModels)
4022
+ },
4023
+ "openai-native": {
4024
+ id: "openai-native",
4025
+ label: "OpenAI",
4026
+ models: Object.keys(openAiNativeModels)
4027
+ },
4028
+ roo: { id: "roo", label: "Roo", models: Object.keys(rooModels) },
4029
+ sambanova: {
4030
+ id: "sambanova",
4031
+ label: "SambaNova",
4032
+ models: Object.keys(sambaNovaModels)
4033
+ },
4034
+ vertex: {
4035
+ id: "vertex",
4036
+ label: "GCP Vertex AI",
4037
+ models: Object.keys(vertexModels)
4038
+ },
4039
+ "vscode-lm": {
4040
+ id: "vscode-lm",
4041
+ label: "VS Code LM API",
4042
+ models: Object.keys(vscodeLlmModels)
4043
+ },
4044
+ xai: { id: "xai", label: "xAI (Grok)", models: Object.keys(xaiModels) },
4045
+ zai: { id: "zai", label: "Zai", models: Object.keys(internationalZAiModels) },
4046
+ // Models pulled from the respective APIs.
4047
+ "gemini-cli": { id: "gemini-cli", label: "Gemini CLI", models: [] },
4048
+ glama: { id: "glama", label: "Glama", models: [] },
4049
+ huggingface: { id: "huggingface", label: "Hugging Face", models: [] },
4050
+ litellm: { id: "litellm", label: "LiteLLM", models: [] },
4051
+ lmstudio: { id: "lmstudio", label: "LM Studio", models: [] },
4052
+ ollama: { id: "ollama", label: "Ollama", models: [] },
4053
+ openai: { id: "openai", label: "OpenAI Compatible", models: [] },
4054
+ openrouter: { id: "openrouter", label: "OpenRouter", models: [] },
4055
+ requesty: { id: "requesty", label: "Requesty", models: [] },
4056
+ unbound: { id: "unbound", label: "Unbound", models: [] }
4057
+ };
4058
+
4059
+ // src/history.ts
4060
+ var import_zod9 = require("zod");
4061
+ var historyItemSchema = import_zod9.z.object({
4062
+ id: import_zod9.z.string(),
4063
+ number: import_zod9.z.number(),
4064
+ ts: import_zod9.z.number(),
4065
+ task: import_zod9.z.string(),
4066
+ tokensIn: import_zod9.z.number(),
4067
+ tokensOut: import_zod9.z.number(),
4068
+ cacheWrites: import_zod9.z.number().optional(),
4069
+ cacheReads: import_zod9.z.number().optional(),
4070
+ totalCost: import_zod9.z.number(),
4071
+ size: import_zod9.z.number().optional(),
4072
+ workspace: import_zod9.z.string().optional(),
4073
+ mode: import_zod9.z.string().optional()
4074
+ });
4279
4075
 
4280
- // src/providers/xai.ts
4281
- var xaiDefaultModelId = "grok-4";
4282
- var xaiModels = {
4283
- "grok-4": {
4284
- maxTokens: 8192,
4285
- contextWindow: 256e3,
4286
- supportsImages: true,
4287
- supportsPromptCache: true,
4288
- inputPrice: 3,
4289
- outputPrice: 15,
4290
- cacheWritesPrice: 0.75,
4291
- cacheReadsPrice: 0.75,
4292
- description: "xAI's Grok-4 model with 256K context window"
4293
- },
4294
- "grok-3": {
4295
- maxTokens: 8192,
4296
- contextWindow: 131072,
4297
- supportsImages: false,
4298
- supportsPromptCache: true,
4299
- inputPrice: 3,
4300
- outputPrice: 15,
4301
- cacheWritesPrice: 0.75,
4302
- cacheReadsPrice: 0.75,
4303
- description: "xAI's Grok-3 model with 128K context window"
4076
+ // src/telemetry.ts
4077
+ var import_zod10 = require("zod");
4078
+ var telemetrySettings = ["unset", "enabled", "disabled"];
4079
+ var telemetrySettingsSchema = import_zod10.z.enum(telemetrySettings);
4080
+ var TelemetryEventName = /* @__PURE__ */ ((TelemetryEventName2) => {
4081
+ TelemetryEventName2["TASK_CREATED"] = "Task Created";
4082
+ TelemetryEventName2["TASK_RESTARTED"] = "Task Reopened";
4083
+ TelemetryEventName2["TASK_COMPLETED"] = "Task Completed";
4084
+ TelemetryEventName2["TASK_MESSAGE"] = "Task Message";
4085
+ TelemetryEventName2["TASK_CONVERSATION_MESSAGE"] = "Conversation Message";
4086
+ TelemetryEventName2["LLM_COMPLETION"] = "LLM Completion";
4087
+ TelemetryEventName2["MODE_SWITCH"] = "Mode Switched";
4088
+ TelemetryEventName2["MODE_SELECTOR_OPENED"] = "Mode Selector Opened";
4089
+ TelemetryEventName2["TOOL_USED"] = "Tool Used";
4090
+ TelemetryEventName2["CHECKPOINT_CREATED"] = "Checkpoint Created";
4091
+ TelemetryEventName2["CHECKPOINT_RESTORED"] = "Checkpoint Restored";
4092
+ TelemetryEventName2["CHECKPOINT_DIFFED"] = "Checkpoint Diffed";
4093
+ TelemetryEventName2["TAB_SHOWN"] = "Tab Shown";
4094
+ TelemetryEventName2["MODE_SETTINGS_CHANGED"] = "Mode Setting Changed";
4095
+ TelemetryEventName2["CUSTOM_MODE_CREATED"] = "Custom Mode Created";
4096
+ TelemetryEventName2["CONTEXT_CONDENSED"] = "Context Condensed";
4097
+ TelemetryEventName2["SLIDING_WINDOW_TRUNCATION"] = "Sliding Window Truncation";
4098
+ TelemetryEventName2["CODE_ACTION_USED"] = "Code Action Used";
4099
+ TelemetryEventName2["PROMPT_ENHANCED"] = "Prompt Enhanced";
4100
+ TelemetryEventName2["TITLE_BUTTON_CLICKED"] = "Title Button Clicked";
4101
+ TelemetryEventName2["AUTHENTICATION_INITIATED"] = "Authentication Initiated";
4102
+ TelemetryEventName2["MARKETPLACE_ITEM_INSTALLED"] = "Marketplace Item Installed";
4103
+ TelemetryEventName2["MARKETPLACE_ITEM_REMOVED"] = "Marketplace Item Removed";
4104
+ TelemetryEventName2["MARKETPLACE_TAB_VIEWED"] = "Marketplace Tab Viewed";
4105
+ TelemetryEventName2["MARKETPLACE_INSTALL_BUTTON_CLICKED"] = "Marketplace Install Button Clicked";
4106
+ TelemetryEventName2["SHARE_BUTTON_CLICKED"] = "Share Button Clicked";
4107
+ TelemetryEventName2["SHARE_ORGANIZATION_CLICKED"] = "Share Organization Clicked";
4108
+ TelemetryEventName2["SHARE_PUBLIC_CLICKED"] = "Share Public Clicked";
4109
+ TelemetryEventName2["SHARE_CONNECT_TO_CLOUD_CLICKED"] = "Share Connect To Cloud Clicked";
4110
+ TelemetryEventName2["ACCOUNT_CONNECT_CLICKED"] = "Account Connect Clicked";
4111
+ TelemetryEventName2["ACCOUNT_CONNECT_SUCCESS"] = "Account Connect Success";
4112
+ TelemetryEventName2["ACCOUNT_LOGOUT_CLICKED"] = "Account Logout Clicked";
4113
+ TelemetryEventName2["ACCOUNT_LOGOUT_SUCCESS"] = "Account Logout Success";
4114
+ TelemetryEventName2["SCHEMA_VALIDATION_ERROR"] = "Schema Validation Error";
4115
+ TelemetryEventName2["DIFF_APPLICATION_ERROR"] = "Diff Application Error";
4116
+ TelemetryEventName2["SHELL_INTEGRATION_ERROR"] = "Shell Integration Error";
4117
+ TelemetryEventName2["CONSECUTIVE_MISTAKE_ERROR"] = "Consecutive Mistake Error";
4118
+ TelemetryEventName2["CODE_INDEX_ERROR"] = "Code Index Error";
4119
+ return TelemetryEventName2;
4120
+ })(TelemetryEventName || {});
4121
+ var staticAppPropertiesSchema = import_zod10.z.object({
4122
+ appName: import_zod10.z.string(),
4123
+ appVersion: import_zod10.z.string(),
4124
+ vscodeVersion: import_zod10.z.string(),
4125
+ platform: import_zod10.z.string(),
4126
+ editorName: import_zod10.z.string()
4127
+ });
4128
+ var dynamicAppPropertiesSchema = import_zod10.z.object({
4129
+ language: import_zod10.z.string(),
4130
+ mode: import_zod10.z.string()
4131
+ });
4132
+ var cloudAppPropertiesSchema = import_zod10.z.object({
4133
+ cloudIsAuthenticated: import_zod10.z.boolean().optional()
4134
+ });
4135
+ var appPropertiesSchema = import_zod10.z.object({
4136
+ ...staticAppPropertiesSchema.shape,
4137
+ ...dynamicAppPropertiesSchema.shape,
4138
+ ...cloudAppPropertiesSchema.shape
4139
+ });
4140
+ var taskPropertiesSchema = import_zod10.z.object({
4141
+ taskId: import_zod10.z.string().optional(),
4142
+ apiProvider: import_zod10.z.enum(providerNames).optional(),
4143
+ modelId: import_zod10.z.string().optional(),
4144
+ diffStrategy: import_zod10.z.string().optional(),
4145
+ isSubtask: import_zod10.z.boolean().optional(),
4146
+ todos: import_zod10.z.object({
4147
+ total: import_zod10.z.number(),
4148
+ completed: import_zod10.z.number(),
4149
+ inProgress: import_zod10.z.number(),
4150
+ pending: import_zod10.z.number()
4151
+ }).optional()
4152
+ });
4153
+ var gitPropertiesSchema = import_zod10.z.object({
4154
+ repositoryUrl: import_zod10.z.string().optional(),
4155
+ repositoryName: import_zod10.z.string().optional(),
4156
+ defaultBranch: import_zod10.z.string().optional()
4157
+ });
4158
+ var telemetryPropertiesSchema = import_zod10.z.object({
4159
+ ...appPropertiesSchema.shape,
4160
+ ...taskPropertiesSchema.shape,
4161
+ ...gitPropertiesSchema.shape
4162
+ });
4163
+ var rooCodeTelemetryEventSchema = import_zod10.z.discriminatedUnion("type", [
4164
+ import_zod10.z.object({
4165
+ type: import_zod10.z.enum([
4166
+ "Task Created" /* TASK_CREATED */,
4167
+ "Task Reopened" /* TASK_RESTARTED */,
4168
+ "Task Completed" /* TASK_COMPLETED */,
4169
+ "Conversation Message" /* TASK_CONVERSATION_MESSAGE */,
4170
+ "Mode Switched" /* MODE_SWITCH */,
4171
+ "Mode Selector Opened" /* MODE_SELECTOR_OPENED */,
4172
+ "Tool Used" /* TOOL_USED */,
4173
+ "Checkpoint Created" /* CHECKPOINT_CREATED */,
4174
+ "Checkpoint Restored" /* CHECKPOINT_RESTORED */,
4175
+ "Checkpoint Diffed" /* CHECKPOINT_DIFFED */,
4176
+ "Code Action Used" /* CODE_ACTION_USED */,
4177
+ "Prompt Enhanced" /* PROMPT_ENHANCED */,
4178
+ "Title Button Clicked" /* TITLE_BUTTON_CLICKED */,
4179
+ "Authentication Initiated" /* AUTHENTICATION_INITIATED */,
4180
+ "Marketplace Item Installed" /* MARKETPLACE_ITEM_INSTALLED */,
4181
+ "Marketplace Item Removed" /* MARKETPLACE_ITEM_REMOVED */,
4182
+ "Marketplace Tab Viewed" /* MARKETPLACE_TAB_VIEWED */,
4183
+ "Marketplace Install Button Clicked" /* MARKETPLACE_INSTALL_BUTTON_CLICKED */,
4184
+ "Share Button Clicked" /* SHARE_BUTTON_CLICKED */,
4185
+ "Share Organization Clicked" /* SHARE_ORGANIZATION_CLICKED */,
4186
+ "Share Public Clicked" /* SHARE_PUBLIC_CLICKED */,
4187
+ "Share Connect To Cloud Clicked" /* SHARE_CONNECT_TO_CLOUD_CLICKED */,
4188
+ "Account Connect Clicked" /* ACCOUNT_CONNECT_CLICKED */,
4189
+ "Account Connect Success" /* ACCOUNT_CONNECT_SUCCESS */,
4190
+ "Account Logout Clicked" /* ACCOUNT_LOGOUT_CLICKED */,
4191
+ "Account Logout Success" /* ACCOUNT_LOGOUT_SUCCESS */,
4192
+ "Schema Validation Error" /* SCHEMA_VALIDATION_ERROR */,
4193
+ "Diff Application Error" /* DIFF_APPLICATION_ERROR */,
4194
+ "Shell Integration Error" /* SHELL_INTEGRATION_ERROR */,
4195
+ "Consecutive Mistake Error" /* CONSECUTIVE_MISTAKE_ERROR */,
4196
+ "Code Index Error" /* CODE_INDEX_ERROR */,
4197
+ "Context Condensed" /* CONTEXT_CONDENSED */,
4198
+ "Sliding Window Truncation" /* SLIDING_WINDOW_TRUNCATION */,
4199
+ "Tab Shown" /* TAB_SHOWN */,
4200
+ "Mode Setting Changed" /* MODE_SETTINGS_CHANGED */,
4201
+ "Custom Mode Created" /* CUSTOM_MODE_CREATED */
4202
+ ]),
4203
+ properties: telemetryPropertiesSchema
4204
+ }),
4205
+ import_zod10.z.object({
4206
+ type: import_zod10.z.literal("Task Message" /* TASK_MESSAGE */),
4207
+ properties: import_zod10.z.object({
4208
+ ...telemetryPropertiesSchema.shape,
4209
+ taskId: import_zod10.z.string(),
4210
+ message: clineMessageSchema
4211
+ })
4212
+ }),
4213
+ import_zod10.z.object({
4214
+ type: import_zod10.z.literal("LLM Completion" /* LLM_COMPLETION */),
4215
+ properties: import_zod10.z.object({
4216
+ ...telemetryPropertiesSchema.shape,
4217
+ inputTokens: import_zod10.z.number(),
4218
+ outputTokens: import_zod10.z.number(),
4219
+ cacheReadTokens: import_zod10.z.number().optional(),
4220
+ cacheWriteTokens: import_zod10.z.number().optional(),
4221
+ cost: import_zod10.z.number().optional()
4222
+ })
4223
+ })
4224
+ ]);
4225
+
4226
+ // src/mode.ts
4227
+ var import_zod11 = require("zod");
4228
+ var groupOptionsSchema = import_zod11.z.object({
4229
+ fileRegex: import_zod11.z.string().optional().refine(
4230
+ (pattern) => {
4231
+ if (!pattern) {
4232
+ return true;
4233
+ }
4234
+ try {
4235
+ new RegExp(pattern);
4236
+ return true;
4237
+ } catch {
4238
+ return false;
4239
+ }
4240
+ },
4241
+ { message: "Invalid regular expression pattern" }
4242
+ ),
4243
+ description: import_zod11.z.string().optional()
4244
+ });
4245
+ var groupEntrySchema = import_zod11.z.union([toolGroupsSchema, import_zod11.z.tuple([toolGroupsSchema, groupOptionsSchema])]);
4246
+ var groupEntryArraySchema = import_zod11.z.array(groupEntrySchema).refine(
4247
+ (groups) => {
4248
+ const seen = /* @__PURE__ */ new Set();
4249
+ return groups.every((group) => {
4250
+ const groupName = Array.isArray(group) ? group[0] : group;
4251
+ if (seen.has(groupName)) {
4252
+ return false;
4253
+ }
4254
+ seen.add(groupName);
4255
+ return true;
4256
+ });
4304
4257
  },
4305
- "grok-3-fast": {
4306
- maxTokens: 8192,
4307
- contextWindow: 131072,
4308
- supportsImages: false,
4309
- supportsPromptCache: true,
4310
- inputPrice: 5,
4311
- outputPrice: 25,
4312
- cacheWritesPrice: 1.25,
4313
- cacheReadsPrice: 1.25,
4314
- description: "xAI's Grok-3 fast model with 128K context window"
4258
+ { message: "Duplicate groups are not allowed" }
4259
+ );
4260
+ var modeConfigSchema = import_zod11.z.object({
4261
+ slug: import_zod11.z.string().regex(/^[a-zA-Z0-9-]+$/, "Slug must contain only letters numbers and dashes"),
4262
+ name: import_zod11.z.string().min(1, "Name is required"),
4263
+ roleDefinition: import_zod11.z.string().min(1, "Role definition is required"),
4264
+ whenToUse: import_zod11.z.string().optional(),
4265
+ description: import_zod11.z.string().optional(),
4266
+ customInstructions: import_zod11.z.string().optional(),
4267
+ groups: groupEntryArraySchema,
4268
+ source: import_zod11.z.enum(["global", "project"]).optional()
4269
+ });
4270
+ var customModesSettingsSchema = import_zod11.z.object({
4271
+ customModes: import_zod11.z.array(modeConfigSchema).refine(
4272
+ (modes) => {
4273
+ const slugs = /* @__PURE__ */ new Set();
4274
+ return modes.every((mode) => {
4275
+ if (slugs.has(mode.slug)) {
4276
+ return false;
4277
+ }
4278
+ slugs.add(mode.slug);
4279
+ return true;
4280
+ });
4281
+ },
4282
+ {
4283
+ message: "Duplicate mode slugs are not allowed"
4284
+ }
4285
+ )
4286
+ });
4287
+ var promptComponentSchema = import_zod11.z.object({
4288
+ roleDefinition: import_zod11.z.string().optional(),
4289
+ whenToUse: import_zod11.z.string().optional(),
4290
+ description: import_zod11.z.string().optional(),
4291
+ customInstructions: import_zod11.z.string().optional()
4292
+ });
4293
+ var customModePromptsSchema = import_zod11.z.record(import_zod11.z.string(), promptComponentSchema.optional());
4294
+ var customSupportPromptsSchema = import_zod11.z.record(import_zod11.z.string(), import_zod11.z.string().optional());
4295
+ var DEFAULT_MODES = [
4296
+ {
4297
+ slug: "architect",
4298
+ name: "\u{1F3D7}\uFE0F Architect",
4299
+ roleDefinition: "You are Roo, an experienced technical leader who is inquisitive and an excellent planner. Your goal is to gather information and get context to create a detailed plan for accomplishing the user's task, which the user will review and approve before they switch into another mode to implement the solution.",
4300
+ whenToUse: "Use this mode when you need to plan, design, or strategize before implementation. Perfect for breaking down complex problems, creating technical specifications, designing system architecture, or brainstorming solutions before coding.",
4301
+ description: "Plan and design before implementation",
4302
+ groups: ["read", ["edit", { fileRegex: "\\.md$", description: "Markdown files only" }], "browser", "mcp"],
4303
+ customInstructions: "1. Do some information gathering (using provided tools) to get more context about the task.\n\n2. You should also ask the user clarifying questions to get a better understanding of the task.\n\n3. Once you've gained more context about the user's request, break down the task into clear, actionable steps and create a todo list using the `update_todo_list` tool. Each todo item should be:\n - Specific and actionable\n - Listed in logical execution order\n - Focused on a single, well-defined outcome\n - Clear enough that another mode could execute it independently\n\n **Note:** If the `update_todo_list` tool is not available, write the plan to a markdown file (e.g., `plan.md` or `todo.md`) instead.\n\n4. As you gather more information or discover new requirements, update the todo list to reflect the current understanding of what needs to be accomplished.\n\n5. Ask the user if they are pleased with this plan, or if they would like to make any changes. Think of this as a brainstorming session where you can discuss the task and refine the todo list.\n\n6. Include Mermaid diagrams if they help clarify complex workflows or system architecture. Please avoid using double quotes (\"\") and parentheses () inside square brackets ([]) in Mermaid diagrams, as this can cause parsing errors.\n\n7. Use the switch_mode tool to request that the user switch to another mode to implement the solution.\n\n**IMPORTANT: Focus on creating clear, actionable todo lists rather than lengthy markdown documents. Use the todo list as your primary planning tool to track and organize the work that needs to be done.**"
4315
4304
  },
4316
- "grok-3-mini": {
4317
- maxTokens: 8192,
4318
- contextWindow: 131072,
4319
- supportsImages: false,
4320
- supportsPromptCache: true,
4321
- inputPrice: 0.3,
4322
- outputPrice: 0.5,
4323
- cacheWritesPrice: 0.07,
4324
- cacheReadsPrice: 0.07,
4325
- description: "xAI's Grok-3 mini model with 128K context window",
4326
- supportsReasoningEffort: true
4305
+ {
4306
+ slug: "code",
4307
+ name: "\u{1F4BB} Code",
4308
+ roleDefinition: "You are Roo, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.",
4309
+ whenToUse: "Use this mode when you need to write, modify, or refactor code. Ideal for implementing features, fixing bugs, creating new files, or making code improvements across any programming language or framework.",
4310
+ description: "Write, modify, and refactor code",
4311
+ groups: ["read", "edit", "browser", "command", "mcp"]
4327
4312
  },
4328
- "grok-3-mini-fast": {
4329
- maxTokens: 8192,
4330
- contextWindow: 131072,
4331
- supportsImages: false,
4332
- supportsPromptCache: true,
4333
- inputPrice: 0.6,
4334
- outputPrice: 4,
4335
- cacheWritesPrice: 0.15,
4336
- cacheReadsPrice: 0.15,
4337
- description: "xAI's Grok-3 mini fast model with 128K context window",
4338
- supportsReasoningEffort: true
4313
+ {
4314
+ slug: "ask",
4315
+ name: "\u2753 Ask",
4316
+ roleDefinition: "You are Roo, a knowledgeable technical assistant focused on answering questions and providing information about software development, technology, and related topics.",
4317
+ whenToUse: "Use this mode when you need explanations, documentation, or answers to technical questions. Best for understanding concepts, analyzing existing code, getting recommendations, or learning about technologies without making changes.",
4318
+ description: "Get answers and explanations",
4319
+ groups: ["read", "browser", "mcp"],
4320
+ customInstructions: "You can analyze code, explain concepts, and access external resources. Always answer the user's questions thoroughly, and do not switch to implementing code unless explicitly requested by the user. Include Mermaid diagrams when they clarify your response."
4339
4321
  },
4340
- "grok-2-1212": {
4341
- maxTokens: 8192,
4342
- contextWindow: 131072,
4343
- supportsImages: false,
4344
- supportsPromptCache: false,
4345
- inputPrice: 2,
4346
- outputPrice: 10,
4347
- description: "xAI's Grok-2 model (version 1212) with 128K context window"
4322
+ {
4323
+ slug: "debug",
4324
+ name: "\u{1FAB2} Debug",
4325
+ roleDefinition: "You are Roo, an expert software debugger specializing in systematic problem diagnosis and resolution.",
4326
+ whenToUse: "Use this mode when you're troubleshooting issues, investigating errors, or diagnosing problems. Specialized in systematic debugging, adding logging, analyzing stack traces, and identifying root causes before applying fixes.",
4327
+ description: "Diagnose and fix software issues",
4328
+ groups: ["read", "edit", "browser", "command", "mcp"],
4329
+ customInstructions: "Reflect on 5-7 different possible sources of the problem, distill those down to 1-2 most likely sources, and then add logs to validate your assumptions. Explicitly ask the user to confirm the diagnosis before fixing the problem."
4348
4330
  },
4349
- "grok-2-vision-1212": {
4350
- maxTokens: 8192,
4351
- contextWindow: 32768,
4352
- supportsImages: true,
4353
- supportsPromptCache: false,
4354
- inputPrice: 2,
4355
- outputPrice: 10,
4356
- description: "xAI's Grok-2 Vision model (version 1212) with image support and 32K context window"
4331
+ {
4332
+ slug: "orchestrator",
4333
+ name: "\u{1FA83} Orchestrator",
4334
+ roleDefinition: "You are Roo, a strategic workflow orchestrator who coordinates complex tasks by delegating them to appropriate specialized modes. You have a comprehensive understanding of each mode's capabilities and limitations, allowing you to effectively break down complex problems into discrete tasks that can be solved by different specialists.",
4335
+ whenToUse: "Use this mode for complex, multi-step projects that require coordination across different specialties. Ideal when you need to break down large tasks into subtasks, manage workflows, or coordinate work that spans multiple domains or expertise areas.",
4336
+ description: "Coordinate tasks across multiple modes",
4337
+ groups: [],
4338
+ customInstructions: "Your role is to coordinate complex workflows by delegating tasks to specialized modes. As an orchestrator, you should:\n\n1. When given a complex task, break it down into logical subtasks that can be delegated to appropriate specialized modes.\n\n2. For each subtask, use the `new_task` tool to delegate. Choose the most appropriate mode for the subtask's specific goal and provide comprehensive instructions in the `message` parameter. These instructions must include:\n * All necessary context from the parent task or previous subtasks required to complete the work.\n * A clearly defined scope, specifying exactly what the subtask should accomplish.\n * An explicit statement that the subtask should *only* perform the work outlined in these instructions and not deviate.\n * An instruction for the subtask to signal completion by using the `attempt_completion` tool, providing a concise yet thorough summary of the outcome in the `result` parameter, keeping in mind that this summary will be the source of truth used to keep track of what was completed on this project.\n * A statement that these specific instructions supersede any conflicting general instructions the subtask's mode might have.\n\n3. Track and manage the progress of all subtasks. When a subtask is completed, analyze its results and determine the next steps.\n\n4. Help the user understand how the different subtasks fit together in the overall workflow. Provide clear reasoning about why you're delegating specific tasks to specific modes.\n\n5. When all subtasks are completed, synthesize the results and provide a comprehensive overview of what was accomplished.\n\n6. Ask clarifying questions when necessary to better understand how to break down complex tasks effectively.\n\n7. Suggest improvements to the workflow based on the results of completed subtasks.\n\nUse subtasks to maintain clarity. If a request significantly shifts focus or requires a different expertise (mode), consider creating a subtask rather than overloading the current one."
4357
4339
  }
4340
+ ];
4341
+
4342
+ // src/vscode.ts
4343
+ var import_zod12 = require("zod");
4344
+ var codeActionIds = ["explainCode", "fixCode", "improveCode", "addToContext", "newTask"];
4345
+ var terminalActionIds = ["terminalAddToContext", "terminalFixCommand", "terminalExplainCommand"];
4346
+ var commandIds = [
4347
+ "activationCompleted",
4348
+ "plusButtonClicked",
4349
+ "promptsButtonClicked",
4350
+ "mcpButtonClicked",
4351
+ "historyButtonClicked",
4352
+ "marketplaceButtonClicked",
4353
+ "popoutButtonClicked",
4354
+ "accountButtonClicked",
4355
+ "settingsButtonClicked",
4356
+ "openInNewTab",
4357
+ "showHumanRelayDialog",
4358
+ "registerHumanRelayCallback",
4359
+ "unregisterHumanRelayCallback",
4360
+ "handleHumanRelayResponse",
4361
+ "newTask",
4362
+ "setCustomStoragePath",
4363
+ "importSettings",
4364
+ "focusInput",
4365
+ "acceptInput",
4366
+ "focusPanel"
4367
+ ];
4368
+ var languages = [
4369
+ "ca",
4370
+ "de",
4371
+ "en",
4372
+ "es",
4373
+ "fr",
4374
+ "hi",
4375
+ "id",
4376
+ "it",
4377
+ "ja",
4378
+ "ko",
4379
+ "nl",
4380
+ "pl",
4381
+ "pt-BR",
4382
+ "ru",
4383
+ "tr",
4384
+ "vi",
4385
+ "zh-CN",
4386
+ "zh-TW"
4387
+ ];
4388
+ var languagesSchema = import_zod12.z.enum(languages);
4389
+ var isLanguage = (value) => languages.includes(value);
4390
+
4391
+ // src/global-settings.ts
4392
+ var DEFAULT_WRITE_DELAY_MS = 1e3;
4393
+ var DEFAULT_TERMINAL_OUTPUT_CHARACTER_LIMIT = 5e4;
4394
+ var globalSettingsSchema = import_zod13.z.object({
4395
+ currentApiConfigName: import_zod13.z.string().optional(),
4396
+ listApiConfigMeta: import_zod13.z.array(providerSettingsEntrySchema).optional(),
4397
+ pinnedApiConfigs: import_zod13.z.record(import_zod13.z.string(), import_zod13.z.boolean()).optional(),
4398
+ lastShownAnnouncementId: import_zod13.z.string().optional(),
4399
+ customInstructions: import_zod13.z.string().optional(),
4400
+ taskHistory: import_zod13.z.array(historyItemSchema).optional(),
4401
+ condensingApiConfigId: import_zod13.z.string().optional(),
4402
+ customCondensingPrompt: import_zod13.z.string().optional(),
4403
+ autoApprovalEnabled: import_zod13.z.boolean().optional(),
4404
+ alwaysAllowReadOnly: import_zod13.z.boolean().optional(),
4405
+ alwaysAllowReadOnlyOutsideWorkspace: import_zod13.z.boolean().optional(),
4406
+ alwaysAllowWrite: import_zod13.z.boolean().optional(),
4407
+ alwaysAllowWriteOutsideWorkspace: import_zod13.z.boolean().optional(),
4408
+ alwaysAllowWriteProtected: import_zod13.z.boolean().optional(),
4409
+ writeDelayMs: import_zod13.z.number().min(0).optional(),
4410
+ alwaysAllowBrowser: import_zod13.z.boolean().optional(),
4411
+ alwaysApproveResubmit: import_zod13.z.boolean().optional(),
4412
+ requestDelaySeconds: import_zod13.z.number().optional(),
4413
+ alwaysAllowMcp: import_zod13.z.boolean().optional(),
4414
+ alwaysAllowModeSwitch: import_zod13.z.boolean().optional(),
4415
+ alwaysAllowSubtasks: import_zod13.z.boolean().optional(),
4416
+ alwaysAllowExecute: import_zod13.z.boolean().optional(),
4417
+ alwaysAllowFollowupQuestions: import_zod13.z.boolean().optional(),
4418
+ followupAutoApproveTimeoutMs: import_zod13.z.number().optional(),
4419
+ alwaysAllowUpdateTodoList: import_zod13.z.boolean().optional(),
4420
+ allowedCommands: import_zod13.z.array(import_zod13.z.string()).optional(),
4421
+ deniedCommands: import_zod13.z.array(import_zod13.z.string()).optional(),
4422
+ commandExecutionTimeout: import_zod13.z.number().optional(),
4423
+ commandTimeoutAllowlist: import_zod13.z.array(import_zod13.z.string()).optional(),
4424
+ preventCompletionWithOpenTodos: import_zod13.z.boolean().optional(),
4425
+ allowedMaxRequests: import_zod13.z.number().nullish(),
4426
+ allowedMaxCost: import_zod13.z.number().nullish(),
4427
+ autoCondenseContext: import_zod13.z.boolean().optional(),
4428
+ autoCondenseContextPercent: import_zod13.z.number().optional(),
4429
+ maxConcurrentFileReads: import_zod13.z.number().optional(),
4430
+ /**
4431
+ * Whether to include diagnostic messages (errors, warnings) in tool outputs
4432
+ * @default true
4433
+ */
4434
+ includeDiagnosticMessages: import_zod13.z.boolean().optional(),
4435
+ /**
4436
+ * Maximum number of diagnostic messages to include in tool outputs
4437
+ * @default 50
4438
+ */
4439
+ maxDiagnosticMessages: import_zod13.z.number().optional(),
4440
+ browserToolEnabled: import_zod13.z.boolean().optional(),
4441
+ browserViewportSize: import_zod13.z.string().optional(),
4442
+ screenshotQuality: import_zod13.z.number().optional(),
4443
+ remoteBrowserEnabled: import_zod13.z.boolean().optional(),
4444
+ remoteBrowserHost: import_zod13.z.string().optional(),
4445
+ cachedChromeHostUrl: import_zod13.z.string().optional(),
4446
+ enableCheckpoints: import_zod13.z.boolean().optional(),
4447
+ ttsEnabled: import_zod13.z.boolean().optional(),
4448
+ ttsSpeed: import_zod13.z.number().optional(),
4449
+ soundEnabled: import_zod13.z.boolean().optional(),
4450
+ soundVolume: import_zod13.z.number().optional(),
4451
+ maxOpenTabsContext: import_zod13.z.number().optional(),
4452
+ maxWorkspaceFiles: import_zod13.z.number().optional(),
4453
+ showRooIgnoredFiles: import_zod13.z.boolean().optional(),
4454
+ maxReadFileLine: import_zod13.z.number().optional(),
4455
+ maxImageFileSize: import_zod13.z.number().optional(),
4456
+ maxTotalImageSize: import_zod13.z.number().optional(),
4457
+ terminalOutputLineLimit: import_zod13.z.number().optional(),
4458
+ terminalOutputCharacterLimit: import_zod13.z.number().optional(),
4459
+ terminalShellIntegrationTimeout: import_zod13.z.number().optional(),
4460
+ terminalShellIntegrationDisabled: import_zod13.z.boolean().optional(),
4461
+ terminalCommandDelay: import_zod13.z.number().optional(),
4462
+ terminalPowershellCounter: import_zod13.z.boolean().optional(),
4463
+ terminalZshClearEolMark: import_zod13.z.boolean().optional(),
4464
+ terminalZshOhMy: import_zod13.z.boolean().optional(),
4465
+ terminalZshP10k: import_zod13.z.boolean().optional(),
4466
+ terminalZdotdir: import_zod13.z.boolean().optional(),
4467
+ terminalCompressProgressBar: import_zod13.z.boolean().optional(),
4468
+ diagnosticsEnabled: import_zod13.z.boolean().optional(),
4469
+ rateLimitSeconds: import_zod13.z.number().optional(),
4470
+ diffEnabled: import_zod13.z.boolean().optional(),
4471
+ fuzzyMatchThreshold: import_zod13.z.number().optional(),
4472
+ experiments: experimentsSchema.optional(),
4473
+ codebaseIndexModels: codebaseIndexModelsSchema.optional(),
4474
+ codebaseIndexConfig: codebaseIndexConfigSchema.optional(),
4475
+ language: languagesSchema.optional(),
4476
+ telemetrySetting: telemetrySettingsSchema.optional(),
4477
+ mcpEnabled: import_zod13.z.boolean().optional(),
4478
+ enableMcpServerCreation: import_zod13.z.boolean().optional(),
4479
+ remoteControlEnabled: import_zod13.z.boolean().optional(),
4480
+ mode: import_zod13.z.string().optional(),
4481
+ modeApiConfigs: import_zod13.z.record(import_zod13.z.string(), import_zod13.z.string()).optional(),
4482
+ customModes: import_zod13.z.array(modeConfigSchema).optional(),
4483
+ customModePrompts: customModePromptsSchema.optional(),
4484
+ customSupportPrompts: customSupportPromptsSchema.optional(),
4485
+ enhancementApiConfigId: import_zod13.z.string().optional(),
4486
+ includeTaskHistoryInEnhance: import_zod13.z.boolean().optional(),
4487
+ historyPreviewCollapsed: import_zod13.z.boolean().optional(),
4488
+ profileThresholds: import_zod13.z.record(import_zod13.z.string(), import_zod13.z.number()).optional(),
4489
+ hasOpenedModeSelector: import_zod13.z.boolean().optional(),
4490
+ lastModeExportPath: import_zod13.z.string().optional(),
4491
+ lastModeImportPath: import_zod13.z.string().optional()
4492
+ });
4493
+ var GLOBAL_SETTINGS_KEYS = globalSettingsSchema.keyof().options;
4494
+ var rooCodeSettingsSchema = providerSettingsSchema.merge(globalSettingsSchema);
4495
+ var SECRET_STATE_KEYS = [
4496
+ "apiKey",
4497
+ "glamaApiKey",
4498
+ "openRouterApiKey",
4499
+ "awsAccessKey",
4500
+ "awsApiKey",
4501
+ "awsSecretKey",
4502
+ "awsSessionToken",
4503
+ "openAiApiKey",
4504
+ "geminiApiKey",
4505
+ "openAiNativeApiKey",
4506
+ "cerebrasApiKey",
4507
+ "deepSeekApiKey",
4508
+ "doubaoApiKey",
4509
+ "moonshotApiKey",
4510
+ "mistralApiKey",
4511
+ "unboundApiKey",
4512
+ "requestyApiKey",
4513
+ "xaiApiKey",
4514
+ "groqApiKey",
4515
+ "chutesApiKey",
4516
+ "litellmApiKey",
4517
+ "codeIndexOpenAiKey",
4518
+ "codeIndexQdrantApiKey",
4519
+ "codebaseIndexOpenAiCompatibleApiKey",
4520
+ "codebaseIndexGeminiApiKey",
4521
+ "codebaseIndexMistralApiKey",
4522
+ "huggingFaceApiKey",
4523
+ "sambaNovaApiKey",
4524
+ "zaiApiKey",
4525
+ "fireworksApiKey",
4526
+ "featherlessApiKey",
4527
+ "ioIntelligenceApiKey"
4528
+ ];
4529
+ var isSecretStateKey = (key) => SECRET_STATE_KEYS.includes(key);
4530
+ var GLOBAL_STATE_KEYS = [...GLOBAL_SETTINGS_KEYS, ...PROVIDER_SETTINGS_KEYS].filter(
4531
+ (key) => !SECRET_STATE_KEYS.includes(key)
4532
+ );
4533
+ var isGlobalStateKey = (key) => GLOBAL_STATE_KEYS.includes(key);
4534
+ var EVALS_SETTINGS = {
4535
+ apiProvider: "openrouter",
4536
+ openRouterUseMiddleOutTransform: false,
4537
+ lastShownAnnouncementId: "jul-09-2025-3-23-0",
4538
+ pinnedApiConfigs: {},
4539
+ autoApprovalEnabled: true,
4540
+ alwaysAllowReadOnly: true,
4541
+ alwaysAllowReadOnlyOutsideWorkspace: false,
4542
+ alwaysAllowWrite: true,
4543
+ alwaysAllowWriteOutsideWorkspace: false,
4544
+ alwaysAllowWriteProtected: false,
4545
+ writeDelayMs: 1e3,
4546
+ alwaysAllowBrowser: true,
4547
+ alwaysApproveResubmit: true,
4548
+ requestDelaySeconds: 10,
4549
+ alwaysAllowMcp: true,
4550
+ alwaysAllowModeSwitch: true,
4551
+ alwaysAllowSubtasks: true,
4552
+ alwaysAllowExecute: true,
4553
+ alwaysAllowFollowupQuestions: true,
4554
+ alwaysAllowUpdateTodoList: true,
4555
+ followupAutoApproveTimeoutMs: 0,
4556
+ allowedCommands: ["*"],
4557
+ commandExecutionTimeout: 20,
4558
+ commandTimeoutAllowlist: [],
4559
+ preventCompletionWithOpenTodos: false,
4560
+ browserToolEnabled: false,
4561
+ browserViewportSize: "900x600",
4562
+ screenshotQuality: 75,
4563
+ remoteBrowserEnabled: false,
4564
+ ttsEnabled: false,
4565
+ ttsSpeed: 1,
4566
+ soundEnabled: false,
4567
+ soundVolume: 0.5,
4568
+ terminalOutputLineLimit: 500,
4569
+ terminalOutputCharacterLimit: DEFAULT_TERMINAL_OUTPUT_CHARACTER_LIMIT,
4570
+ terminalShellIntegrationTimeout: 3e4,
4571
+ terminalCommandDelay: 0,
4572
+ terminalPowershellCounter: false,
4573
+ terminalZshOhMy: true,
4574
+ terminalZshClearEolMark: true,
4575
+ terminalZshP10k: false,
4576
+ terminalZdotdir: true,
4577
+ terminalCompressProgressBar: true,
4578
+ terminalShellIntegrationDisabled: true,
4579
+ diagnosticsEnabled: true,
4580
+ diffEnabled: true,
4581
+ fuzzyMatchThreshold: 1,
4582
+ enableCheckpoints: false,
4583
+ rateLimitSeconds: 0,
4584
+ maxOpenTabsContext: 20,
4585
+ maxWorkspaceFiles: 200,
4586
+ showRooIgnoredFiles: true,
4587
+ maxReadFileLine: -1,
4588
+ // -1 to enable full file reading.
4589
+ includeDiagnosticMessages: true,
4590
+ maxDiagnosticMessages: 50,
4591
+ language: "en",
4592
+ telemetrySetting: "enabled",
4593
+ mcpEnabled: false,
4594
+ remoteControlEnabled: false,
4595
+ mode: "code",
4596
+ // "architect",
4597
+ customModes: []
4358
4598
  };
4599
+ var EVALS_TIMEOUT = 5 * 60 * 1e3;
4359
4600
 
4360
- // src/providers/doubao.ts
4361
- var doubaoDefaultModelId = "doubao-seed-1-6-250615";
4362
- var doubaoModels = {
4363
- "doubao-seed-1-6-250615": {
4364
- maxTokens: 32768,
4365
- contextWindow: 128e3,
4366
- supportsImages: true,
4367
- supportsPromptCache: true,
4368
- inputPrice: 1e-4,
4369
- // $0.0001 per million tokens (cache miss)
4370
- outputPrice: 4e-4,
4371
- // $0.0004 per million tokens
4372
- cacheWritesPrice: 1e-4,
4373
- // $0.0001 per million tokens (cache miss)
4374
- cacheReadsPrice: 2e-5,
4375
- // $0.00002 per million tokens (cache hit)
4376
- description: `Doubao Seed 1.6 is a powerful model designed for high-performance tasks with extensive context handling.`
4377
- },
4378
- "doubao-seed-1-6-thinking-250715": {
4379
- maxTokens: 32768,
4380
- contextWindow: 128e3,
4381
- supportsImages: true,
4382
- supportsPromptCache: true,
4383
- inputPrice: 2e-4,
4384
- // $0.0002 per million tokens
4385
- outputPrice: 8e-4,
4386
- // $0.0008 per million tokens
4387
- cacheWritesPrice: 2e-4,
4388
- // $0.0002 per million
4389
- cacheReadsPrice: 4e-5,
4390
- // $0.00004 per million tokens (cache hit)
4391
- description: `Doubao Seed 1.6 Thinking is optimized for reasoning tasks, providing enhanced performance in complex problem-solving scenarios.`
4392
- },
4393
- "doubao-seed-1-6-flash-250715": {
4394
- maxTokens: 32768,
4395
- contextWindow: 128e3,
4396
- supportsImages: true,
4397
- supportsPromptCache: true,
4398
- inputPrice: 15e-5,
4399
- // $0.00015 per million tokens
4400
- outputPrice: 6e-4,
4401
- // $0.0006 per million tokens
4402
- cacheWritesPrice: 15e-5,
4403
- // $0.00015 per million
4404
- cacheReadsPrice: 3e-5,
4405
- // $0.00003 per million tokens (cache hit)
4406
- description: `Doubao Seed 1.6 Flash is tailored for speed and efficiency, making it ideal for applications requiring rapid responses.`
4407
- }
4408
- };
4409
- var doubaoDefaultModelInfo = doubaoModels[doubaoDefaultModelId];
4410
- var DOUBAO_API_BASE_URL = "https://ark.cn-beijing.volces.com/api/v3";
4411
- var DOUBAO_API_CHAT_PATH = "/chat/completions";
4601
+ // src/ipc.ts
4602
+ var import_zod14 = require("zod");
4603
+ var IpcMessageType = /* @__PURE__ */ ((IpcMessageType2) => {
4604
+ IpcMessageType2["Connect"] = "Connect";
4605
+ IpcMessageType2["Disconnect"] = "Disconnect";
4606
+ IpcMessageType2["Ack"] = "Ack";
4607
+ IpcMessageType2["TaskCommand"] = "TaskCommand";
4608
+ IpcMessageType2["TaskEvent"] = "TaskEvent";
4609
+ return IpcMessageType2;
4610
+ })(IpcMessageType || {});
4611
+ var IpcOrigin = /* @__PURE__ */ ((IpcOrigin2) => {
4612
+ IpcOrigin2["Client"] = "client";
4613
+ IpcOrigin2["Server"] = "server";
4614
+ return IpcOrigin2;
4615
+ })(IpcOrigin || {});
4616
+ var ackSchema = import_zod14.z.object({
4617
+ clientId: import_zod14.z.string(),
4618
+ pid: import_zod14.z.number(),
4619
+ ppid: import_zod14.z.number()
4620
+ });
4621
+ var TaskCommandName = /* @__PURE__ */ ((TaskCommandName2) => {
4622
+ TaskCommandName2["StartNewTask"] = "StartNewTask";
4623
+ TaskCommandName2["CancelTask"] = "CancelTask";
4624
+ TaskCommandName2["CloseTask"] = "CloseTask";
4625
+ TaskCommandName2["ResumeTask"] = "ResumeTask";
4626
+ return TaskCommandName2;
4627
+ })(TaskCommandName || {});
4628
+ var taskCommandSchema = import_zod14.z.discriminatedUnion("commandName", [
4629
+ import_zod14.z.object({
4630
+ commandName: import_zod14.z.literal("StartNewTask" /* StartNewTask */),
4631
+ data: import_zod14.z.object({
4632
+ configuration: rooCodeSettingsSchema,
4633
+ text: import_zod14.z.string(),
4634
+ images: import_zod14.z.array(import_zod14.z.string()).optional(),
4635
+ newTab: import_zod14.z.boolean().optional()
4636
+ })
4637
+ }),
4638
+ import_zod14.z.object({
4639
+ commandName: import_zod14.z.literal("CancelTask" /* CancelTask */),
4640
+ data: import_zod14.z.string()
4641
+ }),
4642
+ import_zod14.z.object({
4643
+ commandName: import_zod14.z.literal("CloseTask" /* CloseTask */),
4644
+ data: import_zod14.z.string()
4645
+ }),
4646
+ import_zod14.z.object({
4647
+ commandName: import_zod14.z.literal("ResumeTask" /* ResumeTask */),
4648
+ data: import_zod14.z.string()
4649
+ })
4650
+ ]);
4651
+ var ipcMessageSchema = import_zod14.z.discriminatedUnion("type", [
4652
+ import_zod14.z.object({
4653
+ type: import_zod14.z.literal("Ack" /* Ack */),
4654
+ origin: import_zod14.z.literal("server" /* Server */),
4655
+ data: ackSchema
4656
+ }),
4657
+ import_zod14.z.object({
4658
+ type: import_zod14.z.literal("TaskCommand" /* TaskCommand */),
4659
+ origin: import_zod14.z.literal("client" /* Client */),
4660
+ clientId: import_zod14.z.string(),
4661
+ data: taskCommandSchema
4662
+ }),
4663
+ import_zod14.z.object({
4664
+ type: import_zod14.z.literal("TaskEvent" /* TaskEvent */),
4665
+ origin: import_zod14.z.literal("server" /* Server */),
4666
+ relayClientId: import_zod14.z.string().optional(),
4667
+ data: taskEventSchema
4668
+ })
4669
+ ]);
4670
+
4671
+ // src/marketplace.ts
4672
+ var import_zod15 = require("zod");
4673
+ var mcpParameterSchema = import_zod15.z.object({
4674
+ name: import_zod15.z.string().min(1),
4675
+ key: import_zod15.z.string().min(1),
4676
+ placeholder: import_zod15.z.string().optional(),
4677
+ optional: import_zod15.z.boolean().optional().default(false)
4678
+ });
4679
+ var mcpInstallationMethodSchema = import_zod15.z.object({
4680
+ name: import_zod15.z.string().min(1),
4681
+ content: import_zod15.z.string().min(1),
4682
+ parameters: import_zod15.z.array(mcpParameterSchema).optional(),
4683
+ prerequisites: import_zod15.z.array(import_zod15.z.string()).optional()
4684
+ });
4685
+ var marketplaceItemTypeSchema = import_zod15.z.enum(["mode", "mcp"]);
4686
+ var baseMarketplaceItemSchema = import_zod15.z.object({
4687
+ id: import_zod15.z.string().min(1),
4688
+ name: import_zod15.z.string().min(1, "Name is required"),
4689
+ description: import_zod15.z.string(),
4690
+ author: import_zod15.z.string().optional(),
4691
+ authorUrl: import_zod15.z.string().url("Author URL must be a valid URL").optional(),
4692
+ tags: import_zod15.z.array(import_zod15.z.string()).optional(),
4693
+ prerequisites: import_zod15.z.array(import_zod15.z.string()).optional()
4694
+ });
4695
+ var modeMarketplaceItemSchema = baseMarketplaceItemSchema.extend({
4696
+ content: import_zod15.z.string().min(1)
4697
+ // YAML content for modes
4698
+ });
4699
+ var mcpMarketplaceItemSchema = baseMarketplaceItemSchema.extend({
4700
+ url: import_zod15.z.string().url(),
4701
+ // Required url field
4702
+ content: import_zod15.z.union([import_zod15.z.string().min(1), import_zod15.z.array(mcpInstallationMethodSchema)]),
4703
+ // Single config or array of methods
4704
+ parameters: import_zod15.z.array(mcpParameterSchema).optional()
4705
+ });
4706
+ var marketplaceItemSchema = import_zod15.z.discriminatedUnion("type", [
4707
+ // Mode marketplace item
4708
+ modeMarketplaceItemSchema.extend({
4709
+ type: import_zod15.z.literal("mode")
4710
+ }),
4711
+ // MCP marketplace item
4712
+ mcpMarketplaceItemSchema.extend({
4713
+ type: import_zod15.z.literal("mcp")
4714
+ })
4715
+ ]);
4716
+ var installMarketplaceItemOptionsSchema = import_zod15.z.object({
4717
+ target: import_zod15.z.enum(["global", "project"]).optional().default("project"),
4718
+ parameters: import_zod15.z.record(import_zod15.z.string(), import_zod15.z.any()).optional()
4719
+ });
4720
+
4721
+ // src/mcp.ts
4722
+ var import_zod16 = require("zod");
4723
+ var mcpExecutionStatusSchema = import_zod16.z.discriminatedUnion("status", [
4724
+ import_zod16.z.object({
4725
+ executionId: import_zod16.z.string(),
4726
+ status: import_zod16.z.literal("started"),
4727
+ serverName: import_zod16.z.string(),
4728
+ toolName: import_zod16.z.string()
4729
+ }),
4730
+ import_zod16.z.object({
4731
+ executionId: import_zod16.z.string(),
4732
+ status: import_zod16.z.literal("output"),
4733
+ response: import_zod16.z.string()
4734
+ }),
4735
+ import_zod16.z.object({
4736
+ executionId: import_zod16.z.string(),
4737
+ status: import_zod16.z.literal("completed"),
4738
+ response: import_zod16.z.string().optional()
4739
+ }),
4740
+ import_zod16.z.object({
4741
+ executionId: import_zod16.z.string(),
4742
+ status: import_zod16.z.literal("error"),
4743
+ error: import_zod16.z.string().optional()
4744
+ })
4745
+ ]);
4412
4746
 
4413
- // src/providers/zai.ts
4414
- var internationalZAiDefaultModelId = "glm-4.5";
4415
- var internationalZAiModels = {
4416
- "glm-4.5": {
4417
- maxTokens: 98304,
4418
- contextWindow: 131072,
4419
- supportsImages: false,
4420
- supportsPromptCache: true,
4421
- inputPrice: 0.6,
4422
- outputPrice: 2.2,
4423
- cacheWritesPrice: 0,
4424
- cacheReadsPrice: 0.11,
4425
- description: "GLM-4.5 is Zhipu's latest featured model. Its comprehensive capabilities in reasoning, coding, and agent reach the state-of-the-art (SOTA) level among open-source models, with a context length of up to 128k."
4426
- },
4427
- "glm-4.5-air": {
4428
- maxTokens: 98304,
4429
- contextWindow: 131072,
4430
- supportsImages: false,
4431
- supportsPromptCache: true,
4432
- inputPrice: 0.2,
4433
- outputPrice: 1.1,
4434
- cacheWritesPrice: 0,
4435
- cacheReadsPrice: 0.03,
4436
- description: "GLM-4.5-Air is the lightweight version of GLM-4.5. It balances performance and cost-effectiveness, and can flexibly switch to hybrid thinking models."
4747
+ // src/single-file-read-models.ts
4748
+ var SINGLE_FILE_READ_MODELS = /* @__PURE__ */ new Set(["roo/sonic"]);
4749
+ function shouldUseSingleFileRead(modelId) {
4750
+ if (SINGLE_FILE_READ_MODELS.has(modelId)) {
4751
+ return true;
4437
4752
  }
4438
- };
4439
- var mainlandZAiDefaultModelId = "glm-4.5";
4440
- var mainlandZAiModels = {
4441
- "glm-4.5": {
4442
- maxTokens: 98304,
4443
- contextWindow: 131072,
4444
- supportsImages: false,
4445
- supportsPromptCache: true,
4446
- inputPrice: 0.29,
4447
- outputPrice: 1.14,
4448
- cacheWritesPrice: 0,
4449
- cacheReadsPrice: 0.057,
4450
- description: "GLM-4.5 is Zhipu's latest featured model. Its comprehensive capabilities in reasoning, coding, and agent reach the state-of-the-art (SOTA) level among open-source models, with a context length of up to 128k.",
4451
- tiers: [
4452
- {
4453
- contextWindow: 32e3,
4454
- inputPrice: 0.21,
4455
- outputPrice: 1,
4456
- cacheReadsPrice: 0.043
4457
- },
4458
- {
4459
- contextWindow: 128e3,
4460
- inputPrice: 0.29,
4461
- outputPrice: 1.14,
4462
- cacheReadsPrice: 0.057
4463
- },
4464
- {
4465
- contextWindow: Infinity,
4466
- inputPrice: 0.29,
4467
- outputPrice: 1.14,
4468
- cacheReadsPrice: 0.057
4469
- }
4470
- ]
4471
- },
4472
- "glm-4.5-air": {
4473
- maxTokens: 98304,
4474
- contextWindow: 131072,
4475
- supportsImages: false,
4476
- supportsPromptCache: true,
4477
- inputPrice: 0.1,
4478
- outputPrice: 0.6,
4479
- cacheWritesPrice: 0,
4480
- cacheReadsPrice: 0.02,
4481
- description: "GLM-4.5-Air is the lightweight version of GLM-4.5. It balances performance and cost-effectiveness, and can flexibly switch to hybrid thinking models.",
4482
- tiers: [
4483
- {
4484
- contextWindow: 32e3,
4485
- inputPrice: 0.07,
4486
- outputPrice: 0.4,
4487
- cacheReadsPrice: 0.014
4488
- },
4489
- {
4490
- contextWindow: 128e3,
4491
- inputPrice: 0.1,
4492
- outputPrice: 0.6,
4493
- cacheReadsPrice: 0.02
4494
- },
4495
- {
4496
- contextWindow: Infinity,
4497
- inputPrice: 0.1,
4498
- outputPrice: 0.6,
4499
- cacheReadsPrice: 0.02
4500
- }
4501
- ]
4753
+ const patterns = Array.from(SINGLE_FILE_READ_MODELS);
4754
+ for (const pattern of patterns) {
4755
+ if (pattern.endsWith("*") && modelId.startsWith(pattern.slice(0, -1))) {
4756
+ return true;
4757
+ }
4502
4758
  }
4503
- };
4504
- var ZAI_DEFAULT_TEMPERATURE = 0;
4759
+ return false;
4760
+ }
4505
4761
 
4506
- // src/providers/fireworks.ts
4507
- var fireworksDefaultModelId = "accounts/fireworks/models/kimi-k2-instruct";
4508
- var fireworksModels = {
4509
- "accounts/fireworks/models/kimi-k2-instruct": {
4510
- maxTokens: 16384,
4511
- contextWindow: 128e3,
4512
- supportsImages: false,
4513
- supportsPromptCache: false,
4514
- inputPrice: 0.6,
4515
- outputPrice: 2.5,
4516
- description: "Kimi K2 is a state-of-the-art mixture-of-experts (MoE) language model with 32 billion activated parameters and 1 trillion total parameters. Trained with the Muon optimizer, Kimi K2 achieves exceptional performance across frontier knowledge, reasoning, and coding tasks while being meticulously optimized for agentic capabilities."
4517
- },
4518
- "accounts/fireworks/models/qwen3-235b-a22b-instruct-2507": {
4519
- maxTokens: 32768,
4520
- contextWindow: 256e3,
4521
- supportsImages: false,
4522
- supportsPromptCache: false,
4523
- inputPrice: 0.22,
4524
- outputPrice: 0.88,
4525
- description: "Latest Qwen3 thinking model, competitive against the best closed source models in Jul 2025."
4526
- },
4527
- "accounts/fireworks/models/qwen3-coder-480b-a35b-instruct": {
4528
- maxTokens: 32768,
4529
- contextWindow: 256e3,
4530
- supportsImages: false,
4531
- supportsPromptCache: false,
4532
- inputPrice: 0.45,
4533
- outputPrice: 1.8,
4534
- description: "Qwen3's most agentic code model to date."
4535
- },
4536
- "accounts/fireworks/models/deepseek-r1-0528": {
4537
- maxTokens: 20480,
4538
- contextWindow: 16e4,
4539
- supportsImages: false,
4540
- supportsPromptCache: false,
4541
- inputPrice: 3,
4542
- outputPrice: 8,
4543
- description: "05/28 updated checkpoint of Deepseek R1. Its overall performance is now approaching that of leading models, such as O3 and Gemini 2.5 Pro. Compared to the previous version, the upgraded model shows significant improvements in handling complex reasoning tasks, and this version also offers a reduced hallucination rate, enhanced support for function calling, and better experience for vibe coding. Note that fine-tuning for this model is only available through contacting fireworks at https://fireworks.ai/company/contact-us."
4544
- },
4545
- "accounts/fireworks/models/deepseek-v3": {
4546
- maxTokens: 16384,
4547
- contextWindow: 128e3,
4548
- supportsImages: false,
4549
- supportsPromptCache: false,
4550
- inputPrice: 0.9,
4551
- outputPrice: 0.9,
4552
- description: "A strong Mixture-of-Experts (MoE) language model with 671B total parameters with 37B activated for each token from Deepseek. Note that fine-tuning for this model is only available through contacting fireworks at https://fireworks.ai/company/contact-us."
4553
- },
4554
- "accounts/fireworks/models/glm-4p5": {
4555
- maxTokens: 16384,
4556
- contextWindow: 128e3,
4557
- supportsImages: false,
4558
- supportsPromptCache: false,
4559
- inputPrice: 0.55,
4560
- outputPrice: 2.19,
4561
- description: "Z.ai GLM-4.5 with 355B total parameters and 32B active parameters. Features unified reasoning, coding, and intelligent agent capabilities."
4562
- },
4563
- "accounts/fireworks/models/glm-4p5-air": {
4564
- maxTokens: 16384,
4565
- contextWindow: 128e3,
4566
- supportsImages: false,
4567
- supportsPromptCache: false,
4568
- inputPrice: 0.55,
4569
- outputPrice: 2.19,
4570
- description: "Z.ai GLM-4.5-Air with 106B total parameters and 12B active parameters. Features unified reasoning, coding, and intelligent agent capabilities."
4571
- },
4572
- "accounts/fireworks/models/gpt-oss-20b": {
4573
- maxTokens: 16384,
4574
- contextWindow: 128e3,
4575
- supportsImages: false,
4576
- supportsPromptCache: false,
4577
- inputPrice: 0.07,
4578
- outputPrice: 0.3,
4579
- description: "OpenAI gpt-oss-20b: Compact model for local/edge deployments. Optimized for low-latency and resource-constrained environments with chain-of-thought output, adjustable reasoning, and agentic workflows."
4580
- },
4581
- "accounts/fireworks/models/gpt-oss-120b": {
4582
- maxTokens: 16384,
4583
- contextWindow: 128e3,
4584
- supportsImages: false,
4585
- supportsPromptCache: false,
4586
- inputPrice: 0.15,
4587
- outputPrice: 0.6,
4588
- description: "OpenAI gpt-oss-120b: Production-grade, general-purpose model that fits on a single H100 GPU. Features complex reasoning, configurable effort, full chain-of-thought transparency, and supports function calling, tool use, and structured outputs."
4589
- }
4590
- };
4762
+ // src/task.ts
4763
+ var import_zod17 = require("zod");
4764
+ var TaskStatus = /* @__PURE__ */ ((TaskStatus2) => {
4765
+ TaskStatus2["Running"] = "running";
4766
+ TaskStatus2["Interactive"] = "interactive";
4767
+ TaskStatus2["Resumable"] = "resumable";
4768
+ TaskStatus2["Idle"] = "idle";
4769
+ TaskStatus2["None"] = "none";
4770
+ return TaskStatus2;
4771
+ })(TaskStatus || {});
4772
+ var taskMetadataSchema = import_zod17.z.object({
4773
+ task: import_zod17.z.string().optional(),
4774
+ images: import_zod17.z.array(import_zod17.z.string()).optional()
4775
+ });
4591
4776
 
4592
- // src/providers/roo.ts
4593
- var rooDefaultModelId = "roo/sonic";
4594
- var rooModels = {
4595
- "roo/sonic": {
4596
- maxTokens: 8192,
4597
- contextWindow: 262144,
4598
- supportsImages: false,
4599
- supportsPromptCache: false,
4600
- inputPrice: 0,
4601
- outputPrice: 0,
4602
- description: "Stealth coding model with 262K context window, accessible for free through Roo Code Cloud for a limited time. (Note: prompts and completions are logged by the model creator and used to improve the model.)"
4603
- }
4604
- };
4777
+ // src/todo.ts
4778
+ var import_zod18 = require("zod");
4779
+ var todoStatusSchema = import_zod18.z.enum(["pending", "in_progress", "completed"]);
4780
+ var todoItemSchema = import_zod18.z.object({
4781
+ id: import_zod18.z.string(),
4782
+ content: import_zod18.z.string(),
4783
+ status: todoStatusSchema
4784
+ });
4785
+
4786
+ // src/terminal.ts
4787
+ var import_zod19 = require("zod");
4788
+ var commandExecutionStatusSchema = import_zod19.z.discriminatedUnion("status", [
4789
+ import_zod19.z.object({
4790
+ executionId: import_zod19.z.string(),
4791
+ status: import_zod19.z.literal("started"),
4792
+ pid: import_zod19.z.number().optional(),
4793
+ command: import_zod19.z.string()
4794
+ }),
4795
+ import_zod19.z.object({
4796
+ executionId: import_zod19.z.string(),
4797
+ status: import_zod19.z.literal("output"),
4798
+ output: import_zod19.z.string()
4799
+ }),
4800
+ import_zod19.z.object({
4801
+ executionId: import_zod19.z.string(),
4802
+ status: import_zod19.z.literal("exited"),
4803
+ exitCode: import_zod19.z.number().optional()
4804
+ }),
4805
+ import_zod19.z.object({
4806
+ executionId: import_zod19.z.string(),
4807
+ status: import_zod19.z.literal("fallback")
4808
+ }),
4809
+ import_zod19.z.object({
4810
+ executionId: import_zod19.z.string(),
4811
+ status: import_zod19.z.literal("timeout")
4812
+ })
4813
+ ]);
4605
4814
  // Annotate the CommonJS export names for ESM import in node:
4606
4815
  0 && (module.exports = {
4607
4816
  ANTHROPIC_DEFAULT_MAX_TOKENS,
@@ -4641,6 +4850,7 @@ var rooModels = {
4641
4850
  LITELLM_COMPUTER_USE_MODELS,
4642
4851
  LMSTUDIO_DEFAULT_TEMPERATURE,
4643
4852
  MISTRAL_DEFAULT_TEMPERATURE,
4853
+ MODELS_BY_PROVIDER,
4644
4854
  MODEL_ID_KEYS,
4645
4855
  MOONSHOT_DEFAULT_TEMPERATURE,
4646
4856
  OPENAI_AZURE_AI_INFERENCE_PATH,
@@ -4653,6 +4863,7 @@ var rooModels = {
4653
4863
  PROVIDER_SETTINGS_KEYS,
4654
4864
  RooCodeEventName,
4655
4865
  SECRET_STATE_KEYS,
4866
+ SINGLE_FILE_READ_MODELS,
4656
4867
  TaskCommandName,
4657
4868
  TaskStatus,
4658
4869
  TelemetryEventName,
@@ -4699,7 +4910,8 @@ var rooModels = {
4699
4910
  experimentIds,
4700
4911
  experimentIdsSchema,
4701
4912
  experimentsSchema,
4702
- extendedReasoningEffortsSchema,
4913
+ featherlessDefaultModelId,
4914
+ featherlessModels,
4703
4915
  fireworksDefaultModelId,
4704
4916
  fireworksModels,
4705
4917
  followUpDataSchema,
@@ -4770,6 +4982,7 @@ var rooModels = {
4770
4982
  providerSettingsSchema,
4771
4983
  providerSettingsSchemaDiscriminated,
4772
4984
  providerSettingsWithIdSchema,
4985
+ reasoningEffortWithMinimalSchema,
4773
4986
  reasoningEfforts,
4774
4987
  reasoningEffortsSchema,
4775
4988
  requestyDefaultModelId,
@@ -4782,6 +4995,7 @@ var rooModels = {
4782
4995
  rooModels,
4783
4996
  sambaNovaDefaultModelId,
4784
4997
  sambaNovaModels,
4998
+ shouldUseSingleFileRead,
4785
4999
  staticAppPropertiesSchema,
4786
5000
  suggestionItemSchema,
4787
5001
  taskCommandSchema,