@roo-code/types 1.55.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,
@@ -116,7 +117,6 @@ __export(index_exports, {
116
117
  experimentIds: () => experimentIds,
117
118
  experimentIdsSchema: () => experimentIdsSchema,
118
119
  experimentsSchema: () => experimentsSchema,
119
- extendedReasoningEffortsSchema: () => extendedReasoningEffortsSchema,
120
120
  featherlessDefaultModelId: () => featherlessDefaultModelId,
121
121
  featherlessModels: () => featherlessModels,
122
122
  fireworksDefaultModelId: () => fireworksDefaultModelId,
@@ -189,6 +189,7 @@ __export(index_exports, {
189
189
  providerSettingsSchema: () => providerSettingsSchema,
190
190
  providerSettingsSchemaDiscriminated: () => providerSettingsSchemaDiscriminated,
191
191
  providerSettingsWithIdSchema: () => providerSettingsWithIdSchema,
192
+ reasoningEffortWithMinimalSchema: () => reasoningEffortWithMinimalSchema,
192
193
  reasoningEfforts: () => reasoningEfforts,
193
194
  reasoningEffortsSchema: () => reasoningEffortsSchema,
194
195
  requestyDefaultModelId: () => requestyDefaultModelId,
@@ -621,6 +622,7 @@ var import_zod8 = require("zod");
621
622
  var import_zod7 = require("zod");
622
623
  var reasoningEfforts = ["low", "medium", "high"];
623
624
  var reasoningEffortsSchema = import_zod7.z.enum(reasoningEfforts);
625
+ var reasoningEffortWithMinimalSchema = import_zod7.z.union([reasoningEffortsSchema, import_zod7.z.literal("minimal")]);
624
626
  var verbosityLevels = ["low", "medium", "high"];
625
627
  var verbosityLevelsSchema = import_zod7.z.enum(verbosityLevels);
626
628
  var modelParameters = ["max_tokens", "temperature", "reasoning", "include_reasoning"];
@@ -659,1100 +661,6 @@ var modelInfoSchema = import_zod7.z.object({
659
661
  ).optional()
660
662
  });
661
663
 
662
- // src/provider-settings.ts
663
- var BEDROCK_CLAUDE_SONNET_4_MODEL_ID = "anthropic.claude-sonnet-4-20250514-v1:0";
664
- var extendedReasoningEffortsSchema = import_zod8.z.union([reasoningEffortsSchema, import_zod8.z.literal("minimal")]);
665
- var providerNames = [
666
- "anthropic",
667
- "claude-code",
668
- "glama",
669
- "openrouter",
670
- "bedrock",
671
- "vertex",
672
- "openai",
673
- "ollama",
674
- "vscode-lm",
675
- "lmstudio",
676
- "gemini",
677
- "gemini-cli",
678
- "openai-native",
679
- "mistral",
680
- "moonshot",
681
- "deepseek",
682
- "doubao",
683
- "unbound",
684
- "requesty",
685
- "human-relay",
686
- "fake-ai",
687
- "xai",
688
- "groq",
689
- "chutes",
690
- "litellm",
691
- "huggingface",
692
- "cerebras",
693
- "sambanova",
694
- "zai",
695
- "fireworks",
696
- "featherless",
697
- "io-intelligence",
698
- "roo"
699
- ];
700
- var providerNamesSchema = import_zod8.z.enum(providerNames);
701
- var providerSettingsEntrySchema = import_zod8.z.object({
702
- id: import_zod8.z.string(),
703
- name: import_zod8.z.string(),
704
- apiProvider: providerNamesSchema.optional()
705
- });
706
- var DEFAULT_CONSECUTIVE_MISTAKE_LIMIT = 3;
707
- var baseProviderSettingsSchema = import_zod8.z.object({
708
- includeMaxTokens: import_zod8.z.boolean().optional(),
709
- diffEnabled: import_zod8.z.boolean().optional(),
710
- todoListEnabled: import_zod8.z.boolean().optional(),
711
- fuzzyMatchThreshold: import_zod8.z.number().optional(),
712
- modelTemperature: import_zod8.z.number().nullish(),
713
- rateLimitSeconds: import_zod8.z.number().optional(),
714
- consecutiveMistakeLimit: import_zod8.z.number().min(0).optional(),
715
- // Model reasoning.
716
- enableReasoningEffort: import_zod8.z.boolean().optional(),
717
- reasoningEffort: extendedReasoningEffortsSchema.optional(),
718
- modelMaxTokens: import_zod8.z.number().optional(),
719
- modelMaxThinkingTokens: import_zod8.z.number().optional(),
720
- // Model verbosity.
721
- verbosity: verbosityLevelsSchema.optional()
722
- });
723
- var apiModelIdProviderModelSchema = baseProviderSettingsSchema.extend({
724
- apiModelId: import_zod8.z.string().optional()
725
- });
726
- var anthropicSchema = apiModelIdProviderModelSchema.extend({
727
- apiKey: import_zod8.z.string().optional(),
728
- anthropicBaseUrl: import_zod8.z.string().optional(),
729
- anthropicUseAuthToken: import_zod8.z.boolean().optional(),
730
- anthropicBeta1MContext: import_zod8.z.boolean().optional()
731
- // Enable 'context-1m-2025-08-07' beta for 1M context window
732
- });
733
- var claudeCodeSchema = apiModelIdProviderModelSchema.extend({
734
- claudeCodePath: import_zod8.z.string().optional(),
735
- claudeCodeMaxOutputTokens: import_zod8.z.number().int().min(1).max(2e5).optional()
736
- });
737
- var glamaSchema = baseProviderSettingsSchema.extend({
738
- glamaModelId: import_zod8.z.string().optional(),
739
- glamaApiKey: import_zod8.z.string().optional()
740
- });
741
- var openRouterSchema = baseProviderSettingsSchema.extend({
742
- openRouterApiKey: import_zod8.z.string().optional(),
743
- openRouterModelId: import_zod8.z.string().optional(),
744
- openRouterBaseUrl: import_zod8.z.string().optional(),
745
- openRouterSpecificProvider: import_zod8.z.string().optional(),
746
- openRouterUseMiddleOutTransform: import_zod8.z.boolean().optional()
747
- });
748
- var bedrockSchema = apiModelIdProviderModelSchema.extend({
749
- awsAccessKey: import_zod8.z.string().optional(),
750
- awsSecretKey: import_zod8.z.string().optional(),
751
- awsSessionToken: import_zod8.z.string().optional(),
752
- awsRegion: import_zod8.z.string().optional(),
753
- awsUseCrossRegionInference: import_zod8.z.boolean().optional(),
754
- awsUsePromptCache: import_zod8.z.boolean().optional(),
755
- awsProfile: import_zod8.z.string().optional(),
756
- awsUseProfile: import_zod8.z.boolean().optional(),
757
- awsApiKey: import_zod8.z.string().optional(),
758
- awsUseApiKey: import_zod8.z.boolean().optional(),
759
- awsCustomArn: import_zod8.z.string().optional(),
760
- awsModelContextWindow: import_zod8.z.number().optional(),
761
- awsBedrockEndpointEnabled: import_zod8.z.boolean().optional(),
762
- awsBedrockEndpoint: import_zod8.z.string().optional(),
763
- awsBedrock1MContext: import_zod8.z.boolean().optional()
764
- // Enable 'context-1m-2025-08-07' beta for 1M context window
765
- });
766
- var vertexSchema = apiModelIdProviderModelSchema.extend({
767
- vertexKeyFile: import_zod8.z.string().optional(),
768
- vertexJsonCredentials: import_zod8.z.string().optional(),
769
- vertexProjectId: import_zod8.z.string().optional(),
770
- vertexRegion: import_zod8.z.string().optional()
771
- });
772
- var openAiSchema = baseProviderSettingsSchema.extend({
773
- openAiBaseUrl: import_zod8.z.string().optional(),
774
- openAiApiKey: import_zod8.z.string().optional(),
775
- openAiLegacyFormat: import_zod8.z.boolean().optional(),
776
- openAiR1FormatEnabled: import_zod8.z.boolean().optional(),
777
- openAiModelId: import_zod8.z.string().optional(),
778
- openAiCustomModelInfo: modelInfoSchema.nullish(),
779
- openAiUseAzure: import_zod8.z.boolean().optional(),
780
- azureApiVersion: import_zod8.z.string().optional(),
781
- openAiStreamingEnabled: import_zod8.z.boolean().optional(),
782
- openAiHostHeader: import_zod8.z.string().optional(),
783
- // Keep temporarily for backward compatibility during migration.
784
- openAiHeaders: import_zod8.z.record(import_zod8.z.string(), import_zod8.z.string()).optional()
785
- });
786
- var ollamaSchema = baseProviderSettingsSchema.extend({
787
- ollamaModelId: import_zod8.z.string().optional(),
788
- ollamaBaseUrl: import_zod8.z.string().optional()
789
- });
790
- var vsCodeLmSchema = baseProviderSettingsSchema.extend({
791
- vsCodeLmModelSelector: import_zod8.z.object({
792
- vendor: import_zod8.z.string().optional(),
793
- family: import_zod8.z.string().optional(),
794
- version: import_zod8.z.string().optional(),
795
- id: import_zod8.z.string().optional()
796
- }).optional()
797
- });
798
- var lmStudioSchema = baseProviderSettingsSchema.extend({
799
- lmStudioModelId: import_zod8.z.string().optional(),
800
- lmStudioBaseUrl: import_zod8.z.string().optional(),
801
- lmStudioDraftModelId: import_zod8.z.string().optional(),
802
- lmStudioSpeculativeDecodingEnabled: import_zod8.z.boolean().optional()
803
- });
804
- var geminiSchema = apiModelIdProviderModelSchema.extend({
805
- geminiApiKey: import_zod8.z.string().optional(),
806
- googleGeminiBaseUrl: import_zod8.z.string().optional(),
807
- enableUrlContext: import_zod8.z.boolean().optional(),
808
- enableGrounding: import_zod8.z.boolean().optional()
809
- });
810
- var geminiCliSchema = apiModelIdProviderModelSchema.extend({
811
- geminiCliOAuthPath: import_zod8.z.string().optional(),
812
- geminiCliProjectId: import_zod8.z.string().optional()
813
- });
814
- var openAiNativeSchema = apiModelIdProviderModelSchema.extend({
815
- openAiNativeApiKey: import_zod8.z.string().optional(),
816
- openAiNativeBaseUrl: import_zod8.z.string().optional()
817
- });
818
- var mistralSchema = apiModelIdProviderModelSchema.extend({
819
- mistralApiKey: import_zod8.z.string().optional(),
820
- mistralCodestralUrl: import_zod8.z.string().optional()
821
- });
822
- var deepSeekSchema = apiModelIdProviderModelSchema.extend({
823
- deepSeekBaseUrl: import_zod8.z.string().optional(),
824
- deepSeekApiKey: import_zod8.z.string().optional()
825
- });
826
- var doubaoSchema = apiModelIdProviderModelSchema.extend({
827
- doubaoBaseUrl: import_zod8.z.string().optional(),
828
- doubaoApiKey: import_zod8.z.string().optional()
829
- });
830
- var moonshotSchema = apiModelIdProviderModelSchema.extend({
831
- moonshotBaseUrl: import_zod8.z.union([import_zod8.z.literal("https://api.moonshot.ai/v1"), import_zod8.z.literal("https://api.moonshot.cn/v1")]).optional(),
832
- moonshotApiKey: import_zod8.z.string().optional()
833
- });
834
- var unboundSchema = baseProviderSettingsSchema.extend({
835
- unboundApiKey: import_zod8.z.string().optional(),
836
- unboundModelId: import_zod8.z.string().optional()
837
- });
838
- var requestySchema = baseProviderSettingsSchema.extend({
839
- requestyBaseUrl: import_zod8.z.string().optional(),
840
- requestyApiKey: import_zod8.z.string().optional(),
841
- requestyModelId: import_zod8.z.string().optional()
842
- });
843
- var humanRelaySchema = baseProviderSettingsSchema;
844
- var fakeAiSchema = baseProviderSettingsSchema.extend({
845
- fakeAi: import_zod8.z.unknown().optional()
846
- });
847
- var xaiSchema = apiModelIdProviderModelSchema.extend({
848
- xaiApiKey: import_zod8.z.string().optional()
849
- });
850
- var groqSchema = apiModelIdProviderModelSchema.extend({
851
- groqApiKey: import_zod8.z.string().optional()
852
- });
853
- var huggingFaceSchema = baseProviderSettingsSchema.extend({
854
- huggingFaceApiKey: import_zod8.z.string().optional(),
855
- huggingFaceModelId: import_zod8.z.string().optional(),
856
- huggingFaceInferenceProvider: import_zod8.z.string().optional()
857
- });
858
- var chutesSchema = apiModelIdProviderModelSchema.extend({
859
- chutesApiKey: import_zod8.z.string().optional()
860
- });
861
- var litellmSchema = baseProviderSettingsSchema.extend({
862
- litellmBaseUrl: import_zod8.z.string().optional(),
863
- litellmApiKey: import_zod8.z.string().optional(),
864
- litellmModelId: import_zod8.z.string().optional(),
865
- litellmUsePromptCache: import_zod8.z.boolean().optional()
866
- });
867
- var cerebrasSchema = apiModelIdProviderModelSchema.extend({
868
- cerebrasApiKey: import_zod8.z.string().optional()
869
- });
870
- var sambaNovaSchema = apiModelIdProviderModelSchema.extend({
871
- sambaNovaApiKey: import_zod8.z.string().optional()
872
- });
873
- var zaiSchema = apiModelIdProviderModelSchema.extend({
874
- zaiApiKey: import_zod8.z.string().optional(),
875
- zaiApiLine: import_zod8.z.union([import_zod8.z.literal("china"), import_zod8.z.literal("international")]).optional()
876
- });
877
- var fireworksSchema = apiModelIdProviderModelSchema.extend({
878
- fireworksApiKey: import_zod8.z.string().optional()
879
- });
880
- var featherlessSchema = apiModelIdProviderModelSchema.extend({
881
- featherlessApiKey: import_zod8.z.string().optional()
882
- });
883
- var ioIntelligenceSchema = apiModelIdProviderModelSchema.extend({
884
- ioIntelligenceModelId: import_zod8.z.string().optional(),
885
- ioIntelligenceApiKey: import_zod8.z.string().optional()
886
- });
887
- var rooSchema = apiModelIdProviderModelSchema.extend({
888
- // No additional fields needed - uses cloud authentication
889
- });
890
- var defaultSchema = import_zod8.z.object({
891
- apiProvider: import_zod8.z.undefined()
892
- });
893
- var providerSettingsSchemaDiscriminated = import_zod8.z.discriminatedUnion("apiProvider", [
894
- anthropicSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("anthropic") })),
895
- claudeCodeSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("claude-code") })),
896
- glamaSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("glama") })),
897
- openRouterSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("openrouter") })),
898
- bedrockSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("bedrock") })),
899
- vertexSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("vertex") })),
900
- openAiSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("openai") })),
901
- ollamaSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("ollama") })),
902
- vsCodeLmSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("vscode-lm") })),
903
- lmStudioSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("lmstudio") })),
904
- geminiSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("gemini") })),
905
- geminiCliSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("gemini-cli") })),
906
- openAiNativeSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("openai-native") })),
907
- mistralSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("mistral") })),
908
- deepSeekSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("deepseek") })),
909
- doubaoSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("doubao") })),
910
- moonshotSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("moonshot") })),
911
- unboundSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("unbound") })),
912
- requestySchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("requesty") })),
913
- humanRelaySchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("human-relay") })),
914
- fakeAiSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("fake-ai") })),
915
- xaiSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("xai") })),
916
- groqSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("groq") })),
917
- huggingFaceSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("huggingface") })),
918
- chutesSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("chutes") })),
919
- litellmSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("litellm") })),
920
- cerebrasSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("cerebras") })),
921
- sambaNovaSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("sambanova") })),
922
- zaiSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("zai") })),
923
- fireworksSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("fireworks") })),
924
- featherlessSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("featherless") })),
925
- ioIntelligenceSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("io-intelligence") })),
926
- rooSchema.merge(import_zod8.z.object({ apiProvider: import_zod8.z.literal("roo") })),
927
- defaultSchema
928
- ]);
929
- var providerSettingsSchema = import_zod8.z.object({
930
- apiProvider: providerNamesSchema.optional(),
931
- ...anthropicSchema.shape,
932
- ...claudeCodeSchema.shape,
933
- ...glamaSchema.shape,
934
- ...openRouterSchema.shape,
935
- ...bedrockSchema.shape,
936
- ...vertexSchema.shape,
937
- ...openAiSchema.shape,
938
- ...ollamaSchema.shape,
939
- ...vsCodeLmSchema.shape,
940
- ...lmStudioSchema.shape,
941
- ...geminiSchema.shape,
942
- ...geminiCliSchema.shape,
943
- ...openAiNativeSchema.shape,
944
- ...mistralSchema.shape,
945
- ...deepSeekSchema.shape,
946
- ...doubaoSchema.shape,
947
- ...moonshotSchema.shape,
948
- ...unboundSchema.shape,
949
- ...requestySchema.shape,
950
- ...humanRelaySchema.shape,
951
- ...fakeAiSchema.shape,
952
- ...xaiSchema.shape,
953
- ...groqSchema.shape,
954
- ...huggingFaceSchema.shape,
955
- ...chutesSchema.shape,
956
- ...litellmSchema.shape,
957
- ...cerebrasSchema.shape,
958
- ...sambaNovaSchema.shape,
959
- ...zaiSchema.shape,
960
- ...fireworksSchema.shape,
961
- ...featherlessSchema.shape,
962
- ...ioIntelligenceSchema.shape,
963
- ...rooSchema.shape,
964
- ...codebaseIndexProviderSchema.shape
965
- });
966
- var providerSettingsWithIdSchema = providerSettingsSchema.extend({ id: import_zod8.z.string().optional() });
967
- var discriminatedProviderSettingsWithIdSchema = providerSettingsSchemaDiscriminated.and(
968
- import_zod8.z.object({ id: import_zod8.z.string().optional() })
969
- );
970
- var PROVIDER_SETTINGS_KEYS = providerSettingsSchema.keyof().options;
971
- var MODEL_ID_KEYS = [
972
- "apiModelId",
973
- "glamaModelId",
974
- "openRouterModelId",
975
- "openAiModelId",
976
- "ollamaModelId",
977
- "lmStudioModelId",
978
- "lmStudioDraftModelId",
979
- "unboundModelId",
980
- "requestyModelId",
981
- "litellmModelId",
982
- "huggingFaceModelId",
983
- "ioIntelligenceModelId"
984
- ];
985
- var getModelId = (settings) => {
986
- const modelIdKey = MODEL_ID_KEYS.find((key) => settings[key]);
987
- return modelIdKey ? settings[modelIdKey] : void 0;
988
- };
989
- var ANTHROPIC_STYLE_PROVIDERS = ["anthropic", "claude-code", "bedrock"];
990
- var getApiProtocol = (provider, modelId) => {
991
- if (provider && ANTHROPIC_STYLE_PROVIDERS.includes(provider)) {
992
- return "anthropic";
993
- }
994
- if (provider && provider === "vertex" && modelId && modelId.toLowerCase().includes("claude")) {
995
- return "anthropic";
996
- }
997
- return "openai";
998
- };
999
-
1000
- // src/history.ts
1001
- var import_zod9 = require("zod");
1002
- var historyItemSchema = import_zod9.z.object({
1003
- id: import_zod9.z.string(),
1004
- number: import_zod9.z.number(),
1005
- ts: import_zod9.z.number(),
1006
- task: import_zod9.z.string(),
1007
- tokensIn: import_zod9.z.number(),
1008
- tokensOut: import_zod9.z.number(),
1009
- cacheWrites: import_zod9.z.number().optional(),
1010
- cacheReads: import_zod9.z.number().optional(),
1011
- totalCost: import_zod9.z.number(),
1012
- size: import_zod9.z.number().optional(),
1013
- workspace: import_zod9.z.string().optional(),
1014
- mode: import_zod9.z.string().optional()
1015
- });
1016
-
1017
- // src/telemetry.ts
1018
- var import_zod10 = require("zod");
1019
- var telemetrySettings = ["unset", "enabled", "disabled"];
1020
- var telemetrySettingsSchema = import_zod10.z.enum(telemetrySettings);
1021
- var TelemetryEventName = /* @__PURE__ */ ((TelemetryEventName2) => {
1022
- TelemetryEventName2["TASK_CREATED"] = "Task Created";
1023
- TelemetryEventName2["TASK_RESTARTED"] = "Task Reopened";
1024
- TelemetryEventName2["TASK_COMPLETED"] = "Task Completed";
1025
- TelemetryEventName2["TASK_MESSAGE"] = "Task Message";
1026
- TelemetryEventName2["TASK_CONVERSATION_MESSAGE"] = "Conversation Message";
1027
- TelemetryEventName2["LLM_COMPLETION"] = "LLM Completion";
1028
- TelemetryEventName2["MODE_SWITCH"] = "Mode Switched";
1029
- TelemetryEventName2["MODE_SELECTOR_OPENED"] = "Mode Selector Opened";
1030
- TelemetryEventName2["TOOL_USED"] = "Tool Used";
1031
- TelemetryEventName2["CHECKPOINT_CREATED"] = "Checkpoint Created";
1032
- TelemetryEventName2["CHECKPOINT_RESTORED"] = "Checkpoint Restored";
1033
- TelemetryEventName2["CHECKPOINT_DIFFED"] = "Checkpoint Diffed";
1034
- TelemetryEventName2["TAB_SHOWN"] = "Tab Shown";
1035
- TelemetryEventName2["MODE_SETTINGS_CHANGED"] = "Mode Setting Changed";
1036
- TelemetryEventName2["CUSTOM_MODE_CREATED"] = "Custom Mode Created";
1037
- TelemetryEventName2["CONTEXT_CONDENSED"] = "Context Condensed";
1038
- TelemetryEventName2["SLIDING_WINDOW_TRUNCATION"] = "Sliding Window Truncation";
1039
- TelemetryEventName2["CODE_ACTION_USED"] = "Code Action Used";
1040
- TelemetryEventName2["PROMPT_ENHANCED"] = "Prompt Enhanced";
1041
- TelemetryEventName2["TITLE_BUTTON_CLICKED"] = "Title Button Clicked";
1042
- TelemetryEventName2["AUTHENTICATION_INITIATED"] = "Authentication Initiated";
1043
- TelemetryEventName2["MARKETPLACE_ITEM_INSTALLED"] = "Marketplace Item Installed";
1044
- TelemetryEventName2["MARKETPLACE_ITEM_REMOVED"] = "Marketplace Item Removed";
1045
- TelemetryEventName2["MARKETPLACE_TAB_VIEWED"] = "Marketplace Tab Viewed";
1046
- TelemetryEventName2["MARKETPLACE_INSTALL_BUTTON_CLICKED"] = "Marketplace Install Button Clicked";
1047
- TelemetryEventName2["SHARE_BUTTON_CLICKED"] = "Share Button Clicked";
1048
- TelemetryEventName2["SHARE_ORGANIZATION_CLICKED"] = "Share Organization Clicked";
1049
- TelemetryEventName2["SHARE_PUBLIC_CLICKED"] = "Share Public Clicked";
1050
- TelemetryEventName2["SHARE_CONNECT_TO_CLOUD_CLICKED"] = "Share Connect To Cloud Clicked";
1051
- TelemetryEventName2["ACCOUNT_CONNECT_CLICKED"] = "Account Connect Clicked";
1052
- TelemetryEventName2["ACCOUNT_CONNECT_SUCCESS"] = "Account Connect Success";
1053
- TelemetryEventName2["ACCOUNT_LOGOUT_CLICKED"] = "Account Logout Clicked";
1054
- TelemetryEventName2["ACCOUNT_LOGOUT_SUCCESS"] = "Account Logout Success";
1055
- TelemetryEventName2["SCHEMA_VALIDATION_ERROR"] = "Schema Validation Error";
1056
- TelemetryEventName2["DIFF_APPLICATION_ERROR"] = "Diff Application Error";
1057
- TelemetryEventName2["SHELL_INTEGRATION_ERROR"] = "Shell Integration Error";
1058
- TelemetryEventName2["CONSECUTIVE_MISTAKE_ERROR"] = "Consecutive Mistake Error";
1059
- TelemetryEventName2["CODE_INDEX_ERROR"] = "Code Index Error";
1060
- return TelemetryEventName2;
1061
- })(TelemetryEventName || {});
1062
- var staticAppPropertiesSchema = import_zod10.z.object({
1063
- appName: import_zod10.z.string(),
1064
- appVersion: import_zod10.z.string(),
1065
- vscodeVersion: import_zod10.z.string(),
1066
- platform: import_zod10.z.string(),
1067
- editorName: import_zod10.z.string()
1068
- });
1069
- var dynamicAppPropertiesSchema = import_zod10.z.object({
1070
- language: import_zod10.z.string(),
1071
- mode: import_zod10.z.string()
1072
- });
1073
- var cloudAppPropertiesSchema = import_zod10.z.object({
1074
- cloudIsAuthenticated: import_zod10.z.boolean().optional()
1075
- });
1076
- var appPropertiesSchema = import_zod10.z.object({
1077
- ...staticAppPropertiesSchema.shape,
1078
- ...dynamicAppPropertiesSchema.shape,
1079
- ...cloudAppPropertiesSchema.shape
1080
- });
1081
- var taskPropertiesSchema = import_zod10.z.object({
1082
- taskId: import_zod10.z.string().optional(),
1083
- apiProvider: import_zod10.z.enum(providerNames).optional(),
1084
- modelId: import_zod10.z.string().optional(),
1085
- diffStrategy: import_zod10.z.string().optional(),
1086
- isSubtask: import_zod10.z.boolean().optional(),
1087
- todos: import_zod10.z.object({
1088
- total: import_zod10.z.number(),
1089
- completed: import_zod10.z.number(),
1090
- inProgress: import_zod10.z.number(),
1091
- pending: import_zod10.z.number()
1092
- }).optional()
1093
- });
1094
- var gitPropertiesSchema = import_zod10.z.object({
1095
- repositoryUrl: import_zod10.z.string().optional(),
1096
- repositoryName: import_zod10.z.string().optional(),
1097
- defaultBranch: import_zod10.z.string().optional()
1098
- });
1099
- var telemetryPropertiesSchema = import_zod10.z.object({
1100
- ...appPropertiesSchema.shape,
1101
- ...taskPropertiesSchema.shape,
1102
- ...gitPropertiesSchema.shape
1103
- });
1104
- var rooCodeTelemetryEventSchema = import_zod10.z.discriminatedUnion("type", [
1105
- import_zod10.z.object({
1106
- type: import_zod10.z.enum([
1107
- "Task Created" /* TASK_CREATED */,
1108
- "Task Reopened" /* TASK_RESTARTED */,
1109
- "Task Completed" /* TASK_COMPLETED */,
1110
- "Conversation Message" /* TASK_CONVERSATION_MESSAGE */,
1111
- "Mode Switched" /* MODE_SWITCH */,
1112
- "Mode Selector Opened" /* MODE_SELECTOR_OPENED */,
1113
- "Tool Used" /* TOOL_USED */,
1114
- "Checkpoint Created" /* CHECKPOINT_CREATED */,
1115
- "Checkpoint Restored" /* CHECKPOINT_RESTORED */,
1116
- "Checkpoint Diffed" /* CHECKPOINT_DIFFED */,
1117
- "Code Action Used" /* CODE_ACTION_USED */,
1118
- "Prompt Enhanced" /* PROMPT_ENHANCED */,
1119
- "Title Button Clicked" /* TITLE_BUTTON_CLICKED */,
1120
- "Authentication Initiated" /* AUTHENTICATION_INITIATED */,
1121
- "Marketplace Item Installed" /* MARKETPLACE_ITEM_INSTALLED */,
1122
- "Marketplace Item Removed" /* MARKETPLACE_ITEM_REMOVED */,
1123
- "Marketplace Tab Viewed" /* MARKETPLACE_TAB_VIEWED */,
1124
- "Marketplace Install Button Clicked" /* MARKETPLACE_INSTALL_BUTTON_CLICKED */,
1125
- "Share Button Clicked" /* SHARE_BUTTON_CLICKED */,
1126
- "Share Organization Clicked" /* SHARE_ORGANIZATION_CLICKED */,
1127
- "Share Public Clicked" /* SHARE_PUBLIC_CLICKED */,
1128
- "Share Connect To Cloud Clicked" /* SHARE_CONNECT_TO_CLOUD_CLICKED */,
1129
- "Account Connect Clicked" /* ACCOUNT_CONNECT_CLICKED */,
1130
- "Account Connect Success" /* ACCOUNT_CONNECT_SUCCESS */,
1131
- "Account Logout Clicked" /* ACCOUNT_LOGOUT_CLICKED */,
1132
- "Account Logout Success" /* ACCOUNT_LOGOUT_SUCCESS */,
1133
- "Schema Validation Error" /* SCHEMA_VALIDATION_ERROR */,
1134
- "Diff Application Error" /* DIFF_APPLICATION_ERROR */,
1135
- "Shell Integration Error" /* SHELL_INTEGRATION_ERROR */,
1136
- "Consecutive Mistake Error" /* CONSECUTIVE_MISTAKE_ERROR */,
1137
- "Code Index Error" /* CODE_INDEX_ERROR */,
1138
- "Context Condensed" /* CONTEXT_CONDENSED */,
1139
- "Sliding Window Truncation" /* SLIDING_WINDOW_TRUNCATION */,
1140
- "Tab Shown" /* TAB_SHOWN */,
1141
- "Mode Setting Changed" /* MODE_SETTINGS_CHANGED */,
1142
- "Custom Mode Created" /* CUSTOM_MODE_CREATED */
1143
- ]),
1144
- properties: telemetryPropertiesSchema
1145
- }),
1146
- import_zod10.z.object({
1147
- type: import_zod10.z.literal("Task Message" /* TASK_MESSAGE */),
1148
- properties: import_zod10.z.object({
1149
- ...telemetryPropertiesSchema.shape,
1150
- taskId: import_zod10.z.string(),
1151
- message: clineMessageSchema
1152
- })
1153
- }),
1154
- import_zod10.z.object({
1155
- type: import_zod10.z.literal("LLM Completion" /* LLM_COMPLETION */),
1156
- properties: import_zod10.z.object({
1157
- ...telemetryPropertiesSchema.shape,
1158
- inputTokens: import_zod10.z.number(),
1159
- outputTokens: import_zod10.z.number(),
1160
- cacheReadTokens: import_zod10.z.number().optional(),
1161
- cacheWriteTokens: import_zod10.z.number().optional(),
1162
- cost: import_zod10.z.number().optional()
1163
- })
1164
- })
1165
- ]);
1166
-
1167
- // src/mode.ts
1168
- var import_zod11 = require("zod");
1169
- var groupOptionsSchema = import_zod11.z.object({
1170
- fileRegex: import_zod11.z.string().optional().refine(
1171
- (pattern) => {
1172
- if (!pattern) {
1173
- return true;
1174
- }
1175
- try {
1176
- new RegExp(pattern);
1177
- return true;
1178
- } catch {
1179
- return false;
1180
- }
1181
- },
1182
- { message: "Invalid regular expression pattern" }
1183
- ),
1184
- description: import_zod11.z.string().optional()
1185
- });
1186
- var groupEntrySchema = import_zod11.z.union([toolGroupsSchema, import_zod11.z.tuple([toolGroupsSchema, groupOptionsSchema])]);
1187
- var groupEntryArraySchema = import_zod11.z.array(groupEntrySchema).refine(
1188
- (groups) => {
1189
- const seen = /* @__PURE__ */ new Set();
1190
- return groups.every((group) => {
1191
- const groupName = Array.isArray(group) ? group[0] : group;
1192
- if (seen.has(groupName)) {
1193
- return false;
1194
- }
1195
- seen.add(groupName);
1196
- return true;
1197
- });
1198
- },
1199
- { message: "Duplicate groups are not allowed" }
1200
- );
1201
- var modeConfigSchema = import_zod11.z.object({
1202
- slug: import_zod11.z.string().regex(/^[a-zA-Z0-9-]+$/, "Slug must contain only letters numbers and dashes"),
1203
- name: import_zod11.z.string().min(1, "Name is required"),
1204
- roleDefinition: import_zod11.z.string().min(1, "Role definition is required"),
1205
- whenToUse: import_zod11.z.string().optional(),
1206
- description: import_zod11.z.string().optional(),
1207
- customInstructions: import_zod11.z.string().optional(),
1208
- groups: groupEntryArraySchema,
1209
- source: import_zod11.z.enum(["global", "project"]).optional()
1210
- });
1211
- var customModesSettingsSchema = import_zod11.z.object({
1212
- customModes: import_zod11.z.array(modeConfigSchema).refine(
1213
- (modes) => {
1214
- const slugs = /* @__PURE__ */ new Set();
1215
- return modes.every((mode) => {
1216
- if (slugs.has(mode.slug)) {
1217
- return false;
1218
- }
1219
- slugs.add(mode.slug);
1220
- return true;
1221
- });
1222
- },
1223
- {
1224
- message: "Duplicate mode slugs are not allowed"
1225
- }
1226
- )
1227
- });
1228
- var promptComponentSchema = import_zod11.z.object({
1229
- roleDefinition: import_zod11.z.string().optional(),
1230
- whenToUse: import_zod11.z.string().optional(),
1231
- description: import_zod11.z.string().optional(),
1232
- customInstructions: import_zod11.z.string().optional()
1233
- });
1234
- var customModePromptsSchema = import_zod11.z.record(import_zod11.z.string(), promptComponentSchema.optional());
1235
- var customSupportPromptsSchema = import_zod11.z.record(import_zod11.z.string(), import_zod11.z.string().optional());
1236
- var DEFAULT_MODES = [
1237
- {
1238
- slug: "architect",
1239
- name: "\u{1F3D7}\uFE0F Architect",
1240
- 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.",
1241
- 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.",
1242
- description: "Plan and design before implementation",
1243
- groups: ["read", ["edit", { fileRegex: "\\.md$", description: "Markdown files only" }], "browser", "mcp"],
1244
- 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.**"
1245
- },
1246
- {
1247
- slug: "code",
1248
- name: "\u{1F4BB} Code",
1249
- roleDefinition: "You are Roo, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.",
1250
- 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.",
1251
- description: "Write, modify, and refactor code",
1252
- groups: ["read", "edit", "browser", "command", "mcp"]
1253
- },
1254
- {
1255
- slug: "ask",
1256
- name: "\u2753 Ask",
1257
- roleDefinition: "You are Roo, a knowledgeable technical assistant focused on answering questions and providing information about software development, technology, and related topics.",
1258
- 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.",
1259
- description: "Get answers and explanations",
1260
- groups: ["read", "browser", "mcp"],
1261
- 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."
1262
- },
1263
- {
1264
- slug: "debug",
1265
- name: "\u{1FAB2} Debug",
1266
- roleDefinition: "You are Roo, an expert software debugger specializing in systematic problem diagnosis and resolution.",
1267
- 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.",
1268
- description: "Diagnose and fix software issues",
1269
- groups: ["read", "edit", "browser", "command", "mcp"],
1270
- 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."
1271
- },
1272
- {
1273
- slug: "orchestrator",
1274
- name: "\u{1FA83} Orchestrator",
1275
- 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.",
1276
- 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.",
1277
- description: "Coordinate tasks across multiple modes",
1278
- groups: [],
1279
- 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."
1280
- }
1281
- ];
1282
-
1283
- // src/vscode.ts
1284
- var import_zod12 = require("zod");
1285
- var codeActionIds = ["explainCode", "fixCode", "improveCode", "addToContext", "newTask"];
1286
- var terminalActionIds = ["terminalAddToContext", "terminalFixCommand", "terminalExplainCommand"];
1287
- var commandIds = [
1288
- "activationCompleted",
1289
- "plusButtonClicked",
1290
- "promptsButtonClicked",
1291
- "mcpButtonClicked",
1292
- "historyButtonClicked",
1293
- "marketplaceButtonClicked",
1294
- "popoutButtonClicked",
1295
- "accountButtonClicked",
1296
- "settingsButtonClicked",
1297
- "openInNewTab",
1298
- "showHumanRelayDialog",
1299
- "registerHumanRelayCallback",
1300
- "unregisterHumanRelayCallback",
1301
- "handleHumanRelayResponse",
1302
- "newTask",
1303
- "setCustomStoragePath",
1304
- "importSettings",
1305
- "focusInput",
1306
- "acceptInput",
1307
- "focusPanel"
1308
- ];
1309
- var languages = [
1310
- "ca",
1311
- "de",
1312
- "en",
1313
- "es",
1314
- "fr",
1315
- "hi",
1316
- "id",
1317
- "it",
1318
- "ja",
1319
- "ko",
1320
- "nl",
1321
- "pl",
1322
- "pt-BR",
1323
- "ru",
1324
- "tr",
1325
- "vi",
1326
- "zh-CN",
1327
- "zh-TW"
1328
- ];
1329
- var languagesSchema = import_zod12.z.enum(languages);
1330
- var isLanguage = (value) => languages.includes(value);
1331
-
1332
- // src/global-settings.ts
1333
- var DEFAULT_WRITE_DELAY_MS = 1e3;
1334
- var DEFAULT_TERMINAL_OUTPUT_CHARACTER_LIMIT = 5e4;
1335
- var globalSettingsSchema = import_zod13.z.object({
1336
- currentApiConfigName: import_zod13.z.string().optional(),
1337
- listApiConfigMeta: import_zod13.z.array(providerSettingsEntrySchema).optional(),
1338
- pinnedApiConfigs: import_zod13.z.record(import_zod13.z.string(), import_zod13.z.boolean()).optional(),
1339
- lastShownAnnouncementId: import_zod13.z.string().optional(),
1340
- customInstructions: import_zod13.z.string().optional(),
1341
- taskHistory: import_zod13.z.array(historyItemSchema).optional(),
1342
- condensingApiConfigId: import_zod13.z.string().optional(),
1343
- customCondensingPrompt: import_zod13.z.string().optional(),
1344
- autoApprovalEnabled: import_zod13.z.boolean().optional(),
1345
- alwaysAllowReadOnly: import_zod13.z.boolean().optional(),
1346
- alwaysAllowReadOnlyOutsideWorkspace: import_zod13.z.boolean().optional(),
1347
- alwaysAllowWrite: import_zod13.z.boolean().optional(),
1348
- alwaysAllowWriteOutsideWorkspace: import_zod13.z.boolean().optional(),
1349
- alwaysAllowWriteProtected: import_zod13.z.boolean().optional(),
1350
- writeDelayMs: import_zod13.z.number().min(0).optional(),
1351
- alwaysAllowBrowser: import_zod13.z.boolean().optional(),
1352
- alwaysApproveResubmit: import_zod13.z.boolean().optional(),
1353
- requestDelaySeconds: import_zod13.z.number().optional(),
1354
- alwaysAllowMcp: import_zod13.z.boolean().optional(),
1355
- alwaysAllowModeSwitch: import_zod13.z.boolean().optional(),
1356
- alwaysAllowSubtasks: import_zod13.z.boolean().optional(),
1357
- alwaysAllowExecute: import_zod13.z.boolean().optional(),
1358
- alwaysAllowFollowupQuestions: import_zod13.z.boolean().optional(),
1359
- followupAutoApproveTimeoutMs: import_zod13.z.number().optional(),
1360
- alwaysAllowUpdateTodoList: import_zod13.z.boolean().optional(),
1361
- allowedCommands: import_zod13.z.array(import_zod13.z.string()).optional(),
1362
- deniedCommands: import_zod13.z.array(import_zod13.z.string()).optional(),
1363
- commandExecutionTimeout: import_zod13.z.number().optional(),
1364
- commandTimeoutAllowlist: import_zod13.z.array(import_zod13.z.string()).optional(),
1365
- preventCompletionWithOpenTodos: import_zod13.z.boolean().optional(),
1366
- allowedMaxRequests: import_zod13.z.number().nullish(),
1367
- allowedMaxCost: import_zod13.z.number().nullish(),
1368
- autoCondenseContext: import_zod13.z.boolean().optional(),
1369
- autoCondenseContextPercent: import_zod13.z.number().optional(),
1370
- maxConcurrentFileReads: import_zod13.z.number().optional(),
1371
- /**
1372
- * Whether to include diagnostic messages (errors, warnings) in tool outputs
1373
- * @default true
1374
- */
1375
- includeDiagnosticMessages: import_zod13.z.boolean().optional(),
1376
- /**
1377
- * Maximum number of diagnostic messages to include in tool outputs
1378
- * @default 50
1379
- */
1380
- maxDiagnosticMessages: import_zod13.z.number().optional(),
1381
- browserToolEnabled: import_zod13.z.boolean().optional(),
1382
- browserViewportSize: import_zod13.z.string().optional(),
1383
- screenshotQuality: import_zod13.z.number().optional(),
1384
- remoteBrowserEnabled: import_zod13.z.boolean().optional(),
1385
- remoteBrowserHost: import_zod13.z.string().optional(),
1386
- cachedChromeHostUrl: import_zod13.z.string().optional(),
1387
- enableCheckpoints: import_zod13.z.boolean().optional(),
1388
- ttsEnabled: import_zod13.z.boolean().optional(),
1389
- ttsSpeed: import_zod13.z.number().optional(),
1390
- soundEnabled: import_zod13.z.boolean().optional(),
1391
- soundVolume: import_zod13.z.number().optional(),
1392
- maxOpenTabsContext: import_zod13.z.number().optional(),
1393
- maxWorkspaceFiles: import_zod13.z.number().optional(),
1394
- showRooIgnoredFiles: import_zod13.z.boolean().optional(),
1395
- maxReadFileLine: import_zod13.z.number().optional(),
1396
- maxImageFileSize: import_zod13.z.number().optional(),
1397
- maxTotalImageSize: import_zod13.z.number().optional(),
1398
- terminalOutputLineLimit: import_zod13.z.number().optional(),
1399
- terminalOutputCharacterLimit: import_zod13.z.number().optional(),
1400
- terminalShellIntegrationTimeout: import_zod13.z.number().optional(),
1401
- terminalShellIntegrationDisabled: import_zod13.z.boolean().optional(),
1402
- terminalCommandDelay: import_zod13.z.number().optional(),
1403
- terminalPowershellCounter: import_zod13.z.boolean().optional(),
1404
- terminalZshClearEolMark: import_zod13.z.boolean().optional(),
1405
- terminalZshOhMy: import_zod13.z.boolean().optional(),
1406
- terminalZshP10k: import_zod13.z.boolean().optional(),
1407
- terminalZdotdir: import_zod13.z.boolean().optional(),
1408
- terminalCompressProgressBar: import_zod13.z.boolean().optional(),
1409
- diagnosticsEnabled: import_zod13.z.boolean().optional(),
1410
- rateLimitSeconds: import_zod13.z.number().optional(),
1411
- diffEnabled: import_zod13.z.boolean().optional(),
1412
- fuzzyMatchThreshold: import_zod13.z.number().optional(),
1413
- experiments: experimentsSchema.optional(),
1414
- codebaseIndexModels: codebaseIndexModelsSchema.optional(),
1415
- codebaseIndexConfig: codebaseIndexConfigSchema.optional(),
1416
- language: languagesSchema.optional(),
1417
- telemetrySetting: telemetrySettingsSchema.optional(),
1418
- mcpEnabled: import_zod13.z.boolean().optional(),
1419
- enableMcpServerCreation: import_zod13.z.boolean().optional(),
1420
- remoteControlEnabled: import_zod13.z.boolean().optional(),
1421
- mode: import_zod13.z.string().optional(),
1422
- modeApiConfigs: import_zod13.z.record(import_zod13.z.string(), import_zod13.z.string()).optional(),
1423
- customModes: import_zod13.z.array(modeConfigSchema).optional(),
1424
- customModePrompts: customModePromptsSchema.optional(),
1425
- customSupportPrompts: customSupportPromptsSchema.optional(),
1426
- enhancementApiConfigId: import_zod13.z.string().optional(),
1427
- includeTaskHistoryInEnhance: import_zod13.z.boolean().optional(),
1428
- historyPreviewCollapsed: import_zod13.z.boolean().optional(),
1429
- profileThresholds: import_zod13.z.record(import_zod13.z.string(), import_zod13.z.number()).optional(),
1430
- hasOpenedModeSelector: import_zod13.z.boolean().optional(),
1431
- lastModeExportPath: import_zod13.z.string().optional(),
1432
- lastModeImportPath: import_zod13.z.string().optional()
1433
- });
1434
- var GLOBAL_SETTINGS_KEYS = globalSettingsSchema.keyof().options;
1435
- var rooCodeSettingsSchema = providerSettingsSchema.merge(globalSettingsSchema);
1436
- var SECRET_STATE_KEYS = [
1437
- "apiKey",
1438
- "glamaApiKey",
1439
- "openRouterApiKey",
1440
- "awsAccessKey",
1441
- "awsApiKey",
1442
- "awsSecretKey",
1443
- "awsSessionToken",
1444
- "openAiApiKey",
1445
- "geminiApiKey",
1446
- "openAiNativeApiKey",
1447
- "cerebrasApiKey",
1448
- "deepSeekApiKey",
1449
- "doubaoApiKey",
1450
- "moonshotApiKey",
1451
- "mistralApiKey",
1452
- "unboundApiKey",
1453
- "requestyApiKey",
1454
- "xaiApiKey",
1455
- "groqApiKey",
1456
- "chutesApiKey",
1457
- "litellmApiKey",
1458
- "codeIndexOpenAiKey",
1459
- "codeIndexQdrantApiKey",
1460
- "codebaseIndexOpenAiCompatibleApiKey",
1461
- "codebaseIndexGeminiApiKey",
1462
- "codebaseIndexMistralApiKey",
1463
- "huggingFaceApiKey",
1464
- "sambaNovaApiKey",
1465
- "zaiApiKey",
1466
- "fireworksApiKey",
1467
- "featherlessApiKey",
1468
- "ioIntelligenceApiKey"
1469
- ];
1470
- var isSecretStateKey = (key) => SECRET_STATE_KEYS.includes(key);
1471
- var GLOBAL_STATE_KEYS = [...GLOBAL_SETTINGS_KEYS, ...PROVIDER_SETTINGS_KEYS].filter(
1472
- (key) => !SECRET_STATE_KEYS.includes(key)
1473
- );
1474
- var isGlobalStateKey = (key) => GLOBAL_STATE_KEYS.includes(key);
1475
- var EVALS_SETTINGS = {
1476
- apiProvider: "openrouter",
1477
- openRouterUseMiddleOutTransform: false,
1478
- lastShownAnnouncementId: "jul-09-2025-3-23-0",
1479
- pinnedApiConfigs: {},
1480
- autoApprovalEnabled: true,
1481
- alwaysAllowReadOnly: true,
1482
- alwaysAllowReadOnlyOutsideWorkspace: false,
1483
- alwaysAllowWrite: true,
1484
- alwaysAllowWriteOutsideWorkspace: false,
1485
- alwaysAllowWriteProtected: false,
1486
- writeDelayMs: 1e3,
1487
- alwaysAllowBrowser: true,
1488
- alwaysApproveResubmit: true,
1489
- requestDelaySeconds: 10,
1490
- alwaysAllowMcp: true,
1491
- alwaysAllowModeSwitch: true,
1492
- alwaysAllowSubtasks: true,
1493
- alwaysAllowExecute: true,
1494
- alwaysAllowFollowupQuestions: true,
1495
- alwaysAllowUpdateTodoList: true,
1496
- followupAutoApproveTimeoutMs: 0,
1497
- allowedCommands: ["*"],
1498
- commandExecutionTimeout: 20,
1499
- commandTimeoutAllowlist: [],
1500
- preventCompletionWithOpenTodos: false,
1501
- browserToolEnabled: false,
1502
- browserViewportSize: "900x600",
1503
- screenshotQuality: 75,
1504
- remoteBrowserEnabled: false,
1505
- ttsEnabled: false,
1506
- ttsSpeed: 1,
1507
- soundEnabled: false,
1508
- soundVolume: 0.5,
1509
- terminalOutputLineLimit: 500,
1510
- terminalOutputCharacterLimit: DEFAULT_TERMINAL_OUTPUT_CHARACTER_LIMIT,
1511
- terminalShellIntegrationTimeout: 3e4,
1512
- terminalCommandDelay: 0,
1513
- terminalPowershellCounter: false,
1514
- terminalZshOhMy: true,
1515
- terminalZshClearEolMark: true,
1516
- terminalZshP10k: false,
1517
- terminalZdotdir: true,
1518
- terminalCompressProgressBar: true,
1519
- terminalShellIntegrationDisabled: true,
1520
- diagnosticsEnabled: true,
1521
- diffEnabled: true,
1522
- fuzzyMatchThreshold: 1,
1523
- enableCheckpoints: false,
1524
- rateLimitSeconds: 0,
1525
- maxOpenTabsContext: 20,
1526
- maxWorkspaceFiles: 200,
1527
- showRooIgnoredFiles: true,
1528
- maxReadFileLine: -1,
1529
- // -1 to enable full file reading.
1530
- includeDiagnosticMessages: true,
1531
- maxDiagnosticMessages: 50,
1532
- language: "en",
1533
- telemetrySetting: "enabled",
1534
- mcpEnabled: false,
1535
- remoteControlEnabled: false,
1536
- mode: "code",
1537
- // "architect",
1538
- customModes: []
1539
- };
1540
- var EVALS_TIMEOUT = 5 * 60 * 1e3;
1541
-
1542
- // src/ipc.ts
1543
- var import_zod14 = require("zod");
1544
- var IpcMessageType = /* @__PURE__ */ ((IpcMessageType2) => {
1545
- IpcMessageType2["Connect"] = "Connect";
1546
- IpcMessageType2["Disconnect"] = "Disconnect";
1547
- IpcMessageType2["Ack"] = "Ack";
1548
- IpcMessageType2["TaskCommand"] = "TaskCommand";
1549
- IpcMessageType2["TaskEvent"] = "TaskEvent";
1550
- return IpcMessageType2;
1551
- })(IpcMessageType || {});
1552
- var IpcOrigin = /* @__PURE__ */ ((IpcOrigin2) => {
1553
- IpcOrigin2["Client"] = "client";
1554
- IpcOrigin2["Server"] = "server";
1555
- return IpcOrigin2;
1556
- })(IpcOrigin || {});
1557
- var ackSchema = import_zod14.z.object({
1558
- clientId: import_zod14.z.string(),
1559
- pid: import_zod14.z.number(),
1560
- ppid: import_zod14.z.number()
1561
- });
1562
- var TaskCommandName = /* @__PURE__ */ ((TaskCommandName2) => {
1563
- TaskCommandName2["StartNewTask"] = "StartNewTask";
1564
- TaskCommandName2["CancelTask"] = "CancelTask";
1565
- TaskCommandName2["CloseTask"] = "CloseTask";
1566
- TaskCommandName2["ResumeTask"] = "ResumeTask";
1567
- return TaskCommandName2;
1568
- })(TaskCommandName || {});
1569
- var taskCommandSchema = import_zod14.z.discriminatedUnion("commandName", [
1570
- import_zod14.z.object({
1571
- commandName: import_zod14.z.literal("StartNewTask" /* StartNewTask */),
1572
- data: import_zod14.z.object({
1573
- configuration: rooCodeSettingsSchema,
1574
- text: import_zod14.z.string(),
1575
- images: import_zod14.z.array(import_zod14.z.string()).optional(),
1576
- newTab: import_zod14.z.boolean().optional()
1577
- })
1578
- }),
1579
- import_zod14.z.object({
1580
- commandName: import_zod14.z.literal("CancelTask" /* CancelTask */),
1581
- data: import_zod14.z.string()
1582
- }),
1583
- import_zod14.z.object({
1584
- commandName: import_zod14.z.literal("CloseTask" /* CloseTask */),
1585
- data: import_zod14.z.string()
1586
- }),
1587
- import_zod14.z.object({
1588
- commandName: import_zod14.z.literal("ResumeTask" /* ResumeTask */),
1589
- data: import_zod14.z.string()
1590
- })
1591
- ]);
1592
- var ipcMessageSchema = import_zod14.z.discriminatedUnion("type", [
1593
- import_zod14.z.object({
1594
- type: import_zod14.z.literal("Ack" /* Ack */),
1595
- origin: import_zod14.z.literal("server" /* Server */),
1596
- data: ackSchema
1597
- }),
1598
- import_zod14.z.object({
1599
- type: import_zod14.z.literal("TaskCommand" /* TaskCommand */),
1600
- origin: import_zod14.z.literal("client" /* Client */),
1601
- clientId: import_zod14.z.string(),
1602
- data: taskCommandSchema
1603
- }),
1604
- import_zod14.z.object({
1605
- type: import_zod14.z.literal("TaskEvent" /* TaskEvent */),
1606
- origin: import_zod14.z.literal("server" /* Server */),
1607
- relayClientId: import_zod14.z.string().optional(),
1608
- data: taskEventSchema
1609
- })
1610
- ]);
1611
-
1612
- // src/marketplace.ts
1613
- var import_zod15 = require("zod");
1614
- var mcpParameterSchema = import_zod15.z.object({
1615
- name: import_zod15.z.string().min(1),
1616
- key: import_zod15.z.string().min(1),
1617
- placeholder: import_zod15.z.string().optional(),
1618
- optional: import_zod15.z.boolean().optional().default(false)
1619
- });
1620
- var mcpInstallationMethodSchema = import_zod15.z.object({
1621
- name: import_zod15.z.string().min(1),
1622
- content: import_zod15.z.string().min(1),
1623
- parameters: import_zod15.z.array(mcpParameterSchema).optional(),
1624
- prerequisites: import_zod15.z.array(import_zod15.z.string()).optional()
1625
- });
1626
- var marketplaceItemTypeSchema = import_zod15.z.enum(["mode", "mcp"]);
1627
- var baseMarketplaceItemSchema = import_zod15.z.object({
1628
- id: import_zod15.z.string().min(1),
1629
- name: import_zod15.z.string().min(1, "Name is required"),
1630
- description: import_zod15.z.string(),
1631
- author: import_zod15.z.string().optional(),
1632
- authorUrl: import_zod15.z.string().url("Author URL must be a valid URL").optional(),
1633
- tags: import_zod15.z.array(import_zod15.z.string()).optional(),
1634
- prerequisites: import_zod15.z.array(import_zod15.z.string()).optional()
1635
- });
1636
- var modeMarketplaceItemSchema = baseMarketplaceItemSchema.extend({
1637
- content: import_zod15.z.string().min(1)
1638
- // YAML content for modes
1639
- });
1640
- var mcpMarketplaceItemSchema = baseMarketplaceItemSchema.extend({
1641
- url: import_zod15.z.string().url(),
1642
- // Required url field
1643
- content: import_zod15.z.union([import_zod15.z.string().min(1), import_zod15.z.array(mcpInstallationMethodSchema)]),
1644
- // Single config or array of methods
1645
- parameters: import_zod15.z.array(mcpParameterSchema).optional()
1646
- });
1647
- var marketplaceItemSchema = import_zod15.z.discriminatedUnion("type", [
1648
- // Mode marketplace item
1649
- modeMarketplaceItemSchema.extend({
1650
- type: import_zod15.z.literal("mode")
1651
- }),
1652
- // MCP marketplace item
1653
- mcpMarketplaceItemSchema.extend({
1654
- type: import_zod15.z.literal("mcp")
1655
- })
1656
- ]);
1657
- var installMarketplaceItemOptionsSchema = import_zod15.z.object({
1658
- target: import_zod15.z.enum(["global", "project"]).optional().default("project"),
1659
- parameters: import_zod15.z.record(import_zod15.z.string(), import_zod15.z.any()).optional()
1660
- });
1661
-
1662
- // src/mcp.ts
1663
- var import_zod16 = require("zod");
1664
- var mcpExecutionStatusSchema = import_zod16.z.discriminatedUnion("status", [
1665
- import_zod16.z.object({
1666
- executionId: import_zod16.z.string(),
1667
- status: import_zod16.z.literal("started"),
1668
- serverName: import_zod16.z.string(),
1669
- toolName: import_zod16.z.string()
1670
- }),
1671
- import_zod16.z.object({
1672
- executionId: import_zod16.z.string(),
1673
- status: import_zod16.z.literal("output"),
1674
- response: import_zod16.z.string()
1675
- }),
1676
- import_zod16.z.object({
1677
- executionId: import_zod16.z.string(),
1678
- status: import_zod16.z.literal("completed"),
1679
- response: import_zod16.z.string().optional()
1680
- }),
1681
- import_zod16.z.object({
1682
- executionId: import_zod16.z.string(),
1683
- status: import_zod16.z.literal("error"),
1684
- error: import_zod16.z.string().optional()
1685
- })
1686
- ]);
1687
-
1688
- // src/single-file-read-models.ts
1689
- var SINGLE_FILE_READ_MODELS = /* @__PURE__ */ new Set(["roo/sonic"]);
1690
- function shouldUseSingleFileRead(modelId) {
1691
- if (SINGLE_FILE_READ_MODELS.has(modelId)) {
1692
- return true;
1693
- }
1694
- const patterns = Array.from(SINGLE_FILE_READ_MODELS);
1695
- for (const pattern of patterns) {
1696
- if (pattern.endsWith("*") && modelId.startsWith(pattern.slice(0, -1))) {
1697
- return true;
1698
- }
1699
- }
1700
- return false;
1701
- }
1702
-
1703
- // src/task.ts
1704
- var import_zod17 = require("zod");
1705
- var TaskStatus = /* @__PURE__ */ ((TaskStatus2) => {
1706
- TaskStatus2["Running"] = "running";
1707
- TaskStatus2["Interactive"] = "interactive";
1708
- TaskStatus2["Resumable"] = "resumable";
1709
- TaskStatus2["Idle"] = "idle";
1710
- TaskStatus2["None"] = "none";
1711
- return TaskStatus2;
1712
- })(TaskStatus || {});
1713
- var taskMetadataSchema = import_zod17.z.object({
1714
- task: import_zod17.z.string().optional(),
1715
- images: import_zod17.z.array(import_zod17.z.string()).optional()
1716
- });
1717
-
1718
- // src/todo.ts
1719
- var import_zod18 = require("zod");
1720
- var todoStatusSchema = import_zod18.z.enum(["pending", "in_progress", "completed"]);
1721
- var todoItemSchema = import_zod18.z.object({
1722
- id: import_zod18.z.string(),
1723
- content: import_zod18.z.string(),
1724
- status: todoStatusSchema
1725
- });
1726
-
1727
- // src/terminal.ts
1728
- var import_zod19 = require("zod");
1729
- var commandExecutionStatusSchema = import_zod19.z.discriminatedUnion("status", [
1730
- import_zod19.z.object({
1731
- executionId: import_zod19.z.string(),
1732
- status: import_zod19.z.literal("started"),
1733
- pid: import_zod19.z.number().optional(),
1734
- command: import_zod19.z.string()
1735
- }),
1736
- import_zod19.z.object({
1737
- executionId: import_zod19.z.string(),
1738
- status: import_zod19.z.literal("output"),
1739
- output: import_zod19.z.string()
1740
- }),
1741
- import_zod19.z.object({
1742
- executionId: import_zod19.z.string(),
1743
- status: import_zod19.z.literal("exited"),
1744
- exitCode: import_zod19.z.number().optional()
1745
- }),
1746
- import_zod19.z.object({
1747
- executionId: import_zod19.z.string(),
1748
- status: import_zod19.z.literal("fallback")
1749
- }),
1750
- import_zod19.z.object({
1751
- executionId: import_zod19.z.string(),
1752
- status: import_zod19.z.literal("timeout")
1753
- })
1754
- ]);
1755
-
1756
664
  // src/providers/anthropic.ts
1757
665
  var anthropicDefaultModelId = "claude-sonnet-4-20250514";
1758
666
  var anthropicModels = {
@@ -2334,6 +1242,7 @@ var BEDROCK_REGIONS = [
2334
1242
  { value: "us-gov-east-1", label: "us-gov-east-1" },
2335
1243
  { value: "us-gov-west-1", label: "us-gov-west-1" }
2336
1244
  ].sort((a, b) => a.value.localeCompare(b.value));
1245
+ var BEDROCK_CLAUDE_SONNET_4_MODEL_ID = "anthropic.claude-sonnet-4-20250514-v1:0";
2337
1246
 
2338
1247
  // src/providers/cerebras.ts
2339
1248
  var cerebrasDefaultModelId = "qwen-3-coder-480b-free";
@@ -2713,49 +1622,238 @@ var claudeCodeModels = {
2713
1622
  "claude-3-5-haiku-20241022": {
2714
1623
  ...anthropicModels["claude-3-5-haiku-20241022"],
2715
1624
  supportsImages: false,
2716
- supportsPromptCache: true,
2717
- // Claude Code does report cache tokens
2718
- supportsReasoningEffort: false,
2719
- supportsReasoningBudget: false,
2720
- requiredReasoningBudget: false
2721
- }
2722
- };
2723
-
2724
- // src/providers/deepseek.ts
2725
- var deepSeekDefaultModelId = "deepseek-chat";
2726
- var deepSeekModels = {
2727
- "deepseek-chat": {
2728
- maxTokens: 8192,
2729
- contextWindow: 64e3,
1625
+ supportsPromptCache: true,
1626
+ // Claude Code does report cache tokens
1627
+ supportsReasoningEffort: false,
1628
+ supportsReasoningBudget: false,
1629
+ requiredReasoningBudget: false
1630
+ }
1631
+ };
1632
+
1633
+ // src/providers/deepseek.ts
1634
+ var deepSeekDefaultModelId = "deepseek-chat";
1635
+ var deepSeekModels = {
1636
+ "deepseek-chat": {
1637
+ maxTokens: 8192,
1638
+ contextWindow: 64e3,
1639
+ supportsImages: false,
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,
2730
1823
  supportsImages: false,
2731
- supportsPromptCache: true,
2732
- inputPrice: 0.27,
2733
- // $0.27 per million tokens (cache miss)
2734
- outputPrice: 1.1,
2735
- // $1.10 per million tokens
2736
- cacheWritesPrice: 0.27,
2737
- // $0.27 per million tokens (cache miss)
2738
- cacheReadsPrice: 0.07,
2739
- // $0.07 per million tokens (cache hit).
2740
- 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.`
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."
2741
1828
  },
2742
- "deepseek-reasoner": {
2743
- maxTokens: 8192,
2744
- contextWindow: 64e3,
1829
+ "accounts/fireworks/models/glm-4p5-air": {
1830
+ maxTokens: 16384,
1831
+ contextWindow: 128e3,
2745
1832
  supportsImages: false,
2746
- supportsPromptCache: true,
1833
+ supportsPromptCache: false,
2747
1834
  inputPrice: 0.55,
2748
- // $0.55 per million tokens (cache miss)
2749
1835
  outputPrice: 2.19,
2750
- // $2.19 per million tokens
2751
- cacheWritesPrice: 0.55,
2752
- // $0.55 per million tokens (cache miss)
2753
- cacheReadsPrice: 0.14,
2754
- // $0.14 per million tokens (cache hit)
2755
- 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."
2756
1855
  }
2757
1856
  };
2758
- var DEEP_SEEK_DEFAULT_TEMPERATURE = 0.6;
2759
1857
 
2760
1858
  // src/providers/gemini.ts
2761
1859
  var geminiDefaultModelId = "gemini-2.0-flash-001";
@@ -3738,6 +2836,20 @@ var requestyDefaultModelInfo = {
3738
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."
3739
2837
  };
3740
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
+
3741
2853
  // src/providers/sambanova.ts
3742
2854
  var sambaNovaDefaultModelId = "Meta-Llama-3.3-70B-Instruct";
3743
2855
  var sambaNovaModels = {
@@ -4291,431 +3403,1414 @@ var vscodeLlmModels = {
4291
3403
  supportsToolCalling: true,
4292
3404
  maxInputTokens: 108637
4293
3405
  },
4294
- "o4-mini": {
4295
- contextWindow: 128e3,
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
3417
+ },
3418
+ "gpt-4.1": {
3419
+ contextWindow: 128e3,
3420
+ supportsImages: true,
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
3429
+ },
3430
+ "gpt-5-mini": {
3431
+ contextWindow: 128e3,
3432
+ supportsImages: 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
3441
+ },
3442
+ "gpt-5": {
3443
+ contextWindow: 128e3,
3444
+ supportsImages: true,
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": {
3460
+ maxTokens: 8192,
3461
+ contextWindow: 256e3,
3462
+ supportsImages: true,
3463
+ supportsPromptCache: true,
3464
+ inputPrice: 3,
3465
+ outputPrice: 15,
3466
+ cacheWritesPrice: 0.75,
3467
+ cacheReadsPrice: 0.75,
3468
+ description: "xAI's Grok-4 model with 256K context window"
3469
+ },
3470
+ "grok-3": {
3471
+ maxTokens: 8192,
3472
+ contextWindow: 131072,
3473
+ supportsImages: false,
3474
+ supportsPromptCache: true,
3475
+ inputPrice: 3,
3476
+ outputPrice: 15,
3477
+ cacheWritesPrice: 0.75,
3478
+ cacheReadsPrice: 0.75,
3479
+ description: "xAI's Grok-3 model with 128K context window"
3480
+ },
3481
+ "grok-3-fast": {
3482
+ maxTokens: 8192,
3483
+ contextWindow: 131072,
3484
+ supportsImages: false,
3485
+ supportsPromptCache: true,
3486
+ inputPrice: 5,
3487
+ outputPrice: 25,
3488
+ cacheWritesPrice: 1.25,
3489
+ cacheReadsPrice: 1.25,
3490
+ description: "xAI's Grok-3 fast model with 128K context window"
3491
+ },
3492
+ "grok-3-mini": {
3493
+ maxTokens: 8192,
3494
+ contextWindow: 131072,
3495
+ supportsImages: false,
3496
+ supportsPromptCache: true,
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
3503
+ },
3504
+ "grok-3-mini-fast": {
3505
+ maxTokens: 8192,
3506
+ contextWindow: 131072,
3507
+ supportsImages: false,
3508
+ supportsPromptCache: true,
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
3515
+ },
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,
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,
3543
+ supportsPromptCache: 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."
3549
+ },
3550
+ "glm-4.5-air": {
3551
+ maxTokens: 98304,
3552
+ contextWindow: 131072,
3553
+ supportsImages: false,
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."
3560
+ }
3561
+ };
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,
4296
3598
  supportsImages: false,
4297
- supportsPromptCache: false,
4298
- inputPrice: 0,
4299
- outputPrice: 0,
4300
- family: "o4-mini",
4301
- version: "o4-mini-2025-04-16",
4302
- name: "o4-mini (Preview)",
4303
- supportsToolCalling: true,
4304
- maxInputTokens: 111452
4305
- },
4306
- "gpt-4.1": {
4307
- contextWindow: 128e3,
4308
- supportsImages: true,
4309
- supportsPromptCache: false,
4310
- inputPrice: 0,
4311
- outputPrice: 0,
4312
- family: "gpt-4.1",
4313
- version: "gpt-4.1-2025-04-14",
4314
- name: "GPT-4.1 (Preview)",
4315
- supportsToolCalling: true,
4316
- maxInputTokens: 111452
4317
- },
4318
- "gpt-5-mini": {
4319
- contextWindow: 128e3,
4320
- supportsImages: true,
4321
- supportsPromptCache: false,
4322
- inputPrice: 0,
4323
- outputPrice: 0,
4324
- family: "gpt-5-mini",
4325
- version: "gpt-5-mini",
4326
- name: "GPT-5 mini (Preview)",
4327
- supportsToolCalling: true,
4328
- maxInputTokens: 108637
4329
- },
4330
- "gpt-5": {
4331
- contextWindow: 128e3,
4332
- supportsImages: true,
4333
- supportsPromptCache: false,
4334
- inputPrice: 0,
4335
- outputPrice: 0,
4336
- family: "gpt-5",
4337
- version: "gpt-5",
4338
- name: "GPT-5 (Preview)",
4339
- supportsToolCalling: true,
4340
- maxInputTokens: 108637
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"
3949
+ ];
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";
4341
3961
  }
3962
+ return "openai";
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: [] }
4342
4057
  };
4343
4058
 
4344
- // src/providers/xai.ts
4345
- var xaiDefaultModelId = "grok-4";
4346
- var xaiModels = {
4347
- "grok-4": {
4348
- maxTokens: 8192,
4349
- contextWindow: 256e3,
4350
- supportsImages: true,
4351
- supportsPromptCache: true,
4352
- inputPrice: 3,
4353
- outputPrice: 15,
4354
- cacheWritesPrice: 0.75,
4355
- cacheReadsPrice: 0.75,
4356
- description: "xAI's Grok-4 model with 256K context window"
4357
- },
4358
- "grok-3": {
4359
- maxTokens: 8192,
4360
- contextWindow: 131072,
4361
- supportsImages: false,
4362
- supportsPromptCache: true,
4363
- inputPrice: 3,
4364
- outputPrice: 15,
4365
- cacheWritesPrice: 0.75,
4366
- cacheReadsPrice: 0.75,
4367
- description: "xAI's Grok-3 model with 128K context window"
4368
- },
4369
- "grok-3-fast": {
4370
- maxTokens: 8192,
4371
- contextWindow: 131072,
4372
- supportsImages: false,
4373
- supportsPromptCache: true,
4374
- inputPrice: 5,
4375
- outputPrice: 25,
4376
- cacheWritesPrice: 1.25,
4377
- cacheReadsPrice: 1.25,
4378
- description: "xAI's Grok-3 fast model with 128K context window"
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
+ });
4075
+
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
+ });
4379
4257
  },
4380
- "grok-3-mini": {
4381
- maxTokens: 8192,
4382
- contextWindow: 131072,
4383
- supportsImages: false,
4384
- supportsPromptCache: true,
4385
- inputPrice: 0.3,
4386
- outputPrice: 0.5,
4387
- cacheWritesPrice: 0.07,
4388
- cacheReadsPrice: 0.07,
4389
- description: "xAI's Grok-3 mini model with 128K context window",
4390
- supportsReasoningEffort: true
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.**"
4391
4304
  },
4392
- "grok-3-mini-fast": {
4393
- maxTokens: 8192,
4394
- contextWindow: 131072,
4395
- supportsImages: false,
4396
- supportsPromptCache: true,
4397
- inputPrice: 0.6,
4398
- outputPrice: 4,
4399
- cacheWritesPrice: 0.15,
4400
- cacheReadsPrice: 0.15,
4401
- description: "xAI's Grok-3 mini fast model with 128K context window",
4402
- 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"]
4403
4312
  },
4404
- "grok-2-1212": {
4405
- maxTokens: 8192,
4406
- contextWindow: 131072,
4407
- supportsImages: false,
4408
- supportsPromptCache: false,
4409
- inputPrice: 2,
4410
- outputPrice: 10,
4411
- description: "xAI's Grok-2 model (version 1212) with 128K context window"
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."
4412
4321
  },
4413
- "grok-2-vision-1212": {
4414
- maxTokens: 8192,
4415
- contextWindow: 32768,
4416
- supportsImages: true,
4417
- supportsPromptCache: false,
4418
- inputPrice: 2,
4419
- outputPrice: 10,
4420
- description: "xAI's Grok-2 Vision model (version 1212) with image support and 32K 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."
4330
+ },
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."
4421
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: []
4422
4598
  };
4599
+ var EVALS_TIMEOUT = 5 * 60 * 1e3;
4423
4600
 
4424
- // src/providers/doubao.ts
4425
- var doubaoDefaultModelId = "doubao-seed-1-6-250615";
4426
- var doubaoModels = {
4427
- "doubao-seed-1-6-250615": {
4428
- maxTokens: 32768,
4429
- contextWindow: 128e3,
4430
- supportsImages: true,
4431
- supportsPromptCache: true,
4432
- inputPrice: 1e-4,
4433
- // $0.0001 per million tokens (cache miss)
4434
- outputPrice: 4e-4,
4435
- // $0.0004 per million tokens
4436
- cacheWritesPrice: 1e-4,
4437
- // $0.0001 per million tokens (cache miss)
4438
- cacheReadsPrice: 2e-5,
4439
- // $0.00002 per million tokens (cache hit)
4440
- description: `Doubao Seed 1.6 is a powerful model designed for high-performance tasks with extensive context handling.`
4441
- },
4442
- "doubao-seed-1-6-thinking-250715": {
4443
- maxTokens: 32768,
4444
- contextWindow: 128e3,
4445
- supportsImages: true,
4446
- supportsPromptCache: true,
4447
- inputPrice: 2e-4,
4448
- // $0.0002 per million tokens
4449
- outputPrice: 8e-4,
4450
- // $0.0008 per million tokens
4451
- cacheWritesPrice: 2e-4,
4452
- // $0.0002 per million
4453
- cacheReadsPrice: 4e-5,
4454
- // $0.00004 per million tokens (cache hit)
4455
- description: `Doubao Seed 1.6 Thinking is optimized for reasoning tasks, providing enhanced performance in complex problem-solving scenarios.`
4456
- },
4457
- "doubao-seed-1-6-flash-250715": {
4458
- maxTokens: 32768,
4459
- contextWindow: 128e3,
4460
- supportsImages: true,
4461
- supportsPromptCache: true,
4462
- inputPrice: 15e-5,
4463
- // $0.00015 per million tokens
4464
- outputPrice: 6e-4,
4465
- // $0.0006 per million tokens
4466
- cacheWritesPrice: 15e-5,
4467
- // $0.00015 per million
4468
- cacheReadsPrice: 3e-5,
4469
- // $0.00003 per million tokens (cache hit)
4470
- description: `Doubao Seed 1.6 Flash is tailored for speed and efficiency, making it ideal for applications requiring rapid responses.`
4471
- }
4472
- };
4473
- var doubaoDefaultModelInfo = doubaoModels[doubaoDefaultModelId];
4474
- var DOUBAO_API_BASE_URL = "https://ark.cn-beijing.volces.com/api/v3";
4475
- 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
+ ]);
4476
4670
 
4477
- // src/providers/zai.ts
4478
- var internationalZAiDefaultModelId = "glm-4.5";
4479
- var internationalZAiModels = {
4480
- "glm-4.5": {
4481
- maxTokens: 98304,
4482
- contextWindow: 131072,
4483
- supportsImages: false,
4484
- supportsPromptCache: true,
4485
- inputPrice: 0.6,
4486
- outputPrice: 2.2,
4487
- cacheWritesPrice: 0,
4488
- cacheReadsPrice: 0.11,
4489
- 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."
4490
- },
4491
- "glm-4.5-air": {
4492
- maxTokens: 98304,
4493
- contextWindow: 131072,
4494
- supportsImages: false,
4495
- supportsPromptCache: true,
4496
- inputPrice: 0.2,
4497
- outputPrice: 1.1,
4498
- cacheWritesPrice: 0,
4499
- cacheReadsPrice: 0.03,
4500
- 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."
4501
- }
4502
- };
4503
- var mainlandZAiDefaultModelId = "glm-4.5";
4504
- var mainlandZAiModels = {
4505
- "glm-4.5": {
4506
- maxTokens: 98304,
4507
- contextWindow: 131072,
4508
- supportsImages: false,
4509
- supportsPromptCache: true,
4510
- inputPrice: 0.29,
4511
- outputPrice: 1.14,
4512
- cacheWritesPrice: 0,
4513
- cacheReadsPrice: 0.057,
4514
- 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.",
4515
- tiers: [
4516
- {
4517
- contextWindow: 32e3,
4518
- inputPrice: 0.21,
4519
- outputPrice: 1,
4520
- cacheReadsPrice: 0.043
4521
- },
4522
- {
4523
- contextWindow: 128e3,
4524
- inputPrice: 0.29,
4525
- outputPrice: 1.14,
4526
- cacheReadsPrice: 0.057
4527
- },
4528
- {
4529
- contextWindow: Infinity,
4530
- inputPrice: 0.29,
4531
- outputPrice: 1.14,
4532
- cacheReadsPrice: 0.057
4533
- }
4534
- ]
4535
- },
4536
- "glm-4.5-air": {
4537
- maxTokens: 98304,
4538
- contextWindow: 131072,
4539
- supportsImages: false,
4540
- supportsPromptCache: true,
4541
- inputPrice: 0.1,
4542
- outputPrice: 0.6,
4543
- cacheWritesPrice: 0,
4544
- cacheReadsPrice: 0.02,
4545
- 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.",
4546
- tiers: [
4547
- {
4548
- contextWindow: 32e3,
4549
- inputPrice: 0.07,
4550
- outputPrice: 0.4,
4551
- cacheReadsPrice: 0.014
4552
- },
4553
- {
4554
- contextWindow: 128e3,
4555
- inputPrice: 0.1,
4556
- outputPrice: 0.6,
4557
- cacheReadsPrice: 0.02
4558
- },
4559
- {
4560
- contextWindow: Infinity,
4561
- inputPrice: 0.1,
4562
- outputPrice: 0.6,
4563
- cacheReadsPrice: 0.02
4564
- }
4565
- ]
4566
- }
4567
- };
4568
- var ZAI_DEFAULT_TEMPERATURE = 0;
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
+ });
4569
4720
 
4570
- // src/providers/fireworks.ts
4571
- var fireworksDefaultModelId = "accounts/fireworks/models/kimi-k2-instruct";
4572
- var fireworksModels = {
4573
- "accounts/fireworks/models/kimi-k2-instruct": {
4574
- maxTokens: 16384,
4575
- contextWindow: 128e3,
4576
- supportsImages: false,
4577
- supportsPromptCache: false,
4578
- inputPrice: 0.6,
4579
- outputPrice: 2.5,
4580
- 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."
4581
- },
4582
- "accounts/fireworks/models/qwen3-235b-a22b-instruct-2507": {
4583
- maxTokens: 32768,
4584
- contextWindow: 256e3,
4585
- supportsImages: false,
4586
- supportsPromptCache: false,
4587
- inputPrice: 0.22,
4588
- outputPrice: 0.88,
4589
- description: "Latest Qwen3 thinking model, competitive against the best closed source models in Jul 2025."
4590
- },
4591
- "accounts/fireworks/models/qwen3-coder-480b-a35b-instruct": {
4592
- maxTokens: 32768,
4593
- contextWindow: 256e3,
4594
- supportsImages: false,
4595
- supportsPromptCache: false,
4596
- inputPrice: 0.45,
4597
- outputPrice: 1.8,
4598
- description: "Qwen3's most agentic code model to date."
4599
- },
4600
- "accounts/fireworks/models/deepseek-r1-0528": {
4601
- maxTokens: 20480,
4602
- contextWindow: 16e4,
4603
- supportsImages: false,
4604
- supportsPromptCache: false,
4605
- inputPrice: 3,
4606
- outputPrice: 8,
4607
- 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."
4608
- },
4609
- "accounts/fireworks/models/deepseek-v3": {
4610
- maxTokens: 16384,
4611
- contextWindow: 128e3,
4612
- supportsImages: false,
4613
- supportsPromptCache: false,
4614
- inputPrice: 0.9,
4615
- outputPrice: 0.9,
4616
- 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."
4617
- },
4618
- "accounts/fireworks/models/glm-4p5": {
4619
- maxTokens: 16384,
4620
- contextWindow: 128e3,
4621
- supportsImages: false,
4622
- supportsPromptCache: false,
4623
- inputPrice: 0.55,
4624
- outputPrice: 2.19,
4625
- description: "Z.ai GLM-4.5 with 355B total parameters and 32B active parameters. Features unified reasoning, coding, and intelligent agent capabilities."
4626
- },
4627
- "accounts/fireworks/models/glm-4p5-air": {
4628
- maxTokens: 16384,
4629
- contextWindow: 128e3,
4630
- supportsImages: false,
4631
- supportsPromptCache: false,
4632
- inputPrice: 0.55,
4633
- outputPrice: 2.19,
4634
- description: "Z.ai GLM-4.5-Air with 106B total parameters and 12B active parameters. Features unified reasoning, coding, and intelligent agent capabilities."
4635
- },
4636
- "accounts/fireworks/models/gpt-oss-20b": {
4637
- maxTokens: 16384,
4638
- contextWindow: 128e3,
4639
- supportsImages: false,
4640
- supportsPromptCache: false,
4641
- inputPrice: 0.07,
4642
- outputPrice: 0.3,
4643
- 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."
4644
- },
4645
- "accounts/fireworks/models/gpt-oss-120b": {
4646
- maxTokens: 16384,
4647
- contextWindow: 128e3,
4648
- supportsImages: false,
4649
- supportsPromptCache: false,
4650
- inputPrice: 0.15,
4651
- outputPrice: 0.6,
4652
- 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."
4653
- }
4654
- };
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
+ ]);
4655
4746
 
4656
- // src/providers/roo.ts
4657
- var rooDefaultModelId = "roo/sonic";
4658
- var rooModels = {
4659
- "roo/sonic": {
4660
- maxTokens: 16384,
4661
- contextWindow: 262144,
4662
- supportsImages: false,
4663
- supportsPromptCache: true,
4664
- inputPrice: 0,
4665
- outputPrice: 0,
4666
- 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.)"
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;
4667
4752
  }
4668
- };
4669
-
4670
- // src/providers/featherless.ts
4671
- var featherlessModels = {
4672
- "deepseek-ai/DeepSeek-V3-0324": {
4673
- maxTokens: 4096,
4674
- contextWindow: 32678,
4675
- supportsImages: false,
4676
- supportsPromptCache: false,
4677
- inputPrice: 0,
4678
- outputPrice: 0,
4679
- description: "DeepSeek V3 0324 model."
4680
- },
4681
- "deepseek-ai/DeepSeek-R1-0528": {
4682
- maxTokens: 4096,
4683
- contextWindow: 32678,
4684
- supportsImages: false,
4685
- supportsPromptCache: false,
4686
- inputPrice: 0,
4687
- outputPrice: 0,
4688
- description: "DeepSeek R1 0528 model."
4689
- },
4690
- "moonshotai/Kimi-K2-Instruct": {
4691
- maxTokens: 4096,
4692
- contextWindow: 32678,
4693
- supportsImages: false,
4694
- supportsPromptCache: false,
4695
- inputPrice: 0,
4696
- outputPrice: 0,
4697
- description: "Kimi K2 Instruct model."
4698
- },
4699
- "openai/gpt-oss-120b": {
4700
- maxTokens: 4096,
4701
- contextWindow: 32678,
4702
- supportsImages: false,
4703
- supportsPromptCache: false,
4704
- inputPrice: 0,
4705
- outputPrice: 0,
4706
- description: "GPT-OSS 120B model."
4707
- },
4708
- "Qwen/Qwen3-Coder-480B-A35B-Instruct": {
4709
- maxTokens: 4096,
4710
- contextWindow: 32678,
4711
- supportsImages: false,
4712
- supportsPromptCache: false,
4713
- inputPrice: 0,
4714
- outputPrice: 0,
4715
- description: "Qwen3 Coder 480B A35B Instruct model."
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
+ }
4716
4758
  }
4717
- };
4718
- var featherlessDefaultModelId = "deepseek-ai/DeepSeek-R1-0528";
4759
+ return false;
4760
+ }
4761
+
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
+ });
4776
+
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
+ ]);
4719
4814
  // Annotate the CommonJS export names for ESM import in node:
4720
4815
  0 && (module.exports = {
4721
4816
  ANTHROPIC_DEFAULT_MAX_TOKENS,
@@ -4755,6 +4850,7 @@ var featherlessDefaultModelId = "deepseek-ai/DeepSeek-R1-0528";
4755
4850
  LITELLM_COMPUTER_USE_MODELS,
4756
4851
  LMSTUDIO_DEFAULT_TEMPERATURE,
4757
4852
  MISTRAL_DEFAULT_TEMPERATURE,
4853
+ MODELS_BY_PROVIDER,
4758
4854
  MODEL_ID_KEYS,
4759
4855
  MOONSHOT_DEFAULT_TEMPERATURE,
4760
4856
  OPENAI_AZURE_AI_INFERENCE_PATH,
@@ -4814,7 +4910,6 @@ var featherlessDefaultModelId = "deepseek-ai/DeepSeek-R1-0528";
4814
4910
  experimentIds,
4815
4911
  experimentIdsSchema,
4816
4912
  experimentsSchema,
4817
- extendedReasoningEffortsSchema,
4818
4913
  featherlessDefaultModelId,
4819
4914
  featherlessModels,
4820
4915
  fireworksDefaultModelId,
@@ -4887,6 +4982,7 @@ var featherlessDefaultModelId = "deepseek-ai/DeepSeek-R1-0528";
4887
4982
  providerSettingsSchema,
4888
4983
  providerSettingsSchemaDiscriminated,
4889
4984
  providerSettingsWithIdSchema,
4985
+ reasoningEffortWithMinimalSchema,
4890
4986
  reasoningEfforts,
4891
4987
  reasoningEffortsSchema,
4892
4988
  requestyDefaultModelId,