@roo-code/types 1.55.0 → 1.57.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.js CHANGED
@@ -385,6 +385,7 @@ import { z as z8 } from "zod";
385
385
  import { z as z7 } from "zod";
386
386
  var reasoningEfforts = ["low", "medium", "high"];
387
387
  var reasoningEffortsSchema = z7.enum(reasoningEfforts);
388
+ var reasoningEffortWithMinimalSchema = z7.union([reasoningEffortsSchema, z7.literal("minimal")]);
388
389
  var verbosityLevels = ["low", "medium", "high"];
389
390
  var verbosityLevelsSchema = z7.enum(verbosityLevels);
390
391
  var modelParameters = ["max_tokens", "temperature", "reasoning", "include_reasoning"];
@@ -423,1100 +424,6 @@ var modelInfoSchema = z7.object({
423
424
  ).optional()
424
425
  });
425
426
 
426
- // src/provider-settings.ts
427
- var BEDROCK_CLAUDE_SONNET_4_MODEL_ID = "anthropic.claude-sonnet-4-20250514-v1:0";
428
- var extendedReasoningEffortsSchema = z8.union([reasoningEffortsSchema, z8.literal("minimal")]);
429
- var providerNames = [
430
- "anthropic",
431
- "claude-code",
432
- "glama",
433
- "openrouter",
434
- "bedrock",
435
- "vertex",
436
- "openai",
437
- "ollama",
438
- "vscode-lm",
439
- "lmstudio",
440
- "gemini",
441
- "gemini-cli",
442
- "openai-native",
443
- "mistral",
444
- "moonshot",
445
- "deepseek",
446
- "doubao",
447
- "unbound",
448
- "requesty",
449
- "human-relay",
450
- "fake-ai",
451
- "xai",
452
- "groq",
453
- "chutes",
454
- "litellm",
455
- "huggingface",
456
- "cerebras",
457
- "sambanova",
458
- "zai",
459
- "fireworks",
460
- "featherless",
461
- "io-intelligence",
462
- "roo"
463
- ];
464
- var providerNamesSchema = z8.enum(providerNames);
465
- var providerSettingsEntrySchema = z8.object({
466
- id: z8.string(),
467
- name: z8.string(),
468
- apiProvider: providerNamesSchema.optional()
469
- });
470
- var DEFAULT_CONSECUTIVE_MISTAKE_LIMIT = 3;
471
- var baseProviderSettingsSchema = z8.object({
472
- includeMaxTokens: z8.boolean().optional(),
473
- diffEnabled: z8.boolean().optional(),
474
- todoListEnabled: z8.boolean().optional(),
475
- fuzzyMatchThreshold: z8.number().optional(),
476
- modelTemperature: z8.number().nullish(),
477
- rateLimitSeconds: z8.number().optional(),
478
- consecutiveMistakeLimit: z8.number().min(0).optional(),
479
- // Model reasoning.
480
- enableReasoningEffort: z8.boolean().optional(),
481
- reasoningEffort: extendedReasoningEffortsSchema.optional(),
482
- modelMaxTokens: z8.number().optional(),
483
- modelMaxThinkingTokens: z8.number().optional(),
484
- // Model verbosity.
485
- verbosity: verbosityLevelsSchema.optional()
486
- });
487
- var apiModelIdProviderModelSchema = baseProviderSettingsSchema.extend({
488
- apiModelId: z8.string().optional()
489
- });
490
- var anthropicSchema = apiModelIdProviderModelSchema.extend({
491
- apiKey: z8.string().optional(),
492
- anthropicBaseUrl: z8.string().optional(),
493
- anthropicUseAuthToken: z8.boolean().optional(),
494
- anthropicBeta1MContext: z8.boolean().optional()
495
- // Enable 'context-1m-2025-08-07' beta for 1M context window
496
- });
497
- var claudeCodeSchema = apiModelIdProviderModelSchema.extend({
498
- claudeCodePath: z8.string().optional(),
499
- claudeCodeMaxOutputTokens: z8.number().int().min(1).max(2e5).optional()
500
- });
501
- var glamaSchema = baseProviderSettingsSchema.extend({
502
- glamaModelId: z8.string().optional(),
503
- glamaApiKey: z8.string().optional()
504
- });
505
- var openRouterSchema = baseProviderSettingsSchema.extend({
506
- openRouterApiKey: z8.string().optional(),
507
- openRouterModelId: z8.string().optional(),
508
- openRouterBaseUrl: z8.string().optional(),
509
- openRouterSpecificProvider: z8.string().optional(),
510
- openRouterUseMiddleOutTransform: z8.boolean().optional()
511
- });
512
- var bedrockSchema = apiModelIdProviderModelSchema.extend({
513
- awsAccessKey: z8.string().optional(),
514
- awsSecretKey: z8.string().optional(),
515
- awsSessionToken: z8.string().optional(),
516
- awsRegion: z8.string().optional(),
517
- awsUseCrossRegionInference: z8.boolean().optional(),
518
- awsUsePromptCache: z8.boolean().optional(),
519
- awsProfile: z8.string().optional(),
520
- awsUseProfile: z8.boolean().optional(),
521
- awsApiKey: z8.string().optional(),
522
- awsUseApiKey: z8.boolean().optional(),
523
- awsCustomArn: z8.string().optional(),
524
- awsModelContextWindow: z8.number().optional(),
525
- awsBedrockEndpointEnabled: z8.boolean().optional(),
526
- awsBedrockEndpoint: z8.string().optional(),
527
- awsBedrock1MContext: z8.boolean().optional()
528
- // Enable 'context-1m-2025-08-07' beta for 1M context window
529
- });
530
- var vertexSchema = apiModelIdProviderModelSchema.extend({
531
- vertexKeyFile: z8.string().optional(),
532
- vertexJsonCredentials: z8.string().optional(),
533
- vertexProjectId: z8.string().optional(),
534
- vertexRegion: z8.string().optional()
535
- });
536
- var openAiSchema = baseProviderSettingsSchema.extend({
537
- openAiBaseUrl: z8.string().optional(),
538
- openAiApiKey: z8.string().optional(),
539
- openAiLegacyFormat: z8.boolean().optional(),
540
- openAiR1FormatEnabled: z8.boolean().optional(),
541
- openAiModelId: z8.string().optional(),
542
- openAiCustomModelInfo: modelInfoSchema.nullish(),
543
- openAiUseAzure: z8.boolean().optional(),
544
- azureApiVersion: z8.string().optional(),
545
- openAiStreamingEnabled: z8.boolean().optional(),
546
- openAiHostHeader: z8.string().optional(),
547
- // Keep temporarily for backward compatibility during migration.
548
- openAiHeaders: z8.record(z8.string(), z8.string()).optional()
549
- });
550
- var ollamaSchema = baseProviderSettingsSchema.extend({
551
- ollamaModelId: z8.string().optional(),
552
- ollamaBaseUrl: z8.string().optional()
553
- });
554
- var vsCodeLmSchema = baseProviderSettingsSchema.extend({
555
- vsCodeLmModelSelector: z8.object({
556
- vendor: z8.string().optional(),
557
- family: z8.string().optional(),
558
- version: z8.string().optional(),
559
- id: z8.string().optional()
560
- }).optional()
561
- });
562
- var lmStudioSchema = baseProviderSettingsSchema.extend({
563
- lmStudioModelId: z8.string().optional(),
564
- lmStudioBaseUrl: z8.string().optional(),
565
- lmStudioDraftModelId: z8.string().optional(),
566
- lmStudioSpeculativeDecodingEnabled: z8.boolean().optional()
567
- });
568
- var geminiSchema = apiModelIdProviderModelSchema.extend({
569
- geminiApiKey: z8.string().optional(),
570
- googleGeminiBaseUrl: z8.string().optional(),
571
- enableUrlContext: z8.boolean().optional(),
572
- enableGrounding: z8.boolean().optional()
573
- });
574
- var geminiCliSchema = apiModelIdProviderModelSchema.extend({
575
- geminiCliOAuthPath: z8.string().optional(),
576
- geminiCliProjectId: z8.string().optional()
577
- });
578
- var openAiNativeSchema = apiModelIdProviderModelSchema.extend({
579
- openAiNativeApiKey: z8.string().optional(),
580
- openAiNativeBaseUrl: z8.string().optional()
581
- });
582
- var mistralSchema = apiModelIdProviderModelSchema.extend({
583
- mistralApiKey: z8.string().optional(),
584
- mistralCodestralUrl: z8.string().optional()
585
- });
586
- var deepSeekSchema = apiModelIdProviderModelSchema.extend({
587
- deepSeekBaseUrl: z8.string().optional(),
588
- deepSeekApiKey: z8.string().optional()
589
- });
590
- var doubaoSchema = apiModelIdProviderModelSchema.extend({
591
- doubaoBaseUrl: z8.string().optional(),
592
- doubaoApiKey: z8.string().optional()
593
- });
594
- var moonshotSchema = apiModelIdProviderModelSchema.extend({
595
- moonshotBaseUrl: z8.union([z8.literal("https://api.moonshot.ai/v1"), z8.literal("https://api.moonshot.cn/v1")]).optional(),
596
- moonshotApiKey: z8.string().optional()
597
- });
598
- var unboundSchema = baseProviderSettingsSchema.extend({
599
- unboundApiKey: z8.string().optional(),
600
- unboundModelId: z8.string().optional()
601
- });
602
- var requestySchema = baseProviderSettingsSchema.extend({
603
- requestyBaseUrl: z8.string().optional(),
604
- requestyApiKey: z8.string().optional(),
605
- requestyModelId: z8.string().optional()
606
- });
607
- var humanRelaySchema = baseProviderSettingsSchema;
608
- var fakeAiSchema = baseProviderSettingsSchema.extend({
609
- fakeAi: z8.unknown().optional()
610
- });
611
- var xaiSchema = apiModelIdProviderModelSchema.extend({
612
- xaiApiKey: z8.string().optional()
613
- });
614
- var groqSchema = apiModelIdProviderModelSchema.extend({
615
- groqApiKey: z8.string().optional()
616
- });
617
- var huggingFaceSchema = baseProviderSettingsSchema.extend({
618
- huggingFaceApiKey: z8.string().optional(),
619
- huggingFaceModelId: z8.string().optional(),
620
- huggingFaceInferenceProvider: z8.string().optional()
621
- });
622
- var chutesSchema = apiModelIdProviderModelSchema.extend({
623
- chutesApiKey: z8.string().optional()
624
- });
625
- var litellmSchema = baseProviderSettingsSchema.extend({
626
- litellmBaseUrl: z8.string().optional(),
627
- litellmApiKey: z8.string().optional(),
628
- litellmModelId: z8.string().optional(),
629
- litellmUsePromptCache: z8.boolean().optional()
630
- });
631
- var cerebrasSchema = apiModelIdProviderModelSchema.extend({
632
- cerebrasApiKey: z8.string().optional()
633
- });
634
- var sambaNovaSchema = apiModelIdProviderModelSchema.extend({
635
- sambaNovaApiKey: z8.string().optional()
636
- });
637
- var zaiSchema = apiModelIdProviderModelSchema.extend({
638
- zaiApiKey: z8.string().optional(),
639
- zaiApiLine: z8.union([z8.literal("china"), z8.literal("international")]).optional()
640
- });
641
- var fireworksSchema = apiModelIdProviderModelSchema.extend({
642
- fireworksApiKey: z8.string().optional()
643
- });
644
- var featherlessSchema = apiModelIdProviderModelSchema.extend({
645
- featherlessApiKey: z8.string().optional()
646
- });
647
- var ioIntelligenceSchema = apiModelIdProviderModelSchema.extend({
648
- ioIntelligenceModelId: z8.string().optional(),
649
- ioIntelligenceApiKey: z8.string().optional()
650
- });
651
- var rooSchema = apiModelIdProviderModelSchema.extend({
652
- // No additional fields needed - uses cloud authentication
653
- });
654
- var defaultSchema = z8.object({
655
- apiProvider: z8.undefined()
656
- });
657
- var providerSettingsSchemaDiscriminated = z8.discriminatedUnion("apiProvider", [
658
- anthropicSchema.merge(z8.object({ apiProvider: z8.literal("anthropic") })),
659
- claudeCodeSchema.merge(z8.object({ apiProvider: z8.literal("claude-code") })),
660
- glamaSchema.merge(z8.object({ apiProvider: z8.literal("glama") })),
661
- openRouterSchema.merge(z8.object({ apiProvider: z8.literal("openrouter") })),
662
- bedrockSchema.merge(z8.object({ apiProvider: z8.literal("bedrock") })),
663
- vertexSchema.merge(z8.object({ apiProvider: z8.literal("vertex") })),
664
- openAiSchema.merge(z8.object({ apiProvider: z8.literal("openai") })),
665
- ollamaSchema.merge(z8.object({ apiProvider: z8.literal("ollama") })),
666
- vsCodeLmSchema.merge(z8.object({ apiProvider: z8.literal("vscode-lm") })),
667
- lmStudioSchema.merge(z8.object({ apiProvider: z8.literal("lmstudio") })),
668
- geminiSchema.merge(z8.object({ apiProvider: z8.literal("gemini") })),
669
- geminiCliSchema.merge(z8.object({ apiProvider: z8.literal("gemini-cli") })),
670
- openAiNativeSchema.merge(z8.object({ apiProvider: z8.literal("openai-native") })),
671
- mistralSchema.merge(z8.object({ apiProvider: z8.literal("mistral") })),
672
- deepSeekSchema.merge(z8.object({ apiProvider: z8.literal("deepseek") })),
673
- doubaoSchema.merge(z8.object({ apiProvider: z8.literal("doubao") })),
674
- moonshotSchema.merge(z8.object({ apiProvider: z8.literal("moonshot") })),
675
- unboundSchema.merge(z8.object({ apiProvider: z8.literal("unbound") })),
676
- requestySchema.merge(z8.object({ apiProvider: z8.literal("requesty") })),
677
- humanRelaySchema.merge(z8.object({ apiProvider: z8.literal("human-relay") })),
678
- fakeAiSchema.merge(z8.object({ apiProvider: z8.literal("fake-ai") })),
679
- xaiSchema.merge(z8.object({ apiProvider: z8.literal("xai") })),
680
- groqSchema.merge(z8.object({ apiProvider: z8.literal("groq") })),
681
- huggingFaceSchema.merge(z8.object({ apiProvider: z8.literal("huggingface") })),
682
- chutesSchema.merge(z8.object({ apiProvider: z8.literal("chutes") })),
683
- litellmSchema.merge(z8.object({ apiProvider: z8.literal("litellm") })),
684
- cerebrasSchema.merge(z8.object({ apiProvider: z8.literal("cerebras") })),
685
- sambaNovaSchema.merge(z8.object({ apiProvider: z8.literal("sambanova") })),
686
- zaiSchema.merge(z8.object({ apiProvider: z8.literal("zai") })),
687
- fireworksSchema.merge(z8.object({ apiProvider: z8.literal("fireworks") })),
688
- featherlessSchema.merge(z8.object({ apiProvider: z8.literal("featherless") })),
689
- ioIntelligenceSchema.merge(z8.object({ apiProvider: z8.literal("io-intelligence") })),
690
- rooSchema.merge(z8.object({ apiProvider: z8.literal("roo") })),
691
- defaultSchema
692
- ]);
693
- var providerSettingsSchema = z8.object({
694
- apiProvider: providerNamesSchema.optional(),
695
- ...anthropicSchema.shape,
696
- ...claudeCodeSchema.shape,
697
- ...glamaSchema.shape,
698
- ...openRouterSchema.shape,
699
- ...bedrockSchema.shape,
700
- ...vertexSchema.shape,
701
- ...openAiSchema.shape,
702
- ...ollamaSchema.shape,
703
- ...vsCodeLmSchema.shape,
704
- ...lmStudioSchema.shape,
705
- ...geminiSchema.shape,
706
- ...geminiCliSchema.shape,
707
- ...openAiNativeSchema.shape,
708
- ...mistralSchema.shape,
709
- ...deepSeekSchema.shape,
710
- ...doubaoSchema.shape,
711
- ...moonshotSchema.shape,
712
- ...unboundSchema.shape,
713
- ...requestySchema.shape,
714
- ...humanRelaySchema.shape,
715
- ...fakeAiSchema.shape,
716
- ...xaiSchema.shape,
717
- ...groqSchema.shape,
718
- ...huggingFaceSchema.shape,
719
- ...chutesSchema.shape,
720
- ...litellmSchema.shape,
721
- ...cerebrasSchema.shape,
722
- ...sambaNovaSchema.shape,
723
- ...zaiSchema.shape,
724
- ...fireworksSchema.shape,
725
- ...featherlessSchema.shape,
726
- ...ioIntelligenceSchema.shape,
727
- ...rooSchema.shape,
728
- ...codebaseIndexProviderSchema.shape
729
- });
730
- var providerSettingsWithIdSchema = providerSettingsSchema.extend({ id: z8.string().optional() });
731
- var discriminatedProviderSettingsWithIdSchema = providerSettingsSchemaDiscriminated.and(
732
- z8.object({ id: z8.string().optional() })
733
- );
734
- var PROVIDER_SETTINGS_KEYS = providerSettingsSchema.keyof().options;
735
- var MODEL_ID_KEYS = [
736
- "apiModelId",
737
- "glamaModelId",
738
- "openRouterModelId",
739
- "openAiModelId",
740
- "ollamaModelId",
741
- "lmStudioModelId",
742
- "lmStudioDraftModelId",
743
- "unboundModelId",
744
- "requestyModelId",
745
- "litellmModelId",
746
- "huggingFaceModelId",
747
- "ioIntelligenceModelId"
748
- ];
749
- var getModelId = (settings) => {
750
- const modelIdKey = MODEL_ID_KEYS.find((key) => settings[key]);
751
- return modelIdKey ? settings[modelIdKey] : void 0;
752
- };
753
- var ANTHROPIC_STYLE_PROVIDERS = ["anthropic", "claude-code", "bedrock"];
754
- var getApiProtocol = (provider, modelId) => {
755
- if (provider && ANTHROPIC_STYLE_PROVIDERS.includes(provider)) {
756
- return "anthropic";
757
- }
758
- if (provider && provider === "vertex" && modelId && modelId.toLowerCase().includes("claude")) {
759
- return "anthropic";
760
- }
761
- return "openai";
762
- };
763
-
764
- // src/history.ts
765
- import { z as z9 } from "zod";
766
- var historyItemSchema = z9.object({
767
- id: z9.string(),
768
- number: z9.number(),
769
- ts: z9.number(),
770
- task: z9.string(),
771
- tokensIn: z9.number(),
772
- tokensOut: z9.number(),
773
- cacheWrites: z9.number().optional(),
774
- cacheReads: z9.number().optional(),
775
- totalCost: z9.number(),
776
- size: z9.number().optional(),
777
- workspace: z9.string().optional(),
778
- mode: z9.string().optional()
779
- });
780
-
781
- // src/telemetry.ts
782
- import { z as z10 } from "zod";
783
- var telemetrySettings = ["unset", "enabled", "disabled"];
784
- var telemetrySettingsSchema = z10.enum(telemetrySettings);
785
- var TelemetryEventName = /* @__PURE__ */ ((TelemetryEventName2) => {
786
- TelemetryEventName2["TASK_CREATED"] = "Task Created";
787
- TelemetryEventName2["TASK_RESTARTED"] = "Task Reopened";
788
- TelemetryEventName2["TASK_COMPLETED"] = "Task Completed";
789
- TelemetryEventName2["TASK_MESSAGE"] = "Task Message";
790
- TelemetryEventName2["TASK_CONVERSATION_MESSAGE"] = "Conversation Message";
791
- TelemetryEventName2["LLM_COMPLETION"] = "LLM Completion";
792
- TelemetryEventName2["MODE_SWITCH"] = "Mode Switched";
793
- TelemetryEventName2["MODE_SELECTOR_OPENED"] = "Mode Selector Opened";
794
- TelemetryEventName2["TOOL_USED"] = "Tool Used";
795
- TelemetryEventName2["CHECKPOINT_CREATED"] = "Checkpoint Created";
796
- TelemetryEventName2["CHECKPOINT_RESTORED"] = "Checkpoint Restored";
797
- TelemetryEventName2["CHECKPOINT_DIFFED"] = "Checkpoint Diffed";
798
- TelemetryEventName2["TAB_SHOWN"] = "Tab Shown";
799
- TelemetryEventName2["MODE_SETTINGS_CHANGED"] = "Mode Setting Changed";
800
- TelemetryEventName2["CUSTOM_MODE_CREATED"] = "Custom Mode Created";
801
- TelemetryEventName2["CONTEXT_CONDENSED"] = "Context Condensed";
802
- TelemetryEventName2["SLIDING_WINDOW_TRUNCATION"] = "Sliding Window Truncation";
803
- TelemetryEventName2["CODE_ACTION_USED"] = "Code Action Used";
804
- TelemetryEventName2["PROMPT_ENHANCED"] = "Prompt Enhanced";
805
- TelemetryEventName2["TITLE_BUTTON_CLICKED"] = "Title Button Clicked";
806
- TelemetryEventName2["AUTHENTICATION_INITIATED"] = "Authentication Initiated";
807
- TelemetryEventName2["MARKETPLACE_ITEM_INSTALLED"] = "Marketplace Item Installed";
808
- TelemetryEventName2["MARKETPLACE_ITEM_REMOVED"] = "Marketplace Item Removed";
809
- TelemetryEventName2["MARKETPLACE_TAB_VIEWED"] = "Marketplace Tab Viewed";
810
- TelemetryEventName2["MARKETPLACE_INSTALL_BUTTON_CLICKED"] = "Marketplace Install Button Clicked";
811
- TelemetryEventName2["SHARE_BUTTON_CLICKED"] = "Share Button Clicked";
812
- TelemetryEventName2["SHARE_ORGANIZATION_CLICKED"] = "Share Organization Clicked";
813
- TelemetryEventName2["SHARE_PUBLIC_CLICKED"] = "Share Public Clicked";
814
- TelemetryEventName2["SHARE_CONNECT_TO_CLOUD_CLICKED"] = "Share Connect To Cloud Clicked";
815
- TelemetryEventName2["ACCOUNT_CONNECT_CLICKED"] = "Account Connect Clicked";
816
- TelemetryEventName2["ACCOUNT_CONNECT_SUCCESS"] = "Account Connect Success";
817
- TelemetryEventName2["ACCOUNT_LOGOUT_CLICKED"] = "Account Logout Clicked";
818
- TelemetryEventName2["ACCOUNT_LOGOUT_SUCCESS"] = "Account Logout Success";
819
- TelemetryEventName2["SCHEMA_VALIDATION_ERROR"] = "Schema Validation Error";
820
- TelemetryEventName2["DIFF_APPLICATION_ERROR"] = "Diff Application Error";
821
- TelemetryEventName2["SHELL_INTEGRATION_ERROR"] = "Shell Integration Error";
822
- TelemetryEventName2["CONSECUTIVE_MISTAKE_ERROR"] = "Consecutive Mistake Error";
823
- TelemetryEventName2["CODE_INDEX_ERROR"] = "Code Index Error";
824
- return TelemetryEventName2;
825
- })(TelemetryEventName || {});
826
- var staticAppPropertiesSchema = z10.object({
827
- appName: z10.string(),
828
- appVersion: z10.string(),
829
- vscodeVersion: z10.string(),
830
- platform: z10.string(),
831
- editorName: z10.string()
832
- });
833
- var dynamicAppPropertiesSchema = z10.object({
834
- language: z10.string(),
835
- mode: z10.string()
836
- });
837
- var cloudAppPropertiesSchema = z10.object({
838
- cloudIsAuthenticated: z10.boolean().optional()
839
- });
840
- var appPropertiesSchema = z10.object({
841
- ...staticAppPropertiesSchema.shape,
842
- ...dynamicAppPropertiesSchema.shape,
843
- ...cloudAppPropertiesSchema.shape
844
- });
845
- var taskPropertiesSchema = z10.object({
846
- taskId: z10.string().optional(),
847
- apiProvider: z10.enum(providerNames).optional(),
848
- modelId: z10.string().optional(),
849
- diffStrategy: z10.string().optional(),
850
- isSubtask: z10.boolean().optional(),
851
- todos: z10.object({
852
- total: z10.number(),
853
- completed: z10.number(),
854
- inProgress: z10.number(),
855
- pending: z10.number()
856
- }).optional()
857
- });
858
- var gitPropertiesSchema = z10.object({
859
- repositoryUrl: z10.string().optional(),
860
- repositoryName: z10.string().optional(),
861
- defaultBranch: z10.string().optional()
862
- });
863
- var telemetryPropertiesSchema = z10.object({
864
- ...appPropertiesSchema.shape,
865
- ...taskPropertiesSchema.shape,
866
- ...gitPropertiesSchema.shape
867
- });
868
- var rooCodeTelemetryEventSchema = z10.discriminatedUnion("type", [
869
- z10.object({
870
- type: z10.enum([
871
- "Task Created" /* TASK_CREATED */,
872
- "Task Reopened" /* TASK_RESTARTED */,
873
- "Task Completed" /* TASK_COMPLETED */,
874
- "Conversation Message" /* TASK_CONVERSATION_MESSAGE */,
875
- "Mode Switched" /* MODE_SWITCH */,
876
- "Mode Selector Opened" /* MODE_SELECTOR_OPENED */,
877
- "Tool Used" /* TOOL_USED */,
878
- "Checkpoint Created" /* CHECKPOINT_CREATED */,
879
- "Checkpoint Restored" /* CHECKPOINT_RESTORED */,
880
- "Checkpoint Diffed" /* CHECKPOINT_DIFFED */,
881
- "Code Action Used" /* CODE_ACTION_USED */,
882
- "Prompt Enhanced" /* PROMPT_ENHANCED */,
883
- "Title Button Clicked" /* TITLE_BUTTON_CLICKED */,
884
- "Authentication Initiated" /* AUTHENTICATION_INITIATED */,
885
- "Marketplace Item Installed" /* MARKETPLACE_ITEM_INSTALLED */,
886
- "Marketplace Item Removed" /* MARKETPLACE_ITEM_REMOVED */,
887
- "Marketplace Tab Viewed" /* MARKETPLACE_TAB_VIEWED */,
888
- "Marketplace Install Button Clicked" /* MARKETPLACE_INSTALL_BUTTON_CLICKED */,
889
- "Share Button Clicked" /* SHARE_BUTTON_CLICKED */,
890
- "Share Organization Clicked" /* SHARE_ORGANIZATION_CLICKED */,
891
- "Share Public Clicked" /* SHARE_PUBLIC_CLICKED */,
892
- "Share Connect To Cloud Clicked" /* SHARE_CONNECT_TO_CLOUD_CLICKED */,
893
- "Account Connect Clicked" /* ACCOUNT_CONNECT_CLICKED */,
894
- "Account Connect Success" /* ACCOUNT_CONNECT_SUCCESS */,
895
- "Account Logout Clicked" /* ACCOUNT_LOGOUT_CLICKED */,
896
- "Account Logout Success" /* ACCOUNT_LOGOUT_SUCCESS */,
897
- "Schema Validation Error" /* SCHEMA_VALIDATION_ERROR */,
898
- "Diff Application Error" /* DIFF_APPLICATION_ERROR */,
899
- "Shell Integration Error" /* SHELL_INTEGRATION_ERROR */,
900
- "Consecutive Mistake Error" /* CONSECUTIVE_MISTAKE_ERROR */,
901
- "Code Index Error" /* CODE_INDEX_ERROR */,
902
- "Context Condensed" /* CONTEXT_CONDENSED */,
903
- "Sliding Window Truncation" /* SLIDING_WINDOW_TRUNCATION */,
904
- "Tab Shown" /* TAB_SHOWN */,
905
- "Mode Setting Changed" /* MODE_SETTINGS_CHANGED */,
906
- "Custom Mode Created" /* CUSTOM_MODE_CREATED */
907
- ]),
908
- properties: telemetryPropertiesSchema
909
- }),
910
- z10.object({
911
- type: z10.literal("Task Message" /* TASK_MESSAGE */),
912
- properties: z10.object({
913
- ...telemetryPropertiesSchema.shape,
914
- taskId: z10.string(),
915
- message: clineMessageSchema
916
- })
917
- }),
918
- z10.object({
919
- type: z10.literal("LLM Completion" /* LLM_COMPLETION */),
920
- properties: z10.object({
921
- ...telemetryPropertiesSchema.shape,
922
- inputTokens: z10.number(),
923
- outputTokens: z10.number(),
924
- cacheReadTokens: z10.number().optional(),
925
- cacheWriteTokens: z10.number().optional(),
926
- cost: z10.number().optional()
927
- })
928
- })
929
- ]);
930
-
931
- // src/mode.ts
932
- import { z as z11 } from "zod";
933
- var groupOptionsSchema = z11.object({
934
- fileRegex: z11.string().optional().refine(
935
- (pattern) => {
936
- if (!pattern) {
937
- return true;
938
- }
939
- try {
940
- new RegExp(pattern);
941
- return true;
942
- } catch {
943
- return false;
944
- }
945
- },
946
- { message: "Invalid regular expression pattern" }
947
- ),
948
- description: z11.string().optional()
949
- });
950
- var groupEntrySchema = z11.union([toolGroupsSchema, z11.tuple([toolGroupsSchema, groupOptionsSchema])]);
951
- var groupEntryArraySchema = z11.array(groupEntrySchema).refine(
952
- (groups) => {
953
- const seen = /* @__PURE__ */ new Set();
954
- return groups.every((group) => {
955
- const groupName = Array.isArray(group) ? group[0] : group;
956
- if (seen.has(groupName)) {
957
- return false;
958
- }
959
- seen.add(groupName);
960
- return true;
961
- });
962
- },
963
- { message: "Duplicate groups are not allowed" }
964
- );
965
- var modeConfigSchema = z11.object({
966
- slug: z11.string().regex(/^[a-zA-Z0-9-]+$/, "Slug must contain only letters numbers and dashes"),
967
- name: z11.string().min(1, "Name is required"),
968
- roleDefinition: z11.string().min(1, "Role definition is required"),
969
- whenToUse: z11.string().optional(),
970
- description: z11.string().optional(),
971
- customInstructions: z11.string().optional(),
972
- groups: groupEntryArraySchema,
973
- source: z11.enum(["global", "project"]).optional()
974
- });
975
- var customModesSettingsSchema = z11.object({
976
- customModes: z11.array(modeConfigSchema).refine(
977
- (modes) => {
978
- const slugs = /* @__PURE__ */ new Set();
979
- return modes.every((mode) => {
980
- if (slugs.has(mode.slug)) {
981
- return false;
982
- }
983
- slugs.add(mode.slug);
984
- return true;
985
- });
986
- },
987
- {
988
- message: "Duplicate mode slugs are not allowed"
989
- }
990
- )
991
- });
992
- var promptComponentSchema = z11.object({
993
- roleDefinition: z11.string().optional(),
994
- whenToUse: z11.string().optional(),
995
- description: z11.string().optional(),
996
- customInstructions: z11.string().optional()
997
- });
998
- var customModePromptsSchema = z11.record(z11.string(), promptComponentSchema.optional());
999
- var customSupportPromptsSchema = z11.record(z11.string(), z11.string().optional());
1000
- var DEFAULT_MODES = [
1001
- {
1002
- slug: "architect",
1003
- name: "\u{1F3D7}\uFE0F Architect",
1004
- 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.",
1005
- 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.",
1006
- description: "Plan and design before implementation",
1007
- groups: ["read", ["edit", { fileRegex: "\\.md$", description: "Markdown files only" }], "browser", "mcp"],
1008
- 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.**"
1009
- },
1010
- {
1011
- slug: "code",
1012
- name: "\u{1F4BB} Code",
1013
- roleDefinition: "You are Roo, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.",
1014
- 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.",
1015
- description: "Write, modify, and refactor code",
1016
- groups: ["read", "edit", "browser", "command", "mcp"]
1017
- },
1018
- {
1019
- slug: "ask",
1020
- name: "\u2753 Ask",
1021
- roleDefinition: "You are Roo, a knowledgeable technical assistant focused on answering questions and providing information about software development, technology, and related topics.",
1022
- 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.",
1023
- description: "Get answers and explanations",
1024
- groups: ["read", "browser", "mcp"],
1025
- 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."
1026
- },
1027
- {
1028
- slug: "debug",
1029
- name: "\u{1FAB2} Debug",
1030
- roleDefinition: "You are Roo, an expert software debugger specializing in systematic problem diagnosis and resolution.",
1031
- 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.",
1032
- description: "Diagnose and fix software issues",
1033
- groups: ["read", "edit", "browser", "command", "mcp"],
1034
- 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."
1035
- },
1036
- {
1037
- slug: "orchestrator",
1038
- name: "\u{1FA83} Orchestrator",
1039
- 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.",
1040
- 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.",
1041
- description: "Coordinate tasks across multiple modes",
1042
- groups: [],
1043
- 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."
1044
- }
1045
- ];
1046
-
1047
- // src/vscode.ts
1048
- import { z as z12 } from "zod";
1049
- var codeActionIds = ["explainCode", "fixCode", "improveCode", "addToContext", "newTask"];
1050
- var terminalActionIds = ["terminalAddToContext", "terminalFixCommand", "terminalExplainCommand"];
1051
- var commandIds = [
1052
- "activationCompleted",
1053
- "plusButtonClicked",
1054
- "promptsButtonClicked",
1055
- "mcpButtonClicked",
1056
- "historyButtonClicked",
1057
- "marketplaceButtonClicked",
1058
- "popoutButtonClicked",
1059
- "accountButtonClicked",
1060
- "settingsButtonClicked",
1061
- "openInNewTab",
1062
- "showHumanRelayDialog",
1063
- "registerHumanRelayCallback",
1064
- "unregisterHumanRelayCallback",
1065
- "handleHumanRelayResponse",
1066
- "newTask",
1067
- "setCustomStoragePath",
1068
- "importSettings",
1069
- "focusInput",
1070
- "acceptInput",
1071
- "focusPanel"
1072
- ];
1073
- var languages = [
1074
- "ca",
1075
- "de",
1076
- "en",
1077
- "es",
1078
- "fr",
1079
- "hi",
1080
- "id",
1081
- "it",
1082
- "ja",
1083
- "ko",
1084
- "nl",
1085
- "pl",
1086
- "pt-BR",
1087
- "ru",
1088
- "tr",
1089
- "vi",
1090
- "zh-CN",
1091
- "zh-TW"
1092
- ];
1093
- var languagesSchema = z12.enum(languages);
1094
- var isLanguage = (value) => languages.includes(value);
1095
-
1096
- // src/global-settings.ts
1097
- var DEFAULT_WRITE_DELAY_MS = 1e3;
1098
- var DEFAULT_TERMINAL_OUTPUT_CHARACTER_LIMIT = 5e4;
1099
- var globalSettingsSchema = z13.object({
1100
- currentApiConfigName: z13.string().optional(),
1101
- listApiConfigMeta: z13.array(providerSettingsEntrySchema).optional(),
1102
- pinnedApiConfigs: z13.record(z13.string(), z13.boolean()).optional(),
1103
- lastShownAnnouncementId: z13.string().optional(),
1104
- customInstructions: z13.string().optional(),
1105
- taskHistory: z13.array(historyItemSchema).optional(),
1106
- condensingApiConfigId: z13.string().optional(),
1107
- customCondensingPrompt: z13.string().optional(),
1108
- autoApprovalEnabled: z13.boolean().optional(),
1109
- alwaysAllowReadOnly: z13.boolean().optional(),
1110
- alwaysAllowReadOnlyOutsideWorkspace: z13.boolean().optional(),
1111
- alwaysAllowWrite: z13.boolean().optional(),
1112
- alwaysAllowWriteOutsideWorkspace: z13.boolean().optional(),
1113
- alwaysAllowWriteProtected: z13.boolean().optional(),
1114
- writeDelayMs: z13.number().min(0).optional(),
1115
- alwaysAllowBrowser: z13.boolean().optional(),
1116
- alwaysApproveResubmit: z13.boolean().optional(),
1117
- requestDelaySeconds: z13.number().optional(),
1118
- alwaysAllowMcp: z13.boolean().optional(),
1119
- alwaysAllowModeSwitch: z13.boolean().optional(),
1120
- alwaysAllowSubtasks: z13.boolean().optional(),
1121
- alwaysAllowExecute: z13.boolean().optional(),
1122
- alwaysAllowFollowupQuestions: z13.boolean().optional(),
1123
- followupAutoApproveTimeoutMs: z13.number().optional(),
1124
- alwaysAllowUpdateTodoList: z13.boolean().optional(),
1125
- allowedCommands: z13.array(z13.string()).optional(),
1126
- deniedCommands: z13.array(z13.string()).optional(),
1127
- commandExecutionTimeout: z13.number().optional(),
1128
- commandTimeoutAllowlist: z13.array(z13.string()).optional(),
1129
- preventCompletionWithOpenTodos: z13.boolean().optional(),
1130
- allowedMaxRequests: z13.number().nullish(),
1131
- allowedMaxCost: z13.number().nullish(),
1132
- autoCondenseContext: z13.boolean().optional(),
1133
- autoCondenseContextPercent: z13.number().optional(),
1134
- maxConcurrentFileReads: z13.number().optional(),
1135
- /**
1136
- * Whether to include diagnostic messages (errors, warnings) in tool outputs
1137
- * @default true
1138
- */
1139
- includeDiagnosticMessages: z13.boolean().optional(),
1140
- /**
1141
- * Maximum number of diagnostic messages to include in tool outputs
1142
- * @default 50
1143
- */
1144
- maxDiagnosticMessages: z13.number().optional(),
1145
- browserToolEnabled: z13.boolean().optional(),
1146
- browserViewportSize: z13.string().optional(),
1147
- screenshotQuality: z13.number().optional(),
1148
- remoteBrowserEnabled: z13.boolean().optional(),
1149
- remoteBrowserHost: z13.string().optional(),
1150
- cachedChromeHostUrl: z13.string().optional(),
1151
- enableCheckpoints: z13.boolean().optional(),
1152
- ttsEnabled: z13.boolean().optional(),
1153
- ttsSpeed: z13.number().optional(),
1154
- soundEnabled: z13.boolean().optional(),
1155
- soundVolume: z13.number().optional(),
1156
- maxOpenTabsContext: z13.number().optional(),
1157
- maxWorkspaceFiles: z13.number().optional(),
1158
- showRooIgnoredFiles: z13.boolean().optional(),
1159
- maxReadFileLine: z13.number().optional(),
1160
- maxImageFileSize: z13.number().optional(),
1161
- maxTotalImageSize: z13.number().optional(),
1162
- terminalOutputLineLimit: z13.number().optional(),
1163
- terminalOutputCharacterLimit: z13.number().optional(),
1164
- terminalShellIntegrationTimeout: z13.number().optional(),
1165
- terminalShellIntegrationDisabled: z13.boolean().optional(),
1166
- terminalCommandDelay: z13.number().optional(),
1167
- terminalPowershellCounter: z13.boolean().optional(),
1168
- terminalZshClearEolMark: z13.boolean().optional(),
1169
- terminalZshOhMy: z13.boolean().optional(),
1170
- terminalZshP10k: z13.boolean().optional(),
1171
- terminalZdotdir: z13.boolean().optional(),
1172
- terminalCompressProgressBar: z13.boolean().optional(),
1173
- diagnosticsEnabled: z13.boolean().optional(),
1174
- rateLimitSeconds: z13.number().optional(),
1175
- diffEnabled: z13.boolean().optional(),
1176
- fuzzyMatchThreshold: z13.number().optional(),
1177
- experiments: experimentsSchema.optional(),
1178
- codebaseIndexModels: codebaseIndexModelsSchema.optional(),
1179
- codebaseIndexConfig: codebaseIndexConfigSchema.optional(),
1180
- language: languagesSchema.optional(),
1181
- telemetrySetting: telemetrySettingsSchema.optional(),
1182
- mcpEnabled: z13.boolean().optional(),
1183
- enableMcpServerCreation: z13.boolean().optional(),
1184
- remoteControlEnabled: z13.boolean().optional(),
1185
- mode: z13.string().optional(),
1186
- modeApiConfigs: z13.record(z13.string(), z13.string()).optional(),
1187
- customModes: z13.array(modeConfigSchema).optional(),
1188
- customModePrompts: customModePromptsSchema.optional(),
1189
- customSupportPrompts: customSupportPromptsSchema.optional(),
1190
- enhancementApiConfigId: z13.string().optional(),
1191
- includeTaskHistoryInEnhance: z13.boolean().optional(),
1192
- historyPreviewCollapsed: z13.boolean().optional(),
1193
- profileThresholds: z13.record(z13.string(), z13.number()).optional(),
1194
- hasOpenedModeSelector: z13.boolean().optional(),
1195
- lastModeExportPath: z13.string().optional(),
1196
- lastModeImportPath: z13.string().optional()
1197
- });
1198
- var GLOBAL_SETTINGS_KEYS = globalSettingsSchema.keyof().options;
1199
- var rooCodeSettingsSchema = providerSettingsSchema.merge(globalSettingsSchema);
1200
- var SECRET_STATE_KEYS = [
1201
- "apiKey",
1202
- "glamaApiKey",
1203
- "openRouterApiKey",
1204
- "awsAccessKey",
1205
- "awsApiKey",
1206
- "awsSecretKey",
1207
- "awsSessionToken",
1208
- "openAiApiKey",
1209
- "geminiApiKey",
1210
- "openAiNativeApiKey",
1211
- "cerebrasApiKey",
1212
- "deepSeekApiKey",
1213
- "doubaoApiKey",
1214
- "moonshotApiKey",
1215
- "mistralApiKey",
1216
- "unboundApiKey",
1217
- "requestyApiKey",
1218
- "xaiApiKey",
1219
- "groqApiKey",
1220
- "chutesApiKey",
1221
- "litellmApiKey",
1222
- "codeIndexOpenAiKey",
1223
- "codeIndexQdrantApiKey",
1224
- "codebaseIndexOpenAiCompatibleApiKey",
1225
- "codebaseIndexGeminiApiKey",
1226
- "codebaseIndexMistralApiKey",
1227
- "huggingFaceApiKey",
1228
- "sambaNovaApiKey",
1229
- "zaiApiKey",
1230
- "fireworksApiKey",
1231
- "featherlessApiKey",
1232
- "ioIntelligenceApiKey"
1233
- ];
1234
- var isSecretStateKey = (key) => SECRET_STATE_KEYS.includes(key);
1235
- var GLOBAL_STATE_KEYS = [...GLOBAL_SETTINGS_KEYS, ...PROVIDER_SETTINGS_KEYS].filter(
1236
- (key) => !SECRET_STATE_KEYS.includes(key)
1237
- );
1238
- var isGlobalStateKey = (key) => GLOBAL_STATE_KEYS.includes(key);
1239
- var EVALS_SETTINGS = {
1240
- apiProvider: "openrouter",
1241
- openRouterUseMiddleOutTransform: false,
1242
- lastShownAnnouncementId: "jul-09-2025-3-23-0",
1243
- pinnedApiConfigs: {},
1244
- autoApprovalEnabled: true,
1245
- alwaysAllowReadOnly: true,
1246
- alwaysAllowReadOnlyOutsideWorkspace: false,
1247
- alwaysAllowWrite: true,
1248
- alwaysAllowWriteOutsideWorkspace: false,
1249
- alwaysAllowWriteProtected: false,
1250
- writeDelayMs: 1e3,
1251
- alwaysAllowBrowser: true,
1252
- alwaysApproveResubmit: true,
1253
- requestDelaySeconds: 10,
1254
- alwaysAllowMcp: true,
1255
- alwaysAllowModeSwitch: true,
1256
- alwaysAllowSubtasks: true,
1257
- alwaysAllowExecute: true,
1258
- alwaysAllowFollowupQuestions: true,
1259
- alwaysAllowUpdateTodoList: true,
1260
- followupAutoApproveTimeoutMs: 0,
1261
- allowedCommands: ["*"],
1262
- commandExecutionTimeout: 20,
1263
- commandTimeoutAllowlist: [],
1264
- preventCompletionWithOpenTodos: false,
1265
- browserToolEnabled: false,
1266
- browserViewportSize: "900x600",
1267
- screenshotQuality: 75,
1268
- remoteBrowserEnabled: false,
1269
- ttsEnabled: false,
1270
- ttsSpeed: 1,
1271
- soundEnabled: false,
1272
- soundVolume: 0.5,
1273
- terminalOutputLineLimit: 500,
1274
- terminalOutputCharacterLimit: DEFAULT_TERMINAL_OUTPUT_CHARACTER_LIMIT,
1275
- terminalShellIntegrationTimeout: 3e4,
1276
- terminalCommandDelay: 0,
1277
- terminalPowershellCounter: false,
1278
- terminalZshOhMy: true,
1279
- terminalZshClearEolMark: true,
1280
- terminalZshP10k: false,
1281
- terminalZdotdir: true,
1282
- terminalCompressProgressBar: true,
1283
- terminalShellIntegrationDisabled: true,
1284
- diagnosticsEnabled: true,
1285
- diffEnabled: true,
1286
- fuzzyMatchThreshold: 1,
1287
- enableCheckpoints: false,
1288
- rateLimitSeconds: 0,
1289
- maxOpenTabsContext: 20,
1290
- maxWorkspaceFiles: 200,
1291
- showRooIgnoredFiles: true,
1292
- maxReadFileLine: -1,
1293
- // -1 to enable full file reading.
1294
- includeDiagnosticMessages: true,
1295
- maxDiagnosticMessages: 50,
1296
- language: "en",
1297
- telemetrySetting: "enabled",
1298
- mcpEnabled: false,
1299
- remoteControlEnabled: false,
1300
- mode: "code",
1301
- // "architect",
1302
- customModes: []
1303
- };
1304
- var EVALS_TIMEOUT = 5 * 60 * 1e3;
1305
-
1306
- // src/ipc.ts
1307
- import { z as z14 } from "zod";
1308
- var IpcMessageType = /* @__PURE__ */ ((IpcMessageType2) => {
1309
- IpcMessageType2["Connect"] = "Connect";
1310
- IpcMessageType2["Disconnect"] = "Disconnect";
1311
- IpcMessageType2["Ack"] = "Ack";
1312
- IpcMessageType2["TaskCommand"] = "TaskCommand";
1313
- IpcMessageType2["TaskEvent"] = "TaskEvent";
1314
- return IpcMessageType2;
1315
- })(IpcMessageType || {});
1316
- var IpcOrigin = /* @__PURE__ */ ((IpcOrigin2) => {
1317
- IpcOrigin2["Client"] = "client";
1318
- IpcOrigin2["Server"] = "server";
1319
- return IpcOrigin2;
1320
- })(IpcOrigin || {});
1321
- var ackSchema = z14.object({
1322
- clientId: z14.string(),
1323
- pid: z14.number(),
1324
- ppid: z14.number()
1325
- });
1326
- var TaskCommandName = /* @__PURE__ */ ((TaskCommandName2) => {
1327
- TaskCommandName2["StartNewTask"] = "StartNewTask";
1328
- TaskCommandName2["CancelTask"] = "CancelTask";
1329
- TaskCommandName2["CloseTask"] = "CloseTask";
1330
- TaskCommandName2["ResumeTask"] = "ResumeTask";
1331
- return TaskCommandName2;
1332
- })(TaskCommandName || {});
1333
- var taskCommandSchema = z14.discriminatedUnion("commandName", [
1334
- z14.object({
1335
- commandName: z14.literal("StartNewTask" /* StartNewTask */),
1336
- data: z14.object({
1337
- configuration: rooCodeSettingsSchema,
1338
- text: z14.string(),
1339
- images: z14.array(z14.string()).optional(),
1340
- newTab: z14.boolean().optional()
1341
- })
1342
- }),
1343
- z14.object({
1344
- commandName: z14.literal("CancelTask" /* CancelTask */),
1345
- data: z14.string()
1346
- }),
1347
- z14.object({
1348
- commandName: z14.literal("CloseTask" /* CloseTask */),
1349
- data: z14.string()
1350
- }),
1351
- z14.object({
1352
- commandName: z14.literal("ResumeTask" /* ResumeTask */),
1353
- data: z14.string()
1354
- })
1355
- ]);
1356
- var ipcMessageSchema = z14.discriminatedUnion("type", [
1357
- z14.object({
1358
- type: z14.literal("Ack" /* Ack */),
1359
- origin: z14.literal("server" /* Server */),
1360
- data: ackSchema
1361
- }),
1362
- z14.object({
1363
- type: z14.literal("TaskCommand" /* TaskCommand */),
1364
- origin: z14.literal("client" /* Client */),
1365
- clientId: z14.string(),
1366
- data: taskCommandSchema
1367
- }),
1368
- z14.object({
1369
- type: z14.literal("TaskEvent" /* TaskEvent */),
1370
- origin: z14.literal("server" /* Server */),
1371
- relayClientId: z14.string().optional(),
1372
- data: taskEventSchema
1373
- })
1374
- ]);
1375
-
1376
- // src/marketplace.ts
1377
- import { z as z15 } from "zod";
1378
- var mcpParameterSchema = z15.object({
1379
- name: z15.string().min(1),
1380
- key: z15.string().min(1),
1381
- placeholder: z15.string().optional(),
1382
- optional: z15.boolean().optional().default(false)
1383
- });
1384
- var mcpInstallationMethodSchema = z15.object({
1385
- name: z15.string().min(1),
1386
- content: z15.string().min(1),
1387
- parameters: z15.array(mcpParameterSchema).optional(),
1388
- prerequisites: z15.array(z15.string()).optional()
1389
- });
1390
- var marketplaceItemTypeSchema = z15.enum(["mode", "mcp"]);
1391
- var baseMarketplaceItemSchema = z15.object({
1392
- id: z15.string().min(1),
1393
- name: z15.string().min(1, "Name is required"),
1394
- description: z15.string(),
1395
- author: z15.string().optional(),
1396
- authorUrl: z15.string().url("Author URL must be a valid URL").optional(),
1397
- tags: z15.array(z15.string()).optional(),
1398
- prerequisites: z15.array(z15.string()).optional()
1399
- });
1400
- var modeMarketplaceItemSchema = baseMarketplaceItemSchema.extend({
1401
- content: z15.string().min(1)
1402
- // YAML content for modes
1403
- });
1404
- var mcpMarketplaceItemSchema = baseMarketplaceItemSchema.extend({
1405
- url: z15.string().url(),
1406
- // Required url field
1407
- content: z15.union([z15.string().min(1), z15.array(mcpInstallationMethodSchema)]),
1408
- // Single config or array of methods
1409
- parameters: z15.array(mcpParameterSchema).optional()
1410
- });
1411
- var marketplaceItemSchema = z15.discriminatedUnion("type", [
1412
- // Mode marketplace item
1413
- modeMarketplaceItemSchema.extend({
1414
- type: z15.literal("mode")
1415
- }),
1416
- // MCP marketplace item
1417
- mcpMarketplaceItemSchema.extend({
1418
- type: z15.literal("mcp")
1419
- })
1420
- ]);
1421
- var installMarketplaceItemOptionsSchema = z15.object({
1422
- target: z15.enum(["global", "project"]).optional().default("project"),
1423
- parameters: z15.record(z15.string(), z15.any()).optional()
1424
- });
1425
-
1426
- // src/mcp.ts
1427
- import { z as z16 } from "zod";
1428
- var mcpExecutionStatusSchema = z16.discriminatedUnion("status", [
1429
- z16.object({
1430
- executionId: z16.string(),
1431
- status: z16.literal("started"),
1432
- serverName: z16.string(),
1433
- toolName: z16.string()
1434
- }),
1435
- z16.object({
1436
- executionId: z16.string(),
1437
- status: z16.literal("output"),
1438
- response: z16.string()
1439
- }),
1440
- z16.object({
1441
- executionId: z16.string(),
1442
- status: z16.literal("completed"),
1443
- response: z16.string().optional()
1444
- }),
1445
- z16.object({
1446
- executionId: z16.string(),
1447
- status: z16.literal("error"),
1448
- error: z16.string().optional()
1449
- })
1450
- ]);
1451
-
1452
- // src/single-file-read-models.ts
1453
- var SINGLE_FILE_READ_MODELS = /* @__PURE__ */ new Set(["roo/sonic"]);
1454
- function shouldUseSingleFileRead(modelId) {
1455
- if (SINGLE_FILE_READ_MODELS.has(modelId)) {
1456
- return true;
1457
- }
1458
- const patterns = Array.from(SINGLE_FILE_READ_MODELS);
1459
- for (const pattern of patterns) {
1460
- if (pattern.endsWith("*") && modelId.startsWith(pattern.slice(0, -1))) {
1461
- return true;
1462
- }
1463
- }
1464
- return false;
1465
- }
1466
-
1467
- // src/task.ts
1468
- import { z as z17 } from "zod";
1469
- var TaskStatus = /* @__PURE__ */ ((TaskStatus2) => {
1470
- TaskStatus2["Running"] = "running";
1471
- TaskStatus2["Interactive"] = "interactive";
1472
- TaskStatus2["Resumable"] = "resumable";
1473
- TaskStatus2["Idle"] = "idle";
1474
- TaskStatus2["None"] = "none";
1475
- return TaskStatus2;
1476
- })(TaskStatus || {});
1477
- var taskMetadataSchema = z17.object({
1478
- task: z17.string().optional(),
1479
- images: z17.array(z17.string()).optional()
1480
- });
1481
-
1482
- // src/todo.ts
1483
- import { z as z18 } from "zod";
1484
- var todoStatusSchema = z18.enum(["pending", "in_progress", "completed"]);
1485
- var todoItemSchema = z18.object({
1486
- id: z18.string(),
1487
- content: z18.string(),
1488
- status: todoStatusSchema
1489
- });
1490
-
1491
- // src/terminal.ts
1492
- import { z as z19 } from "zod";
1493
- var commandExecutionStatusSchema = z19.discriminatedUnion("status", [
1494
- z19.object({
1495
- executionId: z19.string(),
1496
- status: z19.literal("started"),
1497
- pid: z19.number().optional(),
1498
- command: z19.string()
1499
- }),
1500
- z19.object({
1501
- executionId: z19.string(),
1502
- status: z19.literal("output"),
1503
- output: z19.string()
1504
- }),
1505
- z19.object({
1506
- executionId: z19.string(),
1507
- status: z19.literal("exited"),
1508
- exitCode: z19.number().optional()
1509
- }),
1510
- z19.object({
1511
- executionId: z19.string(),
1512
- status: z19.literal("fallback")
1513
- }),
1514
- z19.object({
1515
- executionId: z19.string(),
1516
- status: z19.literal("timeout")
1517
- })
1518
- ]);
1519
-
1520
427
  // src/providers/anthropic.ts
1521
428
  var anthropicDefaultModelId = "claude-sonnet-4-20250514";
1522
429
  var anthropicModels = {
@@ -2098,6 +1005,7 @@ var BEDROCK_REGIONS = [
2098
1005
  { value: "us-gov-east-1", label: "us-gov-east-1" },
2099
1006
  { value: "us-gov-west-1", label: "us-gov-west-1" }
2100
1007
  ].sort((a, b) => a.value.localeCompare(b.value));
1008
+ var BEDROCK_CLAUDE_SONNET_4_MODEL_ID = "anthropic.claude-sonnet-4-20250514-v1:0";
2101
1009
 
2102
1010
  // src/providers/cerebras.ts
2103
1011
  var cerebrasDefaultModelId = "qwen-3-coder-480b-free";
@@ -2477,49 +1385,238 @@ var claudeCodeModels = {
2477
1385
  "claude-3-5-haiku-20241022": {
2478
1386
  ...anthropicModels["claude-3-5-haiku-20241022"],
2479
1387
  supportsImages: false,
2480
- supportsPromptCache: true,
2481
- // Claude Code does report cache tokens
2482
- supportsReasoningEffort: false,
2483
- supportsReasoningBudget: false,
2484
- requiredReasoningBudget: false
2485
- }
2486
- };
2487
-
2488
- // src/providers/deepseek.ts
2489
- var deepSeekDefaultModelId = "deepseek-chat";
2490
- var deepSeekModels = {
2491
- "deepseek-chat": {
2492
- maxTokens: 8192,
2493
- contextWindow: 64e3,
1388
+ supportsPromptCache: true,
1389
+ // Claude Code does report cache tokens
1390
+ supportsReasoningEffort: false,
1391
+ supportsReasoningBudget: false,
1392
+ requiredReasoningBudget: false
1393
+ }
1394
+ };
1395
+
1396
+ // src/providers/deepseek.ts
1397
+ var deepSeekDefaultModelId = "deepseek-chat";
1398
+ var deepSeekModels = {
1399
+ "deepseek-chat": {
1400
+ maxTokens: 8192,
1401
+ contextWindow: 64e3,
1402
+ supportsImages: false,
1403
+ supportsPromptCache: true,
1404
+ inputPrice: 0.27,
1405
+ // $0.27 per million tokens (cache miss)
1406
+ outputPrice: 1.1,
1407
+ // $1.10 per million tokens
1408
+ cacheWritesPrice: 0.27,
1409
+ // $0.27 per million tokens (cache miss)
1410
+ cacheReadsPrice: 0.07,
1411
+ // $0.07 per million tokens (cache hit).
1412
+ 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.`
1413
+ },
1414
+ "deepseek-reasoner": {
1415
+ maxTokens: 8192,
1416
+ contextWindow: 64e3,
1417
+ supportsImages: false,
1418
+ supportsPromptCache: true,
1419
+ inputPrice: 0.55,
1420
+ // $0.55 per million tokens (cache miss)
1421
+ outputPrice: 2.19,
1422
+ // $2.19 per million tokens
1423
+ cacheWritesPrice: 0.55,
1424
+ // $0.55 per million tokens (cache miss)
1425
+ cacheReadsPrice: 0.14,
1426
+ // $0.14 per million tokens (cache hit)
1427
+ 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.`
1428
+ }
1429
+ };
1430
+ var DEEP_SEEK_DEFAULT_TEMPERATURE = 0.6;
1431
+
1432
+ // src/providers/doubao.ts
1433
+ var doubaoDefaultModelId = "doubao-seed-1-6-250615";
1434
+ var doubaoModels = {
1435
+ "doubao-seed-1-6-250615": {
1436
+ maxTokens: 32768,
1437
+ contextWindow: 128e3,
1438
+ supportsImages: true,
1439
+ supportsPromptCache: true,
1440
+ inputPrice: 1e-4,
1441
+ // $0.0001 per million tokens (cache miss)
1442
+ outputPrice: 4e-4,
1443
+ // $0.0004 per million tokens
1444
+ cacheWritesPrice: 1e-4,
1445
+ // $0.0001 per million tokens (cache miss)
1446
+ cacheReadsPrice: 2e-5,
1447
+ // $0.00002 per million tokens (cache hit)
1448
+ description: `Doubao Seed 1.6 is a powerful model designed for high-performance tasks with extensive context handling.`
1449
+ },
1450
+ "doubao-seed-1-6-thinking-250715": {
1451
+ maxTokens: 32768,
1452
+ contextWindow: 128e3,
1453
+ supportsImages: true,
1454
+ supportsPromptCache: true,
1455
+ inputPrice: 2e-4,
1456
+ // $0.0002 per million tokens
1457
+ outputPrice: 8e-4,
1458
+ // $0.0008 per million tokens
1459
+ cacheWritesPrice: 2e-4,
1460
+ // $0.0002 per million
1461
+ cacheReadsPrice: 4e-5,
1462
+ // $0.00004 per million tokens (cache hit)
1463
+ description: `Doubao Seed 1.6 Thinking is optimized for reasoning tasks, providing enhanced performance in complex problem-solving scenarios.`
1464
+ },
1465
+ "doubao-seed-1-6-flash-250715": {
1466
+ maxTokens: 32768,
1467
+ contextWindow: 128e3,
1468
+ supportsImages: true,
1469
+ supportsPromptCache: true,
1470
+ inputPrice: 15e-5,
1471
+ // $0.00015 per million tokens
1472
+ outputPrice: 6e-4,
1473
+ // $0.0006 per million tokens
1474
+ cacheWritesPrice: 15e-5,
1475
+ // $0.00015 per million
1476
+ cacheReadsPrice: 3e-5,
1477
+ // $0.00003 per million tokens (cache hit)
1478
+ description: `Doubao Seed 1.6 Flash is tailored for speed and efficiency, making it ideal for applications requiring rapid responses.`
1479
+ }
1480
+ };
1481
+ var doubaoDefaultModelInfo = doubaoModels[doubaoDefaultModelId];
1482
+ var DOUBAO_API_BASE_URL = "https://ark.cn-beijing.volces.com/api/v3";
1483
+ var DOUBAO_API_CHAT_PATH = "/chat/completions";
1484
+
1485
+ // src/providers/featherless.ts
1486
+ var featherlessModels = {
1487
+ "deepseek-ai/DeepSeek-V3-0324": {
1488
+ maxTokens: 4096,
1489
+ contextWindow: 32678,
1490
+ supportsImages: false,
1491
+ supportsPromptCache: false,
1492
+ inputPrice: 0,
1493
+ outputPrice: 0,
1494
+ description: "DeepSeek V3 0324 model."
1495
+ },
1496
+ "deepseek-ai/DeepSeek-R1-0528": {
1497
+ maxTokens: 4096,
1498
+ contextWindow: 32678,
1499
+ supportsImages: false,
1500
+ supportsPromptCache: false,
1501
+ inputPrice: 0,
1502
+ outputPrice: 0,
1503
+ description: "DeepSeek R1 0528 model."
1504
+ },
1505
+ "moonshotai/Kimi-K2-Instruct": {
1506
+ maxTokens: 4096,
1507
+ contextWindow: 32678,
1508
+ supportsImages: false,
1509
+ supportsPromptCache: false,
1510
+ inputPrice: 0,
1511
+ outputPrice: 0,
1512
+ description: "Kimi K2 Instruct model."
1513
+ },
1514
+ "openai/gpt-oss-120b": {
1515
+ maxTokens: 4096,
1516
+ contextWindow: 32678,
1517
+ supportsImages: false,
1518
+ supportsPromptCache: false,
1519
+ inputPrice: 0,
1520
+ outputPrice: 0,
1521
+ description: "GPT-OSS 120B model."
1522
+ },
1523
+ "Qwen/Qwen3-Coder-480B-A35B-Instruct": {
1524
+ maxTokens: 4096,
1525
+ contextWindow: 32678,
1526
+ supportsImages: false,
1527
+ supportsPromptCache: false,
1528
+ inputPrice: 0,
1529
+ outputPrice: 0,
1530
+ description: "Qwen3 Coder 480B A35B Instruct model."
1531
+ }
1532
+ };
1533
+ var featherlessDefaultModelId = "deepseek-ai/DeepSeek-R1-0528";
1534
+
1535
+ // src/providers/fireworks.ts
1536
+ var fireworksDefaultModelId = "accounts/fireworks/models/kimi-k2-instruct";
1537
+ var fireworksModels = {
1538
+ "accounts/fireworks/models/kimi-k2-instruct": {
1539
+ maxTokens: 16384,
1540
+ contextWindow: 128e3,
1541
+ supportsImages: false,
1542
+ supportsPromptCache: false,
1543
+ inputPrice: 0.6,
1544
+ outputPrice: 2.5,
1545
+ 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."
1546
+ },
1547
+ "accounts/fireworks/models/qwen3-235b-a22b-instruct-2507": {
1548
+ maxTokens: 32768,
1549
+ contextWindow: 256e3,
1550
+ supportsImages: false,
1551
+ supportsPromptCache: false,
1552
+ inputPrice: 0.22,
1553
+ outputPrice: 0.88,
1554
+ description: "Latest Qwen3 thinking model, competitive against the best closed source models in Jul 2025."
1555
+ },
1556
+ "accounts/fireworks/models/qwen3-coder-480b-a35b-instruct": {
1557
+ maxTokens: 32768,
1558
+ contextWindow: 256e3,
1559
+ supportsImages: false,
1560
+ supportsPromptCache: false,
1561
+ inputPrice: 0.45,
1562
+ outputPrice: 1.8,
1563
+ description: "Qwen3's most agentic code model to date."
1564
+ },
1565
+ "accounts/fireworks/models/deepseek-r1-0528": {
1566
+ maxTokens: 20480,
1567
+ contextWindow: 16e4,
1568
+ supportsImages: false,
1569
+ supportsPromptCache: false,
1570
+ inputPrice: 3,
1571
+ outputPrice: 8,
1572
+ 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."
1573
+ },
1574
+ "accounts/fireworks/models/deepseek-v3": {
1575
+ maxTokens: 16384,
1576
+ contextWindow: 128e3,
1577
+ supportsImages: false,
1578
+ supportsPromptCache: false,
1579
+ inputPrice: 0.9,
1580
+ outputPrice: 0.9,
1581
+ 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."
1582
+ },
1583
+ "accounts/fireworks/models/glm-4p5": {
1584
+ maxTokens: 16384,
1585
+ contextWindow: 128e3,
2494
1586
  supportsImages: false,
2495
- supportsPromptCache: true,
2496
- inputPrice: 0.27,
2497
- // $0.27 per million tokens (cache miss)
2498
- outputPrice: 1.1,
2499
- // $1.10 per million tokens
2500
- cacheWritesPrice: 0.27,
2501
- // $0.27 per million tokens (cache miss)
2502
- cacheReadsPrice: 0.07,
2503
- // $0.07 per million tokens (cache hit).
2504
- 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.`
1587
+ supportsPromptCache: false,
1588
+ inputPrice: 0.55,
1589
+ outputPrice: 2.19,
1590
+ description: "Z.ai GLM-4.5 with 355B total parameters and 32B active parameters. Features unified reasoning, coding, and intelligent agent capabilities."
2505
1591
  },
2506
- "deepseek-reasoner": {
2507
- maxTokens: 8192,
2508
- contextWindow: 64e3,
1592
+ "accounts/fireworks/models/glm-4p5-air": {
1593
+ maxTokens: 16384,
1594
+ contextWindow: 128e3,
2509
1595
  supportsImages: false,
2510
- supportsPromptCache: true,
1596
+ supportsPromptCache: false,
2511
1597
  inputPrice: 0.55,
2512
- // $0.55 per million tokens (cache miss)
2513
1598
  outputPrice: 2.19,
2514
- // $2.19 per million tokens
2515
- cacheWritesPrice: 0.55,
2516
- // $0.55 per million tokens (cache miss)
2517
- cacheReadsPrice: 0.14,
2518
- // $0.14 per million tokens (cache hit)
2519
- 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.`
1599
+ description: "Z.ai GLM-4.5-Air with 106B total parameters and 12B active parameters. Features unified reasoning, coding, and intelligent agent capabilities."
1600
+ },
1601
+ "accounts/fireworks/models/gpt-oss-20b": {
1602
+ maxTokens: 16384,
1603
+ contextWindow: 128e3,
1604
+ supportsImages: false,
1605
+ supportsPromptCache: false,
1606
+ inputPrice: 0.07,
1607
+ outputPrice: 0.3,
1608
+ 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."
1609
+ },
1610
+ "accounts/fireworks/models/gpt-oss-120b": {
1611
+ maxTokens: 16384,
1612
+ contextWindow: 128e3,
1613
+ supportsImages: false,
1614
+ supportsPromptCache: false,
1615
+ inputPrice: 0.15,
1616
+ outputPrice: 0.6,
1617
+ 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."
2520
1618
  }
2521
1619
  };
2522
- var DEEP_SEEK_DEFAULT_TEMPERATURE = 0.6;
2523
1620
 
2524
1621
  // src/providers/gemini.ts
2525
1622
  var geminiDefaultModelId = "gemini-2.0-flash-001";
@@ -3502,6 +2599,20 @@ var requestyDefaultModelInfo = {
3502
2599
  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."
3503
2600
  };
3504
2601
 
2602
+ // src/providers/roo.ts
2603
+ var rooDefaultModelId = "roo/sonic";
2604
+ var rooModels = {
2605
+ "roo/sonic": {
2606
+ maxTokens: 16384,
2607
+ contextWindow: 262144,
2608
+ supportsImages: false,
2609
+ supportsPromptCache: true,
2610
+ inputPrice: 0,
2611
+ outputPrice: 0,
2612
+ 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.)"
2613
+ }
2614
+ };
2615
+
3505
2616
  // src/providers/sambanova.ts
3506
2617
  var sambaNovaDefaultModelId = "Meta-Llama-3.3-70B-Instruct";
3507
2618
  var sambaNovaModels = {
@@ -4055,431 +3166,1410 @@ var vscodeLlmModels = {
4055
3166
  supportsToolCalling: true,
4056
3167
  maxInputTokens: 108637
4057
3168
  },
4058
- "o4-mini": {
4059
- contextWindow: 128e3,
3169
+ "o4-mini": {
3170
+ contextWindow: 128e3,
3171
+ supportsImages: false,
3172
+ supportsPromptCache: false,
3173
+ inputPrice: 0,
3174
+ outputPrice: 0,
3175
+ family: "o4-mini",
3176
+ version: "o4-mini-2025-04-16",
3177
+ name: "o4-mini (Preview)",
3178
+ supportsToolCalling: true,
3179
+ maxInputTokens: 111452
3180
+ },
3181
+ "gpt-4.1": {
3182
+ contextWindow: 128e3,
3183
+ supportsImages: true,
3184
+ supportsPromptCache: false,
3185
+ inputPrice: 0,
3186
+ outputPrice: 0,
3187
+ family: "gpt-4.1",
3188
+ version: "gpt-4.1-2025-04-14",
3189
+ name: "GPT-4.1 (Preview)",
3190
+ supportsToolCalling: true,
3191
+ maxInputTokens: 111452
3192
+ },
3193
+ "gpt-5-mini": {
3194
+ contextWindow: 128e3,
3195
+ supportsImages: true,
3196
+ supportsPromptCache: false,
3197
+ inputPrice: 0,
3198
+ outputPrice: 0,
3199
+ family: "gpt-5-mini",
3200
+ version: "gpt-5-mini",
3201
+ name: "GPT-5 mini (Preview)",
3202
+ supportsToolCalling: true,
3203
+ maxInputTokens: 108637
3204
+ },
3205
+ "gpt-5": {
3206
+ contextWindow: 128e3,
3207
+ supportsImages: true,
3208
+ supportsPromptCache: false,
3209
+ inputPrice: 0,
3210
+ outputPrice: 0,
3211
+ family: "gpt-5",
3212
+ version: "gpt-5",
3213
+ name: "GPT-5 (Preview)",
3214
+ supportsToolCalling: true,
3215
+ maxInputTokens: 108637
3216
+ }
3217
+ };
3218
+
3219
+ // src/providers/xai.ts
3220
+ var xaiDefaultModelId = "grok-4";
3221
+ var xaiModels = {
3222
+ "grok-4": {
3223
+ maxTokens: 8192,
3224
+ contextWindow: 256e3,
3225
+ supportsImages: true,
3226
+ supportsPromptCache: true,
3227
+ inputPrice: 3,
3228
+ outputPrice: 15,
3229
+ cacheWritesPrice: 0.75,
3230
+ cacheReadsPrice: 0.75,
3231
+ description: "xAI's Grok-4 model with 256K context window"
3232
+ },
3233
+ "grok-3": {
3234
+ maxTokens: 8192,
3235
+ contextWindow: 131072,
3236
+ supportsImages: false,
3237
+ supportsPromptCache: true,
3238
+ inputPrice: 3,
3239
+ outputPrice: 15,
3240
+ cacheWritesPrice: 0.75,
3241
+ cacheReadsPrice: 0.75,
3242
+ description: "xAI's Grok-3 model with 128K context window"
3243
+ },
3244
+ "grok-3-fast": {
3245
+ maxTokens: 8192,
3246
+ contextWindow: 131072,
3247
+ supportsImages: false,
3248
+ supportsPromptCache: true,
3249
+ inputPrice: 5,
3250
+ outputPrice: 25,
3251
+ cacheWritesPrice: 1.25,
3252
+ cacheReadsPrice: 1.25,
3253
+ description: "xAI's Grok-3 fast model with 128K context window"
3254
+ },
3255
+ "grok-3-mini": {
3256
+ maxTokens: 8192,
3257
+ contextWindow: 131072,
3258
+ supportsImages: false,
3259
+ supportsPromptCache: true,
3260
+ inputPrice: 0.3,
3261
+ outputPrice: 0.5,
3262
+ cacheWritesPrice: 0.07,
3263
+ cacheReadsPrice: 0.07,
3264
+ description: "xAI's Grok-3 mini model with 128K context window",
3265
+ supportsReasoningEffort: true
3266
+ },
3267
+ "grok-3-mini-fast": {
3268
+ maxTokens: 8192,
3269
+ contextWindow: 131072,
3270
+ supportsImages: false,
3271
+ supportsPromptCache: true,
3272
+ inputPrice: 0.6,
3273
+ outputPrice: 4,
3274
+ cacheWritesPrice: 0.15,
3275
+ cacheReadsPrice: 0.15,
3276
+ description: "xAI's Grok-3 mini fast model with 128K context window",
3277
+ supportsReasoningEffort: true
3278
+ },
3279
+ "grok-2-1212": {
3280
+ maxTokens: 8192,
3281
+ contextWindow: 131072,
3282
+ supportsImages: false,
3283
+ supportsPromptCache: false,
3284
+ inputPrice: 2,
3285
+ outputPrice: 10,
3286
+ description: "xAI's Grok-2 model (version 1212) with 128K context window"
3287
+ },
3288
+ "grok-2-vision-1212": {
3289
+ maxTokens: 8192,
3290
+ contextWindow: 32768,
3291
+ supportsImages: true,
3292
+ supportsPromptCache: false,
3293
+ inputPrice: 2,
3294
+ outputPrice: 10,
3295
+ description: "xAI's Grok-2 Vision model (version 1212) with image support and 32K context window"
3296
+ }
3297
+ };
3298
+
3299
+ // src/providers/zai.ts
3300
+ var internationalZAiDefaultModelId = "glm-4.5";
3301
+ var internationalZAiModels = {
3302
+ "glm-4.5": {
3303
+ maxTokens: 98304,
3304
+ contextWindow: 131072,
3305
+ supportsImages: false,
3306
+ supportsPromptCache: true,
3307
+ inputPrice: 0.6,
3308
+ outputPrice: 2.2,
3309
+ cacheWritesPrice: 0,
3310
+ cacheReadsPrice: 0.11,
3311
+ 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."
3312
+ },
3313
+ "glm-4.5-air": {
3314
+ maxTokens: 98304,
3315
+ contextWindow: 131072,
3316
+ supportsImages: false,
3317
+ supportsPromptCache: true,
3318
+ inputPrice: 0.2,
3319
+ outputPrice: 1.1,
3320
+ cacheWritesPrice: 0,
3321
+ cacheReadsPrice: 0.03,
3322
+ 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."
3323
+ }
3324
+ };
3325
+ var mainlandZAiDefaultModelId = "glm-4.5";
3326
+ var mainlandZAiModels = {
3327
+ "glm-4.5": {
3328
+ maxTokens: 98304,
3329
+ contextWindow: 131072,
3330
+ supportsImages: false,
3331
+ supportsPromptCache: true,
3332
+ inputPrice: 0.29,
3333
+ outputPrice: 1.14,
3334
+ cacheWritesPrice: 0,
3335
+ cacheReadsPrice: 0.057,
3336
+ 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.",
3337
+ tiers: [
3338
+ {
3339
+ contextWindow: 32e3,
3340
+ inputPrice: 0.21,
3341
+ outputPrice: 1,
3342
+ cacheReadsPrice: 0.043
3343
+ },
3344
+ {
3345
+ contextWindow: 128e3,
3346
+ inputPrice: 0.29,
3347
+ outputPrice: 1.14,
3348
+ cacheReadsPrice: 0.057
3349
+ },
3350
+ {
3351
+ contextWindow: Infinity,
3352
+ inputPrice: 0.29,
3353
+ outputPrice: 1.14,
3354
+ cacheReadsPrice: 0.057
3355
+ }
3356
+ ]
3357
+ },
3358
+ "glm-4.5-air": {
3359
+ maxTokens: 98304,
3360
+ contextWindow: 131072,
4060
3361
  supportsImages: false,
4061
- supportsPromptCache: false,
4062
- inputPrice: 0,
4063
- outputPrice: 0,
4064
- family: "o4-mini",
4065
- version: "o4-mini-2025-04-16",
4066
- name: "o4-mini (Preview)",
4067
- supportsToolCalling: true,
4068
- maxInputTokens: 111452
4069
- },
4070
- "gpt-4.1": {
4071
- contextWindow: 128e3,
4072
- supportsImages: true,
4073
- supportsPromptCache: false,
4074
- inputPrice: 0,
4075
- outputPrice: 0,
4076
- family: "gpt-4.1",
4077
- version: "gpt-4.1-2025-04-14",
4078
- name: "GPT-4.1 (Preview)",
4079
- supportsToolCalling: true,
4080
- maxInputTokens: 111452
4081
- },
4082
- "gpt-5-mini": {
4083
- contextWindow: 128e3,
4084
- supportsImages: true,
4085
- supportsPromptCache: false,
4086
- inputPrice: 0,
4087
- outputPrice: 0,
4088
- family: "gpt-5-mini",
4089
- version: "gpt-5-mini",
4090
- name: "GPT-5 mini (Preview)",
4091
- supportsToolCalling: true,
4092
- maxInputTokens: 108637
4093
- },
4094
- "gpt-5": {
4095
- contextWindow: 128e3,
4096
- supportsImages: true,
4097
- supportsPromptCache: false,
4098
- inputPrice: 0,
4099
- outputPrice: 0,
4100
- family: "gpt-5",
4101
- version: "gpt-5",
4102
- name: "GPT-5 (Preview)",
4103
- supportsToolCalling: true,
4104
- maxInputTokens: 108637
3362
+ supportsPromptCache: true,
3363
+ inputPrice: 0.1,
3364
+ outputPrice: 0.6,
3365
+ cacheWritesPrice: 0,
3366
+ cacheReadsPrice: 0.02,
3367
+ 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.",
3368
+ tiers: [
3369
+ {
3370
+ contextWindow: 32e3,
3371
+ inputPrice: 0.07,
3372
+ outputPrice: 0.4,
3373
+ cacheReadsPrice: 0.014
3374
+ },
3375
+ {
3376
+ contextWindow: 128e3,
3377
+ inputPrice: 0.1,
3378
+ outputPrice: 0.6,
3379
+ cacheReadsPrice: 0.02
3380
+ },
3381
+ {
3382
+ contextWindow: Infinity,
3383
+ inputPrice: 0.1,
3384
+ outputPrice: 0.6,
3385
+ cacheReadsPrice: 0.02
3386
+ }
3387
+ ]
3388
+ }
3389
+ };
3390
+ var ZAI_DEFAULT_TEMPERATURE = 0;
3391
+
3392
+ // src/provider-settings.ts
3393
+ var providerNames = [
3394
+ "anthropic",
3395
+ "claude-code",
3396
+ "glama",
3397
+ "openrouter",
3398
+ "bedrock",
3399
+ "vertex",
3400
+ "openai",
3401
+ "ollama",
3402
+ "vscode-lm",
3403
+ "lmstudio",
3404
+ "gemini",
3405
+ "gemini-cli",
3406
+ "openai-native",
3407
+ "mistral",
3408
+ "moonshot",
3409
+ "deepseek",
3410
+ "doubao",
3411
+ "unbound",
3412
+ "requesty",
3413
+ "human-relay",
3414
+ "fake-ai",
3415
+ "xai",
3416
+ "groq",
3417
+ "chutes",
3418
+ "litellm",
3419
+ "huggingface",
3420
+ "cerebras",
3421
+ "sambanova",
3422
+ "zai",
3423
+ "fireworks",
3424
+ "featherless",
3425
+ "io-intelligence",
3426
+ "roo"
3427
+ ];
3428
+ var providerNamesSchema = z8.enum(providerNames);
3429
+ var providerSettingsEntrySchema = z8.object({
3430
+ id: z8.string(),
3431
+ name: z8.string(),
3432
+ apiProvider: providerNamesSchema.optional()
3433
+ });
3434
+ var DEFAULT_CONSECUTIVE_MISTAKE_LIMIT = 3;
3435
+ var baseProviderSettingsSchema = z8.object({
3436
+ includeMaxTokens: z8.boolean().optional(),
3437
+ diffEnabled: z8.boolean().optional(),
3438
+ todoListEnabled: z8.boolean().optional(),
3439
+ fuzzyMatchThreshold: z8.number().optional(),
3440
+ modelTemperature: z8.number().nullish(),
3441
+ rateLimitSeconds: z8.number().optional(),
3442
+ consecutiveMistakeLimit: z8.number().min(0).optional(),
3443
+ // Model reasoning.
3444
+ enableReasoningEffort: z8.boolean().optional(),
3445
+ reasoningEffort: reasoningEffortWithMinimalSchema.optional(),
3446
+ modelMaxTokens: z8.number().optional(),
3447
+ modelMaxThinkingTokens: z8.number().optional(),
3448
+ // Model verbosity.
3449
+ verbosity: verbosityLevelsSchema.optional()
3450
+ });
3451
+ var apiModelIdProviderModelSchema = baseProviderSettingsSchema.extend({
3452
+ apiModelId: z8.string().optional()
3453
+ });
3454
+ var anthropicSchema = apiModelIdProviderModelSchema.extend({
3455
+ apiKey: z8.string().optional(),
3456
+ anthropicBaseUrl: z8.string().optional(),
3457
+ anthropicUseAuthToken: z8.boolean().optional(),
3458
+ anthropicBeta1MContext: z8.boolean().optional()
3459
+ // Enable 'context-1m-2025-08-07' beta for 1M context window
3460
+ });
3461
+ var claudeCodeSchema = apiModelIdProviderModelSchema.extend({
3462
+ claudeCodePath: z8.string().optional(),
3463
+ claudeCodeMaxOutputTokens: z8.number().int().min(1).max(2e5).optional()
3464
+ });
3465
+ var glamaSchema = baseProviderSettingsSchema.extend({
3466
+ glamaModelId: z8.string().optional(),
3467
+ glamaApiKey: z8.string().optional()
3468
+ });
3469
+ var openRouterSchema = baseProviderSettingsSchema.extend({
3470
+ openRouterApiKey: z8.string().optional(),
3471
+ openRouterModelId: z8.string().optional(),
3472
+ openRouterBaseUrl: z8.string().optional(),
3473
+ openRouterSpecificProvider: z8.string().optional(),
3474
+ openRouterUseMiddleOutTransform: z8.boolean().optional()
3475
+ });
3476
+ var bedrockSchema = apiModelIdProviderModelSchema.extend({
3477
+ awsAccessKey: z8.string().optional(),
3478
+ awsSecretKey: z8.string().optional(),
3479
+ awsSessionToken: z8.string().optional(),
3480
+ awsRegion: z8.string().optional(),
3481
+ awsUseCrossRegionInference: z8.boolean().optional(),
3482
+ awsUsePromptCache: z8.boolean().optional(),
3483
+ awsProfile: z8.string().optional(),
3484
+ awsUseProfile: z8.boolean().optional(),
3485
+ awsApiKey: z8.string().optional(),
3486
+ awsUseApiKey: z8.boolean().optional(),
3487
+ awsCustomArn: z8.string().optional(),
3488
+ awsModelContextWindow: z8.number().optional(),
3489
+ awsBedrockEndpointEnabled: z8.boolean().optional(),
3490
+ awsBedrockEndpoint: z8.string().optional(),
3491
+ awsBedrock1MContext: z8.boolean().optional()
3492
+ // Enable 'context-1m-2025-08-07' beta for 1M context window
3493
+ });
3494
+ var vertexSchema = apiModelIdProviderModelSchema.extend({
3495
+ vertexKeyFile: z8.string().optional(),
3496
+ vertexJsonCredentials: z8.string().optional(),
3497
+ vertexProjectId: z8.string().optional(),
3498
+ vertexRegion: z8.string().optional()
3499
+ });
3500
+ var openAiSchema = baseProviderSettingsSchema.extend({
3501
+ openAiBaseUrl: z8.string().optional(),
3502
+ openAiApiKey: z8.string().optional(),
3503
+ openAiLegacyFormat: z8.boolean().optional(),
3504
+ openAiR1FormatEnabled: z8.boolean().optional(),
3505
+ openAiModelId: z8.string().optional(),
3506
+ openAiCustomModelInfo: modelInfoSchema.nullish(),
3507
+ openAiUseAzure: z8.boolean().optional(),
3508
+ azureApiVersion: z8.string().optional(),
3509
+ openAiStreamingEnabled: z8.boolean().optional(),
3510
+ openAiHostHeader: z8.string().optional(),
3511
+ // Keep temporarily for backward compatibility during migration.
3512
+ openAiHeaders: z8.record(z8.string(), z8.string()).optional()
3513
+ });
3514
+ var ollamaSchema = baseProviderSettingsSchema.extend({
3515
+ ollamaModelId: z8.string().optional(),
3516
+ ollamaBaseUrl: z8.string().optional()
3517
+ });
3518
+ var vsCodeLmSchema = baseProviderSettingsSchema.extend({
3519
+ vsCodeLmModelSelector: z8.object({
3520
+ vendor: z8.string().optional(),
3521
+ family: z8.string().optional(),
3522
+ version: z8.string().optional(),
3523
+ id: z8.string().optional()
3524
+ }).optional()
3525
+ });
3526
+ var lmStudioSchema = baseProviderSettingsSchema.extend({
3527
+ lmStudioModelId: z8.string().optional(),
3528
+ lmStudioBaseUrl: z8.string().optional(),
3529
+ lmStudioDraftModelId: z8.string().optional(),
3530
+ lmStudioSpeculativeDecodingEnabled: z8.boolean().optional()
3531
+ });
3532
+ var geminiSchema = apiModelIdProviderModelSchema.extend({
3533
+ geminiApiKey: z8.string().optional(),
3534
+ googleGeminiBaseUrl: z8.string().optional(),
3535
+ enableUrlContext: z8.boolean().optional(),
3536
+ enableGrounding: z8.boolean().optional()
3537
+ });
3538
+ var geminiCliSchema = apiModelIdProviderModelSchema.extend({
3539
+ geminiCliOAuthPath: z8.string().optional(),
3540
+ geminiCliProjectId: z8.string().optional()
3541
+ });
3542
+ var openAiNativeSchema = apiModelIdProviderModelSchema.extend({
3543
+ openAiNativeApiKey: z8.string().optional(),
3544
+ openAiNativeBaseUrl: z8.string().optional()
3545
+ });
3546
+ var mistralSchema = apiModelIdProviderModelSchema.extend({
3547
+ mistralApiKey: z8.string().optional(),
3548
+ mistralCodestralUrl: z8.string().optional()
3549
+ });
3550
+ var deepSeekSchema = apiModelIdProviderModelSchema.extend({
3551
+ deepSeekBaseUrl: z8.string().optional(),
3552
+ deepSeekApiKey: z8.string().optional()
3553
+ });
3554
+ var doubaoSchema = apiModelIdProviderModelSchema.extend({
3555
+ doubaoBaseUrl: z8.string().optional(),
3556
+ doubaoApiKey: z8.string().optional()
3557
+ });
3558
+ var moonshotSchema = apiModelIdProviderModelSchema.extend({
3559
+ moonshotBaseUrl: z8.union([z8.literal("https://api.moonshot.ai/v1"), z8.literal("https://api.moonshot.cn/v1")]).optional(),
3560
+ moonshotApiKey: z8.string().optional()
3561
+ });
3562
+ var unboundSchema = baseProviderSettingsSchema.extend({
3563
+ unboundApiKey: z8.string().optional(),
3564
+ unboundModelId: z8.string().optional()
3565
+ });
3566
+ var requestySchema = baseProviderSettingsSchema.extend({
3567
+ requestyBaseUrl: z8.string().optional(),
3568
+ requestyApiKey: z8.string().optional(),
3569
+ requestyModelId: z8.string().optional()
3570
+ });
3571
+ var humanRelaySchema = baseProviderSettingsSchema;
3572
+ var fakeAiSchema = baseProviderSettingsSchema.extend({
3573
+ fakeAi: z8.unknown().optional()
3574
+ });
3575
+ var xaiSchema = apiModelIdProviderModelSchema.extend({
3576
+ xaiApiKey: z8.string().optional()
3577
+ });
3578
+ var groqSchema = apiModelIdProviderModelSchema.extend({
3579
+ groqApiKey: z8.string().optional()
3580
+ });
3581
+ var huggingFaceSchema = baseProviderSettingsSchema.extend({
3582
+ huggingFaceApiKey: z8.string().optional(),
3583
+ huggingFaceModelId: z8.string().optional(),
3584
+ huggingFaceInferenceProvider: z8.string().optional()
3585
+ });
3586
+ var chutesSchema = apiModelIdProviderModelSchema.extend({
3587
+ chutesApiKey: z8.string().optional()
3588
+ });
3589
+ var litellmSchema = baseProviderSettingsSchema.extend({
3590
+ litellmBaseUrl: z8.string().optional(),
3591
+ litellmApiKey: z8.string().optional(),
3592
+ litellmModelId: z8.string().optional(),
3593
+ litellmUsePromptCache: z8.boolean().optional()
3594
+ });
3595
+ var cerebrasSchema = apiModelIdProviderModelSchema.extend({
3596
+ cerebrasApiKey: z8.string().optional()
3597
+ });
3598
+ var sambaNovaSchema = apiModelIdProviderModelSchema.extend({
3599
+ sambaNovaApiKey: z8.string().optional()
3600
+ });
3601
+ var zaiSchema = apiModelIdProviderModelSchema.extend({
3602
+ zaiApiKey: z8.string().optional(),
3603
+ zaiApiLine: z8.union([z8.literal("china"), z8.literal("international")]).optional()
3604
+ });
3605
+ var fireworksSchema = apiModelIdProviderModelSchema.extend({
3606
+ fireworksApiKey: z8.string().optional()
3607
+ });
3608
+ var featherlessSchema = apiModelIdProviderModelSchema.extend({
3609
+ featherlessApiKey: z8.string().optional()
3610
+ });
3611
+ var ioIntelligenceSchema = apiModelIdProviderModelSchema.extend({
3612
+ ioIntelligenceModelId: z8.string().optional(),
3613
+ ioIntelligenceApiKey: z8.string().optional()
3614
+ });
3615
+ var rooSchema = apiModelIdProviderModelSchema.extend({
3616
+ // No additional fields needed - uses cloud authentication
3617
+ });
3618
+ var defaultSchema = z8.object({
3619
+ apiProvider: z8.undefined()
3620
+ });
3621
+ var providerSettingsSchemaDiscriminated = z8.discriminatedUnion("apiProvider", [
3622
+ anthropicSchema.merge(z8.object({ apiProvider: z8.literal("anthropic") })),
3623
+ claudeCodeSchema.merge(z8.object({ apiProvider: z8.literal("claude-code") })),
3624
+ glamaSchema.merge(z8.object({ apiProvider: z8.literal("glama") })),
3625
+ openRouterSchema.merge(z8.object({ apiProvider: z8.literal("openrouter") })),
3626
+ bedrockSchema.merge(z8.object({ apiProvider: z8.literal("bedrock") })),
3627
+ vertexSchema.merge(z8.object({ apiProvider: z8.literal("vertex") })),
3628
+ openAiSchema.merge(z8.object({ apiProvider: z8.literal("openai") })),
3629
+ ollamaSchema.merge(z8.object({ apiProvider: z8.literal("ollama") })),
3630
+ vsCodeLmSchema.merge(z8.object({ apiProvider: z8.literal("vscode-lm") })),
3631
+ lmStudioSchema.merge(z8.object({ apiProvider: z8.literal("lmstudio") })),
3632
+ geminiSchema.merge(z8.object({ apiProvider: z8.literal("gemini") })),
3633
+ geminiCliSchema.merge(z8.object({ apiProvider: z8.literal("gemini-cli") })),
3634
+ openAiNativeSchema.merge(z8.object({ apiProvider: z8.literal("openai-native") })),
3635
+ mistralSchema.merge(z8.object({ apiProvider: z8.literal("mistral") })),
3636
+ deepSeekSchema.merge(z8.object({ apiProvider: z8.literal("deepseek") })),
3637
+ doubaoSchema.merge(z8.object({ apiProvider: z8.literal("doubao") })),
3638
+ moonshotSchema.merge(z8.object({ apiProvider: z8.literal("moonshot") })),
3639
+ unboundSchema.merge(z8.object({ apiProvider: z8.literal("unbound") })),
3640
+ requestySchema.merge(z8.object({ apiProvider: z8.literal("requesty") })),
3641
+ humanRelaySchema.merge(z8.object({ apiProvider: z8.literal("human-relay") })),
3642
+ fakeAiSchema.merge(z8.object({ apiProvider: z8.literal("fake-ai") })),
3643
+ xaiSchema.merge(z8.object({ apiProvider: z8.literal("xai") })),
3644
+ groqSchema.merge(z8.object({ apiProvider: z8.literal("groq") })),
3645
+ huggingFaceSchema.merge(z8.object({ apiProvider: z8.literal("huggingface") })),
3646
+ chutesSchema.merge(z8.object({ apiProvider: z8.literal("chutes") })),
3647
+ litellmSchema.merge(z8.object({ apiProvider: z8.literal("litellm") })),
3648
+ cerebrasSchema.merge(z8.object({ apiProvider: z8.literal("cerebras") })),
3649
+ sambaNovaSchema.merge(z8.object({ apiProvider: z8.literal("sambanova") })),
3650
+ zaiSchema.merge(z8.object({ apiProvider: z8.literal("zai") })),
3651
+ fireworksSchema.merge(z8.object({ apiProvider: z8.literal("fireworks") })),
3652
+ featherlessSchema.merge(z8.object({ apiProvider: z8.literal("featherless") })),
3653
+ ioIntelligenceSchema.merge(z8.object({ apiProvider: z8.literal("io-intelligence") })),
3654
+ rooSchema.merge(z8.object({ apiProvider: z8.literal("roo") })),
3655
+ defaultSchema
3656
+ ]);
3657
+ var providerSettingsSchema = z8.object({
3658
+ apiProvider: providerNamesSchema.optional(),
3659
+ ...anthropicSchema.shape,
3660
+ ...claudeCodeSchema.shape,
3661
+ ...glamaSchema.shape,
3662
+ ...openRouterSchema.shape,
3663
+ ...bedrockSchema.shape,
3664
+ ...vertexSchema.shape,
3665
+ ...openAiSchema.shape,
3666
+ ...ollamaSchema.shape,
3667
+ ...vsCodeLmSchema.shape,
3668
+ ...lmStudioSchema.shape,
3669
+ ...geminiSchema.shape,
3670
+ ...geminiCliSchema.shape,
3671
+ ...openAiNativeSchema.shape,
3672
+ ...mistralSchema.shape,
3673
+ ...deepSeekSchema.shape,
3674
+ ...doubaoSchema.shape,
3675
+ ...moonshotSchema.shape,
3676
+ ...unboundSchema.shape,
3677
+ ...requestySchema.shape,
3678
+ ...humanRelaySchema.shape,
3679
+ ...fakeAiSchema.shape,
3680
+ ...xaiSchema.shape,
3681
+ ...groqSchema.shape,
3682
+ ...huggingFaceSchema.shape,
3683
+ ...chutesSchema.shape,
3684
+ ...litellmSchema.shape,
3685
+ ...cerebrasSchema.shape,
3686
+ ...sambaNovaSchema.shape,
3687
+ ...zaiSchema.shape,
3688
+ ...fireworksSchema.shape,
3689
+ ...featherlessSchema.shape,
3690
+ ...ioIntelligenceSchema.shape,
3691
+ ...rooSchema.shape,
3692
+ ...codebaseIndexProviderSchema.shape
3693
+ });
3694
+ var providerSettingsWithIdSchema = providerSettingsSchema.extend({ id: z8.string().optional() });
3695
+ var discriminatedProviderSettingsWithIdSchema = providerSettingsSchemaDiscriminated.and(
3696
+ z8.object({ id: z8.string().optional() })
3697
+ );
3698
+ var PROVIDER_SETTINGS_KEYS = providerSettingsSchema.keyof().options;
3699
+ var MODEL_ID_KEYS = [
3700
+ "apiModelId",
3701
+ "glamaModelId",
3702
+ "openRouterModelId",
3703
+ "openAiModelId",
3704
+ "ollamaModelId",
3705
+ "lmStudioModelId",
3706
+ "lmStudioDraftModelId",
3707
+ "unboundModelId",
3708
+ "requestyModelId",
3709
+ "litellmModelId",
3710
+ "huggingFaceModelId",
3711
+ "ioIntelligenceModelId"
3712
+ ];
3713
+ var getModelId = (settings) => {
3714
+ const modelIdKey = MODEL_ID_KEYS.find((key) => settings[key]);
3715
+ return modelIdKey ? settings[modelIdKey] : void 0;
3716
+ };
3717
+ var ANTHROPIC_STYLE_PROVIDERS = ["anthropic", "claude-code", "bedrock"];
3718
+ var getApiProtocol = (provider, modelId) => {
3719
+ if (provider && ANTHROPIC_STYLE_PROVIDERS.includes(provider)) {
3720
+ return "anthropic";
3721
+ }
3722
+ if (provider && provider === "vertex" && modelId && modelId.toLowerCase().includes("claude")) {
3723
+ return "anthropic";
4105
3724
  }
3725
+ return "openai";
3726
+ };
3727
+ var MODELS_BY_PROVIDER = {
3728
+ anthropic: {
3729
+ id: "anthropic",
3730
+ label: "Anthropic",
3731
+ models: Object.keys(anthropicModels)
3732
+ },
3733
+ bedrock: {
3734
+ id: "bedrock",
3735
+ label: "Amazon Bedrock",
3736
+ models: Object.keys(bedrockModels)
3737
+ },
3738
+ cerebras: {
3739
+ id: "cerebras",
3740
+ label: "Cerebras",
3741
+ models: Object.keys(cerebrasModels)
3742
+ },
3743
+ chutes: {
3744
+ id: "chutes",
3745
+ label: "Chutes AI",
3746
+ models: Object.keys(chutesModels)
3747
+ },
3748
+ "claude-code": { id: "claude-code", label: "Claude Code", models: Object.keys(claudeCodeModels) },
3749
+ deepseek: {
3750
+ id: "deepseek",
3751
+ label: "DeepSeek",
3752
+ models: Object.keys(deepSeekModels)
3753
+ },
3754
+ doubao: { id: "doubao", label: "Doubao", models: Object.keys(doubaoModels) },
3755
+ featherless: {
3756
+ id: "featherless",
3757
+ label: "Featherless",
3758
+ models: Object.keys(featherlessModels)
3759
+ },
3760
+ fireworks: {
3761
+ id: "fireworks",
3762
+ label: "Fireworks",
3763
+ models: Object.keys(fireworksModels)
3764
+ },
3765
+ gemini: {
3766
+ id: "gemini",
3767
+ label: "Google Gemini",
3768
+ models: Object.keys(geminiModels)
3769
+ },
3770
+ groq: { id: "groq", label: "Groq", models: Object.keys(groqModels) },
3771
+ "io-intelligence": {
3772
+ id: "io-intelligence",
3773
+ label: "IO Intelligence",
3774
+ models: Object.keys(ioIntelligenceModels)
3775
+ },
3776
+ mistral: {
3777
+ id: "mistral",
3778
+ label: "Mistral",
3779
+ models: Object.keys(mistralModels)
3780
+ },
3781
+ moonshot: {
3782
+ id: "moonshot",
3783
+ label: "Moonshot",
3784
+ models: Object.keys(moonshotModels)
3785
+ },
3786
+ "openai-native": {
3787
+ id: "openai-native",
3788
+ label: "OpenAI",
3789
+ models: Object.keys(openAiNativeModels)
3790
+ },
3791
+ roo: { id: "roo", label: "Roo", models: Object.keys(rooModels) },
3792
+ sambanova: {
3793
+ id: "sambanova",
3794
+ label: "SambaNova",
3795
+ models: Object.keys(sambaNovaModels)
3796
+ },
3797
+ vertex: {
3798
+ id: "vertex",
3799
+ label: "GCP Vertex AI",
3800
+ models: Object.keys(vertexModels)
3801
+ },
3802
+ "vscode-lm": {
3803
+ id: "vscode-lm",
3804
+ label: "VS Code LM API",
3805
+ models: Object.keys(vscodeLlmModels)
3806
+ },
3807
+ xai: { id: "xai", label: "xAI (Grok)", models: Object.keys(xaiModels) },
3808
+ zai: { id: "zai", label: "Zai", models: Object.keys(internationalZAiModels) },
3809
+ // Models pulled from the respective APIs.
3810
+ glama: { id: "glama", label: "Glama", models: [] },
3811
+ huggingface: { id: "huggingface", label: "Hugging Face", models: [] },
3812
+ litellm: { id: "litellm", label: "LiteLLM", models: [] },
3813
+ openrouter: { id: "openrouter", label: "OpenRouter", models: [] },
3814
+ requesty: { id: "requesty", label: "Requesty", models: [] },
3815
+ unbound: { id: "unbound", label: "Unbound", models: [] }
4106
3816
  };
4107
3817
 
4108
- // src/providers/xai.ts
4109
- var xaiDefaultModelId = "grok-4";
4110
- var xaiModels = {
4111
- "grok-4": {
4112
- maxTokens: 8192,
4113
- contextWindow: 256e3,
4114
- supportsImages: true,
4115
- supportsPromptCache: true,
4116
- inputPrice: 3,
4117
- outputPrice: 15,
4118
- cacheWritesPrice: 0.75,
4119
- cacheReadsPrice: 0.75,
4120
- description: "xAI's Grok-4 model with 256K context window"
4121
- },
4122
- "grok-3": {
4123
- maxTokens: 8192,
4124
- contextWindow: 131072,
4125
- supportsImages: false,
4126
- supportsPromptCache: true,
4127
- inputPrice: 3,
4128
- outputPrice: 15,
4129
- cacheWritesPrice: 0.75,
4130
- cacheReadsPrice: 0.75,
4131
- description: "xAI's Grok-3 model with 128K context window"
4132
- },
4133
- "grok-3-fast": {
4134
- maxTokens: 8192,
4135
- contextWindow: 131072,
4136
- supportsImages: false,
4137
- supportsPromptCache: true,
4138
- inputPrice: 5,
4139
- outputPrice: 25,
4140
- cacheWritesPrice: 1.25,
4141
- cacheReadsPrice: 1.25,
4142
- description: "xAI's Grok-3 fast model with 128K context window"
3818
+ // src/history.ts
3819
+ import { z as z9 } from "zod";
3820
+ var historyItemSchema = z9.object({
3821
+ id: z9.string(),
3822
+ number: z9.number(),
3823
+ ts: z9.number(),
3824
+ task: z9.string(),
3825
+ tokensIn: z9.number(),
3826
+ tokensOut: z9.number(),
3827
+ cacheWrites: z9.number().optional(),
3828
+ cacheReads: z9.number().optional(),
3829
+ totalCost: z9.number(),
3830
+ size: z9.number().optional(),
3831
+ workspace: z9.string().optional(),
3832
+ mode: z9.string().optional()
3833
+ });
3834
+
3835
+ // src/telemetry.ts
3836
+ import { z as z10 } from "zod";
3837
+ var telemetrySettings = ["unset", "enabled", "disabled"];
3838
+ var telemetrySettingsSchema = z10.enum(telemetrySettings);
3839
+ var TelemetryEventName = /* @__PURE__ */ ((TelemetryEventName2) => {
3840
+ TelemetryEventName2["TASK_CREATED"] = "Task Created";
3841
+ TelemetryEventName2["TASK_RESTARTED"] = "Task Reopened";
3842
+ TelemetryEventName2["TASK_COMPLETED"] = "Task Completed";
3843
+ TelemetryEventName2["TASK_MESSAGE"] = "Task Message";
3844
+ TelemetryEventName2["TASK_CONVERSATION_MESSAGE"] = "Conversation Message";
3845
+ TelemetryEventName2["LLM_COMPLETION"] = "LLM Completion";
3846
+ TelemetryEventName2["MODE_SWITCH"] = "Mode Switched";
3847
+ TelemetryEventName2["MODE_SELECTOR_OPENED"] = "Mode Selector Opened";
3848
+ TelemetryEventName2["TOOL_USED"] = "Tool Used";
3849
+ TelemetryEventName2["CHECKPOINT_CREATED"] = "Checkpoint Created";
3850
+ TelemetryEventName2["CHECKPOINT_RESTORED"] = "Checkpoint Restored";
3851
+ TelemetryEventName2["CHECKPOINT_DIFFED"] = "Checkpoint Diffed";
3852
+ TelemetryEventName2["TAB_SHOWN"] = "Tab Shown";
3853
+ TelemetryEventName2["MODE_SETTINGS_CHANGED"] = "Mode Setting Changed";
3854
+ TelemetryEventName2["CUSTOM_MODE_CREATED"] = "Custom Mode Created";
3855
+ TelemetryEventName2["CONTEXT_CONDENSED"] = "Context Condensed";
3856
+ TelemetryEventName2["SLIDING_WINDOW_TRUNCATION"] = "Sliding Window Truncation";
3857
+ TelemetryEventName2["CODE_ACTION_USED"] = "Code Action Used";
3858
+ TelemetryEventName2["PROMPT_ENHANCED"] = "Prompt Enhanced";
3859
+ TelemetryEventName2["TITLE_BUTTON_CLICKED"] = "Title Button Clicked";
3860
+ TelemetryEventName2["AUTHENTICATION_INITIATED"] = "Authentication Initiated";
3861
+ TelemetryEventName2["MARKETPLACE_ITEM_INSTALLED"] = "Marketplace Item Installed";
3862
+ TelemetryEventName2["MARKETPLACE_ITEM_REMOVED"] = "Marketplace Item Removed";
3863
+ TelemetryEventName2["MARKETPLACE_TAB_VIEWED"] = "Marketplace Tab Viewed";
3864
+ TelemetryEventName2["MARKETPLACE_INSTALL_BUTTON_CLICKED"] = "Marketplace Install Button Clicked";
3865
+ TelemetryEventName2["SHARE_BUTTON_CLICKED"] = "Share Button Clicked";
3866
+ TelemetryEventName2["SHARE_ORGANIZATION_CLICKED"] = "Share Organization Clicked";
3867
+ TelemetryEventName2["SHARE_PUBLIC_CLICKED"] = "Share Public Clicked";
3868
+ TelemetryEventName2["SHARE_CONNECT_TO_CLOUD_CLICKED"] = "Share Connect To Cloud Clicked";
3869
+ TelemetryEventName2["ACCOUNT_CONNECT_CLICKED"] = "Account Connect Clicked";
3870
+ TelemetryEventName2["ACCOUNT_CONNECT_SUCCESS"] = "Account Connect Success";
3871
+ TelemetryEventName2["ACCOUNT_LOGOUT_CLICKED"] = "Account Logout Clicked";
3872
+ TelemetryEventName2["ACCOUNT_LOGOUT_SUCCESS"] = "Account Logout Success";
3873
+ TelemetryEventName2["SCHEMA_VALIDATION_ERROR"] = "Schema Validation Error";
3874
+ TelemetryEventName2["DIFF_APPLICATION_ERROR"] = "Diff Application Error";
3875
+ TelemetryEventName2["SHELL_INTEGRATION_ERROR"] = "Shell Integration Error";
3876
+ TelemetryEventName2["CONSECUTIVE_MISTAKE_ERROR"] = "Consecutive Mistake Error";
3877
+ TelemetryEventName2["CODE_INDEX_ERROR"] = "Code Index Error";
3878
+ return TelemetryEventName2;
3879
+ })(TelemetryEventName || {});
3880
+ var staticAppPropertiesSchema = z10.object({
3881
+ appName: z10.string(),
3882
+ appVersion: z10.string(),
3883
+ vscodeVersion: z10.string(),
3884
+ platform: z10.string(),
3885
+ editorName: z10.string()
3886
+ });
3887
+ var dynamicAppPropertiesSchema = z10.object({
3888
+ language: z10.string(),
3889
+ mode: z10.string()
3890
+ });
3891
+ var cloudAppPropertiesSchema = z10.object({
3892
+ cloudIsAuthenticated: z10.boolean().optional()
3893
+ });
3894
+ var appPropertiesSchema = z10.object({
3895
+ ...staticAppPropertiesSchema.shape,
3896
+ ...dynamicAppPropertiesSchema.shape,
3897
+ ...cloudAppPropertiesSchema.shape
3898
+ });
3899
+ var taskPropertiesSchema = z10.object({
3900
+ taskId: z10.string().optional(),
3901
+ apiProvider: z10.enum(providerNames).optional(),
3902
+ modelId: z10.string().optional(),
3903
+ diffStrategy: z10.string().optional(),
3904
+ isSubtask: z10.boolean().optional(),
3905
+ todos: z10.object({
3906
+ total: z10.number(),
3907
+ completed: z10.number(),
3908
+ inProgress: z10.number(),
3909
+ pending: z10.number()
3910
+ }).optional()
3911
+ });
3912
+ var gitPropertiesSchema = z10.object({
3913
+ repositoryUrl: z10.string().optional(),
3914
+ repositoryName: z10.string().optional(),
3915
+ defaultBranch: z10.string().optional()
3916
+ });
3917
+ var telemetryPropertiesSchema = z10.object({
3918
+ ...appPropertiesSchema.shape,
3919
+ ...taskPropertiesSchema.shape,
3920
+ ...gitPropertiesSchema.shape
3921
+ });
3922
+ var rooCodeTelemetryEventSchema = z10.discriminatedUnion("type", [
3923
+ z10.object({
3924
+ type: z10.enum([
3925
+ "Task Created" /* TASK_CREATED */,
3926
+ "Task Reopened" /* TASK_RESTARTED */,
3927
+ "Task Completed" /* TASK_COMPLETED */,
3928
+ "Conversation Message" /* TASK_CONVERSATION_MESSAGE */,
3929
+ "Mode Switched" /* MODE_SWITCH */,
3930
+ "Mode Selector Opened" /* MODE_SELECTOR_OPENED */,
3931
+ "Tool Used" /* TOOL_USED */,
3932
+ "Checkpoint Created" /* CHECKPOINT_CREATED */,
3933
+ "Checkpoint Restored" /* CHECKPOINT_RESTORED */,
3934
+ "Checkpoint Diffed" /* CHECKPOINT_DIFFED */,
3935
+ "Code Action Used" /* CODE_ACTION_USED */,
3936
+ "Prompt Enhanced" /* PROMPT_ENHANCED */,
3937
+ "Title Button Clicked" /* TITLE_BUTTON_CLICKED */,
3938
+ "Authentication Initiated" /* AUTHENTICATION_INITIATED */,
3939
+ "Marketplace Item Installed" /* MARKETPLACE_ITEM_INSTALLED */,
3940
+ "Marketplace Item Removed" /* MARKETPLACE_ITEM_REMOVED */,
3941
+ "Marketplace Tab Viewed" /* MARKETPLACE_TAB_VIEWED */,
3942
+ "Marketplace Install Button Clicked" /* MARKETPLACE_INSTALL_BUTTON_CLICKED */,
3943
+ "Share Button Clicked" /* SHARE_BUTTON_CLICKED */,
3944
+ "Share Organization Clicked" /* SHARE_ORGANIZATION_CLICKED */,
3945
+ "Share Public Clicked" /* SHARE_PUBLIC_CLICKED */,
3946
+ "Share Connect To Cloud Clicked" /* SHARE_CONNECT_TO_CLOUD_CLICKED */,
3947
+ "Account Connect Clicked" /* ACCOUNT_CONNECT_CLICKED */,
3948
+ "Account Connect Success" /* ACCOUNT_CONNECT_SUCCESS */,
3949
+ "Account Logout Clicked" /* ACCOUNT_LOGOUT_CLICKED */,
3950
+ "Account Logout Success" /* ACCOUNT_LOGOUT_SUCCESS */,
3951
+ "Schema Validation Error" /* SCHEMA_VALIDATION_ERROR */,
3952
+ "Diff Application Error" /* DIFF_APPLICATION_ERROR */,
3953
+ "Shell Integration Error" /* SHELL_INTEGRATION_ERROR */,
3954
+ "Consecutive Mistake Error" /* CONSECUTIVE_MISTAKE_ERROR */,
3955
+ "Code Index Error" /* CODE_INDEX_ERROR */,
3956
+ "Context Condensed" /* CONTEXT_CONDENSED */,
3957
+ "Sliding Window Truncation" /* SLIDING_WINDOW_TRUNCATION */,
3958
+ "Tab Shown" /* TAB_SHOWN */,
3959
+ "Mode Setting Changed" /* MODE_SETTINGS_CHANGED */,
3960
+ "Custom Mode Created" /* CUSTOM_MODE_CREATED */
3961
+ ]),
3962
+ properties: telemetryPropertiesSchema
3963
+ }),
3964
+ z10.object({
3965
+ type: z10.literal("Task Message" /* TASK_MESSAGE */),
3966
+ properties: z10.object({
3967
+ ...telemetryPropertiesSchema.shape,
3968
+ taskId: z10.string(),
3969
+ message: clineMessageSchema
3970
+ })
3971
+ }),
3972
+ z10.object({
3973
+ type: z10.literal("LLM Completion" /* LLM_COMPLETION */),
3974
+ properties: z10.object({
3975
+ ...telemetryPropertiesSchema.shape,
3976
+ inputTokens: z10.number(),
3977
+ outputTokens: z10.number(),
3978
+ cacheReadTokens: z10.number().optional(),
3979
+ cacheWriteTokens: z10.number().optional(),
3980
+ cost: z10.number().optional()
3981
+ })
3982
+ })
3983
+ ]);
3984
+
3985
+ // src/mode.ts
3986
+ import { z as z11 } from "zod";
3987
+ var groupOptionsSchema = z11.object({
3988
+ fileRegex: z11.string().optional().refine(
3989
+ (pattern) => {
3990
+ if (!pattern) {
3991
+ return true;
3992
+ }
3993
+ try {
3994
+ new RegExp(pattern);
3995
+ return true;
3996
+ } catch {
3997
+ return false;
3998
+ }
3999
+ },
4000
+ { message: "Invalid regular expression pattern" }
4001
+ ),
4002
+ description: z11.string().optional()
4003
+ });
4004
+ var groupEntrySchema = z11.union([toolGroupsSchema, z11.tuple([toolGroupsSchema, groupOptionsSchema])]);
4005
+ var groupEntryArraySchema = z11.array(groupEntrySchema).refine(
4006
+ (groups) => {
4007
+ const seen = /* @__PURE__ */ new Set();
4008
+ return groups.every((group) => {
4009
+ const groupName = Array.isArray(group) ? group[0] : group;
4010
+ if (seen.has(groupName)) {
4011
+ return false;
4012
+ }
4013
+ seen.add(groupName);
4014
+ return true;
4015
+ });
4143
4016
  },
4144
- "grok-3-mini": {
4145
- maxTokens: 8192,
4146
- contextWindow: 131072,
4147
- supportsImages: false,
4148
- supportsPromptCache: true,
4149
- inputPrice: 0.3,
4150
- outputPrice: 0.5,
4151
- cacheWritesPrice: 0.07,
4152
- cacheReadsPrice: 0.07,
4153
- description: "xAI's Grok-3 mini model with 128K context window",
4154
- supportsReasoningEffort: true
4017
+ { message: "Duplicate groups are not allowed" }
4018
+ );
4019
+ var modeConfigSchema = z11.object({
4020
+ slug: z11.string().regex(/^[a-zA-Z0-9-]+$/, "Slug must contain only letters numbers and dashes"),
4021
+ name: z11.string().min(1, "Name is required"),
4022
+ roleDefinition: z11.string().min(1, "Role definition is required"),
4023
+ whenToUse: z11.string().optional(),
4024
+ description: z11.string().optional(),
4025
+ customInstructions: z11.string().optional(),
4026
+ groups: groupEntryArraySchema,
4027
+ source: z11.enum(["global", "project"]).optional()
4028
+ });
4029
+ var customModesSettingsSchema = z11.object({
4030
+ customModes: z11.array(modeConfigSchema).refine(
4031
+ (modes) => {
4032
+ const slugs = /* @__PURE__ */ new Set();
4033
+ return modes.every((mode) => {
4034
+ if (slugs.has(mode.slug)) {
4035
+ return false;
4036
+ }
4037
+ slugs.add(mode.slug);
4038
+ return true;
4039
+ });
4040
+ },
4041
+ {
4042
+ message: "Duplicate mode slugs are not allowed"
4043
+ }
4044
+ )
4045
+ });
4046
+ var promptComponentSchema = z11.object({
4047
+ roleDefinition: z11.string().optional(),
4048
+ whenToUse: z11.string().optional(),
4049
+ description: z11.string().optional(),
4050
+ customInstructions: z11.string().optional()
4051
+ });
4052
+ var customModePromptsSchema = z11.record(z11.string(), promptComponentSchema.optional());
4053
+ var customSupportPromptsSchema = z11.record(z11.string(), z11.string().optional());
4054
+ var DEFAULT_MODES = [
4055
+ {
4056
+ slug: "architect",
4057
+ name: "\u{1F3D7}\uFE0F Architect",
4058
+ 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.",
4059
+ 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.",
4060
+ description: "Plan and design before implementation",
4061
+ groups: ["read", ["edit", { fileRegex: "\\.md$", description: "Markdown files only" }], "browser", "mcp"],
4062
+ 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.**"
4155
4063
  },
4156
- "grok-3-mini-fast": {
4157
- maxTokens: 8192,
4158
- contextWindow: 131072,
4159
- supportsImages: false,
4160
- supportsPromptCache: true,
4161
- inputPrice: 0.6,
4162
- outputPrice: 4,
4163
- cacheWritesPrice: 0.15,
4164
- cacheReadsPrice: 0.15,
4165
- description: "xAI's Grok-3 mini fast model with 128K context window",
4166
- supportsReasoningEffort: true
4064
+ {
4065
+ slug: "code",
4066
+ name: "\u{1F4BB} Code",
4067
+ roleDefinition: "You are Roo, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.",
4068
+ 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.",
4069
+ description: "Write, modify, and refactor code",
4070
+ groups: ["read", "edit", "browser", "command", "mcp"]
4167
4071
  },
4168
- "grok-2-1212": {
4169
- maxTokens: 8192,
4170
- contextWindow: 131072,
4171
- supportsImages: false,
4172
- supportsPromptCache: false,
4173
- inputPrice: 2,
4174
- outputPrice: 10,
4175
- description: "xAI's Grok-2 model (version 1212) with 128K context window"
4072
+ {
4073
+ slug: "ask",
4074
+ name: "\u2753 Ask",
4075
+ roleDefinition: "You are Roo, a knowledgeable technical assistant focused on answering questions and providing information about software development, technology, and related topics.",
4076
+ 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.",
4077
+ description: "Get answers and explanations",
4078
+ groups: ["read", "browser", "mcp"],
4079
+ 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."
4176
4080
  },
4177
- "grok-2-vision-1212": {
4178
- maxTokens: 8192,
4179
- contextWindow: 32768,
4180
- supportsImages: true,
4181
- supportsPromptCache: false,
4182
- inputPrice: 2,
4183
- outputPrice: 10,
4184
- description: "xAI's Grok-2 Vision model (version 1212) with image support and 32K context window"
4081
+ {
4082
+ slug: "debug",
4083
+ name: "\u{1FAB2} Debug",
4084
+ roleDefinition: "You are Roo, an expert software debugger specializing in systematic problem diagnosis and resolution.",
4085
+ 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.",
4086
+ description: "Diagnose and fix software issues",
4087
+ groups: ["read", "edit", "browser", "command", "mcp"],
4088
+ 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."
4089
+ },
4090
+ {
4091
+ slug: "orchestrator",
4092
+ name: "\u{1FA83} Orchestrator",
4093
+ 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.",
4094
+ 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.",
4095
+ description: "Coordinate tasks across multiple modes",
4096
+ groups: [],
4097
+ 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."
4185
4098
  }
4099
+ ];
4100
+
4101
+ // src/vscode.ts
4102
+ import { z as z12 } from "zod";
4103
+ var codeActionIds = ["explainCode", "fixCode", "improveCode", "addToContext", "newTask"];
4104
+ var terminalActionIds = ["terminalAddToContext", "terminalFixCommand", "terminalExplainCommand"];
4105
+ var commandIds = [
4106
+ "activationCompleted",
4107
+ "plusButtonClicked",
4108
+ "promptsButtonClicked",
4109
+ "mcpButtonClicked",
4110
+ "historyButtonClicked",
4111
+ "marketplaceButtonClicked",
4112
+ "popoutButtonClicked",
4113
+ "accountButtonClicked",
4114
+ "settingsButtonClicked",
4115
+ "openInNewTab",
4116
+ "showHumanRelayDialog",
4117
+ "registerHumanRelayCallback",
4118
+ "unregisterHumanRelayCallback",
4119
+ "handleHumanRelayResponse",
4120
+ "newTask",
4121
+ "setCustomStoragePath",
4122
+ "importSettings",
4123
+ "focusInput",
4124
+ "acceptInput",
4125
+ "focusPanel"
4126
+ ];
4127
+ var languages = [
4128
+ "ca",
4129
+ "de",
4130
+ "en",
4131
+ "es",
4132
+ "fr",
4133
+ "hi",
4134
+ "id",
4135
+ "it",
4136
+ "ja",
4137
+ "ko",
4138
+ "nl",
4139
+ "pl",
4140
+ "pt-BR",
4141
+ "ru",
4142
+ "tr",
4143
+ "vi",
4144
+ "zh-CN",
4145
+ "zh-TW"
4146
+ ];
4147
+ var languagesSchema = z12.enum(languages);
4148
+ var isLanguage = (value) => languages.includes(value);
4149
+
4150
+ // src/global-settings.ts
4151
+ var DEFAULT_WRITE_DELAY_MS = 1e3;
4152
+ var DEFAULT_TERMINAL_OUTPUT_CHARACTER_LIMIT = 5e4;
4153
+ var globalSettingsSchema = z13.object({
4154
+ currentApiConfigName: z13.string().optional(),
4155
+ listApiConfigMeta: z13.array(providerSettingsEntrySchema).optional(),
4156
+ pinnedApiConfigs: z13.record(z13.string(), z13.boolean()).optional(),
4157
+ lastShownAnnouncementId: z13.string().optional(),
4158
+ customInstructions: z13.string().optional(),
4159
+ taskHistory: z13.array(historyItemSchema).optional(),
4160
+ condensingApiConfigId: z13.string().optional(),
4161
+ customCondensingPrompt: z13.string().optional(),
4162
+ autoApprovalEnabled: z13.boolean().optional(),
4163
+ alwaysAllowReadOnly: z13.boolean().optional(),
4164
+ alwaysAllowReadOnlyOutsideWorkspace: z13.boolean().optional(),
4165
+ alwaysAllowWrite: z13.boolean().optional(),
4166
+ alwaysAllowWriteOutsideWorkspace: z13.boolean().optional(),
4167
+ alwaysAllowWriteProtected: z13.boolean().optional(),
4168
+ writeDelayMs: z13.number().min(0).optional(),
4169
+ alwaysAllowBrowser: z13.boolean().optional(),
4170
+ alwaysApproveResubmit: z13.boolean().optional(),
4171
+ requestDelaySeconds: z13.number().optional(),
4172
+ alwaysAllowMcp: z13.boolean().optional(),
4173
+ alwaysAllowModeSwitch: z13.boolean().optional(),
4174
+ alwaysAllowSubtasks: z13.boolean().optional(),
4175
+ alwaysAllowExecute: z13.boolean().optional(),
4176
+ alwaysAllowFollowupQuestions: z13.boolean().optional(),
4177
+ followupAutoApproveTimeoutMs: z13.number().optional(),
4178
+ alwaysAllowUpdateTodoList: z13.boolean().optional(),
4179
+ allowedCommands: z13.array(z13.string()).optional(),
4180
+ deniedCommands: z13.array(z13.string()).optional(),
4181
+ commandExecutionTimeout: z13.number().optional(),
4182
+ commandTimeoutAllowlist: z13.array(z13.string()).optional(),
4183
+ preventCompletionWithOpenTodos: z13.boolean().optional(),
4184
+ allowedMaxRequests: z13.number().nullish(),
4185
+ allowedMaxCost: z13.number().nullish(),
4186
+ autoCondenseContext: z13.boolean().optional(),
4187
+ autoCondenseContextPercent: z13.number().optional(),
4188
+ maxConcurrentFileReads: z13.number().optional(),
4189
+ /**
4190
+ * Whether to include diagnostic messages (errors, warnings) in tool outputs
4191
+ * @default true
4192
+ */
4193
+ includeDiagnosticMessages: z13.boolean().optional(),
4194
+ /**
4195
+ * Maximum number of diagnostic messages to include in tool outputs
4196
+ * @default 50
4197
+ */
4198
+ maxDiagnosticMessages: z13.number().optional(),
4199
+ browserToolEnabled: z13.boolean().optional(),
4200
+ browserViewportSize: z13.string().optional(),
4201
+ screenshotQuality: z13.number().optional(),
4202
+ remoteBrowserEnabled: z13.boolean().optional(),
4203
+ remoteBrowserHost: z13.string().optional(),
4204
+ cachedChromeHostUrl: z13.string().optional(),
4205
+ enableCheckpoints: z13.boolean().optional(),
4206
+ ttsEnabled: z13.boolean().optional(),
4207
+ ttsSpeed: z13.number().optional(),
4208
+ soundEnabled: z13.boolean().optional(),
4209
+ soundVolume: z13.number().optional(),
4210
+ maxOpenTabsContext: z13.number().optional(),
4211
+ maxWorkspaceFiles: z13.number().optional(),
4212
+ showRooIgnoredFiles: z13.boolean().optional(),
4213
+ maxReadFileLine: z13.number().optional(),
4214
+ maxImageFileSize: z13.number().optional(),
4215
+ maxTotalImageSize: z13.number().optional(),
4216
+ terminalOutputLineLimit: z13.number().optional(),
4217
+ terminalOutputCharacterLimit: z13.number().optional(),
4218
+ terminalShellIntegrationTimeout: z13.number().optional(),
4219
+ terminalShellIntegrationDisabled: z13.boolean().optional(),
4220
+ terminalCommandDelay: z13.number().optional(),
4221
+ terminalPowershellCounter: z13.boolean().optional(),
4222
+ terminalZshClearEolMark: z13.boolean().optional(),
4223
+ terminalZshOhMy: z13.boolean().optional(),
4224
+ terminalZshP10k: z13.boolean().optional(),
4225
+ terminalZdotdir: z13.boolean().optional(),
4226
+ terminalCompressProgressBar: z13.boolean().optional(),
4227
+ diagnosticsEnabled: z13.boolean().optional(),
4228
+ rateLimitSeconds: z13.number().optional(),
4229
+ diffEnabled: z13.boolean().optional(),
4230
+ fuzzyMatchThreshold: z13.number().optional(),
4231
+ experiments: experimentsSchema.optional(),
4232
+ codebaseIndexModels: codebaseIndexModelsSchema.optional(),
4233
+ codebaseIndexConfig: codebaseIndexConfigSchema.optional(),
4234
+ language: languagesSchema.optional(),
4235
+ telemetrySetting: telemetrySettingsSchema.optional(),
4236
+ mcpEnabled: z13.boolean().optional(),
4237
+ enableMcpServerCreation: z13.boolean().optional(),
4238
+ remoteControlEnabled: z13.boolean().optional(),
4239
+ mode: z13.string().optional(),
4240
+ modeApiConfigs: z13.record(z13.string(), z13.string()).optional(),
4241
+ customModes: z13.array(modeConfigSchema).optional(),
4242
+ customModePrompts: customModePromptsSchema.optional(),
4243
+ customSupportPrompts: customSupportPromptsSchema.optional(),
4244
+ enhancementApiConfigId: z13.string().optional(),
4245
+ includeTaskHistoryInEnhance: z13.boolean().optional(),
4246
+ historyPreviewCollapsed: z13.boolean().optional(),
4247
+ profileThresholds: z13.record(z13.string(), z13.number()).optional(),
4248
+ hasOpenedModeSelector: z13.boolean().optional(),
4249
+ lastModeExportPath: z13.string().optional(),
4250
+ lastModeImportPath: z13.string().optional()
4251
+ });
4252
+ var GLOBAL_SETTINGS_KEYS = globalSettingsSchema.keyof().options;
4253
+ var rooCodeSettingsSchema = providerSettingsSchema.merge(globalSettingsSchema);
4254
+ var SECRET_STATE_KEYS = [
4255
+ "apiKey",
4256
+ "glamaApiKey",
4257
+ "openRouterApiKey",
4258
+ "awsAccessKey",
4259
+ "awsApiKey",
4260
+ "awsSecretKey",
4261
+ "awsSessionToken",
4262
+ "openAiApiKey",
4263
+ "geminiApiKey",
4264
+ "openAiNativeApiKey",
4265
+ "cerebrasApiKey",
4266
+ "deepSeekApiKey",
4267
+ "doubaoApiKey",
4268
+ "moonshotApiKey",
4269
+ "mistralApiKey",
4270
+ "unboundApiKey",
4271
+ "requestyApiKey",
4272
+ "xaiApiKey",
4273
+ "groqApiKey",
4274
+ "chutesApiKey",
4275
+ "litellmApiKey",
4276
+ "codeIndexOpenAiKey",
4277
+ "codeIndexQdrantApiKey",
4278
+ "codebaseIndexOpenAiCompatibleApiKey",
4279
+ "codebaseIndexGeminiApiKey",
4280
+ "codebaseIndexMistralApiKey",
4281
+ "huggingFaceApiKey",
4282
+ "sambaNovaApiKey",
4283
+ "zaiApiKey",
4284
+ "fireworksApiKey",
4285
+ "featherlessApiKey",
4286
+ "ioIntelligenceApiKey"
4287
+ ];
4288
+ var isSecretStateKey = (key) => SECRET_STATE_KEYS.includes(key);
4289
+ var GLOBAL_STATE_KEYS = [...GLOBAL_SETTINGS_KEYS, ...PROVIDER_SETTINGS_KEYS].filter(
4290
+ (key) => !SECRET_STATE_KEYS.includes(key)
4291
+ );
4292
+ var isGlobalStateKey = (key) => GLOBAL_STATE_KEYS.includes(key);
4293
+ var EVALS_SETTINGS = {
4294
+ apiProvider: "openrouter",
4295
+ openRouterUseMiddleOutTransform: false,
4296
+ lastShownAnnouncementId: "jul-09-2025-3-23-0",
4297
+ pinnedApiConfigs: {},
4298
+ autoApprovalEnabled: true,
4299
+ alwaysAllowReadOnly: true,
4300
+ alwaysAllowReadOnlyOutsideWorkspace: false,
4301
+ alwaysAllowWrite: true,
4302
+ alwaysAllowWriteOutsideWorkspace: false,
4303
+ alwaysAllowWriteProtected: false,
4304
+ writeDelayMs: 1e3,
4305
+ alwaysAllowBrowser: true,
4306
+ alwaysApproveResubmit: true,
4307
+ requestDelaySeconds: 10,
4308
+ alwaysAllowMcp: true,
4309
+ alwaysAllowModeSwitch: true,
4310
+ alwaysAllowSubtasks: true,
4311
+ alwaysAllowExecute: true,
4312
+ alwaysAllowFollowupQuestions: true,
4313
+ alwaysAllowUpdateTodoList: true,
4314
+ followupAutoApproveTimeoutMs: 0,
4315
+ allowedCommands: ["*"],
4316
+ commandExecutionTimeout: 20,
4317
+ commandTimeoutAllowlist: [],
4318
+ preventCompletionWithOpenTodos: false,
4319
+ browserToolEnabled: false,
4320
+ browserViewportSize: "900x600",
4321
+ screenshotQuality: 75,
4322
+ remoteBrowserEnabled: false,
4323
+ ttsEnabled: false,
4324
+ ttsSpeed: 1,
4325
+ soundEnabled: false,
4326
+ soundVolume: 0.5,
4327
+ terminalOutputLineLimit: 500,
4328
+ terminalOutputCharacterLimit: DEFAULT_TERMINAL_OUTPUT_CHARACTER_LIMIT,
4329
+ terminalShellIntegrationTimeout: 3e4,
4330
+ terminalCommandDelay: 0,
4331
+ terminalPowershellCounter: false,
4332
+ terminalZshOhMy: true,
4333
+ terminalZshClearEolMark: true,
4334
+ terminalZshP10k: false,
4335
+ terminalZdotdir: true,
4336
+ terminalCompressProgressBar: true,
4337
+ terminalShellIntegrationDisabled: true,
4338
+ diagnosticsEnabled: true,
4339
+ diffEnabled: true,
4340
+ fuzzyMatchThreshold: 1,
4341
+ enableCheckpoints: false,
4342
+ rateLimitSeconds: 0,
4343
+ maxOpenTabsContext: 20,
4344
+ maxWorkspaceFiles: 200,
4345
+ showRooIgnoredFiles: true,
4346
+ maxReadFileLine: -1,
4347
+ // -1 to enable full file reading.
4348
+ includeDiagnosticMessages: true,
4349
+ maxDiagnosticMessages: 50,
4350
+ language: "en",
4351
+ telemetrySetting: "enabled",
4352
+ mcpEnabled: false,
4353
+ remoteControlEnabled: false,
4354
+ mode: "code",
4355
+ // "architect",
4356
+ customModes: []
4186
4357
  };
4358
+ var EVALS_TIMEOUT = 5 * 60 * 1e3;
4187
4359
 
4188
- // src/providers/doubao.ts
4189
- var doubaoDefaultModelId = "doubao-seed-1-6-250615";
4190
- var doubaoModels = {
4191
- "doubao-seed-1-6-250615": {
4192
- maxTokens: 32768,
4193
- contextWindow: 128e3,
4194
- supportsImages: true,
4195
- supportsPromptCache: true,
4196
- inputPrice: 1e-4,
4197
- // $0.0001 per million tokens (cache miss)
4198
- outputPrice: 4e-4,
4199
- // $0.0004 per million tokens
4200
- cacheWritesPrice: 1e-4,
4201
- // $0.0001 per million tokens (cache miss)
4202
- cacheReadsPrice: 2e-5,
4203
- // $0.00002 per million tokens (cache hit)
4204
- description: `Doubao Seed 1.6 is a powerful model designed for high-performance tasks with extensive context handling.`
4205
- },
4206
- "doubao-seed-1-6-thinking-250715": {
4207
- maxTokens: 32768,
4208
- contextWindow: 128e3,
4209
- supportsImages: true,
4210
- supportsPromptCache: true,
4211
- inputPrice: 2e-4,
4212
- // $0.0002 per million tokens
4213
- outputPrice: 8e-4,
4214
- // $0.0008 per million tokens
4215
- cacheWritesPrice: 2e-4,
4216
- // $0.0002 per million
4217
- cacheReadsPrice: 4e-5,
4218
- // $0.00004 per million tokens (cache hit)
4219
- description: `Doubao Seed 1.6 Thinking is optimized for reasoning tasks, providing enhanced performance in complex problem-solving scenarios.`
4220
- },
4221
- "doubao-seed-1-6-flash-250715": {
4222
- maxTokens: 32768,
4223
- contextWindow: 128e3,
4224
- supportsImages: true,
4225
- supportsPromptCache: true,
4226
- inputPrice: 15e-5,
4227
- // $0.00015 per million tokens
4228
- outputPrice: 6e-4,
4229
- // $0.0006 per million tokens
4230
- cacheWritesPrice: 15e-5,
4231
- // $0.00015 per million
4232
- cacheReadsPrice: 3e-5,
4233
- // $0.00003 per million tokens (cache hit)
4234
- description: `Doubao Seed 1.6 Flash is tailored for speed and efficiency, making it ideal for applications requiring rapid responses.`
4235
- }
4236
- };
4237
- var doubaoDefaultModelInfo = doubaoModels[doubaoDefaultModelId];
4238
- var DOUBAO_API_BASE_URL = "https://ark.cn-beijing.volces.com/api/v3";
4239
- var DOUBAO_API_CHAT_PATH = "/chat/completions";
4360
+ // src/ipc.ts
4361
+ import { z as z14 } from "zod";
4362
+ var IpcMessageType = /* @__PURE__ */ ((IpcMessageType2) => {
4363
+ IpcMessageType2["Connect"] = "Connect";
4364
+ IpcMessageType2["Disconnect"] = "Disconnect";
4365
+ IpcMessageType2["Ack"] = "Ack";
4366
+ IpcMessageType2["TaskCommand"] = "TaskCommand";
4367
+ IpcMessageType2["TaskEvent"] = "TaskEvent";
4368
+ return IpcMessageType2;
4369
+ })(IpcMessageType || {});
4370
+ var IpcOrigin = /* @__PURE__ */ ((IpcOrigin2) => {
4371
+ IpcOrigin2["Client"] = "client";
4372
+ IpcOrigin2["Server"] = "server";
4373
+ return IpcOrigin2;
4374
+ })(IpcOrigin || {});
4375
+ var ackSchema = z14.object({
4376
+ clientId: z14.string(),
4377
+ pid: z14.number(),
4378
+ ppid: z14.number()
4379
+ });
4380
+ var TaskCommandName = /* @__PURE__ */ ((TaskCommandName2) => {
4381
+ TaskCommandName2["StartNewTask"] = "StartNewTask";
4382
+ TaskCommandName2["CancelTask"] = "CancelTask";
4383
+ TaskCommandName2["CloseTask"] = "CloseTask";
4384
+ TaskCommandName2["ResumeTask"] = "ResumeTask";
4385
+ return TaskCommandName2;
4386
+ })(TaskCommandName || {});
4387
+ var taskCommandSchema = z14.discriminatedUnion("commandName", [
4388
+ z14.object({
4389
+ commandName: z14.literal("StartNewTask" /* StartNewTask */),
4390
+ data: z14.object({
4391
+ configuration: rooCodeSettingsSchema,
4392
+ text: z14.string(),
4393
+ images: z14.array(z14.string()).optional(),
4394
+ newTab: z14.boolean().optional()
4395
+ })
4396
+ }),
4397
+ z14.object({
4398
+ commandName: z14.literal("CancelTask" /* CancelTask */),
4399
+ data: z14.string()
4400
+ }),
4401
+ z14.object({
4402
+ commandName: z14.literal("CloseTask" /* CloseTask */),
4403
+ data: z14.string()
4404
+ }),
4405
+ z14.object({
4406
+ commandName: z14.literal("ResumeTask" /* ResumeTask */),
4407
+ data: z14.string()
4408
+ })
4409
+ ]);
4410
+ var ipcMessageSchema = z14.discriminatedUnion("type", [
4411
+ z14.object({
4412
+ type: z14.literal("Ack" /* Ack */),
4413
+ origin: z14.literal("server" /* Server */),
4414
+ data: ackSchema
4415
+ }),
4416
+ z14.object({
4417
+ type: z14.literal("TaskCommand" /* TaskCommand */),
4418
+ origin: z14.literal("client" /* Client */),
4419
+ clientId: z14.string(),
4420
+ data: taskCommandSchema
4421
+ }),
4422
+ z14.object({
4423
+ type: z14.literal("TaskEvent" /* TaskEvent */),
4424
+ origin: z14.literal("server" /* Server */),
4425
+ relayClientId: z14.string().optional(),
4426
+ data: taskEventSchema
4427
+ })
4428
+ ]);
4240
4429
 
4241
- // src/providers/zai.ts
4242
- var internationalZAiDefaultModelId = "glm-4.5";
4243
- var internationalZAiModels = {
4244
- "glm-4.5": {
4245
- maxTokens: 98304,
4246
- contextWindow: 131072,
4247
- supportsImages: false,
4248
- supportsPromptCache: true,
4249
- inputPrice: 0.6,
4250
- outputPrice: 2.2,
4251
- cacheWritesPrice: 0,
4252
- cacheReadsPrice: 0.11,
4253
- 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."
4254
- },
4255
- "glm-4.5-air": {
4256
- maxTokens: 98304,
4257
- contextWindow: 131072,
4258
- supportsImages: false,
4259
- supportsPromptCache: true,
4260
- inputPrice: 0.2,
4261
- outputPrice: 1.1,
4262
- cacheWritesPrice: 0,
4263
- cacheReadsPrice: 0.03,
4264
- 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."
4265
- }
4266
- };
4267
- var mainlandZAiDefaultModelId = "glm-4.5";
4268
- var mainlandZAiModels = {
4269
- "glm-4.5": {
4270
- maxTokens: 98304,
4271
- contextWindow: 131072,
4272
- supportsImages: false,
4273
- supportsPromptCache: true,
4274
- inputPrice: 0.29,
4275
- outputPrice: 1.14,
4276
- cacheWritesPrice: 0,
4277
- cacheReadsPrice: 0.057,
4278
- 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.",
4279
- tiers: [
4280
- {
4281
- contextWindow: 32e3,
4282
- inputPrice: 0.21,
4283
- outputPrice: 1,
4284
- cacheReadsPrice: 0.043
4285
- },
4286
- {
4287
- contextWindow: 128e3,
4288
- inputPrice: 0.29,
4289
- outputPrice: 1.14,
4290
- cacheReadsPrice: 0.057
4291
- },
4292
- {
4293
- contextWindow: Infinity,
4294
- inputPrice: 0.29,
4295
- outputPrice: 1.14,
4296
- cacheReadsPrice: 0.057
4297
- }
4298
- ]
4299
- },
4300
- "glm-4.5-air": {
4301
- maxTokens: 98304,
4302
- contextWindow: 131072,
4303
- supportsImages: false,
4304
- supportsPromptCache: true,
4305
- inputPrice: 0.1,
4306
- outputPrice: 0.6,
4307
- cacheWritesPrice: 0,
4308
- cacheReadsPrice: 0.02,
4309
- 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.",
4310
- tiers: [
4311
- {
4312
- contextWindow: 32e3,
4313
- inputPrice: 0.07,
4314
- outputPrice: 0.4,
4315
- cacheReadsPrice: 0.014
4316
- },
4317
- {
4318
- contextWindow: 128e3,
4319
- inputPrice: 0.1,
4320
- outputPrice: 0.6,
4321
- cacheReadsPrice: 0.02
4322
- },
4323
- {
4324
- contextWindow: Infinity,
4325
- inputPrice: 0.1,
4326
- outputPrice: 0.6,
4327
- cacheReadsPrice: 0.02
4328
- }
4329
- ]
4330
- }
4331
- };
4332
- var ZAI_DEFAULT_TEMPERATURE = 0;
4430
+ // src/marketplace.ts
4431
+ import { z as z15 } from "zod";
4432
+ var mcpParameterSchema = z15.object({
4433
+ name: z15.string().min(1),
4434
+ key: z15.string().min(1),
4435
+ placeholder: z15.string().optional(),
4436
+ optional: z15.boolean().optional().default(false)
4437
+ });
4438
+ var mcpInstallationMethodSchema = z15.object({
4439
+ name: z15.string().min(1),
4440
+ content: z15.string().min(1),
4441
+ parameters: z15.array(mcpParameterSchema).optional(),
4442
+ prerequisites: z15.array(z15.string()).optional()
4443
+ });
4444
+ var marketplaceItemTypeSchema = z15.enum(["mode", "mcp"]);
4445
+ var baseMarketplaceItemSchema = z15.object({
4446
+ id: z15.string().min(1),
4447
+ name: z15.string().min(1, "Name is required"),
4448
+ description: z15.string(),
4449
+ author: z15.string().optional(),
4450
+ authorUrl: z15.string().url("Author URL must be a valid URL").optional(),
4451
+ tags: z15.array(z15.string()).optional(),
4452
+ prerequisites: z15.array(z15.string()).optional()
4453
+ });
4454
+ var modeMarketplaceItemSchema = baseMarketplaceItemSchema.extend({
4455
+ content: z15.string().min(1)
4456
+ // YAML content for modes
4457
+ });
4458
+ var mcpMarketplaceItemSchema = baseMarketplaceItemSchema.extend({
4459
+ url: z15.string().url(),
4460
+ // Required url field
4461
+ content: z15.union([z15.string().min(1), z15.array(mcpInstallationMethodSchema)]),
4462
+ // Single config or array of methods
4463
+ parameters: z15.array(mcpParameterSchema).optional()
4464
+ });
4465
+ var marketplaceItemSchema = z15.discriminatedUnion("type", [
4466
+ // Mode marketplace item
4467
+ modeMarketplaceItemSchema.extend({
4468
+ type: z15.literal("mode")
4469
+ }),
4470
+ // MCP marketplace item
4471
+ mcpMarketplaceItemSchema.extend({
4472
+ type: z15.literal("mcp")
4473
+ })
4474
+ ]);
4475
+ var installMarketplaceItemOptionsSchema = z15.object({
4476
+ target: z15.enum(["global", "project"]).optional().default("project"),
4477
+ parameters: z15.record(z15.string(), z15.any()).optional()
4478
+ });
4333
4479
 
4334
- // src/providers/fireworks.ts
4335
- var fireworksDefaultModelId = "accounts/fireworks/models/kimi-k2-instruct";
4336
- var fireworksModels = {
4337
- "accounts/fireworks/models/kimi-k2-instruct": {
4338
- maxTokens: 16384,
4339
- contextWindow: 128e3,
4340
- supportsImages: false,
4341
- supportsPromptCache: false,
4342
- inputPrice: 0.6,
4343
- outputPrice: 2.5,
4344
- 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."
4345
- },
4346
- "accounts/fireworks/models/qwen3-235b-a22b-instruct-2507": {
4347
- maxTokens: 32768,
4348
- contextWindow: 256e3,
4349
- supportsImages: false,
4350
- supportsPromptCache: false,
4351
- inputPrice: 0.22,
4352
- outputPrice: 0.88,
4353
- description: "Latest Qwen3 thinking model, competitive against the best closed source models in Jul 2025."
4354
- },
4355
- "accounts/fireworks/models/qwen3-coder-480b-a35b-instruct": {
4356
- maxTokens: 32768,
4357
- contextWindow: 256e3,
4358
- supportsImages: false,
4359
- supportsPromptCache: false,
4360
- inputPrice: 0.45,
4361
- outputPrice: 1.8,
4362
- description: "Qwen3's most agentic code model to date."
4363
- },
4364
- "accounts/fireworks/models/deepseek-r1-0528": {
4365
- maxTokens: 20480,
4366
- contextWindow: 16e4,
4367
- supportsImages: false,
4368
- supportsPromptCache: false,
4369
- inputPrice: 3,
4370
- outputPrice: 8,
4371
- 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."
4372
- },
4373
- "accounts/fireworks/models/deepseek-v3": {
4374
- maxTokens: 16384,
4375
- contextWindow: 128e3,
4376
- supportsImages: false,
4377
- supportsPromptCache: false,
4378
- inputPrice: 0.9,
4379
- outputPrice: 0.9,
4380
- 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."
4381
- },
4382
- "accounts/fireworks/models/glm-4p5": {
4383
- maxTokens: 16384,
4384
- contextWindow: 128e3,
4385
- supportsImages: false,
4386
- supportsPromptCache: false,
4387
- inputPrice: 0.55,
4388
- outputPrice: 2.19,
4389
- description: "Z.ai GLM-4.5 with 355B total parameters and 32B active parameters. Features unified reasoning, coding, and intelligent agent capabilities."
4390
- },
4391
- "accounts/fireworks/models/glm-4p5-air": {
4392
- maxTokens: 16384,
4393
- contextWindow: 128e3,
4394
- supportsImages: false,
4395
- supportsPromptCache: false,
4396
- inputPrice: 0.55,
4397
- outputPrice: 2.19,
4398
- description: "Z.ai GLM-4.5-Air with 106B total parameters and 12B active parameters. Features unified reasoning, coding, and intelligent agent capabilities."
4399
- },
4400
- "accounts/fireworks/models/gpt-oss-20b": {
4401
- maxTokens: 16384,
4402
- contextWindow: 128e3,
4403
- supportsImages: false,
4404
- supportsPromptCache: false,
4405
- inputPrice: 0.07,
4406
- outputPrice: 0.3,
4407
- 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."
4408
- },
4409
- "accounts/fireworks/models/gpt-oss-120b": {
4410
- maxTokens: 16384,
4411
- contextWindow: 128e3,
4412
- supportsImages: false,
4413
- supportsPromptCache: false,
4414
- inputPrice: 0.15,
4415
- outputPrice: 0.6,
4416
- 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."
4417
- }
4418
- };
4480
+ // src/mcp.ts
4481
+ import { z as z16 } from "zod";
4482
+ var mcpExecutionStatusSchema = z16.discriminatedUnion("status", [
4483
+ z16.object({
4484
+ executionId: z16.string(),
4485
+ status: z16.literal("started"),
4486
+ serverName: z16.string(),
4487
+ toolName: z16.string()
4488
+ }),
4489
+ z16.object({
4490
+ executionId: z16.string(),
4491
+ status: z16.literal("output"),
4492
+ response: z16.string()
4493
+ }),
4494
+ z16.object({
4495
+ executionId: z16.string(),
4496
+ status: z16.literal("completed"),
4497
+ response: z16.string().optional()
4498
+ }),
4499
+ z16.object({
4500
+ executionId: z16.string(),
4501
+ status: z16.literal("error"),
4502
+ error: z16.string().optional()
4503
+ })
4504
+ ]);
4419
4505
 
4420
- // src/providers/roo.ts
4421
- var rooDefaultModelId = "roo/sonic";
4422
- var rooModels = {
4423
- "roo/sonic": {
4424
- maxTokens: 16384,
4425
- contextWindow: 262144,
4426
- supportsImages: false,
4427
- supportsPromptCache: true,
4428
- inputPrice: 0,
4429
- outputPrice: 0,
4430
- 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.)"
4506
+ // src/single-file-read-models.ts
4507
+ var SINGLE_FILE_READ_MODELS = /* @__PURE__ */ new Set(["roo/sonic"]);
4508
+ function shouldUseSingleFileRead(modelId) {
4509
+ if (SINGLE_FILE_READ_MODELS.has(modelId)) {
4510
+ return true;
4431
4511
  }
4432
- };
4433
-
4434
- // src/providers/featherless.ts
4435
- var featherlessModels = {
4436
- "deepseek-ai/DeepSeek-V3-0324": {
4437
- maxTokens: 4096,
4438
- contextWindow: 32678,
4439
- supportsImages: false,
4440
- supportsPromptCache: false,
4441
- inputPrice: 0,
4442
- outputPrice: 0,
4443
- description: "DeepSeek V3 0324 model."
4444
- },
4445
- "deepseek-ai/DeepSeek-R1-0528": {
4446
- maxTokens: 4096,
4447
- contextWindow: 32678,
4448
- supportsImages: false,
4449
- supportsPromptCache: false,
4450
- inputPrice: 0,
4451
- outputPrice: 0,
4452
- description: "DeepSeek R1 0528 model."
4453
- },
4454
- "moonshotai/Kimi-K2-Instruct": {
4455
- maxTokens: 4096,
4456
- contextWindow: 32678,
4457
- supportsImages: false,
4458
- supportsPromptCache: false,
4459
- inputPrice: 0,
4460
- outputPrice: 0,
4461
- description: "Kimi K2 Instruct model."
4462
- },
4463
- "openai/gpt-oss-120b": {
4464
- maxTokens: 4096,
4465
- contextWindow: 32678,
4466
- supportsImages: false,
4467
- supportsPromptCache: false,
4468
- inputPrice: 0,
4469
- outputPrice: 0,
4470
- description: "GPT-OSS 120B model."
4471
- },
4472
- "Qwen/Qwen3-Coder-480B-A35B-Instruct": {
4473
- maxTokens: 4096,
4474
- contextWindow: 32678,
4475
- supportsImages: false,
4476
- supportsPromptCache: false,
4477
- inputPrice: 0,
4478
- outputPrice: 0,
4479
- description: "Qwen3 Coder 480B A35B Instruct model."
4512
+ const patterns = Array.from(SINGLE_FILE_READ_MODELS);
4513
+ for (const pattern of patterns) {
4514
+ if (pattern.endsWith("*") && modelId.startsWith(pattern.slice(0, -1))) {
4515
+ return true;
4516
+ }
4480
4517
  }
4481
- };
4482
- var featherlessDefaultModelId = "deepseek-ai/DeepSeek-R1-0528";
4518
+ return false;
4519
+ }
4520
+
4521
+ // src/task.ts
4522
+ import { z as z17 } from "zod";
4523
+ var TaskStatus = /* @__PURE__ */ ((TaskStatus2) => {
4524
+ TaskStatus2["Running"] = "running";
4525
+ TaskStatus2["Interactive"] = "interactive";
4526
+ TaskStatus2["Resumable"] = "resumable";
4527
+ TaskStatus2["Idle"] = "idle";
4528
+ TaskStatus2["None"] = "none";
4529
+ return TaskStatus2;
4530
+ })(TaskStatus || {});
4531
+ var taskMetadataSchema = z17.object({
4532
+ task: z17.string().optional(),
4533
+ images: z17.array(z17.string()).optional()
4534
+ });
4535
+
4536
+ // src/todo.ts
4537
+ import { z as z18 } from "zod";
4538
+ var todoStatusSchema = z18.enum(["pending", "in_progress", "completed"]);
4539
+ var todoItemSchema = z18.object({
4540
+ id: z18.string(),
4541
+ content: z18.string(),
4542
+ status: todoStatusSchema
4543
+ });
4544
+
4545
+ // src/terminal.ts
4546
+ import { z as z19 } from "zod";
4547
+ var commandExecutionStatusSchema = z19.discriminatedUnion("status", [
4548
+ z19.object({
4549
+ executionId: z19.string(),
4550
+ status: z19.literal("started"),
4551
+ pid: z19.number().optional(),
4552
+ command: z19.string()
4553
+ }),
4554
+ z19.object({
4555
+ executionId: z19.string(),
4556
+ status: z19.literal("output"),
4557
+ output: z19.string()
4558
+ }),
4559
+ z19.object({
4560
+ executionId: z19.string(),
4561
+ status: z19.literal("exited"),
4562
+ exitCode: z19.number().optional()
4563
+ }),
4564
+ z19.object({
4565
+ executionId: z19.string(),
4566
+ status: z19.literal("fallback")
4567
+ }),
4568
+ z19.object({
4569
+ executionId: z19.string(),
4570
+ status: z19.literal("timeout")
4571
+ })
4572
+ ]);
4483
4573
  export {
4484
4574
  ANTHROPIC_DEFAULT_MAX_TOKENS,
4485
4575
  ANTHROPIC_STYLE_PROVIDERS,
@@ -4518,6 +4608,7 @@ export {
4518
4608
  LITELLM_COMPUTER_USE_MODELS,
4519
4609
  LMSTUDIO_DEFAULT_TEMPERATURE,
4520
4610
  MISTRAL_DEFAULT_TEMPERATURE,
4611
+ MODELS_BY_PROVIDER,
4521
4612
  MODEL_ID_KEYS,
4522
4613
  MOONSHOT_DEFAULT_TEMPERATURE,
4523
4614
  OPENAI_AZURE_AI_INFERENCE_PATH,
@@ -4577,7 +4668,6 @@ export {
4577
4668
  experimentIds,
4578
4669
  experimentIdsSchema,
4579
4670
  experimentsSchema,
4580
- extendedReasoningEffortsSchema,
4581
4671
  featherlessDefaultModelId,
4582
4672
  featherlessModels,
4583
4673
  fireworksDefaultModelId,
@@ -4650,6 +4740,7 @@ export {
4650
4740
  providerSettingsSchema,
4651
4741
  providerSettingsSchemaDiscriminated,
4652
4742
  providerSettingsWithIdSchema,
4743
+ reasoningEffortWithMinimalSchema,
4653
4744
  reasoningEfforts,
4654
4745
  reasoningEffortsSchema,
4655
4746
  requestyDefaultModelId,