@roo-code/types 1.54.0 → 1.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1961 -1747
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +572 -338
- package/dist/index.d.ts +572 -338
- package/dist/index.js +1955 -1746
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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,1076 +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
|
-
"io-intelligence",
|
|
461
|
-
"roo"
|
|
462
|
-
];
|
|
463
|
-
var providerNamesSchema = z8.enum(providerNames);
|
|
464
|
-
var providerSettingsEntrySchema = z8.object({
|
|
465
|
-
id: z8.string(),
|
|
466
|
-
name: z8.string(),
|
|
467
|
-
apiProvider: providerNamesSchema.optional()
|
|
468
|
-
});
|
|
469
|
-
var DEFAULT_CONSECUTIVE_MISTAKE_LIMIT = 3;
|
|
470
|
-
var baseProviderSettingsSchema = z8.object({
|
|
471
|
-
includeMaxTokens: z8.boolean().optional(),
|
|
472
|
-
diffEnabled: z8.boolean().optional(),
|
|
473
|
-
todoListEnabled: z8.boolean().optional(),
|
|
474
|
-
fuzzyMatchThreshold: z8.number().optional(),
|
|
475
|
-
modelTemperature: z8.number().nullish(),
|
|
476
|
-
rateLimitSeconds: z8.number().optional(),
|
|
477
|
-
consecutiveMistakeLimit: z8.number().min(0).optional(),
|
|
478
|
-
// Model reasoning.
|
|
479
|
-
enableReasoningEffort: z8.boolean().optional(),
|
|
480
|
-
reasoningEffort: extendedReasoningEffortsSchema.optional(),
|
|
481
|
-
modelMaxTokens: z8.number().optional(),
|
|
482
|
-
modelMaxThinkingTokens: z8.number().optional(),
|
|
483
|
-
// Model verbosity.
|
|
484
|
-
verbosity: verbosityLevelsSchema.optional()
|
|
485
|
-
});
|
|
486
|
-
var apiModelIdProviderModelSchema = baseProviderSettingsSchema.extend({
|
|
487
|
-
apiModelId: z8.string().optional()
|
|
488
|
-
});
|
|
489
|
-
var anthropicSchema = apiModelIdProviderModelSchema.extend({
|
|
490
|
-
apiKey: z8.string().optional(),
|
|
491
|
-
anthropicBaseUrl: z8.string().optional(),
|
|
492
|
-
anthropicUseAuthToken: z8.boolean().optional(),
|
|
493
|
-
anthropicBeta1MContext: z8.boolean().optional()
|
|
494
|
-
// Enable 'context-1m-2025-08-07' beta for 1M context window
|
|
495
|
-
});
|
|
496
|
-
var claudeCodeSchema = apiModelIdProviderModelSchema.extend({
|
|
497
|
-
claudeCodePath: z8.string().optional(),
|
|
498
|
-
claudeCodeMaxOutputTokens: z8.number().int().min(1).max(2e5).optional()
|
|
499
|
-
});
|
|
500
|
-
var glamaSchema = baseProviderSettingsSchema.extend({
|
|
501
|
-
glamaModelId: z8.string().optional(),
|
|
502
|
-
glamaApiKey: z8.string().optional()
|
|
503
|
-
});
|
|
504
|
-
var openRouterSchema = baseProviderSettingsSchema.extend({
|
|
505
|
-
openRouterApiKey: z8.string().optional(),
|
|
506
|
-
openRouterModelId: z8.string().optional(),
|
|
507
|
-
openRouterBaseUrl: z8.string().optional(),
|
|
508
|
-
openRouterSpecificProvider: z8.string().optional(),
|
|
509
|
-
openRouterUseMiddleOutTransform: z8.boolean().optional()
|
|
510
|
-
});
|
|
511
|
-
var bedrockSchema = apiModelIdProviderModelSchema.extend({
|
|
512
|
-
awsAccessKey: z8.string().optional(),
|
|
513
|
-
awsSecretKey: z8.string().optional(),
|
|
514
|
-
awsSessionToken: z8.string().optional(),
|
|
515
|
-
awsRegion: z8.string().optional(),
|
|
516
|
-
awsUseCrossRegionInference: z8.boolean().optional(),
|
|
517
|
-
awsUsePromptCache: z8.boolean().optional(),
|
|
518
|
-
awsProfile: z8.string().optional(),
|
|
519
|
-
awsUseProfile: z8.boolean().optional(),
|
|
520
|
-
awsApiKey: z8.string().optional(),
|
|
521
|
-
awsUseApiKey: z8.boolean().optional(),
|
|
522
|
-
awsCustomArn: z8.string().optional(),
|
|
523
|
-
awsModelContextWindow: z8.number().optional(),
|
|
524
|
-
awsBedrockEndpointEnabled: z8.boolean().optional(),
|
|
525
|
-
awsBedrockEndpoint: z8.string().optional(),
|
|
526
|
-
awsBedrock1MContext: z8.boolean().optional()
|
|
527
|
-
// Enable 'context-1m-2025-08-07' beta for 1M context window
|
|
528
|
-
});
|
|
529
|
-
var vertexSchema = apiModelIdProviderModelSchema.extend({
|
|
530
|
-
vertexKeyFile: z8.string().optional(),
|
|
531
|
-
vertexJsonCredentials: z8.string().optional(),
|
|
532
|
-
vertexProjectId: z8.string().optional(),
|
|
533
|
-
vertexRegion: z8.string().optional()
|
|
534
|
-
});
|
|
535
|
-
var openAiSchema = baseProviderSettingsSchema.extend({
|
|
536
|
-
openAiBaseUrl: z8.string().optional(),
|
|
537
|
-
openAiApiKey: z8.string().optional(),
|
|
538
|
-
openAiLegacyFormat: z8.boolean().optional(),
|
|
539
|
-
openAiR1FormatEnabled: z8.boolean().optional(),
|
|
540
|
-
openAiModelId: z8.string().optional(),
|
|
541
|
-
openAiCustomModelInfo: modelInfoSchema.nullish(),
|
|
542
|
-
openAiUseAzure: z8.boolean().optional(),
|
|
543
|
-
azureApiVersion: z8.string().optional(),
|
|
544
|
-
openAiStreamingEnabled: z8.boolean().optional(),
|
|
545
|
-
openAiHostHeader: z8.string().optional(),
|
|
546
|
-
// Keep temporarily for backward compatibility during migration.
|
|
547
|
-
openAiHeaders: z8.record(z8.string(), z8.string()).optional()
|
|
548
|
-
});
|
|
549
|
-
var ollamaSchema = baseProviderSettingsSchema.extend({
|
|
550
|
-
ollamaModelId: z8.string().optional(),
|
|
551
|
-
ollamaBaseUrl: z8.string().optional()
|
|
552
|
-
});
|
|
553
|
-
var vsCodeLmSchema = baseProviderSettingsSchema.extend({
|
|
554
|
-
vsCodeLmModelSelector: z8.object({
|
|
555
|
-
vendor: z8.string().optional(),
|
|
556
|
-
family: z8.string().optional(),
|
|
557
|
-
version: z8.string().optional(),
|
|
558
|
-
id: z8.string().optional()
|
|
559
|
-
}).optional()
|
|
560
|
-
});
|
|
561
|
-
var lmStudioSchema = baseProviderSettingsSchema.extend({
|
|
562
|
-
lmStudioModelId: z8.string().optional(),
|
|
563
|
-
lmStudioBaseUrl: z8.string().optional(),
|
|
564
|
-
lmStudioDraftModelId: z8.string().optional(),
|
|
565
|
-
lmStudioSpeculativeDecodingEnabled: z8.boolean().optional()
|
|
566
|
-
});
|
|
567
|
-
var geminiSchema = apiModelIdProviderModelSchema.extend({
|
|
568
|
-
geminiApiKey: z8.string().optional(),
|
|
569
|
-
googleGeminiBaseUrl: z8.string().optional(),
|
|
570
|
-
enableUrlContext: z8.boolean().optional(),
|
|
571
|
-
enableGrounding: z8.boolean().optional()
|
|
572
|
-
});
|
|
573
|
-
var geminiCliSchema = apiModelIdProviderModelSchema.extend({
|
|
574
|
-
geminiCliOAuthPath: z8.string().optional(),
|
|
575
|
-
geminiCliProjectId: z8.string().optional()
|
|
576
|
-
});
|
|
577
|
-
var openAiNativeSchema = apiModelIdProviderModelSchema.extend({
|
|
578
|
-
openAiNativeApiKey: z8.string().optional(),
|
|
579
|
-
openAiNativeBaseUrl: z8.string().optional()
|
|
580
|
-
});
|
|
581
|
-
var mistralSchema = apiModelIdProviderModelSchema.extend({
|
|
582
|
-
mistralApiKey: z8.string().optional(),
|
|
583
|
-
mistralCodestralUrl: z8.string().optional()
|
|
584
|
-
});
|
|
585
|
-
var deepSeekSchema = apiModelIdProviderModelSchema.extend({
|
|
586
|
-
deepSeekBaseUrl: z8.string().optional(),
|
|
587
|
-
deepSeekApiKey: z8.string().optional()
|
|
588
|
-
});
|
|
589
|
-
var doubaoSchema = apiModelIdProviderModelSchema.extend({
|
|
590
|
-
doubaoBaseUrl: z8.string().optional(),
|
|
591
|
-
doubaoApiKey: z8.string().optional()
|
|
592
|
-
});
|
|
593
|
-
var moonshotSchema = apiModelIdProviderModelSchema.extend({
|
|
594
|
-
moonshotBaseUrl: z8.union([z8.literal("https://api.moonshot.ai/v1"), z8.literal("https://api.moonshot.cn/v1")]).optional(),
|
|
595
|
-
moonshotApiKey: z8.string().optional()
|
|
596
|
-
});
|
|
597
|
-
var unboundSchema = baseProviderSettingsSchema.extend({
|
|
598
|
-
unboundApiKey: z8.string().optional(),
|
|
599
|
-
unboundModelId: z8.string().optional()
|
|
600
|
-
});
|
|
601
|
-
var requestySchema = baseProviderSettingsSchema.extend({
|
|
602
|
-
requestyBaseUrl: z8.string().optional(),
|
|
603
|
-
requestyApiKey: z8.string().optional(),
|
|
604
|
-
requestyModelId: z8.string().optional()
|
|
605
|
-
});
|
|
606
|
-
var humanRelaySchema = baseProviderSettingsSchema;
|
|
607
|
-
var fakeAiSchema = baseProviderSettingsSchema.extend({
|
|
608
|
-
fakeAi: z8.unknown().optional()
|
|
609
|
-
});
|
|
610
|
-
var xaiSchema = apiModelIdProviderModelSchema.extend({
|
|
611
|
-
xaiApiKey: z8.string().optional()
|
|
612
|
-
});
|
|
613
|
-
var groqSchema = apiModelIdProviderModelSchema.extend({
|
|
614
|
-
groqApiKey: z8.string().optional()
|
|
615
|
-
});
|
|
616
|
-
var huggingFaceSchema = baseProviderSettingsSchema.extend({
|
|
617
|
-
huggingFaceApiKey: z8.string().optional(),
|
|
618
|
-
huggingFaceModelId: z8.string().optional(),
|
|
619
|
-
huggingFaceInferenceProvider: z8.string().optional()
|
|
620
|
-
});
|
|
621
|
-
var chutesSchema = apiModelIdProviderModelSchema.extend({
|
|
622
|
-
chutesApiKey: z8.string().optional()
|
|
623
|
-
});
|
|
624
|
-
var litellmSchema = baseProviderSettingsSchema.extend({
|
|
625
|
-
litellmBaseUrl: z8.string().optional(),
|
|
626
|
-
litellmApiKey: z8.string().optional(),
|
|
627
|
-
litellmModelId: z8.string().optional(),
|
|
628
|
-
litellmUsePromptCache: z8.boolean().optional()
|
|
629
|
-
});
|
|
630
|
-
var cerebrasSchema = apiModelIdProviderModelSchema.extend({
|
|
631
|
-
cerebrasApiKey: z8.string().optional()
|
|
632
|
-
});
|
|
633
|
-
var sambaNovaSchema = apiModelIdProviderModelSchema.extend({
|
|
634
|
-
sambaNovaApiKey: z8.string().optional()
|
|
635
|
-
});
|
|
636
|
-
var zaiSchema = apiModelIdProviderModelSchema.extend({
|
|
637
|
-
zaiApiKey: z8.string().optional(),
|
|
638
|
-
zaiApiLine: z8.union([z8.literal("china"), z8.literal("international")]).optional()
|
|
639
|
-
});
|
|
640
|
-
var fireworksSchema = apiModelIdProviderModelSchema.extend({
|
|
641
|
-
fireworksApiKey: z8.string().optional()
|
|
642
|
-
});
|
|
643
|
-
var ioIntelligenceSchema = apiModelIdProviderModelSchema.extend({
|
|
644
|
-
ioIntelligenceModelId: z8.string().optional(),
|
|
645
|
-
ioIntelligenceApiKey: z8.string().optional()
|
|
646
|
-
});
|
|
647
|
-
var rooSchema = apiModelIdProviderModelSchema.extend({
|
|
648
|
-
// No additional fields needed - uses cloud authentication
|
|
649
|
-
});
|
|
650
|
-
var defaultSchema = z8.object({
|
|
651
|
-
apiProvider: z8.undefined()
|
|
652
|
-
});
|
|
653
|
-
var providerSettingsSchemaDiscriminated = z8.discriminatedUnion("apiProvider", [
|
|
654
|
-
anthropicSchema.merge(z8.object({ apiProvider: z8.literal("anthropic") })),
|
|
655
|
-
claudeCodeSchema.merge(z8.object({ apiProvider: z8.literal("claude-code") })),
|
|
656
|
-
glamaSchema.merge(z8.object({ apiProvider: z8.literal("glama") })),
|
|
657
|
-
openRouterSchema.merge(z8.object({ apiProvider: z8.literal("openrouter") })),
|
|
658
|
-
bedrockSchema.merge(z8.object({ apiProvider: z8.literal("bedrock") })),
|
|
659
|
-
vertexSchema.merge(z8.object({ apiProvider: z8.literal("vertex") })),
|
|
660
|
-
openAiSchema.merge(z8.object({ apiProvider: z8.literal("openai") })),
|
|
661
|
-
ollamaSchema.merge(z8.object({ apiProvider: z8.literal("ollama") })),
|
|
662
|
-
vsCodeLmSchema.merge(z8.object({ apiProvider: z8.literal("vscode-lm") })),
|
|
663
|
-
lmStudioSchema.merge(z8.object({ apiProvider: z8.literal("lmstudio") })),
|
|
664
|
-
geminiSchema.merge(z8.object({ apiProvider: z8.literal("gemini") })),
|
|
665
|
-
geminiCliSchema.merge(z8.object({ apiProvider: z8.literal("gemini-cli") })),
|
|
666
|
-
openAiNativeSchema.merge(z8.object({ apiProvider: z8.literal("openai-native") })),
|
|
667
|
-
mistralSchema.merge(z8.object({ apiProvider: z8.literal("mistral") })),
|
|
668
|
-
deepSeekSchema.merge(z8.object({ apiProvider: z8.literal("deepseek") })),
|
|
669
|
-
doubaoSchema.merge(z8.object({ apiProvider: z8.literal("doubao") })),
|
|
670
|
-
moonshotSchema.merge(z8.object({ apiProvider: z8.literal("moonshot") })),
|
|
671
|
-
unboundSchema.merge(z8.object({ apiProvider: z8.literal("unbound") })),
|
|
672
|
-
requestySchema.merge(z8.object({ apiProvider: z8.literal("requesty") })),
|
|
673
|
-
humanRelaySchema.merge(z8.object({ apiProvider: z8.literal("human-relay") })),
|
|
674
|
-
fakeAiSchema.merge(z8.object({ apiProvider: z8.literal("fake-ai") })),
|
|
675
|
-
xaiSchema.merge(z8.object({ apiProvider: z8.literal("xai") })),
|
|
676
|
-
groqSchema.merge(z8.object({ apiProvider: z8.literal("groq") })),
|
|
677
|
-
huggingFaceSchema.merge(z8.object({ apiProvider: z8.literal("huggingface") })),
|
|
678
|
-
chutesSchema.merge(z8.object({ apiProvider: z8.literal("chutes") })),
|
|
679
|
-
litellmSchema.merge(z8.object({ apiProvider: z8.literal("litellm") })),
|
|
680
|
-
cerebrasSchema.merge(z8.object({ apiProvider: z8.literal("cerebras") })),
|
|
681
|
-
sambaNovaSchema.merge(z8.object({ apiProvider: z8.literal("sambanova") })),
|
|
682
|
-
zaiSchema.merge(z8.object({ apiProvider: z8.literal("zai") })),
|
|
683
|
-
fireworksSchema.merge(z8.object({ apiProvider: z8.literal("fireworks") })),
|
|
684
|
-
ioIntelligenceSchema.merge(z8.object({ apiProvider: z8.literal("io-intelligence") })),
|
|
685
|
-
rooSchema.merge(z8.object({ apiProvider: z8.literal("roo") })),
|
|
686
|
-
defaultSchema
|
|
687
|
-
]);
|
|
688
|
-
var providerSettingsSchema = z8.object({
|
|
689
|
-
apiProvider: providerNamesSchema.optional(),
|
|
690
|
-
...anthropicSchema.shape,
|
|
691
|
-
...claudeCodeSchema.shape,
|
|
692
|
-
...glamaSchema.shape,
|
|
693
|
-
...openRouterSchema.shape,
|
|
694
|
-
...bedrockSchema.shape,
|
|
695
|
-
...vertexSchema.shape,
|
|
696
|
-
...openAiSchema.shape,
|
|
697
|
-
...ollamaSchema.shape,
|
|
698
|
-
...vsCodeLmSchema.shape,
|
|
699
|
-
...lmStudioSchema.shape,
|
|
700
|
-
...geminiSchema.shape,
|
|
701
|
-
...geminiCliSchema.shape,
|
|
702
|
-
...openAiNativeSchema.shape,
|
|
703
|
-
...mistralSchema.shape,
|
|
704
|
-
...deepSeekSchema.shape,
|
|
705
|
-
...doubaoSchema.shape,
|
|
706
|
-
...moonshotSchema.shape,
|
|
707
|
-
...unboundSchema.shape,
|
|
708
|
-
...requestySchema.shape,
|
|
709
|
-
...humanRelaySchema.shape,
|
|
710
|
-
...fakeAiSchema.shape,
|
|
711
|
-
...xaiSchema.shape,
|
|
712
|
-
...groqSchema.shape,
|
|
713
|
-
...huggingFaceSchema.shape,
|
|
714
|
-
...chutesSchema.shape,
|
|
715
|
-
...litellmSchema.shape,
|
|
716
|
-
...cerebrasSchema.shape,
|
|
717
|
-
...sambaNovaSchema.shape,
|
|
718
|
-
...zaiSchema.shape,
|
|
719
|
-
...fireworksSchema.shape,
|
|
720
|
-
...ioIntelligenceSchema.shape,
|
|
721
|
-
...rooSchema.shape,
|
|
722
|
-
...codebaseIndexProviderSchema.shape
|
|
723
|
-
});
|
|
724
|
-
var providerSettingsWithIdSchema = providerSettingsSchema.extend({ id: z8.string().optional() });
|
|
725
|
-
var discriminatedProviderSettingsWithIdSchema = providerSettingsSchemaDiscriminated.and(
|
|
726
|
-
z8.object({ id: z8.string().optional() })
|
|
727
|
-
);
|
|
728
|
-
var PROVIDER_SETTINGS_KEYS = providerSettingsSchema.keyof().options;
|
|
729
|
-
var MODEL_ID_KEYS = [
|
|
730
|
-
"apiModelId",
|
|
731
|
-
"glamaModelId",
|
|
732
|
-
"openRouterModelId",
|
|
733
|
-
"openAiModelId",
|
|
734
|
-
"ollamaModelId",
|
|
735
|
-
"lmStudioModelId",
|
|
736
|
-
"lmStudioDraftModelId",
|
|
737
|
-
"unboundModelId",
|
|
738
|
-
"requestyModelId",
|
|
739
|
-
"litellmModelId",
|
|
740
|
-
"huggingFaceModelId",
|
|
741
|
-
"ioIntelligenceModelId"
|
|
742
|
-
];
|
|
743
|
-
var getModelId = (settings) => {
|
|
744
|
-
const modelIdKey = MODEL_ID_KEYS.find((key) => settings[key]);
|
|
745
|
-
return modelIdKey ? settings[modelIdKey] : void 0;
|
|
746
|
-
};
|
|
747
|
-
var ANTHROPIC_STYLE_PROVIDERS = ["anthropic", "claude-code", "bedrock"];
|
|
748
|
-
var getApiProtocol = (provider, modelId) => {
|
|
749
|
-
if (provider && ANTHROPIC_STYLE_PROVIDERS.includes(provider)) {
|
|
750
|
-
return "anthropic";
|
|
751
|
-
}
|
|
752
|
-
if (provider && provider === "vertex" && modelId && modelId.toLowerCase().includes("claude")) {
|
|
753
|
-
return "anthropic";
|
|
754
|
-
}
|
|
755
|
-
return "openai";
|
|
756
|
-
};
|
|
757
|
-
|
|
758
|
-
// src/history.ts
|
|
759
|
-
import { z as z9 } from "zod";
|
|
760
|
-
var historyItemSchema = z9.object({
|
|
761
|
-
id: z9.string(),
|
|
762
|
-
number: z9.number(),
|
|
763
|
-
ts: z9.number(),
|
|
764
|
-
task: z9.string(),
|
|
765
|
-
tokensIn: z9.number(),
|
|
766
|
-
tokensOut: z9.number(),
|
|
767
|
-
cacheWrites: z9.number().optional(),
|
|
768
|
-
cacheReads: z9.number().optional(),
|
|
769
|
-
totalCost: z9.number(),
|
|
770
|
-
size: z9.number().optional(),
|
|
771
|
-
workspace: z9.string().optional(),
|
|
772
|
-
mode: z9.string().optional()
|
|
773
|
-
});
|
|
774
|
-
|
|
775
|
-
// src/telemetry.ts
|
|
776
|
-
import { z as z10 } from "zod";
|
|
777
|
-
var telemetrySettings = ["unset", "enabled", "disabled"];
|
|
778
|
-
var telemetrySettingsSchema = z10.enum(telemetrySettings);
|
|
779
|
-
var TelemetryEventName = /* @__PURE__ */ ((TelemetryEventName2) => {
|
|
780
|
-
TelemetryEventName2["TASK_CREATED"] = "Task Created";
|
|
781
|
-
TelemetryEventName2["TASK_RESTARTED"] = "Task Reopened";
|
|
782
|
-
TelemetryEventName2["TASK_COMPLETED"] = "Task Completed";
|
|
783
|
-
TelemetryEventName2["TASK_MESSAGE"] = "Task Message";
|
|
784
|
-
TelemetryEventName2["TASK_CONVERSATION_MESSAGE"] = "Conversation Message";
|
|
785
|
-
TelemetryEventName2["LLM_COMPLETION"] = "LLM Completion";
|
|
786
|
-
TelemetryEventName2["MODE_SWITCH"] = "Mode Switched";
|
|
787
|
-
TelemetryEventName2["MODE_SELECTOR_OPENED"] = "Mode Selector Opened";
|
|
788
|
-
TelemetryEventName2["TOOL_USED"] = "Tool Used";
|
|
789
|
-
TelemetryEventName2["CHECKPOINT_CREATED"] = "Checkpoint Created";
|
|
790
|
-
TelemetryEventName2["CHECKPOINT_RESTORED"] = "Checkpoint Restored";
|
|
791
|
-
TelemetryEventName2["CHECKPOINT_DIFFED"] = "Checkpoint Diffed";
|
|
792
|
-
TelemetryEventName2["TAB_SHOWN"] = "Tab Shown";
|
|
793
|
-
TelemetryEventName2["MODE_SETTINGS_CHANGED"] = "Mode Setting Changed";
|
|
794
|
-
TelemetryEventName2["CUSTOM_MODE_CREATED"] = "Custom Mode Created";
|
|
795
|
-
TelemetryEventName2["CONTEXT_CONDENSED"] = "Context Condensed";
|
|
796
|
-
TelemetryEventName2["SLIDING_WINDOW_TRUNCATION"] = "Sliding Window Truncation";
|
|
797
|
-
TelemetryEventName2["CODE_ACTION_USED"] = "Code Action Used";
|
|
798
|
-
TelemetryEventName2["PROMPT_ENHANCED"] = "Prompt Enhanced";
|
|
799
|
-
TelemetryEventName2["TITLE_BUTTON_CLICKED"] = "Title Button Clicked";
|
|
800
|
-
TelemetryEventName2["AUTHENTICATION_INITIATED"] = "Authentication Initiated";
|
|
801
|
-
TelemetryEventName2["MARKETPLACE_ITEM_INSTALLED"] = "Marketplace Item Installed";
|
|
802
|
-
TelemetryEventName2["MARKETPLACE_ITEM_REMOVED"] = "Marketplace Item Removed";
|
|
803
|
-
TelemetryEventName2["MARKETPLACE_TAB_VIEWED"] = "Marketplace Tab Viewed";
|
|
804
|
-
TelemetryEventName2["MARKETPLACE_INSTALL_BUTTON_CLICKED"] = "Marketplace Install Button Clicked";
|
|
805
|
-
TelemetryEventName2["SHARE_BUTTON_CLICKED"] = "Share Button Clicked";
|
|
806
|
-
TelemetryEventName2["SHARE_ORGANIZATION_CLICKED"] = "Share Organization Clicked";
|
|
807
|
-
TelemetryEventName2["SHARE_PUBLIC_CLICKED"] = "Share Public Clicked";
|
|
808
|
-
TelemetryEventName2["SHARE_CONNECT_TO_CLOUD_CLICKED"] = "Share Connect To Cloud Clicked";
|
|
809
|
-
TelemetryEventName2["ACCOUNT_CONNECT_CLICKED"] = "Account Connect Clicked";
|
|
810
|
-
TelemetryEventName2["ACCOUNT_CONNECT_SUCCESS"] = "Account Connect Success";
|
|
811
|
-
TelemetryEventName2["ACCOUNT_LOGOUT_CLICKED"] = "Account Logout Clicked";
|
|
812
|
-
TelemetryEventName2["ACCOUNT_LOGOUT_SUCCESS"] = "Account Logout Success";
|
|
813
|
-
TelemetryEventName2["SCHEMA_VALIDATION_ERROR"] = "Schema Validation Error";
|
|
814
|
-
TelemetryEventName2["DIFF_APPLICATION_ERROR"] = "Diff Application Error";
|
|
815
|
-
TelemetryEventName2["SHELL_INTEGRATION_ERROR"] = "Shell Integration Error";
|
|
816
|
-
TelemetryEventName2["CONSECUTIVE_MISTAKE_ERROR"] = "Consecutive Mistake Error";
|
|
817
|
-
TelemetryEventName2["CODE_INDEX_ERROR"] = "Code Index Error";
|
|
818
|
-
return TelemetryEventName2;
|
|
819
|
-
})(TelemetryEventName || {});
|
|
820
|
-
var staticAppPropertiesSchema = z10.object({
|
|
821
|
-
appName: z10.string(),
|
|
822
|
-
appVersion: z10.string(),
|
|
823
|
-
vscodeVersion: z10.string(),
|
|
824
|
-
platform: z10.string(),
|
|
825
|
-
editorName: z10.string()
|
|
826
|
-
});
|
|
827
|
-
var dynamicAppPropertiesSchema = z10.object({
|
|
828
|
-
language: z10.string(),
|
|
829
|
-
mode: z10.string()
|
|
830
|
-
});
|
|
831
|
-
var cloudAppPropertiesSchema = z10.object({
|
|
832
|
-
cloudIsAuthenticated: z10.boolean().optional()
|
|
833
|
-
});
|
|
834
|
-
var appPropertiesSchema = z10.object({
|
|
835
|
-
...staticAppPropertiesSchema.shape,
|
|
836
|
-
...dynamicAppPropertiesSchema.shape,
|
|
837
|
-
...cloudAppPropertiesSchema.shape
|
|
838
|
-
});
|
|
839
|
-
var taskPropertiesSchema = z10.object({
|
|
840
|
-
taskId: z10.string().optional(),
|
|
841
|
-
apiProvider: z10.enum(providerNames).optional(),
|
|
842
|
-
modelId: z10.string().optional(),
|
|
843
|
-
diffStrategy: z10.string().optional(),
|
|
844
|
-
isSubtask: z10.boolean().optional(),
|
|
845
|
-
todos: z10.object({
|
|
846
|
-
total: z10.number(),
|
|
847
|
-
completed: z10.number(),
|
|
848
|
-
inProgress: z10.number(),
|
|
849
|
-
pending: z10.number()
|
|
850
|
-
}).optional()
|
|
851
|
-
});
|
|
852
|
-
var gitPropertiesSchema = z10.object({
|
|
853
|
-
repositoryUrl: z10.string().optional(),
|
|
854
|
-
repositoryName: z10.string().optional(),
|
|
855
|
-
defaultBranch: z10.string().optional()
|
|
856
|
-
});
|
|
857
|
-
var telemetryPropertiesSchema = z10.object({
|
|
858
|
-
...appPropertiesSchema.shape,
|
|
859
|
-
...taskPropertiesSchema.shape,
|
|
860
|
-
...gitPropertiesSchema.shape
|
|
861
|
-
});
|
|
862
|
-
var rooCodeTelemetryEventSchema = z10.discriminatedUnion("type", [
|
|
863
|
-
z10.object({
|
|
864
|
-
type: z10.enum([
|
|
865
|
-
"Task Created" /* TASK_CREATED */,
|
|
866
|
-
"Task Reopened" /* TASK_RESTARTED */,
|
|
867
|
-
"Task Completed" /* TASK_COMPLETED */,
|
|
868
|
-
"Conversation Message" /* TASK_CONVERSATION_MESSAGE */,
|
|
869
|
-
"Mode Switched" /* MODE_SWITCH */,
|
|
870
|
-
"Mode Selector Opened" /* MODE_SELECTOR_OPENED */,
|
|
871
|
-
"Tool Used" /* TOOL_USED */,
|
|
872
|
-
"Checkpoint Created" /* CHECKPOINT_CREATED */,
|
|
873
|
-
"Checkpoint Restored" /* CHECKPOINT_RESTORED */,
|
|
874
|
-
"Checkpoint Diffed" /* CHECKPOINT_DIFFED */,
|
|
875
|
-
"Code Action Used" /* CODE_ACTION_USED */,
|
|
876
|
-
"Prompt Enhanced" /* PROMPT_ENHANCED */,
|
|
877
|
-
"Title Button Clicked" /* TITLE_BUTTON_CLICKED */,
|
|
878
|
-
"Authentication Initiated" /* AUTHENTICATION_INITIATED */,
|
|
879
|
-
"Marketplace Item Installed" /* MARKETPLACE_ITEM_INSTALLED */,
|
|
880
|
-
"Marketplace Item Removed" /* MARKETPLACE_ITEM_REMOVED */,
|
|
881
|
-
"Marketplace Tab Viewed" /* MARKETPLACE_TAB_VIEWED */,
|
|
882
|
-
"Marketplace Install Button Clicked" /* MARKETPLACE_INSTALL_BUTTON_CLICKED */,
|
|
883
|
-
"Share Button Clicked" /* SHARE_BUTTON_CLICKED */,
|
|
884
|
-
"Share Organization Clicked" /* SHARE_ORGANIZATION_CLICKED */,
|
|
885
|
-
"Share Public Clicked" /* SHARE_PUBLIC_CLICKED */,
|
|
886
|
-
"Share Connect To Cloud Clicked" /* SHARE_CONNECT_TO_CLOUD_CLICKED */,
|
|
887
|
-
"Account Connect Clicked" /* ACCOUNT_CONNECT_CLICKED */,
|
|
888
|
-
"Account Connect Success" /* ACCOUNT_CONNECT_SUCCESS */,
|
|
889
|
-
"Account Logout Clicked" /* ACCOUNT_LOGOUT_CLICKED */,
|
|
890
|
-
"Account Logout Success" /* ACCOUNT_LOGOUT_SUCCESS */,
|
|
891
|
-
"Schema Validation Error" /* SCHEMA_VALIDATION_ERROR */,
|
|
892
|
-
"Diff Application Error" /* DIFF_APPLICATION_ERROR */,
|
|
893
|
-
"Shell Integration Error" /* SHELL_INTEGRATION_ERROR */,
|
|
894
|
-
"Consecutive Mistake Error" /* CONSECUTIVE_MISTAKE_ERROR */,
|
|
895
|
-
"Code Index Error" /* CODE_INDEX_ERROR */,
|
|
896
|
-
"Context Condensed" /* CONTEXT_CONDENSED */,
|
|
897
|
-
"Sliding Window Truncation" /* SLIDING_WINDOW_TRUNCATION */,
|
|
898
|
-
"Tab Shown" /* TAB_SHOWN */,
|
|
899
|
-
"Mode Setting Changed" /* MODE_SETTINGS_CHANGED */,
|
|
900
|
-
"Custom Mode Created" /* CUSTOM_MODE_CREATED */
|
|
901
|
-
]),
|
|
902
|
-
properties: telemetryPropertiesSchema
|
|
903
|
-
}),
|
|
904
|
-
z10.object({
|
|
905
|
-
type: z10.literal("Task Message" /* TASK_MESSAGE */),
|
|
906
|
-
properties: z10.object({
|
|
907
|
-
...telemetryPropertiesSchema.shape,
|
|
908
|
-
taskId: z10.string(),
|
|
909
|
-
message: clineMessageSchema
|
|
910
|
-
})
|
|
911
|
-
}),
|
|
912
|
-
z10.object({
|
|
913
|
-
type: z10.literal("LLM Completion" /* LLM_COMPLETION */),
|
|
914
|
-
properties: z10.object({
|
|
915
|
-
...telemetryPropertiesSchema.shape,
|
|
916
|
-
inputTokens: z10.number(),
|
|
917
|
-
outputTokens: z10.number(),
|
|
918
|
-
cacheReadTokens: z10.number().optional(),
|
|
919
|
-
cacheWriteTokens: z10.number().optional(),
|
|
920
|
-
cost: z10.number().optional()
|
|
921
|
-
})
|
|
922
|
-
})
|
|
923
|
-
]);
|
|
924
|
-
|
|
925
|
-
// src/mode.ts
|
|
926
|
-
import { z as z11 } from "zod";
|
|
927
|
-
var groupOptionsSchema = z11.object({
|
|
928
|
-
fileRegex: z11.string().optional().refine(
|
|
929
|
-
(pattern) => {
|
|
930
|
-
if (!pattern) {
|
|
931
|
-
return true;
|
|
932
|
-
}
|
|
933
|
-
try {
|
|
934
|
-
new RegExp(pattern);
|
|
935
|
-
return true;
|
|
936
|
-
} catch {
|
|
937
|
-
return false;
|
|
938
|
-
}
|
|
939
|
-
},
|
|
940
|
-
{ message: "Invalid regular expression pattern" }
|
|
941
|
-
),
|
|
942
|
-
description: z11.string().optional()
|
|
943
|
-
});
|
|
944
|
-
var groupEntrySchema = z11.union([toolGroupsSchema, z11.tuple([toolGroupsSchema, groupOptionsSchema])]);
|
|
945
|
-
var groupEntryArraySchema = z11.array(groupEntrySchema).refine(
|
|
946
|
-
(groups) => {
|
|
947
|
-
const seen = /* @__PURE__ */ new Set();
|
|
948
|
-
return groups.every((group) => {
|
|
949
|
-
const groupName = Array.isArray(group) ? group[0] : group;
|
|
950
|
-
if (seen.has(groupName)) {
|
|
951
|
-
return false;
|
|
952
|
-
}
|
|
953
|
-
seen.add(groupName);
|
|
954
|
-
return true;
|
|
955
|
-
});
|
|
956
|
-
},
|
|
957
|
-
{ message: "Duplicate groups are not allowed" }
|
|
958
|
-
);
|
|
959
|
-
var modeConfigSchema = z11.object({
|
|
960
|
-
slug: z11.string().regex(/^[a-zA-Z0-9-]+$/, "Slug must contain only letters numbers and dashes"),
|
|
961
|
-
name: z11.string().min(1, "Name is required"),
|
|
962
|
-
roleDefinition: z11.string().min(1, "Role definition is required"),
|
|
963
|
-
whenToUse: z11.string().optional(),
|
|
964
|
-
description: z11.string().optional(),
|
|
965
|
-
customInstructions: z11.string().optional(),
|
|
966
|
-
groups: groupEntryArraySchema,
|
|
967
|
-
source: z11.enum(["global", "project"]).optional()
|
|
968
|
-
});
|
|
969
|
-
var customModesSettingsSchema = z11.object({
|
|
970
|
-
customModes: z11.array(modeConfigSchema).refine(
|
|
971
|
-
(modes) => {
|
|
972
|
-
const slugs = /* @__PURE__ */ new Set();
|
|
973
|
-
return modes.every((mode) => {
|
|
974
|
-
if (slugs.has(mode.slug)) {
|
|
975
|
-
return false;
|
|
976
|
-
}
|
|
977
|
-
slugs.add(mode.slug);
|
|
978
|
-
return true;
|
|
979
|
-
});
|
|
980
|
-
},
|
|
981
|
-
{
|
|
982
|
-
message: "Duplicate mode slugs are not allowed"
|
|
983
|
-
}
|
|
984
|
-
)
|
|
985
|
-
});
|
|
986
|
-
var promptComponentSchema = z11.object({
|
|
987
|
-
roleDefinition: z11.string().optional(),
|
|
988
|
-
whenToUse: z11.string().optional(),
|
|
989
|
-
description: z11.string().optional(),
|
|
990
|
-
customInstructions: z11.string().optional()
|
|
991
|
-
});
|
|
992
|
-
var customModePromptsSchema = z11.record(z11.string(), promptComponentSchema.optional());
|
|
993
|
-
var customSupportPromptsSchema = z11.record(z11.string(), z11.string().optional());
|
|
994
|
-
var DEFAULT_MODES = [
|
|
995
|
-
{
|
|
996
|
-
slug: "architect",
|
|
997
|
-
name: "\u{1F3D7}\uFE0F Architect",
|
|
998
|
-
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.",
|
|
999
|
-
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.",
|
|
1000
|
-
description: "Plan and design before implementation",
|
|
1001
|
-
groups: ["read", ["edit", { fileRegex: "\\.md$", description: "Markdown files only" }], "browser", "mcp"],
|
|
1002
|
-
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.**"
|
|
1003
|
-
},
|
|
1004
|
-
{
|
|
1005
|
-
slug: "code",
|
|
1006
|
-
name: "\u{1F4BB} Code",
|
|
1007
|
-
roleDefinition: "You are Roo, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.",
|
|
1008
|
-
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.",
|
|
1009
|
-
description: "Write, modify, and refactor code",
|
|
1010
|
-
groups: ["read", "edit", "browser", "command", "mcp"]
|
|
1011
|
-
},
|
|
1012
|
-
{
|
|
1013
|
-
slug: "ask",
|
|
1014
|
-
name: "\u2753 Ask",
|
|
1015
|
-
roleDefinition: "You are Roo, a knowledgeable technical assistant focused on answering questions and providing information about software development, technology, and related topics.",
|
|
1016
|
-
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.",
|
|
1017
|
-
description: "Get answers and explanations",
|
|
1018
|
-
groups: ["read", "browser", "mcp"],
|
|
1019
|
-
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."
|
|
1020
|
-
},
|
|
1021
|
-
{
|
|
1022
|
-
slug: "debug",
|
|
1023
|
-
name: "\u{1FAB2} Debug",
|
|
1024
|
-
roleDefinition: "You are Roo, an expert software debugger specializing in systematic problem diagnosis and resolution.",
|
|
1025
|
-
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.",
|
|
1026
|
-
description: "Diagnose and fix software issues",
|
|
1027
|
-
groups: ["read", "edit", "browser", "command", "mcp"],
|
|
1028
|
-
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."
|
|
1029
|
-
},
|
|
1030
|
-
{
|
|
1031
|
-
slug: "orchestrator",
|
|
1032
|
-
name: "\u{1FA83} Orchestrator",
|
|
1033
|
-
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.",
|
|
1034
|
-
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.",
|
|
1035
|
-
description: "Coordinate tasks across multiple modes",
|
|
1036
|
-
groups: [],
|
|
1037
|
-
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."
|
|
1038
|
-
}
|
|
1039
|
-
];
|
|
1040
|
-
|
|
1041
|
-
// src/vscode.ts
|
|
1042
|
-
import { z as z12 } from "zod";
|
|
1043
|
-
var codeActionIds = ["explainCode", "fixCode", "improveCode", "addToContext", "newTask"];
|
|
1044
|
-
var terminalActionIds = ["terminalAddToContext", "terminalFixCommand", "terminalExplainCommand"];
|
|
1045
|
-
var commandIds = [
|
|
1046
|
-
"activationCompleted",
|
|
1047
|
-
"plusButtonClicked",
|
|
1048
|
-
"promptsButtonClicked",
|
|
1049
|
-
"mcpButtonClicked",
|
|
1050
|
-
"historyButtonClicked",
|
|
1051
|
-
"marketplaceButtonClicked",
|
|
1052
|
-
"popoutButtonClicked",
|
|
1053
|
-
"accountButtonClicked",
|
|
1054
|
-
"settingsButtonClicked",
|
|
1055
|
-
"openInNewTab",
|
|
1056
|
-
"showHumanRelayDialog",
|
|
1057
|
-
"registerHumanRelayCallback",
|
|
1058
|
-
"unregisterHumanRelayCallback",
|
|
1059
|
-
"handleHumanRelayResponse",
|
|
1060
|
-
"newTask",
|
|
1061
|
-
"setCustomStoragePath",
|
|
1062
|
-
"importSettings",
|
|
1063
|
-
"focusInput",
|
|
1064
|
-
"acceptInput",
|
|
1065
|
-
"focusPanel"
|
|
1066
|
-
];
|
|
1067
|
-
var languages = [
|
|
1068
|
-
"ca",
|
|
1069
|
-
"de",
|
|
1070
|
-
"en",
|
|
1071
|
-
"es",
|
|
1072
|
-
"fr",
|
|
1073
|
-
"hi",
|
|
1074
|
-
"id",
|
|
1075
|
-
"it",
|
|
1076
|
-
"ja",
|
|
1077
|
-
"ko",
|
|
1078
|
-
"nl",
|
|
1079
|
-
"pl",
|
|
1080
|
-
"pt-BR",
|
|
1081
|
-
"ru",
|
|
1082
|
-
"tr",
|
|
1083
|
-
"vi",
|
|
1084
|
-
"zh-CN",
|
|
1085
|
-
"zh-TW"
|
|
1086
|
-
];
|
|
1087
|
-
var languagesSchema = z12.enum(languages);
|
|
1088
|
-
var isLanguage = (value) => languages.includes(value);
|
|
1089
|
-
|
|
1090
|
-
// src/global-settings.ts
|
|
1091
|
-
var DEFAULT_WRITE_DELAY_MS = 1e3;
|
|
1092
|
-
var DEFAULT_TERMINAL_OUTPUT_CHARACTER_LIMIT = 5e4;
|
|
1093
|
-
var globalSettingsSchema = z13.object({
|
|
1094
|
-
currentApiConfigName: z13.string().optional(),
|
|
1095
|
-
listApiConfigMeta: z13.array(providerSettingsEntrySchema).optional(),
|
|
1096
|
-
pinnedApiConfigs: z13.record(z13.string(), z13.boolean()).optional(),
|
|
1097
|
-
lastShownAnnouncementId: z13.string().optional(),
|
|
1098
|
-
customInstructions: z13.string().optional(),
|
|
1099
|
-
taskHistory: z13.array(historyItemSchema).optional(),
|
|
1100
|
-
condensingApiConfigId: z13.string().optional(),
|
|
1101
|
-
customCondensingPrompt: z13.string().optional(),
|
|
1102
|
-
autoApprovalEnabled: z13.boolean().optional(),
|
|
1103
|
-
alwaysAllowReadOnly: z13.boolean().optional(),
|
|
1104
|
-
alwaysAllowReadOnlyOutsideWorkspace: z13.boolean().optional(),
|
|
1105
|
-
alwaysAllowWrite: z13.boolean().optional(),
|
|
1106
|
-
alwaysAllowWriteOutsideWorkspace: z13.boolean().optional(),
|
|
1107
|
-
alwaysAllowWriteProtected: z13.boolean().optional(),
|
|
1108
|
-
writeDelayMs: z13.number().min(0).optional(),
|
|
1109
|
-
alwaysAllowBrowser: z13.boolean().optional(),
|
|
1110
|
-
alwaysApproveResubmit: z13.boolean().optional(),
|
|
1111
|
-
requestDelaySeconds: z13.number().optional(),
|
|
1112
|
-
alwaysAllowMcp: z13.boolean().optional(),
|
|
1113
|
-
alwaysAllowModeSwitch: z13.boolean().optional(),
|
|
1114
|
-
alwaysAllowSubtasks: z13.boolean().optional(),
|
|
1115
|
-
alwaysAllowExecute: z13.boolean().optional(),
|
|
1116
|
-
alwaysAllowFollowupQuestions: z13.boolean().optional(),
|
|
1117
|
-
followupAutoApproveTimeoutMs: z13.number().optional(),
|
|
1118
|
-
alwaysAllowUpdateTodoList: z13.boolean().optional(),
|
|
1119
|
-
allowedCommands: z13.array(z13.string()).optional(),
|
|
1120
|
-
deniedCommands: z13.array(z13.string()).optional(),
|
|
1121
|
-
commandExecutionTimeout: z13.number().optional(),
|
|
1122
|
-
commandTimeoutAllowlist: z13.array(z13.string()).optional(),
|
|
1123
|
-
preventCompletionWithOpenTodos: z13.boolean().optional(),
|
|
1124
|
-
allowedMaxRequests: z13.number().nullish(),
|
|
1125
|
-
allowedMaxCost: z13.number().nullish(),
|
|
1126
|
-
autoCondenseContext: z13.boolean().optional(),
|
|
1127
|
-
autoCondenseContextPercent: z13.number().optional(),
|
|
1128
|
-
maxConcurrentFileReads: z13.number().optional(),
|
|
1129
|
-
/**
|
|
1130
|
-
* Whether to include diagnostic messages (errors, warnings) in tool outputs
|
|
1131
|
-
* @default true
|
|
1132
|
-
*/
|
|
1133
|
-
includeDiagnosticMessages: z13.boolean().optional(),
|
|
1134
|
-
/**
|
|
1135
|
-
* Maximum number of diagnostic messages to include in tool outputs
|
|
1136
|
-
* @default 50
|
|
1137
|
-
*/
|
|
1138
|
-
maxDiagnosticMessages: z13.number().optional(),
|
|
1139
|
-
browserToolEnabled: z13.boolean().optional(),
|
|
1140
|
-
browserViewportSize: z13.string().optional(),
|
|
1141
|
-
screenshotQuality: z13.number().optional(),
|
|
1142
|
-
remoteBrowserEnabled: z13.boolean().optional(),
|
|
1143
|
-
remoteBrowserHost: z13.string().optional(),
|
|
1144
|
-
cachedChromeHostUrl: z13.string().optional(),
|
|
1145
|
-
enableCheckpoints: z13.boolean().optional(),
|
|
1146
|
-
ttsEnabled: z13.boolean().optional(),
|
|
1147
|
-
ttsSpeed: z13.number().optional(),
|
|
1148
|
-
soundEnabled: z13.boolean().optional(),
|
|
1149
|
-
soundVolume: z13.number().optional(),
|
|
1150
|
-
maxOpenTabsContext: z13.number().optional(),
|
|
1151
|
-
maxWorkspaceFiles: z13.number().optional(),
|
|
1152
|
-
showRooIgnoredFiles: z13.boolean().optional(),
|
|
1153
|
-
maxReadFileLine: z13.number().optional(),
|
|
1154
|
-
maxImageFileSize: z13.number().optional(),
|
|
1155
|
-
maxTotalImageSize: z13.number().optional(),
|
|
1156
|
-
terminalOutputLineLimit: z13.number().optional(),
|
|
1157
|
-
terminalOutputCharacterLimit: z13.number().optional(),
|
|
1158
|
-
terminalShellIntegrationTimeout: z13.number().optional(),
|
|
1159
|
-
terminalShellIntegrationDisabled: z13.boolean().optional(),
|
|
1160
|
-
terminalCommandDelay: z13.number().optional(),
|
|
1161
|
-
terminalPowershellCounter: z13.boolean().optional(),
|
|
1162
|
-
terminalZshClearEolMark: z13.boolean().optional(),
|
|
1163
|
-
terminalZshOhMy: z13.boolean().optional(),
|
|
1164
|
-
terminalZshP10k: z13.boolean().optional(),
|
|
1165
|
-
terminalZdotdir: z13.boolean().optional(),
|
|
1166
|
-
terminalCompressProgressBar: z13.boolean().optional(),
|
|
1167
|
-
diagnosticsEnabled: z13.boolean().optional(),
|
|
1168
|
-
rateLimitSeconds: z13.number().optional(),
|
|
1169
|
-
diffEnabled: z13.boolean().optional(),
|
|
1170
|
-
fuzzyMatchThreshold: z13.number().optional(),
|
|
1171
|
-
experiments: experimentsSchema.optional(),
|
|
1172
|
-
codebaseIndexModels: codebaseIndexModelsSchema.optional(),
|
|
1173
|
-
codebaseIndexConfig: codebaseIndexConfigSchema.optional(),
|
|
1174
|
-
language: languagesSchema.optional(),
|
|
1175
|
-
telemetrySetting: telemetrySettingsSchema.optional(),
|
|
1176
|
-
mcpEnabled: z13.boolean().optional(),
|
|
1177
|
-
enableMcpServerCreation: z13.boolean().optional(),
|
|
1178
|
-
remoteControlEnabled: z13.boolean().optional(),
|
|
1179
|
-
mode: z13.string().optional(),
|
|
1180
|
-
modeApiConfigs: z13.record(z13.string(), z13.string()).optional(),
|
|
1181
|
-
customModes: z13.array(modeConfigSchema).optional(),
|
|
1182
|
-
customModePrompts: customModePromptsSchema.optional(),
|
|
1183
|
-
customSupportPrompts: customSupportPromptsSchema.optional(),
|
|
1184
|
-
enhancementApiConfigId: z13.string().optional(),
|
|
1185
|
-
includeTaskHistoryInEnhance: z13.boolean().optional(),
|
|
1186
|
-
historyPreviewCollapsed: z13.boolean().optional(),
|
|
1187
|
-
profileThresholds: z13.record(z13.string(), z13.number()).optional(),
|
|
1188
|
-
hasOpenedModeSelector: z13.boolean().optional(),
|
|
1189
|
-
lastModeExportPath: z13.string().optional(),
|
|
1190
|
-
lastModeImportPath: z13.string().optional()
|
|
1191
|
-
});
|
|
1192
|
-
var GLOBAL_SETTINGS_KEYS = globalSettingsSchema.keyof().options;
|
|
1193
|
-
var rooCodeSettingsSchema = providerSettingsSchema.merge(globalSettingsSchema);
|
|
1194
|
-
var SECRET_STATE_KEYS = [
|
|
1195
|
-
"apiKey",
|
|
1196
|
-
"glamaApiKey",
|
|
1197
|
-
"openRouterApiKey",
|
|
1198
|
-
"awsAccessKey",
|
|
1199
|
-
"awsApiKey",
|
|
1200
|
-
"awsSecretKey",
|
|
1201
|
-
"awsSessionToken",
|
|
1202
|
-
"openAiApiKey",
|
|
1203
|
-
"geminiApiKey",
|
|
1204
|
-
"openAiNativeApiKey",
|
|
1205
|
-
"cerebrasApiKey",
|
|
1206
|
-
"deepSeekApiKey",
|
|
1207
|
-
"moonshotApiKey",
|
|
1208
|
-
"mistralApiKey",
|
|
1209
|
-
"unboundApiKey",
|
|
1210
|
-
"requestyApiKey",
|
|
1211
|
-
"xaiApiKey",
|
|
1212
|
-
"groqApiKey",
|
|
1213
|
-
"chutesApiKey",
|
|
1214
|
-
"litellmApiKey",
|
|
1215
|
-
"codeIndexOpenAiKey",
|
|
1216
|
-
"codeIndexQdrantApiKey",
|
|
1217
|
-
"codebaseIndexOpenAiCompatibleApiKey",
|
|
1218
|
-
"codebaseIndexGeminiApiKey",
|
|
1219
|
-
"codebaseIndexMistralApiKey",
|
|
1220
|
-
"huggingFaceApiKey",
|
|
1221
|
-
"sambaNovaApiKey",
|
|
1222
|
-
"fireworksApiKey",
|
|
1223
|
-
"ioIntelligenceApiKey"
|
|
1224
|
-
];
|
|
1225
|
-
var isSecretStateKey = (key) => SECRET_STATE_KEYS.includes(key);
|
|
1226
|
-
var GLOBAL_STATE_KEYS = [...GLOBAL_SETTINGS_KEYS, ...PROVIDER_SETTINGS_KEYS].filter(
|
|
1227
|
-
(key) => !SECRET_STATE_KEYS.includes(key)
|
|
1228
|
-
);
|
|
1229
|
-
var isGlobalStateKey = (key) => GLOBAL_STATE_KEYS.includes(key);
|
|
1230
|
-
var EVALS_SETTINGS = {
|
|
1231
|
-
apiProvider: "openrouter",
|
|
1232
|
-
openRouterUseMiddleOutTransform: false,
|
|
1233
|
-
lastShownAnnouncementId: "jul-09-2025-3-23-0",
|
|
1234
|
-
pinnedApiConfigs: {},
|
|
1235
|
-
autoApprovalEnabled: true,
|
|
1236
|
-
alwaysAllowReadOnly: true,
|
|
1237
|
-
alwaysAllowReadOnlyOutsideWorkspace: false,
|
|
1238
|
-
alwaysAllowWrite: true,
|
|
1239
|
-
alwaysAllowWriteOutsideWorkspace: false,
|
|
1240
|
-
alwaysAllowWriteProtected: false,
|
|
1241
|
-
writeDelayMs: 1e3,
|
|
1242
|
-
alwaysAllowBrowser: true,
|
|
1243
|
-
alwaysApproveResubmit: true,
|
|
1244
|
-
requestDelaySeconds: 10,
|
|
1245
|
-
alwaysAllowMcp: true,
|
|
1246
|
-
alwaysAllowModeSwitch: true,
|
|
1247
|
-
alwaysAllowSubtasks: true,
|
|
1248
|
-
alwaysAllowExecute: true,
|
|
1249
|
-
alwaysAllowFollowupQuestions: true,
|
|
1250
|
-
alwaysAllowUpdateTodoList: true,
|
|
1251
|
-
followupAutoApproveTimeoutMs: 0,
|
|
1252
|
-
allowedCommands: ["*"],
|
|
1253
|
-
commandExecutionTimeout: 20,
|
|
1254
|
-
commandTimeoutAllowlist: [],
|
|
1255
|
-
preventCompletionWithOpenTodos: false,
|
|
1256
|
-
browserToolEnabled: false,
|
|
1257
|
-
browserViewportSize: "900x600",
|
|
1258
|
-
screenshotQuality: 75,
|
|
1259
|
-
remoteBrowserEnabled: false,
|
|
1260
|
-
ttsEnabled: false,
|
|
1261
|
-
ttsSpeed: 1,
|
|
1262
|
-
soundEnabled: false,
|
|
1263
|
-
soundVolume: 0.5,
|
|
1264
|
-
terminalOutputLineLimit: 500,
|
|
1265
|
-
terminalOutputCharacterLimit: DEFAULT_TERMINAL_OUTPUT_CHARACTER_LIMIT,
|
|
1266
|
-
terminalShellIntegrationTimeout: 3e4,
|
|
1267
|
-
terminalCommandDelay: 0,
|
|
1268
|
-
terminalPowershellCounter: false,
|
|
1269
|
-
terminalZshOhMy: true,
|
|
1270
|
-
terminalZshClearEolMark: true,
|
|
1271
|
-
terminalZshP10k: false,
|
|
1272
|
-
terminalZdotdir: true,
|
|
1273
|
-
terminalCompressProgressBar: true,
|
|
1274
|
-
terminalShellIntegrationDisabled: true,
|
|
1275
|
-
diagnosticsEnabled: true,
|
|
1276
|
-
diffEnabled: true,
|
|
1277
|
-
fuzzyMatchThreshold: 1,
|
|
1278
|
-
enableCheckpoints: false,
|
|
1279
|
-
rateLimitSeconds: 0,
|
|
1280
|
-
maxOpenTabsContext: 20,
|
|
1281
|
-
maxWorkspaceFiles: 200,
|
|
1282
|
-
showRooIgnoredFiles: true,
|
|
1283
|
-
maxReadFileLine: -1,
|
|
1284
|
-
// -1 to enable full file reading.
|
|
1285
|
-
includeDiagnosticMessages: true,
|
|
1286
|
-
maxDiagnosticMessages: 50,
|
|
1287
|
-
language: "en",
|
|
1288
|
-
telemetrySetting: "enabled",
|
|
1289
|
-
mcpEnabled: false,
|
|
1290
|
-
remoteControlEnabled: false,
|
|
1291
|
-
mode: "code",
|
|
1292
|
-
// "architect",
|
|
1293
|
-
customModes: []
|
|
1294
|
-
};
|
|
1295
|
-
var EVALS_TIMEOUT = 5 * 60 * 1e3;
|
|
1296
|
-
|
|
1297
|
-
// src/ipc.ts
|
|
1298
|
-
import { z as z14 } from "zod";
|
|
1299
|
-
var IpcMessageType = /* @__PURE__ */ ((IpcMessageType2) => {
|
|
1300
|
-
IpcMessageType2["Connect"] = "Connect";
|
|
1301
|
-
IpcMessageType2["Disconnect"] = "Disconnect";
|
|
1302
|
-
IpcMessageType2["Ack"] = "Ack";
|
|
1303
|
-
IpcMessageType2["TaskCommand"] = "TaskCommand";
|
|
1304
|
-
IpcMessageType2["TaskEvent"] = "TaskEvent";
|
|
1305
|
-
return IpcMessageType2;
|
|
1306
|
-
})(IpcMessageType || {});
|
|
1307
|
-
var IpcOrigin = /* @__PURE__ */ ((IpcOrigin2) => {
|
|
1308
|
-
IpcOrigin2["Client"] = "client";
|
|
1309
|
-
IpcOrigin2["Server"] = "server";
|
|
1310
|
-
return IpcOrigin2;
|
|
1311
|
-
})(IpcOrigin || {});
|
|
1312
|
-
var ackSchema = z14.object({
|
|
1313
|
-
clientId: z14.string(),
|
|
1314
|
-
pid: z14.number(),
|
|
1315
|
-
ppid: z14.number()
|
|
1316
|
-
});
|
|
1317
|
-
var TaskCommandName = /* @__PURE__ */ ((TaskCommandName2) => {
|
|
1318
|
-
TaskCommandName2["StartNewTask"] = "StartNewTask";
|
|
1319
|
-
TaskCommandName2["CancelTask"] = "CancelTask";
|
|
1320
|
-
TaskCommandName2["CloseTask"] = "CloseTask";
|
|
1321
|
-
TaskCommandName2["ResumeTask"] = "ResumeTask";
|
|
1322
|
-
return TaskCommandName2;
|
|
1323
|
-
})(TaskCommandName || {});
|
|
1324
|
-
var taskCommandSchema = z14.discriminatedUnion("commandName", [
|
|
1325
|
-
z14.object({
|
|
1326
|
-
commandName: z14.literal("StartNewTask" /* StartNewTask */),
|
|
1327
|
-
data: z14.object({
|
|
1328
|
-
configuration: rooCodeSettingsSchema,
|
|
1329
|
-
text: z14.string(),
|
|
1330
|
-
images: z14.array(z14.string()).optional(),
|
|
1331
|
-
newTab: z14.boolean().optional()
|
|
1332
|
-
})
|
|
1333
|
-
}),
|
|
1334
|
-
z14.object({
|
|
1335
|
-
commandName: z14.literal("CancelTask" /* CancelTask */),
|
|
1336
|
-
data: z14.string()
|
|
1337
|
-
}),
|
|
1338
|
-
z14.object({
|
|
1339
|
-
commandName: z14.literal("CloseTask" /* CloseTask */),
|
|
1340
|
-
data: z14.string()
|
|
1341
|
-
}),
|
|
1342
|
-
z14.object({
|
|
1343
|
-
commandName: z14.literal("ResumeTask" /* ResumeTask */),
|
|
1344
|
-
data: z14.string()
|
|
1345
|
-
})
|
|
1346
|
-
]);
|
|
1347
|
-
var ipcMessageSchema = z14.discriminatedUnion("type", [
|
|
1348
|
-
z14.object({
|
|
1349
|
-
type: z14.literal("Ack" /* Ack */),
|
|
1350
|
-
origin: z14.literal("server" /* Server */),
|
|
1351
|
-
data: ackSchema
|
|
1352
|
-
}),
|
|
1353
|
-
z14.object({
|
|
1354
|
-
type: z14.literal("TaskCommand" /* TaskCommand */),
|
|
1355
|
-
origin: z14.literal("client" /* Client */),
|
|
1356
|
-
clientId: z14.string(),
|
|
1357
|
-
data: taskCommandSchema
|
|
1358
|
-
}),
|
|
1359
|
-
z14.object({
|
|
1360
|
-
type: z14.literal("TaskEvent" /* TaskEvent */),
|
|
1361
|
-
origin: z14.literal("server" /* Server */),
|
|
1362
|
-
relayClientId: z14.string().optional(),
|
|
1363
|
-
data: taskEventSchema
|
|
1364
|
-
})
|
|
1365
|
-
]);
|
|
1366
|
-
|
|
1367
|
-
// src/marketplace.ts
|
|
1368
|
-
import { z as z15 } from "zod";
|
|
1369
|
-
var mcpParameterSchema = z15.object({
|
|
1370
|
-
name: z15.string().min(1),
|
|
1371
|
-
key: z15.string().min(1),
|
|
1372
|
-
placeholder: z15.string().optional(),
|
|
1373
|
-
optional: z15.boolean().optional().default(false)
|
|
1374
|
-
});
|
|
1375
|
-
var mcpInstallationMethodSchema = z15.object({
|
|
1376
|
-
name: z15.string().min(1),
|
|
1377
|
-
content: z15.string().min(1),
|
|
1378
|
-
parameters: z15.array(mcpParameterSchema).optional(),
|
|
1379
|
-
prerequisites: z15.array(z15.string()).optional()
|
|
1380
|
-
});
|
|
1381
|
-
var marketplaceItemTypeSchema = z15.enum(["mode", "mcp"]);
|
|
1382
|
-
var baseMarketplaceItemSchema = z15.object({
|
|
1383
|
-
id: z15.string().min(1),
|
|
1384
|
-
name: z15.string().min(1, "Name is required"),
|
|
1385
|
-
description: z15.string(),
|
|
1386
|
-
author: z15.string().optional(),
|
|
1387
|
-
authorUrl: z15.string().url("Author URL must be a valid URL").optional(),
|
|
1388
|
-
tags: z15.array(z15.string()).optional(),
|
|
1389
|
-
prerequisites: z15.array(z15.string()).optional()
|
|
1390
|
-
});
|
|
1391
|
-
var modeMarketplaceItemSchema = baseMarketplaceItemSchema.extend({
|
|
1392
|
-
content: z15.string().min(1)
|
|
1393
|
-
// YAML content for modes
|
|
1394
|
-
});
|
|
1395
|
-
var mcpMarketplaceItemSchema = baseMarketplaceItemSchema.extend({
|
|
1396
|
-
url: z15.string().url(),
|
|
1397
|
-
// Required url field
|
|
1398
|
-
content: z15.union([z15.string().min(1), z15.array(mcpInstallationMethodSchema)]),
|
|
1399
|
-
// Single config or array of methods
|
|
1400
|
-
parameters: z15.array(mcpParameterSchema).optional()
|
|
1401
|
-
});
|
|
1402
|
-
var marketplaceItemSchema = z15.discriminatedUnion("type", [
|
|
1403
|
-
// Mode marketplace item
|
|
1404
|
-
modeMarketplaceItemSchema.extend({
|
|
1405
|
-
type: z15.literal("mode")
|
|
1406
|
-
}),
|
|
1407
|
-
// MCP marketplace item
|
|
1408
|
-
mcpMarketplaceItemSchema.extend({
|
|
1409
|
-
type: z15.literal("mcp")
|
|
1410
|
-
})
|
|
1411
|
-
]);
|
|
1412
|
-
var installMarketplaceItemOptionsSchema = z15.object({
|
|
1413
|
-
target: z15.enum(["global", "project"]).optional().default("project"),
|
|
1414
|
-
parameters: z15.record(z15.string(), z15.any()).optional()
|
|
1415
|
-
});
|
|
1416
|
-
|
|
1417
|
-
// src/mcp.ts
|
|
1418
|
-
import { z as z16 } from "zod";
|
|
1419
|
-
var mcpExecutionStatusSchema = z16.discriminatedUnion("status", [
|
|
1420
|
-
z16.object({
|
|
1421
|
-
executionId: z16.string(),
|
|
1422
|
-
status: z16.literal("started"),
|
|
1423
|
-
serverName: z16.string(),
|
|
1424
|
-
toolName: z16.string()
|
|
1425
|
-
}),
|
|
1426
|
-
z16.object({
|
|
1427
|
-
executionId: z16.string(),
|
|
1428
|
-
status: z16.literal("output"),
|
|
1429
|
-
response: z16.string()
|
|
1430
|
-
}),
|
|
1431
|
-
z16.object({
|
|
1432
|
-
executionId: z16.string(),
|
|
1433
|
-
status: z16.literal("completed"),
|
|
1434
|
-
response: z16.string().optional()
|
|
1435
|
-
}),
|
|
1436
|
-
z16.object({
|
|
1437
|
-
executionId: z16.string(),
|
|
1438
|
-
status: z16.literal("error"),
|
|
1439
|
-
error: z16.string().optional()
|
|
1440
|
-
})
|
|
1441
|
-
]);
|
|
1442
|
-
|
|
1443
|
-
// src/task.ts
|
|
1444
|
-
import { z as z17 } from "zod";
|
|
1445
|
-
var TaskStatus = /* @__PURE__ */ ((TaskStatus2) => {
|
|
1446
|
-
TaskStatus2["Running"] = "running";
|
|
1447
|
-
TaskStatus2["Interactive"] = "interactive";
|
|
1448
|
-
TaskStatus2["Resumable"] = "resumable";
|
|
1449
|
-
TaskStatus2["Idle"] = "idle";
|
|
1450
|
-
TaskStatus2["None"] = "none";
|
|
1451
|
-
return TaskStatus2;
|
|
1452
|
-
})(TaskStatus || {});
|
|
1453
|
-
var taskMetadataSchema = z17.object({
|
|
1454
|
-
task: z17.string().optional(),
|
|
1455
|
-
images: z17.array(z17.string()).optional()
|
|
1456
|
-
});
|
|
1457
|
-
|
|
1458
|
-
// src/todo.ts
|
|
1459
|
-
import { z as z18 } from "zod";
|
|
1460
|
-
var todoStatusSchema = z18.enum(["pending", "in_progress", "completed"]);
|
|
1461
|
-
var todoItemSchema = z18.object({
|
|
1462
|
-
id: z18.string(),
|
|
1463
|
-
content: z18.string(),
|
|
1464
|
-
status: todoStatusSchema
|
|
1465
|
-
});
|
|
1466
|
-
|
|
1467
|
-
// src/terminal.ts
|
|
1468
|
-
import { z as z19 } from "zod";
|
|
1469
|
-
var commandExecutionStatusSchema = z19.discriminatedUnion("status", [
|
|
1470
|
-
z19.object({
|
|
1471
|
-
executionId: z19.string(),
|
|
1472
|
-
status: z19.literal("started"),
|
|
1473
|
-
pid: z19.number().optional(),
|
|
1474
|
-
command: z19.string()
|
|
1475
|
-
}),
|
|
1476
|
-
z19.object({
|
|
1477
|
-
executionId: z19.string(),
|
|
1478
|
-
status: z19.literal("output"),
|
|
1479
|
-
output: z19.string()
|
|
1480
|
-
}),
|
|
1481
|
-
z19.object({
|
|
1482
|
-
executionId: z19.string(),
|
|
1483
|
-
status: z19.literal("exited"),
|
|
1484
|
-
exitCode: z19.number().optional()
|
|
1485
|
-
}),
|
|
1486
|
-
z19.object({
|
|
1487
|
-
executionId: z19.string(),
|
|
1488
|
-
status: z19.literal("fallback")
|
|
1489
|
-
}),
|
|
1490
|
-
z19.object({
|
|
1491
|
-
executionId: z19.string(),
|
|
1492
|
-
status: z19.literal("timeout")
|
|
1493
|
-
})
|
|
1494
|
-
]);
|
|
1495
|
-
|
|
1496
427
|
// src/providers/anthropic.ts
|
|
1497
428
|
var anthropicDefaultModelId = "claude-sonnet-4-20250514";
|
|
1498
429
|
var anthropicModels = {
|
|
@@ -2074,6 +1005,7 @@ var BEDROCK_REGIONS = [
|
|
|
2074
1005
|
{ value: "us-gov-east-1", label: "us-gov-east-1" },
|
|
2075
1006
|
{ value: "us-gov-west-1", label: "us-gov-west-1" }
|
|
2076
1007
|
].sort((a, b) => a.value.localeCompare(b.value));
|
|
1008
|
+
var BEDROCK_CLAUDE_SONNET_4_MODEL_ID = "anthropic.claude-sonnet-4-20250514-v1:0";
|
|
2077
1009
|
|
|
2078
1010
|
// src/providers/cerebras.ts
|
|
2079
1011
|
var cerebrasDefaultModelId = "qwen-3-coder-480b-free";
|
|
@@ -2468,34 +1400,223 @@ var deepSeekModels = {
|
|
|
2468
1400
|
maxTokens: 8192,
|
|
2469
1401
|
contextWindow: 64e3,
|
|
2470
1402
|
supportsImages: false,
|
|
2471
|
-
supportsPromptCache: true,
|
|
2472
|
-
inputPrice: 0.27,
|
|
2473
|
-
// $0.27 per million tokens (cache miss)
|
|
2474
|
-
outputPrice: 1.1,
|
|
2475
|
-
// $1.10 per million tokens
|
|
2476
|
-
cacheWritesPrice: 0.27,
|
|
2477
|
-
// $0.27 per million tokens (cache miss)
|
|
2478
|
-
cacheReadsPrice: 0.07,
|
|
2479
|
-
// $0.07 per million tokens (cache hit).
|
|
2480
|
-
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.`
|
|
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,
|
|
1586
|
+
supportsImages: false,
|
|
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."
|
|
2481
1591
|
},
|
|
2482
|
-
"
|
|
2483
|
-
maxTokens:
|
|
2484
|
-
contextWindow:
|
|
1592
|
+
"accounts/fireworks/models/glm-4p5-air": {
|
|
1593
|
+
maxTokens: 16384,
|
|
1594
|
+
contextWindow: 128e3,
|
|
2485
1595
|
supportsImages: false,
|
|
2486
|
-
supportsPromptCache:
|
|
1596
|
+
supportsPromptCache: false,
|
|
2487
1597
|
inputPrice: 0.55,
|
|
2488
|
-
// $0.55 per million tokens (cache miss)
|
|
2489
1598
|
outputPrice: 2.19,
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
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."
|
|
2496
1618
|
}
|
|
2497
1619
|
};
|
|
2498
|
-
var DEEP_SEEK_DEFAULT_TEMPERATURE = 0.6;
|
|
2499
1620
|
|
|
2500
1621
|
// src/providers/gemini.ts
|
|
2501
1622
|
var geminiDefaultModelId = "gemini-2.0-flash-001";
|
|
@@ -3478,6 +2599,20 @@ var requestyDefaultModelInfo = {
|
|
|
3478
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."
|
|
3479
2600
|
};
|
|
3480
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
|
+
|
|
3481
2616
|
// src/providers/sambanova.ts
|
|
3482
2617
|
var sambaNovaDefaultModelId = "Meta-Llama-3.3-70B-Instruct";
|
|
3483
2618
|
var sambaNovaModels = {
|
|
@@ -3638,738 +2773,1807 @@ var vertexModels = {
|
|
|
3638
2773
|
inputPrice: 2.5,
|
|
3639
2774
|
outputPrice: 15
|
|
3640
2775
|
},
|
|
3641
|
-
"gemini-2.5-pro-preview-06-05": {
|
|
3642
|
-
maxTokens: 65535,
|
|
3643
|
-
contextWindow: 1048576,
|
|
2776
|
+
"gemini-2.5-pro-preview-06-05": {
|
|
2777
|
+
maxTokens: 65535,
|
|
2778
|
+
contextWindow: 1048576,
|
|
2779
|
+
supportsImages: true,
|
|
2780
|
+
supportsPromptCache: true,
|
|
2781
|
+
inputPrice: 2.5,
|
|
2782
|
+
outputPrice: 15,
|
|
2783
|
+
maxThinkingTokens: 32768,
|
|
2784
|
+
supportsReasoningBudget: true
|
|
2785
|
+
},
|
|
2786
|
+
"gemini-2.5-pro": {
|
|
2787
|
+
maxTokens: 64e3,
|
|
2788
|
+
contextWindow: 1048576,
|
|
2789
|
+
supportsImages: true,
|
|
2790
|
+
supportsPromptCache: true,
|
|
2791
|
+
inputPrice: 2.5,
|
|
2792
|
+
outputPrice: 15,
|
|
2793
|
+
maxThinkingTokens: 32768,
|
|
2794
|
+
supportsReasoningBudget: true,
|
|
2795
|
+
requiredReasoningBudget: true,
|
|
2796
|
+
tiers: [
|
|
2797
|
+
{
|
|
2798
|
+
contextWindow: 2e5,
|
|
2799
|
+
inputPrice: 1.25,
|
|
2800
|
+
outputPrice: 10,
|
|
2801
|
+
cacheReadsPrice: 0.31
|
|
2802
|
+
},
|
|
2803
|
+
{
|
|
2804
|
+
contextWindow: Infinity,
|
|
2805
|
+
inputPrice: 2.5,
|
|
2806
|
+
outputPrice: 15,
|
|
2807
|
+
cacheReadsPrice: 0.625
|
|
2808
|
+
}
|
|
2809
|
+
]
|
|
2810
|
+
},
|
|
2811
|
+
"gemini-2.5-pro-exp-03-25": {
|
|
2812
|
+
maxTokens: 65535,
|
|
2813
|
+
contextWindow: 1048576,
|
|
2814
|
+
supportsImages: true,
|
|
2815
|
+
supportsPromptCache: false,
|
|
2816
|
+
inputPrice: 0,
|
|
2817
|
+
outputPrice: 0
|
|
2818
|
+
},
|
|
2819
|
+
"gemini-2.0-pro-exp-02-05": {
|
|
2820
|
+
maxTokens: 8192,
|
|
2821
|
+
contextWindow: 2097152,
|
|
2822
|
+
supportsImages: true,
|
|
2823
|
+
supportsPromptCache: false,
|
|
2824
|
+
inputPrice: 0,
|
|
2825
|
+
outputPrice: 0
|
|
2826
|
+
},
|
|
2827
|
+
"gemini-2.0-flash-001": {
|
|
2828
|
+
maxTokens: 8192,
|
|
2829
|
+
contextWindow: 1048576,
|
|
2830
|
+
supportsImages: true,
|
|
2831
|
+
supportsPromptCache: true,
|
|
2832
|
+
inputPrice: 0.15,
|
|
2833
|
+
outputPrice: 0.6
|
|
2834
|
+
},
|
|
2835
|
+
"gemini-2.0-flash-lite-001": {
|
|
2836
|
+
maxTokens: 8192,
|
|
2837
|
+
contextWindow: 1048576,
|
|
2838
|
+
supportsImages: true,
|
|
2839
|
+
supportsPromptCache: false,
|
|
2840
|
+
inputPrice: 0.075,
|
|
2841
|
+
outputPrice: 0.3
|
|
2842
|
+
},
|
|
2843
|
+
"gemini-2.0-flash-thinking-exp-01-21": {
|
|
2844
|
+
maxTokens: 8192,
|
|
2845
|
+
contextWindow: 32768,
|
|
2846
|
+
supportsImages: true,
|
|
2847
|
+
supportsPromptCache: false,
|
|
2848
|
+
inputPrice: 0,
|
|
2849
|
+
outputPrice: 0
|
|
2850
|
+
},
|
|
2851
|
+
"gemini-1.5-flash-002": {
|
|
2852
|
+
maxTokens: 8192,
|
|
2853
|
+
contextWindow: 1048576,
|
|
2854
|
+
supportsImages: true,
|
|
2855
|
+
supportsPromptCache: true,
|
|
2856
|
+
inputPrice: 0.075,
|
|
2857
|
+
outputPrice: 0.3
|
|
2858
|
+
},
|
|
2859
|
+
"gemini-1.5-pro-002": {
|
|
2860
|
+
maxTokens: 8192,
|
|
2861
|
+
contextWindow: 2097152,
|
|
2862
|
+
supportsImages: true,
|
|
2863
|
+
supportsPromptCache: false,
|
|
2864
|
+
inputPrice: 1.25,
|
|
2865
|
+
outputPrice: 5
|
|
2866
|
+
},
|
|
2867
|
+
"claude-sonnet-4@20250514": {
|
|
2868
|
+
maxTokens: 8192,
|
|
2869
|
+
contextWindow: 2e5,
|
|
2870
|
+
supportsImages: true,
|
|
2871
|
+
supportsComputerUse: true,
|
|
2872
|
+
supportsPromptCache: true,
|
|
2873
|
+
inputPrice: 3,
|
|
2874
|
+
outputPrice: 15,
|
|
2875
|
+
cacheWritesPrice: 3.75,
|
|
2876
|
+
cacheReadsPrice: 0.3,
|
|
2877
|
+
supportsReasoningBudget: true
|
|
2878
|
+
},
|
|
2879
|
+
"claude-opus-4-1@20250805": {
|
|
2880
|
+
maxTokens: 8192,
|
|
2881
|
+
contextWindow: 2e5,
|
|
2882
|
+
supportsImages: true,
|
|
2883
|
+
supportsComputerUse: true,
|
|
2884
|
+
supportsPromptCache: true,
|
|
2885
|
+
inputPrice: 15,
|
|
2886
|
+
outputPrice: 75,
|
|
2887
|
+
cacheWritesPrice: 18.75,
|
|
2888
|
+
cacheReadsPrice: 1.5,
|
|
2889
|
+
supportsReasoningBudget: true
|
|
2890
|
+
},
|
|
2891
|
+
"claude-opus-4@20250514": {
|
|
2892
|
+
maxTokens: 8192,
|
|
2893
|
+
contextWindow: 2e5,
|
|
2894
|
+
supportsImages: true,
|
|
2895
|
+
supportsComputerUse: true,
|
|
2896
|
+
supportsPromptCache: true,
|
|
2897
|
+
inputPrice: 15,
|
|
2898
|
+
outputPrice: 75,
|
|
2899
|
+
cacheWritesPrice: 18.75,
|
|
2900
|
+
cacheReadsPrice: 1.5
|
|
2901
|
+
},
|
|
2902
|
+
"claude-3-7-sonnet@20250219:thinking": {
|
|
2903
|
+
maxTokens: 64e3,
|
|
2904
|
+
contextWindow: 2e5,
|
|
2905
|
+
supportsImages: true,
|
|
2906
|
+
supportsComputerUse: true,
|
|
2907
|
+
supportsPromptCache: true,
|
|
2908
|
+
inputPrice: 3,
|
|
2909
|
+
outputPrice: 15,
|
|
2910
|
+
cacheWritesPrice: 3.75,
|
|
2911
|
+
cacheReadsPrice: 0.3,
|
|
2912
|
+
supportsReasoningBudget: true,
|
|
2913
|
+
requiredReasoningBudget: true
|
|
2914
|
+
},
|
|
2915
|
+
"claude-3-7-sonnet@20250219": {
|
|
2916
|
+
maxTokens: 8192,
|
|
2917
|
+
contextWindow: 2e5,
|
|
2918
|
+
supportsImages: true,
|
|
2919
|
+
supportsComputerUse: true,
|
|
2920
|
+
supportsPromptCache: true,
|
|
2921
|
+
inputPrice: 3,
|
|
2922
|
+
outputPrice: 15,
|
|
2923
|
+
cacheWritesPrice: 3.75,
|
|
2924
|
+
cacheReadsPrice: 0.3
|
|
2925
|
+
},
|
|
2926
|
+
"claude-3-5-sonnet-v2@20241022": {
|
|
2927
|
+
maxTokens: 8192,
|
|
2928
|
+
contextWindow: 2e5,
|
|
2929
|
+
supportsImages: true,
|
|
2930
|
+
supportsComputerUse: true,
|
|
2931
|
+
supportsPromptCache: true,
|
|
2932
|
+
inputPrice: 3,
|
|
2933
|
+
outputPrice: 15,
|
|
2934
|
+
cacheWritesPrice: 3.75,
|
|
2935
|
+
cacheReadsPrice: 0.3
|
|
2936
|
+
},
|
|
2937
|
+
"claude-3-5-sonnet@20240620": {
|
|
2938
|
+
maxTokens: 8192,
|
|
2939
|
+
contextWindow: 2e5,
|
|
2940
|
+
supportsImages: true,
|
|
2941
|
+
supportsPromptCache: true,
|
|
2942
|
+
inputPrice: 3,
|
|
2943
|
+
outputPrice: 15,
|
|
2944
|
+
cacheWritesPrice: 3.75,
|
|
2945
|
+
cacheReadsPrice: 0.3
|
|
2946
|
+
},
|
|
2947
|
+
"claude-3-5-haiku@20241022": {
|
|
2948
|
+
maxTokens: 8192,
|
|
2949
|
+
contextWindow: 2e5,
|
|
2950
|
+
supportsImages: false,
|
|
2951
|
+
supportsPromptCache: true,
|
|
2952
|
+
inputPrice: 1,
|
|
2953
|
+
outputPrice: 5,
|
|
2954
|
+
cacheWritesPrice: 1.25,
|
|
2955
|
+
cacheReadsPrice: 0.1
|
|
2956
|
+
},
|
|
2957
|
+
"claude-3-opus@20240229": {
|
|
2958
|
+
maxTokens: 4096,
|
|
2959
|
+
contextWindow: 2e5,
|
|
2960
|
+
supportsImages: true,
|
|
2961
|
+
supportsPromptCache: true,
|
|
2962
|
+
inputPrice: 15,
|
|
2963
|
+
outputPrice: 75,
|
|
2964
|
+
cacheWritesPrice: 18.75,
|
|
2965
|
+
cacheReadsPrice: 1.5
|
|
2966
|
+
},
|
|
2967
|
+
"claude-3-haiku@20240307": {
|
|
2968
|
+
maxTokens: 4096,
|
|
2969
|
+
contextWindow: 2e5,
|
|
3644
2970
|
supportsImages: true,
|
|
3645
2971
|
supportsPromptCache: true,
|
|
3646
|
-
inputPrice:
|
|
3647
|
-
outputPrice:
|
|
3648
|
-
|
|
3649
|
-
|
|
2972
|
+
inputPrice: 0.25,
|
|
2973
|
+
outputPrice: 1.25,
|
|
2974
|
+
cacheWritesPrice: 0.3,
|
|
2975
|
+
cacheReadsPrice: 0.03
|
|
3650
2976
|
},
|
|
3651
|
-
"gemini-2.5-
|
|
2977
|
+
"gemini-2.5-flash-lite-preview-06-17": {
|
|
3652
2978
|
maxTokens: 64e3,
|
|
3653
2979
|
contextWindow: 1048576,
|
|
3654
2980
|
supportsImages: true,
|
|
3655
2981
|
supportsPromptCache: true,
|
|
3656
|
-
inputPrice:
|
|
3657
|
-
outputPrice:
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
{
|
|
3663
|
-
contextWindow: 2e5,
|
|
3664
|
-
inputPrice: 1.25,
|
|
3665
|
-
outputPrice: 10,
|
|
3666
|
-
cacheReadsPrice: 0.31
|
|
3667
|
-
},
|
|
3668
|
-
{
|
|
3669
|
-
contextWindow: Infinity,
|
|
3670
|
-
inputPrice: 2.5,
|
|
3671
|
-
outputPrice: 15,
|
|
3672
|
-
cacheReadsPrice: 0.625
|
|
3673
|
-
}
|
|
3674
|
-
]
|
|
2982
|
+
inputPrice: 0.1,
|
|
2983
|
+
outputPrice: 0.4,
|
|
2984
|
+
cacheReadsPrice: 0.025,
|
|
2985
|
+
cacheWritesPrice: 1,
|
|
2986
|
+
maxThinkingTokens: 24576,
|
|
2987
|
+
supportsReasoningBudget: true
|
|
3675
2988
|
},
|
|
3676
|
-
"
|
|
3677
|
-
maxTokens:
|
|
3678
|
-
contextWindow:
|
|
3679
|
-
supportsImages:
|
|
2989
|
+
"llama-4-maverick-17b-128e-instruct-maas": {
|
|
2990
|
+
maxTokens: 8192,
|
|
2991
|
+
contextWindow: 131072,
|
|
2992
|
+
supportsImages: false,
|
|
2993
|
+
supportsPromptCache: false,
|
|
2994
|
+
inputPrice: 0.35,
|
|
2995
|
+
outputPrice: 1.15,
|
|
2996
|
+
description: "Meta Llama 4 Maverick 17B Instruct model, 128K context."
|
|
2997
|
+
}
|
|
2998
|
+
};
|
|
2999
|
+
var VERTEX_REGIONS = [
|
|
3000
|
+
{ value: "global", label: "global" },
|
|
3001
|
+
{ value: "us-central1", label: "us-central1" },
|
|
3002
|
+
{ value: "us-east1", label: "us-east1" },
|
|
3003
|
+
{ value: "us-east4", label: "us-east4" },
|
|
3004
|
+
{ value: "us-east5", label: "us-east5" },
|
|
3005
|
+
{ value: "us-west1", label: "us-west1" },
|
|
3006
|
+
{ value: "us-west2", label: "us-west2" },
|
|
3007
|
+
{ value: "us-west3", label: "us-west3" },
|
|
3008
|
+
{ value: "us-west4", label: "us-west4" },
|
|
3009
|
+
{ value: "northamerica-northeast1", label: "northamerica-northeast1" },
|
|
3010
|
+
{ value: "northamerica-northeast2", label: "northamerica-northeast2" },
|
|
3011
|
+
{ value: "southamerica-east1", label: "southamerica-east1" },
|
|
3012
|
+
{ value: "europe-west1", label: "europe-west1" },
|
|
3013
|
+
{ value: "europe-west2", label: "europe-west2" },
|
|
3014
|
+
{ value: "europe-west3", label: "europe-west3" },
|
|
3015
|
+
{ value: "europe-west4", label: "europe-west4" },
|
|
3016
|
+
{ value: "europe-west6", label: "europe-west6" },
|
|
3017
|
+
{ value: "europe-central2", label: "europe-central2" },
|
|
3018
|
+
{ value: "asia-east1", label: "asia-east1" },
|
|
3019
|
+
{ value: "asia-east2", label: "asia-east2" },
|
|
3020
|
+
{ value: "asia-northeast1", label: "asia-northeast1" },
|
|
3021
|
+
{ value: "asia-northeast2", label: "asia-northeast2" },
|
|
3022
|
+
{ value: "asia-northeast3", label: "asia-northeast3" },
|
|
3023
|
+
{ value: "asia-south1", label: "asia-south1" },
|
|
3024
|
+
{ value: "asia-south2", label: "asia-south2" },
|
|
3025
|
+
{ value: "asia-southeast1", label: "asia-southeast1" },
|
|
3026
|
+
{ value: "asia-southeast2", label: "asia-southeast2" },
|
|
3027
|
+
{ value: "australia-southeast1", label: "australia-southeast1" },
|
|
3028
|
+
{ value: "australia-southeast2", label: "australia-southeast2" },
|
|
3029
|
+
{ value: "me-west1", label: "me-west1" },
|
|
3030
|
+
{ value: "me-central1", label: "me-central1" },
|
|
3031
|
+
{ value: "africa-south1", label: "africa-south1" }
|
|
3032
|
+
];
|
|
3033
|
+
|
|
3034
|
+
// src/providers/vscode-llm.ts
|
|
3035
|
+
var vscodeLlmDefaultModelId = "claude-3.5-sonnet";
|
|
3036
|
+
var vscodeLlmModels = {
|
|
3037
|
+
"gpt-3.5-turbo": {
|
|
3038
|
+
contextWindow: 12114,
|
|
3039
|
+
supportsImages: false,
|
|
3680
3040
|
supportsPromptCache: false,
|
|
3681
3041
|
inputPrice: 0,
|
|
3682
|
-
outputPrice: 0
|
|
3042
|
+
outputPrice: 0,
|
|
3043
|
+
family: "gpt-3.5-turbo",
|
|
3044
|
+
version: "gpt-3.5-turbo-0613",
|
|
3045
|
+
name: "GPT 3.5 Turbo",
|
|
3046
|
+
supportsToolCalling: true,
|
|
3047
|
+
maxInputTokens: 12114
|
|
3683
3048
|
},
|
|
3684
|
-
"
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
supportsImages: true,
|
|
3049
|
+
"gpt-4o-mini": {
|
|
3050
|
+
contextWindow: 12115,
|
|
3051
|
+
supportsImages: false,
|
|
3688
3052
|
supportsPromptCache: false,
|
|
3689
3053
|
inputPrice: 0,
|
|
3690
|
-
outputPrice: 0
|
|
3054
|
+
outputPrice: 0,
|
|
3055
|
+
family: "gpt-4o-mini",
|
|
3056
|
+
version: "gpt-4o-mini-2024-07-18",
|
|
3057
|
+
name: "GPT-4o mini",
|
|
3058
|
+
supportsToolCalling: true,
|
|
3059
|
+
maxInputTokens: 12115
|
|
3691
3060
|
},
|
|
3692
|
-
"
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3061
|
+
"gpt-4": {
|
|
3062
|
+
contextWindow: 28501,
|
|
3063
|
+
supportsImages: false,
|
|
3064
|
+
supportsPromptCache: false,
|
|
3065
|
+
inputPrice: 0,
|
|
3066
|
+
outputPrice: 0,
|
|
3067
|
+
family: "gpt-4",
|
|
3068
|
+
version: "gpt-4-0613",
|
|
3069
|
+
name: "GPT 4",
|
|
3070
|
+
supportsToolCalling: true,
|
|
3071
|
+
maxInputTokens: 28501
|
|
3699
3072
|
},
|
|
3700
|
-
"
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
supportsImages: true,
|
|
3073
|
+
"gpt-4-0125-preview": {
|
|
3074
|
+
contextWindow: 63826,
|
|
3075
|
+
supportsImages: false,
|
|
3704
3076
|
supportsPromptCache: false,
|
|
3705
|
-
inputPrice: 0
|
|
3706
|
-
outputPrice: 0
|
|
3077
|
+
inputPrice: 0,
|
|
3078
|
+
outputPrice: 0,
|
|
3079
|
+
family: "gpt-4-turbo",
|
|
3080
|
+
version: "gpt-4-0125-preview",
|
|
3081
|
+
name: "GPT 4 Turbo",
|
|
3082
|
+
supportsToolCalling: true,
|
|
3083
|
+
maxInputTokens: 63826
|
|
3707
3084
|
},
|
|
3708
|
-
"
|
|
3709
|
-
|
|
3710
|
-
contextWindow: 32768,
|
|
3085
|
+
"gpt-4o": {
|
|
3086
|
+
contextWindow: 63827,
|
|
3711
3087
|
supportsImages: true,
|
|
3712
3088
|
supportsPromptCache: false,
|
|
3713
3089
|
inputPrice: 0,
|
|
3714
|
-
outputPrice: 0
|
|
3090
|
+
outputPrice: 0,
|
|
3091
|
+
family: "gpt-4o",
|
|
3092
|
+
version: "gpt-4o-2024-11-20",
|
|
3093
|
+
name: "GPT-4o",
|
|
3094
|
+
supportsToolCalling: true,
|
|
3095
|
+
maxInputTokens: 63827
|
|
3715
3096
|
},
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3097
|
+
o1: {
|
|
3098
|
+
contextWindow: 19827,
|
|
3099
|
+
supportsImages: false,
|
|
3100
|
+
supportsPromptCache: false,
|
|
3101
|
+
inputPrice: 0,
|
|
3102
|
+
outputPrice: 0,
|
|
3103
|
+
family: "o1-ga",
|
|
3104
|
+
version: "o1-2024-12-17",
|
|
3105
|
+
name: "o1 (Preview)",
|
|
3106
|
+
supportsToolCalling: true,
|
|
3107
|
+
maxInputTokens: 19827
|
|
3108
|
+
},
|
|
3109
|
+
"o3-mini": {
|
|
3110
|
+
contextWindow: 63827,
|
|
3111
|
+
supportsImages: false,
|
|
3112
|
+
supportsPromptCache: false,
|
|
3113
|
+
inputPrice: 0,
|
|
3114
|
+
outputPrice: 0,
|
|
3115
|
+
family: "o3-mini",
|
|
3116
|
+
version: "o3-mini-2025-01-31",
|
|
3117
|
+
name: "o3-mini",
|
|
3118
|
+
supportsToolCalling: true,
|
|
3119
|
+
maxInputTokens: 63827
|
|
3120
|
+
},
|
|
3121
|
+
"claude-3.5-sonnet": {
|
|
3122
|
+
contextWindow: 81638,
|
|
3719
3123
|
supportsImages: true,
|
|
3720
|
-
supportsPromptCache:
|
|
3721
|
-
inputPrice: 0
|
|
3722
|
-
outputPrice: 0
|
|
3124
|
+
supportsPromptCache: false,
|
|
3125
|
+
inputPrice: 0,
|
|
3126
|
+
outputPrice: 0,
|
|
3127
|
+
family: "claude-3.5-sonnet",
|
|
3128
|
+
version: "claude-3.5-sonnet",
|
|
3129
|
+
name: "Claude 3.5 Sonnet",
|
|
3130
|
+
supportsToolCalling: true,
|
|
3131
|
+
maxInputTokens: 81638
|
|
3723
3132
|
},
|
|
3724
|
-
"
|
|
3725
|
-
|
|
3726
|
-
contextWindow: 2097152,
|
|
3133
|
+
"claude-4-sonnet": {
|
|
3134
|
+
contextWindow: 128e3,
|
|
3727
3135
|
supportsImages: true,
|
|
3728
3136
|
supportsPromptCache: false,
|
|
3729
|
-
inputPrice:
|
|
3730
|
-
outputPrice:
|
|
3137
|
+
inputPrice: 0,
|
|
3138
|
+
outputPrice: 0,
|
|
3139
|
+
family: "claude-sonnet-4",
|
|
3140
|
+
version: "claude-sonnet-4",
|
|
3141
|
+
name: "Claude Sonnet 4",
|
|
3142
|
+
supportsToolCalling: true,
|
|
3143
|
+
maxInputTokens: 111836
|
|
3731
3144
|
},
|
|
3732
|
-
"
|
|
3733
|
-
|
|
3734
|
-
contextWindow: 2e5,
|
|
3145
|
+
"gemini-2.0-flash-001": {
|
|
3146
|
+
contextWindow: 127827,
|
|
3735
3147
|
supportsImages: true,
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3148
|
+
supportsPromptCache: false,
|
|
3149
|
+
inputPrice: 0,
|
|
3150
|
+
outputPrice: 0,
|
|
3151
|
+
family: "gemini-2.0-flash",
|
|
3152
|
+
version: "gemini-2.0-flash-001",
|
|
3153
|
+
name: "Gemini 2.0 Flash",
|
|
3154
|
+
supportsToolCalling: false,
|
|
3155
|
+
maxInputTokens: 127827
|
|
3743
3156
|
},
|
|
3744
|
-
"
|
|
3745
|
-
|
|
3746
|
-
contextWindow: 2e5,
|
|
3157
|
+
"gemini-2.5-pro": {
|
|
3158
|
+
contextWindow: 128e3,
|
|
3747
3159
|
supportsImages: true,
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3160
|
+
supportsPromptCache: false,
|
|
3161
|
+
inputPrice: 0,
|
|
3162
|
+
outputPrice: 0,
|
|
3163
|
+
family: "gemini-2.5-pro",
|
|
3164
|
+
version: "gemini-2.5-pro-preview-03-25",
|
|
3165
|
+
name: "Gemini 2.5 Pro (Preview)",
|
|
3166
|
+
supportsToolCalling: true,
|
|
3167
|
+
maxInputTokens: 108637
|
|
3168
|
+
},
|
|
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
|
|
3755
3180
|
},
|
|
3756
|
-
"
|
|
3757
|
-
|
|
3758
|
-
contextWindow: 2e5,
|
|
3181
|
+
"gpt-4.1": {
|
|
3182
|
+
contextWindow: 128e3,
|
|
3759
3183
|
supportsImages: true,
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
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
|
|
3766
3192
|
},
|
|
3767
|
-
"
|
|
3768
|
-
|
|
3769
|
-
contextWindow: 2e5,
|
|
3193
|
+
"gpt-5-mini": {
|
|
3194
|
+
contextWindow: 128e3,
|
|
3770
3195
|
supportsImages: true,
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
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
|
|
3779
3204
|
},
|
|
3780
|
-
"
|
|
3781
|
-
|
|
3782
|
-
contextWindow: 2e5,
|
|
3205
|
+
"gpt-5": {
|
|
3206
|
+
contextWindow: 128e3,
|
|
3783
3207
|
supportsImages: true,
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
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": {
|
|
3792
3223
|
maxTokens: 8192,
|
|
3793
|
-
contextWindow:
|
|
3224
|
+
contextWindow: 256e3,
|
|
3794
3225
|
supportsImages: true,
|
|
3795
|
-
supportsComputerUse: true,
|
|
3796
3226
|
supportsPromptCache: true,
|
|
3797
3227
|
inputPrice: 3,
|
|
3798
3228
|
outputPrice: 15,
|
|
3799
|
-
cacheWritesPrice:
|
|
3800
|
-
cacheReadsPrice: 0.
|
|
3229
|
+
cacheWritesPrice: 0.75,
|
|
3230
|
+
cacheReadsPrice: 0.75,
|
|
3231
|
+
description: "xAI's Grok-4 model with 256K context window"
|
|
3801
3232
|
},
|
|
3802
|
-
"
|
|
3233
|
+
"grok-3": {
|
|
3803
3234
|
maxTokens: 8192,
|
|
3804
|
-
contextWindow:
|
|
3805
|
-
supportsImages:
|
|
3235
|
+
contextWindow: 131072,
|
|
3236
|
+
supportsImages: false,
|
|
3806
3237
|
supportsPromptCache: true,
|
|
3807
3238
|
inputPrice: 3,
|
|
3808
3239
|
outputPrice: 15,
|
|
3809
|
-
cacheWritesPrice:
|
|
3810
|
-
cacheReadsPrice: 0.
|
|
3240
|
+
cacheWritesPrice: 0.75,
|
|
3241
|
+
cacheReadsPrice: 0.75,
|
|
3242
|
+
description: "xAI's Grok-3 model with 128K context window"
|
|
3811
3243
|
},
|
|
3812
|
-
"
|
|
3244
|
+
"grok-3-fast": {
|
|
3813
3245
|
maxTokens: 8192,
|
|
3814
|
-
contextWindow:
|
|
3246
|
+
contextWindow: 131072,
|
|
3815
3247
|
supportsImages: false,
|
|
3816
3248
|
supportsPromptCache: true,
|
|
3817
|
-
inputPrice:
|
|
3818
|
-
outputPrice:
|
|
3249
|
+
inputPrice: 5,
|
|
3250
|
+
outputPrice: 25,
|
|
3819
3251
|
cacheWritesPrice: 1.25,
|
|
3820
|
-
cacheReadsPrice:
|
|
3252
|
+
cacheReadsPrice: 1.25,
|
|
3253
|
+
description: "xAI's Grok-3 fast model with 128K context window"
|
|
3821
3254
|
},
|
|
3822
|
-
"
|
|
3823
|
-
maxTokens:
|
|
3824
|
-
contextWindow:
|
|
3825
|
-
supportsImages:
|
|
3255
|
+
"grok-3-mini": {
|
|
3256
|
+
maxTokens: 8192,
|
|
3257
|
+
contextWindow: 131072,
|
|
3258
|
+
supportsImages: false,
|
|
3826
3259
|
supportsPromptCache: true,
|
|
3827
|
-
inputPrice:
|
|
3828
|
-
outputPrice:
|
|
3829
|
-
cacheWritesPrice:
|
|
3830
|
-
cacheReadsPrice:
|
|
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
|
|
3831
3266
|
},
|
|
3832
|
-
"
|
|
3833
|
-
maxTokens:
|
|
3834
|
-
contextWindow:
|
|
3835
|
-
supportsImages:
|
|
3267
|
+
"grok-3-mini-fast": {
|
|
3268
|
+
maxTokens: 8192,
|
|
3269
|
+
contextWindow: 131072,
|
|
3270
|
+
supportsImages: false,
|
|
3836
3271
|
supportsPromptCache: true,
|
|
3837
|
-
inputPrice: 0.
|
|
3838
|
-
outputPrice:
|
|
3839
|
-
cacheWritesPrice: 0.
|
|
3840
|
-
cacheReadsPrice: 0.
|
|
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
|
|
3841
3278
|
},
|
|
3842
|
-
"
|
|
3843
|
-
maxTokens:
|
|
3844
|
-
contextWindow:
|
|
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,
|
|
3845
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,
|
|
3846
3306
|
supportsPromptCache: true,
|
|
3847
|
-
inputPrice: 0.
|
|
3848
|
-
outputPrice:
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
supportsReasoningBudget: 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."
|
|
3853
3312
|
},
|
|
3854
|
-
"
|
|
3855
|
-
maxTokens:
|
|
3313
|
+
"glm-4.5-air": {
|
|
3314
|
+
maxTokens: 98304,
|
|
3856
3315
|
contextWindow: 131072,
|
|
3857
3316
|
supportsImages: false,
|
|
3858
|
-
supportsPromptCache:
|
|
3859
|
-
inputPrice: 0.
|
|
3860
|
-
outputPrice: 1.
|
|
3861
|
-
|
|
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."
|
|
3862
3323
|
}
|
|
3863
3324
|
};
|
|
3864
|
-
var
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
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,
|
|
3361
|
+
supportsImages: false,
|
|
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"
|
|
3897
3712
|
];
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
version: "gpt-3.5-turbo-0613",
|
|
3910
|
-
name: "GPT 3.5 Turbo",
|
|
3911
|
-
supportsToolCalling: true,
|
|
3912
|
-
maxInputTokens: 12114
|
|
3913
|
-
},
|
|
3914
|
-
"gpt-4o-mini": {
|
|
3915
|
-
contextWindow: 12115,
|
|
3916
|
-
supportsImages: false,
|
|
3917
|
-
supportsPromptCache: false,
|
|
3918
|
-
inputPrice: 0,
|
|
3919
|
-
outputPrice: 0,
|
|
3920
|
-
family: "gpt-4o-mini",
|
|
3921
|
-
version: "gpt-4o-mini-2024-07-18",
|
|
3922
|
-
name: "GPT-4o mini",
|
|
3923
|
-
supportsToolCalling: true,
|
|
3924
|
-
maxInputTokens: 12115
|
|
3925
|
-
},
|
|
3926
|
-
"gpt-4": {
|
|
3927
|
-
contextWindow: 28501,
|
|
3928
|
-
supportsImages: false,
|
|
3929
|
-
supportsPromptCache: false,
|
|
3930
|
-
inputPrice: 0,
|
|
3931
|
-
outputPrice: 0,
|
|
3932
|
-
family: "gpt-4",
|
|
3933
|
-
version: "gpt-4-0613",
|
|
3934
|
-
name: "GPT 4",
|
|
3935
|
-
supportsToolCalling: true,
|
|
3936
|
-
maxInputTokens: 28501
|
|
3937
|
-
},
|
|
3938
|
-
"gpt-4-0125-preview": {
|
|
3939
|
-
contextWindow: 63826,
|
|
3940
|
-
supportsImages: false,
|
|
3941
|
-
supportsPromptCache: false,
|
|
3942
|
-
inputPrice: 0,
|
|
3943
|
-
outputPrice: 0,
|
|
3944
|
-
family: "gpt-4-turbo",
|
|
3945
|
-
version: "gpt-4-0125-preview",
|
|
3946
|
-
name: "GPT 4 Turbo",
|
|
3947
|
-
supportsToolCalling: true,
|
|
3948
|
-
maxInputTokens: 63826
|
|
3949
|
-
},
|
|
3950
|
-
"gpt-4o": {
|
|
3951
|
-
contextWindow: 63827,
|
|
3952
|
-
supportsImages: true,
|
|
3953
|
-
supportsPromptCache: false,
|
|
3954
|
-
inputPrice: 0,
|
|
3955
|
-
outputPrice: 0,
|
|
3956
|
-
family: "gpt-4o",
|
|
3957
|
-
version: "gpt-4o-2024-11-20",
|
|
3958
|
-
name: "GPT-4o",
|
|
3959
|
-
supportsToolCalling: true,
|
|
3960
|
-
maxInputTokens: 63827
|
|
3961
|
-
},
|
|
3962
|
-
o1: {
|
|
3963
|
-
contextWindow: 19827,
|
|
3964
|
-
supportsImages: false,
|
|
3965
|
-
supportsPromptCache: false,
|
|
3966
|
-
inputPrice: 0,
|
|
3967
|
-
outputPrice: 0,
|
|
3968
|
-
family: "o1-ga",
|
|
3969
|
-
version: "o1-2024-12-17",
|
|
3970
|
-
name: "o1 (Preview)",
|
|
3971
|
-
supportsToolCalling: true,
|
|
3972
|
-
maxInputTokens: 19827
|
|
3973
|
-
},
|
|
3974
|
-
"o3-mini": {
|
|
3975
|
-
contextWindow: 63827,
|
|
3976
|
-
supportsImages: false,
|
|
3977
|
-
supportsPromptCache: false,
|
|
3978
|
-
inputPrice: 0,
|
|
3979
|
-
outputPrice: 0,
|
|
3980
|
-
family: "o3-mini",
|
|
3981
|
-
version: "o3-mini-2025-01-31",
|
|
3982
|
-
name: "o3-mini",
|
|
3983
|
-
supportsToolCalling: true,
|
|
3984
|
-
maxInputTokens: 63827
|
|
3985
|
-
},
|
|
3986
|
-
"claude-3.5-sonnet": {
|
|
3987
|
-
contextWindow: 81638,
|
|
3988
|
-
supportsImages: true,
|
|
3989
|
-
supportsPromptCache: false,
|
|
3990
|
-
inputPrice: 0,
|
|
3991
|
-
outputPrice: 0,
|
|
3992
|
-
family: "claude-3.5-sonnet",
|
|
3993
|
-
version: "claude-3.5-sonnet",
|
|
3994
|
-
name: "Claude 3.5 Sonnet",
|
|
3995
|
-
supportsToolCalling: true,
|
|
3996
|
-
maxInputTokens: 81638
|
|
3997
|
-
},
|
|
3998
|
-
"gemini-2.0-flash-001": {
|
|
3999
|
-
contextWindow: 127827,
|
|
4000
|
-
supportsImages: true,
|
|
4001
|
-
supportsPromptCache: false,
|
|
4002
|
-
inputPrice: 0,
|
|
4003
|
-
outputPrice: 0,
|
|
4004
|
-
family: "gemini-2.0-flash",
|
|
4005
|
-
version: "gemini-2.0-flash-001",
|
|
4006
|
-
name: "Gemini 2.0 Flash",
|
|
4007
|
-
supportsToolCalling: false,
|
|
4008
|
-
maxInputTokens: 127827
|
|
4009
|
-
},
|
|
4010
|
-
"gemini-2.5-pro": {
|
|
4011
|
-
contextWindow: 63830,
|
|
4012
|
-
supportsImages: true,
|
|
4013
|
-
supportsPromptCache: false,
|
|
4014
|
-
inputPrice: 0,
|
|
4015
|
-
outputPrice: 0,
|
|
4016
|
-
family: "gemini-2.5-pro",
|
|
4017
|
-
version: "gemini-2.5-pro-preview-03-25",
|
|
4018
|
-
name: "Gemini 2.5 Pro (Preview)",
|
|
4019
|
-
supportsToolCalling: true,
|
|
4020
|
-
maxInputTokens: 63830
|
|
4021
|
-
},
|
|
4022
|
-
"o4-mini": {
|
|
4023
|
-
contextWindow: 111446,
|
|
4024
|
-
supportsImages: false,
|
|
4025
|
-
supportsPromptCache: false,
|
|
4026
|
-
inputPrice: 0,
|
|
4027
|
-
outputPrice: 0,
|
|
4028
|
-
family: "o4-mini",
|
|
4029
|
-
version: "o4-mini-2025-04-16",
|
|
4030
|
-
name: "o4-mini (Preview)",
|
|
4031
|
-
supportsToolCalling: true,
|
|
4032
|
-
maxInputTokens: 111446
|
|
4033
|
-
},
|
|
4034
|
-
"gpt-4.1": {
|
|
4035
|
-
contextWindow: 111446,
|
|
4036
|
-
supportsImages: true,
|
|
4037
|
-
supportsPromptCache: false,
|
|
4038
|
-
inputPrice: 0,
|
|
4039
|
-
outputPrice: 0,
|
|
4040
|
-
family: "gpt-4.1",
|
|
4041
|
-
version: "gpt-4.1-2025-04-14",
|
|
4042
|
-
name: "GPT-4.1 (Preview)",
|
|
4043
|
-
supportsToolCalling: true,
|
|
4044
|
-
maxInputTokens: 111446
|
|
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";
|
|
4045
3724
|
}
|
|
3725
|
+
return "openai";
|
|
4046
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
|
+
"gemini-cli": { id: "gemini-cli", label: "Gemini CLI", models: [] },
|
|
3811
|
+
glama: { id: "glama", label: "Glama", models: [] },
|
|
3812
|
+
huggingface: { id: "huggingface", label: "Hugging Face", models: [] },
|
|
3813
|
+
litellm: { id: "litellm", label: "LiteLLM", models: [] },
|
|
3814
|
+
lmstudio: { id: "lmstudio", label: "LM Studio", models: [] },
|
|
3815
|
+
ollama: { id: "ollama", label: "Ollama", models: [] },
|
|
3816
|
+
openai: { id: "openai", label: "OpenAI Compatible", models: [] },
|
|
3817
|
+
openrouter: { id: "openrouter", label: "OpenRouter", models: [] },
|
|
3818
|
+
requesty: { id: "requesty", label: "Requesty", models: [] },
|
|
3819
|
+
unbound: { id: "unbound", label: "Unbound", models: [] }
|
|
3820
|
+
};
|
|
3821
|
+
|
|
3822
|
+
// src/history.ts
|
|
3823
|
+
import { z as z9 } from "zod";
|
|
3824
|
+
var historyItemSchema = z9.object({
|
|
3825
|
+
id: z9.string(),
|
|
3826
|
+
number: z9.number(),
|
|
3827
|
+
ts: z9.number(),
|
|
3828
|
+
task: z9.string(),
|
|
3829
|
+
tokensIn: z9.number(),
|
|
3830
|
+
tokensOut: z9.number(),
|
|
3831
|
+
cacheWrites: z9.number().optional(),
|
|
3832
|
+
cacheReads: z9.number().optional(),
|
|
3833
|
+
totalCost: z9.number(),
|
|
3834
|
+
size: z9.number().optional(),
|
|
3835
|
+
workspace: z9.string().optional(),
|
|
3836
|
+
mode: z9.string().optional()
|
|
3837
|
+
});
|
|
4047
3838
|
|
|
4048
|
-
// src/
|
|
4049
|
-
|
|
4050
|
-
var
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
"
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
3839
|
+
// src/telemetry.ts
|
|
3840
|
+
import { z as z10 } from "zod";
|
|
3841
|
+
var telemetrySettings = ["unset", "enabled", "disabled"];
|
|
3842
|
+
var telemetrySettingsSchema = z10.enum(telemetrySettings);
|
|
3843
|
+
var TelemetryEventName = /* @__PURE__ */ ((TelemetryEventName2) => {
|
|
3844
|
+
TelemetryEventName2["TASK_CREATED"] = "Task Created";
|
|
3845
|
+
TelemetryEventName2["TASK_RESTARTED"] = "Task Reopened";
|
|
3846
|
+
TelemetryEventName2["TASK_COMPLETED"] = "Task Completed";
|
|
3847
|
+
TelemetryEventName2["TASK_MESSAGE"] = "Task Message";
|
|
3848
|
+
TelemetryEventName2["TASK_CONVERSATION_MESSAGE"] = "Conversation Message";
|
|
3849
|
+
TelemetryEventName2["LLM_COMPLETION"] = "LLM Completion";
|
|
3850
|
+
TelemetryEventName2["MODE_SWITCH"] = "Mode Switched";
|
|
3851
|
+
TelemetryEventName2["MODE_SELECTOR_OPENED"] = "Mode Selector Opened";
|
|
3852
|
+
TelemetryEventName2["TOOL_USED"] = "Tool Used";
|
|
3853
|
+
TelemetryEventName2["CHECKPOINT_CREATED"] = "Checkpoint Created";
|
|
3854
|
+
TelemetryEventName2["CHECKPOINT_RESTORED"] = "Checkpoint Restored";
|
|
3855
|
+
TelemetryEventName2["CHECKPOINT_DIFFED"] = "Checkpoint Diffed";
|
|
3856
|
+
TelemetryEventName2["TAB_SHOWN"] = "Tab Shown";
|
|
3857
|
+
TelemetryEventName2["MODE_SETTINGS_CHANGED"] = "Mode Setting Changed";
|
|
3858
|
+
TelemetryEventName2["CUSTOM_MODE_CREATED"] = "Custom Mode Created";
|
|
3859
|
+
TelemetryEventName2["CONTEXT_CONDENSED"] = "Context Condensed";
|
|
3860
|
+
TelemetryEventName2["SLIDING_WINDOW_TRUNCATION"] = "Sliding Window Truncation";
|
|
3861
|
+
TelemetryEventName2["CODE_ACTION_USED"] = "Code Action Used";
|
|
3862
|
+
TelemetryEventName2["PROMPT_ENHANCED"] = "Prompt Enhanced";
|
|
3863
|
+
TelemetryEventName2["TITLE_BUTTON_CLICKED"] = "Title Button Clicked";
|
|
3864
|
+
TelemetryEventName2["AUTHENTICATION_INITIATED"] = "Authentication Initiated";
|
|
3865
|
+
TelemetryEventName2["MARKETPLACE_ITEM_INSTALLED"] = "Marketplace Item Installed";
|
|
3866
|
+
TelemetryEventName2["MARKETPLACE_ITEM_REMOVED"] = "Marketplace Item Removed";
|
|
3867
|
+
TelemetryEventName2["MARKETPLACE_TAB_VIEWED"] = "Marketplace Tab Viewed";
|
|
3868
|
+
TelemetryEventName2["MARKETPLACE_INSTALL_BUTTON_CLICKED"] = "Marketplace Install Button Clicked";
|
|
3869
|
+
TelemetryEventName2["SHARE_BUTTON_CLICKED"] = "Share Button Clicked";
|
|
3870
|
+
TelemetryEventName2["SHARE_ORGANIZATION_CLICKED"] = "Share Organization Clicked";
|
|
3871
|
+
TelemetryEventName2["SHARE_PUBLIC_CLICKED"] = "Share Public Clicked";
|
|
3872
|
+
TelemetryEventName2["SHARE_CONNECT_TO_CLOUD_CLICKED"] = "Share Connect To Cloud Clicked";
|
|
3873
|
+
TelemetryEventName2["ACCOUNT_CONNECT_CLICKED"] = "Account Connect Clicked";
|
|
3874
|
+
TelemetryEventName2["ACCOUNT_CONNECT_SUCCESS"] = "Account Connect Success";
|
|
3875
|
+
TelemetryEventName2["ACCOUNT_LOGOUT_CLICKED"] = "Account Logout Clicked";
|
|
3876
|
+
TelemetryEventName2["ACCOUNT_LOGOUT_SUCCESS"] = "Account Logout Success";
|
|
3877
|
+
TelemetryEventName2["SCHEMA_VALIDATION_ERROR"] = "Schema Validation Error";
|
|
3878
|
+
TelemetryEventName2["DIFF_APPLICATION_ERROR"] = "Diff Application Error";
|
|
3879
|
+
TelemetryEventName2["SHELL_INTEGRATION_ERROR"] = "Shell Integration Error";
|
|
3880
|
+
TelemetryEventName2["CONSECUTIVE_MISTAKE_ERROR"] = "Consecutive Mistake Error";
|
|
3881
|
+
TelemetryEventName2["CODE_INDEX_ERROR"] = "Code Index Error";
|
|
3882
|
+
return TelemetryEventName2;
|
|
3883
|
+
})(TelemetryEventName || {});
|
|
3884
|
+
var staticAppPropertiesSchema = z10.object({
|
|
3885
|
+
appName: z10.string(),
|
|
3886
|
+
appVersion: z10.string(),
|
|
3887
|
+
vscodeVersion: z10.string(),
|
|
3888
|
+
platform: z10.string(),
|
|
3889
|
+
editorName: z10.string()
|
|
3890
|
+
});
|
|
3891
|
+
var dynamicAppPropertiesSchema = z10.object({
|
|
3892
|
+
language: z10.string(),
|
|
3893
|
+
mode: z10.string()
|
|
3894
|
+
});
|
|
3895
|
+
var cloudAppPropertiesSchema = z10.object({
|
|
3896
|
+
cloudIsAuthenticated: z10.boolean().optional()
|
|
3897
|
+
});
|
|
3898
|
+
var appPropertiesSchema = z10.object({
|
|
3899
|
+
...staticAppPropertiesSchema.shape,
|
|
3900
|
+
...dynamicAppPropertiesSchema.shape,
|
|
3901
|
+
...cloudAppPropertiesSchema.shape
|
|
3902
|
+
});
|
|
3903
|
+
var taskPropertiesSchema = z10.object({
|
|
3904
|
+
taskId: z10.string().optional(),
|
|
3905
|
+
apiProvider: z10.enum(providerNames).optional(),
|
|
3906
|
+
modelId: z10.string().optional(),
|
|
3907
|
+
diffStrategy: z10.string().optional(),
|
|
3908
|
+
isSubtask: z10.boolean().optional(),
|
|
3909
|
+
todos: z10.object({
|
|
3910
|
+
total: z10.number(),
|
|
3911
|
+
completed: z10.number(),
|
|
3912
|
+
inProgress: z10.number(),
|
|
3913
|
+
pending: z10.number()
|
|
3914
|
+
}).optional()
|
|
3915
|
+
});
|
|
3916
|
+
var gitPropertiesSchema = z10.object({
|
|
3917
|
+
repositoryUrl: z10.string().optional(),
|
|
3918
|
+
repositoryName: z10.string().optional(),
|
|
3919
|
+
defaultBranch: z10.string().optional()
|
|
3920
|
+
});
|
|
3921
|
+
var telemetryPropertiesSchema = z10.object({
|
|
3922
|
+
...appPropertiesSchema.shape,
|
|
3923
|
+
...taskPropertiesSchema.shape,
|
|
3924
|
+
...gitPropertiesSchema.shape
|
|
3925
|
+
});
|
|
3926
|
+
var rooCodeTelemetryEventSchema = z10.discriminatedUnion("type", [
|
|
3927
|
+
z10.object({
|
|
3928
|
+
type: z10.enum([
|
|
3929
|
+
"Task Created" /* TASK_CREATED */,
|
|
3930
|
+
"Task Reopened" /* TASK_RESTARTED */,
|
|
3931
|
+
"Task Completed" /* TASK_COMPLETED */,
|
|
3932
|
+
"Conversation Message" /* TASK_CONVERSATION_MESSAGE */,
|
|
3933
|
+
"Mode Switched" /* MODE_SWITCH */,
|
|
3934
|
+
"Mode Selector Opened" /* MODE_SELECTOR_OPENED */,
|
|
3935
|
+
"Tool Used" /* TOOL_USED */,
|
|
3936
|
+
"Checkpoint Created" /* CHECKPOINT_CREATED */,
|
|
3937
|
+
"Checkpoint Restored" /* CHECKPOINT_RESTORED */,
|
|
3938
|
+
"Checkpoint Diffed" /* CHECKPOINT_DIFFED */,
|
|
3939
|
+
"Code Action Used" /* CODE_ACTION_USED */,
|
|
3940
|
+
"Prompt Enhanced" /* PROMPT_ENHANCED */,
|
|
3941
|
+
"Title Button Clicked" /* TITLE_BUTTON_CLICKED */,
|
|
3942
|
+
"Authentication Initiated" /* AUTHENTICATION_INITIATED */,
|
|
3943
|
+
"Marketplace Item Installed" /* MARKETPLACE_ITEM_INSTALLED */,
|
|
3944
|
+
"Marketplace Item Removed" /* MARKETPLACE_ITEM_REMOVED */,
|
|
3945
|
+
"Marketplace Tab Viewed" /* MARKETPLACE_TAB_VIEWED */,
|
|
3946
|
+
"Marketplace Install Button Clicked" /* MARKETPLACE_INSTALL_BUTTON_CLICKED */,
|
|
3947
|
+
"Share Button Clicked" /* SHARE_BUTTON_CLICKED */,
|
|
3948
|
+
"Share Organization Clicked" /* SHARE_ORGANIZATION_CLICKED */,
|
|
3949
|
+
"Share Public Clicked" /* SHARE_PUBLIC_CLICKED */,
|
|
3950
|
+
"Share Connect To Cloud Clicked" /* SHARE_CONNECT_TO_CLOUD_CLICKED */,
|
|
3951
|
+
"Account Connect Clicked" /* ACCOUNT_CONNECT_CLICKED */,
|
|
3952
|
+
"Account Connect Success" /* ACCOUNT_CONNECT_SUCCESS */,
|
|
3953
|
+
"Account Logout Clicked" /* ACCOUNT_LOGOUT_CLICKED */,
|
|
3954
|
+
"Account Logout Success" /* ACCOUNT_LOGOUT_SUCCESS */,
|
|
3955
|
+
"Schema Validation Error" /* SCHEMA_VALIDATION_ERROR */,
|
|
3956
|
+
"Diff Application Error" /* DIFF_APPLICATION_ERROR */,
|
|
3957
|
+
"Shell Integration Error" /* SHELL_INTEGRATION_ERROR */,
|
|
3958
|
+
"Consecutive Mistake Error" /* CONSECUTIVE_MISTAKE_ERROR */,
|
|
3959
|
+
"Code Index Error" /* CODE_INDEX_ERROR */,
|
|
3960
|
+
"Context Condensed" /* CONTEXT_CONDENSED */,
|
|
3961
|
+
"Sliding Window Truncation" /* SLIDING_WINDOW_TRUNCATION */,
|
|
3962
|
+
"Tab Shown" /* TAB_SHOWN */,
|
|
3963
|
+
"Mode Setting Changed" /* MODE_SETTINGS_CHANGED */,
|
|
3964
|
+
"Custom Mode Created" /* CUSTOM_MODE_CREATED */
|
|
3965
|
+
]),
|
|
3966
|
+
properties: telemetryPropertiesSchema
|
|
3967
|
+
}),
|
|
3968
|
+
z10.object({
|
|
3969
|
+
type: z10.literal("Task Message" /* TASK_MESSAGE */),
|
|
3970
|
+
properties: z10.object({
|
|
3971
|
+
...telemetryPropertiesSchema.shape,
|
|
3972
|
+
taskId: z10.string(),
|
|
3973
|
+
message: clineMessageSchema
|
|
3974
|
+
})
|
|
3975
|
+
}),
|
|
3976
|
+
z10.object({
|
|
3977
|
+
type: z10.literal("LLM Completion" /* LLM_COMPLETION */),
|
|
3978
|
+
properties: z10.object({
|
|
3979
|
+
...telemetryPropertiesSchema.shape,
|
|
3980
|
+
inputTokens: z10.number(),
|
|
3981
|
+
outputTokens: z10.number(),
|
|
3982
|
+
cacheReadTokens: z10.number().optional(),
|
|
3983
|
+
cacheWriteTokens: z10.number().optional(),
|
|
3984
|
+
cost: z10.number().optional()
|
|
3985
|
+
})
|
|
3986
|
+
})
|
|
3987
|
+
]);
|
|
3988
|
+
|
|
3989
|
+
// src/mode.ts
|
|
3990
|
+
import { z as z11 } from "zod";
|
|
3991
|
+
var groupOptionsSchema = z11.object({
|
|
3992
|
+
fileRegex: z11.string().optional().refine(
|
|
3993
|
+
(pattern) => {
|
|
3994
|
+
if (!pattern) {
|
|
3995
|
+
return true;
|
|
3996
|
+
}
|
|
3997
|
+
try {
|
|
3998
|
+
new RegExp(pattern);
|
|
3999
|
+
return true;
|
|
4000
|
+
} catch {
|
|
4001
|
+
return false;
|
|
4002
|
+
}
|
|
4003
|
+
},
|
|
4004
|
+
{ message: "Invalid regular expression pattern" }
|
|
4005
|
+
),
|
|
4006
|
+
description: z11.string().optional()
|
|
4007
|
+
});
|
|
4008
|
+
var groupEntrySchema = z11.union([toolGroupsSchema, z11.tuple([toolGroupsSchema, groupOptionsSchema])]);
|
|
4009
|
+
var groupEntryArraySchema = z11.array(groupEntrySchema).refine(
|
|
4010
|
+
(groups) => {
|
|
4011
|
+
const seen = /* @__PURE__ */ new Set();
|
|
4012
|
+
return groups.every((group) => {
|
|
4013
|
+
const groupName = Array.isArray(group) ? group[0] : group;
|
|
4014
|
+
if (seen.has(groupName)) {
|
|
4015
|
+
return false;
|
|
4016
|
+
}
|
|
4017
|
+
seen.add(groupName);
|
|
4018
|
+
return true;
|
|
4019
|
+
});
|
|
4072
4020
|
},
|
|
4073
|
-
"
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4021
|
+
{ message: "Duplicate groups are not allowed" }
|
|
4022
|
+
);
|
|
4023
|
+
var modeConfigSchema = z11.object({
|
|
4024
|
+
slug: z11.string().regex(/^[a-zA-Z0-9-]+$/, "Slug must contain only letters numbers and dashes"),
|
|
4025
|
+
name: z11.string().min(1, "Name is required"),
|
|
4026
|
+
roleDefinition: z11.string().min(1, "Role definition is required"),
|
|
4027
|
+
whenToUse: z11.string().optional(),
|
|
4028
|
+
description: z11.string().optional(),
|
|
4029
|
+
customInstructions: z11.string().optional(),
|
|
4030
|
+
groups: groupEntryArraySchema,
|
|
4031
|
+
source: z11.enum(["global", "project"]).optional()
|
|
4032
|
+
});
|
|
4033
|
+
var customModesSettingsSchema = z11.object({
|
|
4034
|
+
customModes: z11.array(modeConfigSchema).refine(
|
|
4035
|
+
(modes) => {
|
|
4036
|
+
const slugs = /* @__PURE__ */ new Set();
|
|
4037
|
+
return modes.every((mode) => {
|
|
4038
|
+
if (slugs.has(mode.slug)) {
|
|
4039
|
+
return false;
|
|
4040
|
+
}
|
|
4041
|
+
slugs.add(mode.slug);
|
|
4042
|
+
return true;
|
|
4043
|
+
});
|
|
4044
|
+
},
|
|
4045
|
+
{
|
|
4046
|
+
message: "Duplicate mode slugs are not allowed"
|
|
4047
|
+
}
|
|
4048
|
+
)
|
|
4049
|
+
});
|
|
4050
|
+
var promptComponentSchema = z11.object({
|
|
4051
|
+
roleDefinition: z11.string().optional(),
|
|
4052
|
+
whenToUse: z11.string().optional(),
|
|
4053
|
+
description: z11.string().optional(),
|
|
4054
|
+
customInstructions: z11.string().optional()
|
|
4055
|
+
});
|
|
4056
|
+
var customModePromptsSchema = z11.record(z11.string(), promptComponentSchema.optional());
|
|
4057
|
+
var customSupportPromptsSchema = z11.record(z11.string(), z11.string().optional());
|
|
4058
|
+
var DEFAULT_MODES = [
|
|
4059
|
+
{
|
|
4060
|
+
slug: "architect",
|
|
4061
|
+
name: "\u{1F3D7}\uFE0F Architect",
|
|
4062
|
+
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.",
|
|
4063
|
+
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.",
|
|
4064
|
+
description: "Plan and design before implementation",
|
|
4065
|
+
groups: ["read", ["edit", { fileRegex: "\\.md$", description: "Markdown files only" }], "browser", "mcp"],
|
|
4066
|
+
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.**"
|
|
4083
4067
|
},
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
cacheWritesPrice: 0.07,
|
|
4092
|
-
cacheReadsPrice: 0.07,
|
|
4093
|
-
description: "xAI's Grok-3 mini model with 128K context window",
|
|
4094
|
-
supportsReasoningEffort: true
|
|
4068
|
+
{
|
|
4069
|
+
slug: "code",
|
|
4070
|
+
name: "\u{1F4BB} Code",
|
|
4071
|
+
roleDefinition: "You are Roo, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.",
|
|
4072
|
+
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.",
|
|
4073
|
+
description: "Write, modify, and refactor code",
|
|
4074
|
+
groups: ["read", "edit", "browser", "command", "mcp"]
|
|
4095
4075
|
},
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
cacheReadsPrice: 0.15,
|
|
4105
|
-
description: "xAI's Grok-3 mini fast model with 128K context window",
|
|
4106
|
-
supportsReasoningEffort: true
|
|
4076
|
+
{
|
|
4077
|
+
slug: "ask",
|
|
4078
|
+
name: "\u2753 Ask",
|
|
4079
|
+
roleDefinition: "You are Roo, a knowledgeable technical assistant focused on answering questions and providing information about software development, technology, and related topics.",
|
|
4080
|
+
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.",
|
|
4081
|
+
description: "Get answers and explanations",
|
|
4082
|
+
groups: ["read", "browser", "mcp"],
|
|
4083
|
+
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."
|
|
4107
4084
|
},
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4085
|
+
{
|
|
4086
|
+
slug: "debug",
|
|
4087
|
+
name: "\u{1FAB2} Debug",
|
|
4088
|
+
roleDefinition: "You are Roo, an expert software debugger specializing in systematic problem diagnosis and resolution.",
|
|
4089
|
+
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.",
|
|
4090
|
+
description: "Diagnose and fix software issues",
|
|
4091
|
+
groups: ["read", "edit", "browser", "command", "mcp"],
|
|
4092
|
+
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."
|
|
4116
4093
|
},
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4094
|
+
{
|
|
4095
|
+
slug: "orchestrator",
|
|
4096
|
+
name: "\u{1FA83} Orchestrator",
|
|
4097
|
+
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.",
|
|
4098
|
+
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.",
|
|
4099
|
+
description: "Coordinate tasks across multiple modes",
|
|
4100
|
+
groups: [],
|
|
4101
|
+
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."
|
|
4125
4102
|
}
|
|
4103
|
+
];
|
|
4104
|
+
|
|
4105
|
+
// src/vscode.ts
|
|
4106
|
+
import { z as z12 } from "zod";
|
|
4107
|
+
var codeActionIds = ["explainCode", "fixCode", "improveCode", "addToContext", "newTask"];
|
|
4108
|
+
var terminalActionIds = ["terminalAddToContext", "terminalFixCommand", "terminalExplainCommand"];
|
|
4109
|
+
var commandIds = [
|
|
4110
|
+
"activationCompleted",
|
|
4111
|
+
"plusButtonClicked",
|
|
4112
|
+
"promptsButtonClicked",
|
|
4113
|
+
"mcpButtonClicked",
|
|
4114
|
+
"historyButtonClicked",
|
|
4115
|
+
"marketplaceButtonClicked",
|
|
4116
|
+
"popoutButtonClicked",
|
|
4117
|
+
"accountButtonClicked",
|
|
4118
|
+
"settingsButtonClicked",
|
|
4119
|
+
"openInNewTab",
|
|
4120
|
+
"showHumanRelayDialog",
|
|
4121
|
+
"registerHumanRelayCallback",
|
|
4122
|
+
"unregisterHumanRelayCallback",
|
|
4123
|
+
"handleHumanRelayResponse",
|
|
4124
|
+
"newTask",
|
|
4125
|
+
"setCustomStoragePath",
|
|
4126
|
+
"importSettings",
|
|
4127
|
+
"focusInput",
|
|
4128
|
+
"acceptInput",
|
|
4129
|
+
"focusPanel"
|
|
4130
|
+
];
|
|
4131
|
+
var languages = [
|
|
4132
|
+
"ca",
|
|
4133
|
+
"de",
|
|
4134
|
+
"en",
|
|
4135
|
+
"es",
|
|
4136
|
+
"fr",
|
|
4137
|
+
"hi",
|
|
4138
|
+
"id",
|
|
4139
|
+
"it",
|
|
4140
|
+
"ja",
|
|
4141
|
+
"ko",
|
|
4142
|
+
"nl",
|
|
4143
|
+
"pl",
|
|
4144
|
+
"pt-BR",
|
|
4145
|
+
"ru",
|
|
4146
|
+
"tr",
|
|
4147
|
+
"vi",
|
|
4148
|
+
"zh-CN",
|
|
4149
|
+
"zh-TW"
|
|
4150
|
+
];
|
|
4151
|
+
var languagesSchema = z12.enum(languages);
|
|
4152
|
+
var isLanguage = (value) => languages.includes(value);
|
|
4153
|
+
|
|
4154
|
+
// src/global-settings.ts
|
|
4155
|
+
var DEFAULT_WRITE_DELAY_MS = 1e3;
|
|
4156
|
+
var DEFAULT_TERMINAL_OUTPUT_CHARACTER_LIMIT = 5e4;
|
|
4157
|
+
var globalSettingsSchema = z13.object({
|
|
4158
|
+
currentApiConfigName: z13.string().optional(),
|
|
4159
|
+
listApiConfigMeta: z13.array(providerSettingsEntrySchema).optional(),
|
|
4160
|
+
pinnedApiConfigs: z13.record(z13.string(), z13.boolean()).optional(),
|
|
4161
|
+
lastShownAnnouncementId: z13.string().optional(),
|
|
4162
|
+
customInstructions: z13.string().optional(),
|
|
4163
|
+
taskHistory: z13.array(historyItemSchema).optional(),
|
|
4164
|
+
condensingApiConfigId: z13.string().optional(),
|
|
4165
|
+
customCondensingPrompt: z13.string().optional(),
|
|
4166
|
+
autoApprovalEnabled: z13.boolean().optional(),
|
|
4167
|
+
alwaysAllowReadOnly: z13.boolean().optional(),
|
|
4168
|
+
alwaysAllowReadOnlyOutsideWorkspace: z13.boolean().optional(),
|
|
4169
|
+
alwaysAllowWrite: z13.boolean().optional(),
|
|
4170
|
+
alwaysAllowWriteOutsideWorkspace: z13.boolean().optional(),
|
|
4171
|
+
alwaysAllowWriteProtected: z13.boolean().optional(),
|
|
4172
|
+
writeDelayMs: z13.number().min(0).optional(),
|
|
4173
|
+
alwaysAllowBrowser: z13.boolean().optional(),
|
|
4174
|
+
alwaysApproveResubmit: z13.boolean().optional(),
|
|
4175
|
+
requestDelaySeconds: z13.number().optional(),
|
|
4176
|
+
alwaysAllowMcp: z13.boolean().optional(),
|
|
4177
|
+
alwaysAllowModeSwitch: z13.boolean().optional(),
|
|
4178
|
+
alwaysAllowSubtasks: z13.boolean().optional(),
|
|
4179
|
+
alwaysAllowExecute: z13.boolean().optional(),
|
|
4180
|
+
alwaysAllowFollowupQuestions: z13.boolean().optional(),
|
|
4181
|
+
followupAutoApproveTimeoutMs: z13.number().optional(),
|
|
4182
|
+
alwaysAllowUpdateTodoList: z13.boolean().optional(),
|
|
4183
|
+
allowedCommands: z13.array(z13.string()).optional(),
|
|
4184
|
+
deniedCommands: z13.array(z13.string()).optional(),
|
|
4185
|
+
commandExecutionTimeout: z13.number().optional(),
|
|
4186
|
+
commandTimeoutAllowlist: z13.array(z13.string()).optional(),
|
|
4187
|
+
preventCompletionWithOpenTodos: z13.boolean().optional(),
|
|
4188
|
+
allowedMaxRequests: z13.number().nullish(),
|
|
4189
|
+
allowedMaxCost: z13.number().nullish(),
|
|
4190
|
+
autoCondenseContext: z13.boolean().optional(),
|
|
4191
|
+
autoCondenseContextPercent: z13.number().optional(),
|
|
4192
|
+
maxConcurrentFileReads: z13.number().optional(),
|
|
4193
|
+
/**
|
|
4194
|
+
* Whether to include diagnostic messages (errors, warnings) in tool outputs
|
|
4195
|
+
* @default true
|
|
4196
|
+
*/
|
|
4197
|
+
includeDiagnosticMessages: z13.boolean().optional(),
|
|
4198
|
+
/**
|
|
4199
|
+
* Maximum number of diagnostic messages to include in tool outputs
|
|
4200
|
+
* @default 50
|
|
4201
|
+
*/
|
|
4202
|
+
maxDiagnosticMessages: z13.number().optional(),
|
|
4203
|
+
browserToolEnabled: z13.boolean().optional(),
|
|
4204
|
+
browserViewportSize: z13.string().optional(),
|
|
4205
|
+
screenshotQuality: z13.number().optional(),
|
|
4206
|
+
remoteBrowserEnabled: z13.boolean().optional(),
|
|
4207
|
+
remoteBrowserHost: z13.string().optional(),
|
|
4208
|
+
cachedChromeHostUrl: z13.string().optional(),
|
|
4209
|
+
enableCheckpoints: z13.boolean().optional(),
|
|
4210
|
+
ttsEnabled: z13.boolean().optional(),
|
|
4211
|
+
ttsSpeed: z13.number().optional(),
|
|
4212
|
+
soundEnabled: z13.boolean().optional(),
|
|
4213
|
+
soundVolume: z13.number().optional(),
|
|
4214
|
+
maxOpenTabsContext: z13.number().optional(),
|
|
4215
|
+
maxWorkspaceFiles: z13.number().optional(),
|
|
4216
|
+
showRooIgnoredFiles: z13.boolean().optional(),
|
|
4217
|
+
maxReadFileLine: z13.number().optional(),
|
|
4218
|
+
maxImageFileSize: z13.number().optional(),
|
|
4219
|
+
maxTotalImageSize: z13.number().optional(),
|
|
4220
|
+
terminalOutputLineLimit: z13.number().optional(),
|
|
4221
|
+
terminalOutputCharacterLimit: z13.number().optional(),
|
|
4222
|
+
terminalShellIntegrationTimeout: z13.number().optional(),
|
|
4223
|
+
terminalShellIntegrationDisabled: z13.boolean().optional(),
|
|
4224
|
+
terminalCommandDelay: z13.number().optional(),
|
|
4225
|
+
terminalPowershellCounter: z13.boolean().optional(),
|
|
4226
|
+
terminalZshClearEolMark: z13.boolean().optional(),
|
|
4227
|
+
terminalZshOhMy: z13.boolean().optional(),
|
|
4228
|
+
terminalZshP10k: z13.boolean().optional(),
|
|
4229
|
+
terminalZdotdir: z13.boolean().optional(),
|
|
4230
|
+
terminalCompressProgressBar: z13.boolean().optional(),
|
|
4231
|
+
diagnosticsEnabled: z13.boolean().optional(),
|
|
4232
|
+
rateLimitSeconds: z13.number().optional(),
|
|
4233
|
+
diffEnabled: z13.boolean().optional(),
|
|
4234
|
+
fuzzyMatchThreshold: z13.number().optional(),
|
|
4235
|
+
experiments: experimentsSchema.optional(),
|
|
4236
|
+
codebaseIndexModels: codebaseIndexModelsSchema.optional(),
|
|
4237
|
+
codebaseIndexConfig: codebaseIndexConfigSchema.optional(),
|
|
4238
|
+
language: languagesSchema.optional(),
|
|
4239
|
+
telemetrySetting: telemetrySettingsSchema.optional(),
|
|
4240
|
+
mcpEnabled: z13.boolean().optional(),
|
|
4241
|
+
enableMcpServerCreation: z13.boolean().optional(),
|
|
4242
|
+
remoteControlEnabled: z13.boolean().optional(),
|
|
4243
|
+
mode: z13.string().optional(),
|
|
4244
|
+
modeApiConfigs: z13.record(z13.string(), z13.string()).optional(),
|
|
4245
|
+
customModes: z13.array(modeConfigSchema).optional(),
|
|
4246
|
+
customModePrompts: customModePromptsSchema.optional(),
|
|
4247
|
+
customSupportPrompts: customSupportPromptsSchema.optional(),
|
|
4248
|
+
enhancementApiConfigId: z13.string().optional(),
|
|
4249
|
+
includeTaskHistoryInEnhance: z13.boolean().optional(),
|
|
4250
|
+
historyPreviewCollapsed: z13.boolean().optional(),
|
|
4251
|
+
profileThresholds: z13.record(z13.string(), z13.number()).optional(),
|
|
4252
|
+
hasOpenedModeSelector: z13.boolean().optional(),
|
|
4253
|
+
lastModeExportPath: z13.string().optional(),
|
|
4254
|
+
lastModeImportPath: z13.string().optional()
|
|
4255
|
+
});
|
|
4256
|
+
var GLOBAL_SETTINGS_KEYS = globalSettingsSchema.keyof().options;
|
|
4257
|
+
var rooCodeSettingsSchema = providerSettingsSchema.merge(globalSettingsSchema);
|
|
4258
|
+
var SECRET_STATE_KEYS = [
|
|
4259
|
+
"apiKey",
|
|
4260
|
+
"glamaApiKey",
|
|
4261
|
+
"openRouterApiKey",
|
|
4262
|
+
"awsAccessKey",
|
|
4263
|
+
"awsApiKey",
|
|
4264
|
+
"awsSecretKey",
|
|
4265
|
+
"awsSessionToken",
|
|
4266
|
+
"openAiApiKey",
|
|
4267
|
+
"geminiApiKey",
|
|
4268
|
+
"openAiNativeApiKey",
|
|
4269
|
+
"cerebrasApiKey",
|
|
4270
|
+
"deepSeekApiKey",
|
|
4271
|
+
"doubaoApiKey",
|
|
4272
|
+
"moonshotApiKey",
|
|
4273
|
+
"mistralApiKey",
|
|
4274
|
+
"unboundApiKey",
|
|
4275
|
+
"requestyApiKey",
|
|
4276
|
+
"xaiApiKey",
|
|
4277
|
+
"groqApiKey",
|
|
4278
|
+
"chutesApiKey",
|
|
4279
|
+
"litellmApiKey",
|
|
4280
|
+
"codeIndexOpenAiKey",
|
|
4281
|
+
"codeIndexQdrantApiKey",
|
|
4282
|
+
"codebaseIndexOpenAiCompatibleApiKey",
|
|
4283
|
+
"codebaseIndexGeminiApiKey",
|
|
4284
|
+
"codebaseIndexMistralApiKey",
|
|
4285
|
+
"huggingFaceApiKey",
|
|
4286
|
+
"sambaNovaApiKey",
|
|
4287
|
+
"zaiApiKey",
|
|
4288
|
+
"fireworksApiKey",
|
|
4289
|
+
"featherlessApiKey",
|
|
4290
|
+
"ioIntelligenceApiKey"
|
|
4291
|
+
];
|
|
4292
|
+
var isSecretStateKey = (key) => SECRET_STATE_KEYS.includes(key);
|
|
4293
|
+
var GLOBAL_STATE_KEYS = [...GLOBAL_SETTINGS_KEYS, ...PROVIDER_SETTINGS_KEYS].filter(
|
|
4294
|
+
(key) => !SECRET_STATE_KEYS.includes(key)
|
|
4295
|
+
);
|
|
4296
|
+
var isGlobalStateKey = (key) => GLOBAL_STATE_KEYS.includes(key);
|
|
4297
|
+
var EVALS_SETTINGS = {
|
|
4298
|
+
apiProvider: "openrouter",
|
|
4299
|
+
openRouterUseMiddleOutTransform: false,
|
|
4300
|
+
lastShownAnnouncementId: "jul-09-2025-3-23-0",
|
|
4301
|
+
pinnedApiConfigs: {},
|
|
4302
|
+
autoApprovalEnabled: true,
|
|
4303
|
+
alwaysAllowReadOnly: true,
|
|
4304
|
+
alwaysAllowReadOnlyOutsideWorkspace: false,
|
|
4305
|
+
alwaysAllowWrite: true,
|
|
4306
|
+
alwaysAllowWriteOutsideWorkspace: false,
|
|
4307
|
+
alwaysAllowWriteProtected: false,
|
|
4308
|
+
writeDelayMs: 1e3,
|
|
4309
|
+
alwaysAllowBrowser: true,
|
|
4310
|
+
alwaysApproveResubmit: true,
|
|
4311
|
+
requestDelaySeconds: 10,
|
|
4312
|
+
alwaysAllowMcp: true,
|
|
4313
|
+
alwaysAllowModeSwitch: true,
|
|
4314
|
+
alwaysAllowSubtasks: true,
|
|
4315
|
+
alwaysAllowExecute: true,
|
|
4316
|
+
alwaysAllowFollowupQuestions: true,
|
|
4317
|
+
alwaysAllowUpdateTodoList: true,
|
|
4318
|
+
followupAutoApproveTimeoutMs: 0,
|
|
4319
|
+
allowedCommands: ["*"],
|
|
4320
|
+
commandExecutionTimeout: 20,
|
|
4321
|
+
commandTimeoutAllowlist: [],
|
|
4322
|
+
preventCompletionWithOpenTodos: false,
|
|
4323
|
+
browserToolEnabled: false,
|
|
4324
|
+
browserViewportSize: "900x600",
|
|
4325
|
+
screenshotQuality: 75,
|
|
4326
|
+
remoteBrowserEnabled: false,
|
|
4327
|
+
ttsEnabled: false,
|
|
4328
|
+
ttsSpeed: 1,
|
|
4329
|
+
soundEnabled: false,
|
|
4330
|
+
soundVolume: 0.5,
|
|
4331
|
+
terminalOutputLineLimit: 500,
|
|
4332
|
+
terminalOutputCharacterLimit: DEFAULT_TERMINAL_OUTPUT_CHARACTER_LIMIT,
|
|
4333
|
+
terminalShellIntegrationTimeout: 3e4,
|
|
4334
|
+
terminalCommandDelay: 0,
|
|
4335
|
+
terminalPowershellCounter: false,
|
|
4336
|
+
terminalZshOhMy: true,
|
|
4337
|
+
terminalZshClearEolMark: true,
|
|
4338
|
+
terminalZshP10k: false,
|
|
4339
|
+
terminalZdotdir: true,
|
|
4340
|
+
terminalCompressProgressBar: true,
|
|
4341
|
+
terminalShellIntegrationDisabled: true,
|
|
4342
|
+
diagnosticsEnabled: true,
|
|
4343
|
+
diffEnabled: true,
|
|
4344
|
+
fuzzyMatchThreshold: 1,
|
|
4345
|
+
enableCheckpoints: false,
|
|
4346
|
+
rateLimitSeconds: 0,
|
|
4347
|
+
maxOpenTabsContext: 20,
|
|
4348
|
+
maxWorkspaceFiles: 200,
|
|
4349
|
+
showRooIgnoredFiles: true,
|
|
4350
|
+
maxReadFileLine: -1,
|
|
4351
|
+
// -1 to enable full file reading.
|
|
4352
|
+
includeDiagnosticMessages: true,
|
|
4353
|
+
maxDiagnosticMessages: 50,
|
|
4354
|
+
language: "en",
|
|
4355
|
+
telemetrySetting: "enabled",
|
|
4356
|
+
mcpEnabled: false,
|
|
4357
|
+
remoteControlEnabled: false,
|
|
4358
|
+
mode: "code",
|
|
4359
|
+
// "architect",
|
|
4360
|
+
customModes: []
|
|
4126
4361
|
};
|
|
4362
|
+
var EVALS_TIMEOUT = 5 * 60 * 1e3;
|
|
4127
4363
|
|
|
4128
|
-
// src/
|
|
4129
|
-
|
|
4130
|
-
var
|
|
4131
|
-
"
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
}
|
|
4177
|
-
|
|
4178
|
-
var
|
|
4179
|
-
|
|
4364
|
+
// src/ipc.ts
|
|
4365
|
+
import { z as z14 } from "zod";
|
|
4366
|
+
var IpcMessageType = /* @__PURE__ */ ((IpcMessageType2) => {
|
|
4367
|
+
IpcMessageType2["Connect"] = "Connect";
|
|
4368
|
+
IpcMessageType2["Disconnect"] = "Disconnect";
|
|
4369
|
+
IpcMessageType2["Ack"] = "Ack";
|
|
4370
|
+
IpcMessageType2["TaskCommand"] = "TaskCommand";
|
|
4371
|
+
IpcMessageType2["TaskEvent"] = "TaskEvent";
|
|
4372
|
+
return IpcMessageType2;
|
|
4373
|
+
})(IpcMessageType || {});
|
|
4374
|
+
var IpcOrigin = /* @__PURE__ */ ((IpcOrigin2) => {
|
|
4375
|
+
IpcOrigin2["Client"] = "client";
|
|
4376
|
+
IpcOrigin2["Server"] = "server";
|
|
4377
|
+
return IpcOrigin2;
|
|
4378
|
+
})(IpcOrigin || {});
|
|
4379
|
+
var ackSchema = z14.object({
|
|
4380
|
+
clientId: z14.string(),
|
|
4381
|
+
pid: z14.number(),
|
|
4382
|
+
ppid: z14.number()
|
|
4383
|
+
});
|
|
4384
|
+
var TaskCommandName = /* @__PURE__ */ ((TaskCommandName2) => {
|
|
4385
|
+
TaskCommandName2["StartNewTask"] = "StartNewTask";
|
|
4386
|
+
TaskCommandName2["CancelTask"] = "CancelTask";
|
|
4387
|
+
TaskCommandName2["CloseTask"] = "CloseTask";
|
|
4388
|
+
TaskCommandName2["ResumeTask"] = "ResumeTask";
|
|
4389
|
+
return TaskCommandName2;
|
|
4390
|
+
})(TaskCommandName || {});
|
|
4391
|
+
var taskCommandSchema = z14.discriminatedUnion("commandName", [
|
|
4392
|
+
z14.object({
|
|
4393
|
+
commandName: z14.literal("StartNewTask" /* StartNewTask */),
|
|
4394
|
+
data: z14.object({
|
|
4395
|
+
configuration: rooCodeSettingsSchema,
|
|
4396
|
+
text: z14.string(),
|
|
4397
|
+
images: z14.array(z14.string()).optional(),
|
|
4398
|
+
newTab: z14.boolean().optional()
|
|
4399
|
+
})
|
|
4400
|
+
}),
|
|
4401
|
+
z14.object({
|
|
4402
|
+
commandName: z14.literal("CancelTask" /* CancelTask */),
|
|
4403
|
+
data: z14.string()
|
|
4404
|
+
}),
|
|
4405
|
+
z14.object({
|
|
4406
|
+
commandName: z14.literal("CloseTask" /* CloseTask */),
|
|
4407
|
+
data: z14.string()
|
|
4408
|
+
}),
|
|
4409
|
+
z14.object({
|
|
4410
|
+
commandName: z14.literal("ResumeTask" /* ResumeTask */),
|
|
4411
|
+
data: z14.string()
|
|
4412
|
+
})
|
|
4413
|
+
]);
|
|
4414
|
+
var ipcMessageSchema = z14.discriminatedUnion("type", [
|
|
4415
|
+
z14.object({
|
|
4416
|
+
type: z14.literal("Ack" /* Ack */),
|
|
4417
|
+
origin: z14.literal("server" /* Server */),
|
|
4418
|
+
data: ackSchema
|
|
4419
|
+
}),
|
|
4420
|
+
z14.object({
|
|
4421
|
+
type: z14.literal("TaskCommand" /* TaskCommand */),
|
|
4422
|
+
origin: z14.literal("client" /* Client */),
|
|
4423
|
+
clientId: z14.string(),
|
|
4424
|
+
data: taskCommandSchema
|
|
4425
|
+
}),
|
|
4426
|
+
z14.object({
|
|
4427
|
+
type: z14.literal("TaskEvent" /* TaskEvent */),
|
|
4428
|
+
origin: z14.literal("server" /* Server */),
|
|
4429
|
+
relayClientId: z14.string().optional(),
|
|
4430
|
+
data: taskEventSchema
|
|
4431
|
+
})
|
|
4432
|
+
]);
|
|
4433
|
+
|
|
4434
|
+
// src/marketplace.ts
|
|
4435
|
+
import { z as z15 } from "zod";
|
|
4436
|
+
var mcpParameterSchema = z15.object({
|
|
4437
|
+
name: z15.string().min(1),
|
|
4438
|
+
key: z15.string().min(1),
|
|
4439
|
+
placeholder: z15.string().optional(),
|
|
4440
|
+
optional: z15.boolean().optional().default(false)
|
|
4441
|
+
});
|
|
4442
|
+
var mcpInstallationMethodSchema = z15.object({
|
|
4443
|
+
name: z15.string().min(1),
|
|
4444
|
+
content: z15.string().min(1),
|
|
4445
|
+
parameters: z15.array(mcpParameterSchema).optional(),
|
|
4446
|
+
prerequisites: z15.array(z15.string()).optional()
|
|
4447
|
+
});
|
|
4448
|
+
var marketplaceItemTypeSchema = z15.enum(["mode", "mcp"]);
|
|
4449
|
+
var baseMarketplaceItemSchema = z15.object({
|
|
4450
|
+
id: z15.string().min(1),
|
|
4451
|
+
name: z15.string().min(1, "Name is required"),
|
|
4452
|
+
description: z15.string(),
|
|
4453
|
+
author: z15.string().optional(),
|
|
4454
|
+
authorUrl: z15.string().url("Author URL must be a valid URL").optional(),
|
|
4455
|
+
tags: z15.array(z15.string()).optional(),
|
|
4456
|
+
prerequisites: z15.array(z15.string()).optional()
|
|
4457
|
+
});
|
|
4458
|
+
var modeMarketplaceItemSchema = baseMarketplaceItemSchema.extend({
|
|
4459
|
+
content: z15.string().min(1)
|
|
4460
|
+
// YAML content for modes
|
|
4461
|
+
});
|
|
4462
|
+
var mcpMarketplaceItemSchema = baseMarketplaceItemSchema.extend({
|
|
4463
|
+
url: z15.string().url(),
|
|
4464
|
+
// Required url field
|
|
4465
|
+
content: z15.union([z15.string().min(1), z15.array(mcpInstallationMethodSchema)]),
|
|
4466
|
+
// Single config or array of methods
|
|
4467
|
+
parameters: z15.array(mcpParameterSchema).optional()
|
|
4468
|
+
});
|
|
4469
|
+
var marketplaceItemSchema = z15.discriminatedUnion("type", [
|
|
4470
|
+
// Mode marketplace item
|
|
4471
|
+
modeMarketplaceItemSchema.extend({
|
|
4472
|
+
type: z15.literal("mode")
|
|
4473
|
+
}),
|
|
4474
|
+
// MCP marketplace item
|
|
4475
|
+
mcpMarketplaceItemSchema.extend({
|
|
4476
|
+
type: z15.literal("mcp")
|
|
4477
|
+
})
|
|
4478
|
+
]);
|
|
4479
|
+
var installMarketplaceItemOptionsSchema = z15.object({
|
|
4480
|
+
target: z15.enum(["global", "project"]).optional().default("project"),
|
|
4481
|
+
parameters: z15.record(z15.string(), z15.any()).optional()
|
|
4482
|
+
});
|
|
4483
|
+
|
|
4484
|
+
// src/mcp.ts
|
|
4485
|
+
import { z as z16 } from "zod";
|
|
4486
|
+
var mcpExecutionStatusSchema = z16.discriminatedUnion("status", [
|
|
4487
|
+
z16.object({
|
|
4488
|
+
executionId: z16.string(),
|
|
4489
|
+
status: z16.literal("started"),
|
|
4490
|
+
serverName: z16.string(),
|
|
4491
|
+
toolName: z16.string()
|
|
4492
|
+
}),
|
|
4493
|
+
z16.object({
|
|
4494
|
+
executionId: z16.string(),
|
|
4495
|
+
status: z16.literal("output"),
|
|
4496
|
+
response: z16.string()
|
|
4497
|
+
}),
|
|
4498
|
+
z16.object({
|
|
4499
|
+
executionId: z16.string(),
|
|
4500
|
+
status: z16.literal("completed"),
|
|
4501
|
+
response: z16.string().optional()
|
|
4502
|
+
}),
|
|
4503
|
+
z16.object({
|
|
4504
|
+
executionId: z16.string(),
|
|
4505
|
+
status: z16.literal("error"),
|
|
4506
|
+
error: z16.string().optional()
|
|
4507
|
+
})
|
|
4508
|
+
]);
|
|
4180
4509
|
|
|
4181
|
-
// src/
|
|
4182
|
-
var
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
contextWindow: 131072,
|
|
4187
|
-
supportsImages: false,
|
|
4188
|
-
supportsPromptCache: true,
|
|
4189
|
-
inputPrice: 0.6,
|
|
4190
|
-
outputPrice: 2.2,
|
|
4191
|
-
cacheWritesPrice: 0,
|
|
4192
|
-
cacheReadsPrice: 0.11,
|
|
4193
|
-
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."
|
|
4194
|
-
},
|
|
4195
|
-
"glm-4.5-air": {
|
|
4196
|
-
maxTokens: 98304,
|
|
4197
|
-
contextWindow: 131072,
|
|
4198
|
-
supportsImages: false,
|
|
4199
|
-
supportsPromptCache: true,
|
|
4200
|
-
inputPrice: 0.2,
|
|
4201
|
-
outputPrice: 1.1,
|
|
4202
|
-
cacheWritesPrice: 0,
|
|
4203
|
-
cacheReadsPrice: 0.03,
|
|
4204
|
-
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."
|
|
4510
|
+
// src/single-file-read-models.ts
|
|
4511
|
+
var SINGLE_FILE_READ_MODELS = /* @__PURE__ */ new Set(["roo/sonic"]);
|
|
4512
|
+
function shouldUseSingleFileRead(modelId) {
|
|
4513
|
+
if (SINGLE_FILE_READ_MODELS.has(modelId)) {
|
|
4514
|
+
return true;
|
|
4205
4515
|
}
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
contextWindow: 131072,
|
|
4212
|
-
supportsImages: false,
|
|
4213
|
-
supportsPromptCache: true,
|
|
4214
|
-
inputPrice: 0.29,
|
|
4215
|
-
outputPrice: 1.14,
|
|
4216
|
-
cacheWritesPrice: 0,
|
|
4217
|
-
cacheReadsPrice: 0.057,
|
|
4218
|
-
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.",
|
|
4219
|
-
tiers: [
|
|
4220
|
-
{
|
|
4221
|
-
contextWindow: 32e3,
|
|
4222
|
-
inputPrice: 0.21,
|
|
4223
|
-
outputPrice: 1,
|
|
4224
|
-
cacheReadsPrice: 0.043
|
|
4225
|
-
},
|
|
4226
|
-
{
|
|
4227
|
-
contextWindow: 128e3,
|
|
4228
|
-
inputPrice: 0.29,
|
|
4229
|
-
outputPrice: 1.14,
|
|
4230
|
-
cacheReadsPrice: 0.057
|
|
4231
|
-
},
|
|
4232
|
-
{
|
|
4233
|
-
contextWindow: Infinity,
|
|
4234
|
-
inputPrice: 0.29,
|
|
4235
|
-
outputPrice: 1.14,
|
|
4236
|
-
cacheReadsPrice: 0.057
|
|
4237
|
-
}
|
|
4238
|
-
]
|
|
4239
|
-
},
|
|
4240
|
-
"glm-4.5-air": {
|
|
4241
|
-
maxTokens: 98304,
|
|
4242
|
-
contextWindow: 131072,
|
|
4243
|
-
supportsImages: false,
|
|
4244
|
-
supportsPromptCache: true,
|
|
4245
|
-
inputPrice: 0.1,
|
|
4246
|
-
outputPrice: 0.6,
|
|
4247
|
-
cacheWritesPrice: 0,
|
|
4248
|
-
cacheReadsPrice: 0.02,
|
|
4249
|
-
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.",
|
|
4250
|
-
tiers: [
|
|
4251
|
-
{
|
|
4252
|
-
contextWindow: 32e3,
|
|
4253
|
-
inputPrice: 0.07,
|
|
4254
|
-
outputPrice: 0.4,
|
|
4255
|
-
cacheReadsPrice: 0.014
|
|
4256
|
-
},
|
|
4257
|
-
{
|
|
4258
|
-
contextWindow: 128e3,
|
|
4259
|
-
inputPrice: 0.1,
|
|
4260
|
-
outputPrice: 0.6,
|
|
4261
|
-
cacheReadsPrice: 0.02
|
|
4262
|
-
},
|
|
4263
|
-
{
|
|
4264
|
-
contextWindow: Infinity,
|
|
4265
|
-
inputPrice: 0.1,
|
|
4266
|
-
outputPrice: 0.6,
|
|
4267
|
-
cacheReadsPrice: 0.02
|
|
4268
|
-
}
|
|
4269
|
-
]
|
|
4516
|
+
const patterns = Array.from(SINGLE_FILE_READ_MODELS);
|
|
4517
|
+
for (const pattern of patterns) {
|
|
4518
|
+
if (pattern.endsWith("*") && modelId.startsWith(pattern.slice(0, -1))) {
|
|
4519
|
+
return true;
|
|
4520
|
+
}
|
|
4270
4521
|
}
|
|
4271
|
-
|
|
4272
|
-
|
|
4522
|
+
return false;
|
|
4523
|
+
}
|
|
4273
4524
|
|
|
4274
|
-
// src/
|
|
4275
|
-
|
|
4276
|
-
var
|
|
4277
|
-
"
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
contextWindow: 256e3,
|
|
4289
|
-
supportsImages: false,
|
|
4290
|
-
supportsPromptCache: false,
|
|
4291
|
-
inputPrice: 0.22,
|
|
4292
|
-
outputPrice: 0.88,
|
|
4293
|
-
description: "Latest Qwen3 thinking model, competitive against the best closed source models in Jul 2025."
|
|
4294
|
-
},
|
|
4295
|
-
"accounts/fireworks/models/qwen3-coder-480b-a35b-instruct": {
|
|
4296
|
-
maxTokens: 32768,
|
|
4297
|
-
contextWindow: 256e3,
|
|
4298
|
-
supportsImages: false,
|
|
4299
|
-
supportsPromptCache: false,
|
|
4300
|
-
inputPrice: 0.45,
|
|
4301
|
-
outputPrice: 1.8,
|
|
4302
|
-
description: "Qwen3's most agentic code model to date."
|
|
4303
|
-
},
|
|
4304
|
-
"accounts/fireworks/models/deepseek-r1-0528": {
|
|
4305
|
-
maxTokens: 20480,
|
|
4306
|
-
contextWindow: 16e4,
|
|
4307
|
-
supportsImages: false,
|
|
4308
|
-
supportsPromptCache: false,
|
|
4309
|
-
inputPrice: 3,
|
|
4310
|
-
outputPrice: 8,
|
|
4311
|
-
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."
|
|
4312
|
-
},
|
|
4313
|
-
"accounts/fireworks/models/deepseek-v3": {
|
|
4314
|
-
maxTokens: 16384,
|
|
4315
|
-
contextWindow: 128e3,
|
|
4316
|
-
supportsImages: false,
|
|
4317
|
-
supportsPromptCache: false,
|
|
4318
|
-
inputPrice: 0.9,
|
|
4319
|
-
outputPrice: 0.9,
|
|
4320
|
-
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."
|
|
4321
|
-
},
|
|
4322
|
-
"accounts/fireworks/models/glm-4p5": {
|
|
4323
|
-
maxTokens: 16384,
|
|
4324
|
-
contextWindow: 128e3,
|
|
4325
|
-
supportsImages: false,
|
|
4326
|
-
supportsPromptCache: false,
|
|
4327
|
-
inputPrice: 0.55,
|
|
4328
|
-
outputPrice: 2.19,
|
|
4329
|
-
description: "Z.ai GLM-4.5 with 355B total parameters and 32B active parameters. Features unified reasoning, coding, and intelligent agent capabilities."
|
|
4330
|
-
},
|
|
4331
|
-
"accounts/fireworks/models/glm-4p5-air": {
|
|
4332
|
-
maxTokens: 16384,
|
|
4333
|
-
contextWindow: 128e3,
|
|
4334
|
-
supportsImages: false,
|
|
4335
|
-
supportsPromptCache: false,
|
|
4336
|
-
inputPrice: 0.55,
|
|
4337
|
-
outputPrice: 2.19,
|
|
4338
|
-
description: "Z.ai GLM-4.5-Air with 106B total parameters and 12B active parameters. Features unified reasoning, coding, and intelligent agent capabilities."
|
|
4339
|
-
},
|
|
4340
|
-
"accounts/fireworks/models/gpt-oss-20b": {
|
|
4341
|
-
maxTokens: 16384,
|
|
4342
|
-
contextWindow: 128e3,
|
|
4343
|
-
supportsImages: false,
|
|
4344
|
-
supportsPromptCache: false,
|
|
4345
|
-
inputPrice: 0.07,
|
|
4346
|
-
outputPrice: 0.3,
|
|
4347
|
-
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."
|
|
4348
|
-
},
|
|
4349
|
-
"accounts/fireworks/models/gpt-oss-120b": {
|
|
4350
|
-
maxTokens: 16384,
|
|
4351
|
-
contextWindow: 128e3,
|
|
4352
|
-
supportsImages: false,
|
|
4353
|
-
supportsPromptCache: false,
|
|
4354
|
-
inputPrice: 0.15,
|
|
4355
|
-
outputPrice: 0.6,
|
|
4356
|
-
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."
|
|
4357
|
-
}
|
|
4358
|
-
};
|
|
4525
|
+
// src/task.ts
|
|
4526
|
+
import { z as z17 } from "zod";
|
|
4527
|
+
var TaskStatus = /* @__PURE__ */ ((TaskStatus2) => {
|
|
4528
|
+
TaskStatus2["Running"] = "running";
|
|
4529
|
+
TaskStatus2["Interactive"] = "interactive";
|
|
4530
|
+
TaskStatus2["Resumable"] = "resumable";
|
|
4531
|
+
TaskStatus2["Idle"] = "idle";
|
|
4532
|
+
TaskStatus2["None"] = "none";
|
|
4533
|
+
return TaskStatus2;
|
|
4534
|
+
})(TaskStatus || {});
|
|
4535
|
+
var taskMetadataSchema = z17.object({
|
|
4536
|
+
task: z17.string().optional(),
|
|
4537
|
+
images: z17.array(z17.string()).optional()
|
|
4538
|
+
});
|
|
4359
4539
|
|
|
4360
|
-
// src/
|
|
4361
|
-
|
|
4362
|
-
var
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4540
|
+
// src/todo.ts
|
|
4541
|
+
import { z as z18 } from "zod";
|
|
4542
|
+
var todoStatusSchema = z18.enum(["pending", "in_progress", "completed"]);
|
|
4543
|
+
var todoItemSchema = z18.object({
|
|
4544
|
+
id: z18.string(),
|
|
4545
|
+
content: z18.string(),
|
|
4546
|
+
status: todoStatusSchema
|
|
4547
|
+
});
|
|
4548
|
+
|
|
4549
|
+
// src/terminal.ts
|
|
4550
|
+
import { z as z19 } from "zod";
|
|
4551
|
+
var commandExecutionStatusSchema = z19.discriminatedUnion("status", [
|
|
4552
|
+
z19.object({
|
|
4553
|
+
executionId: z19.string(),
|
|
4554
|
+
status: z19.literal("started"),
|
|
4555
|
+
pid: z19.number().optional(),
|
|
4556
|
+
command: z19.string()
|
|
4557
|
+
}),
|
|
4558
|
+
z19.object({
|
|
4559
|
+
executionId: z19.string(),
|
|
4560
|
+
status: z19.literal("output"),
|
|
4561
|
+
output: z19.string()
|
|
4562
|
+
}),
|
|
4563
|
+
z19.object({
|
|
4564
|
+
executionId: z19.string(),
|
|
4565
|
+
status: z19.literal("exited"),
|
|
4566
|
+
exitCode: z19.number().optional()
|
|
4567
|
+
}),
|
|
4568
|
+
z19.object({
|
|
4569
|
+
executionId: z19.string(),
|
|
4570
|
+
status: z19.literal("fallback")
|
|
4571
|
+
}),
|
|
4572
|
+
z19.object({
|
|
4573
|
+
executionId: z19.string(),
|
|
4574
|
+
status: z19.literal("timeout")
|
|
4575
|
+
})
|
|
4576
|
+
]);
|
|
4373
4577
|
export {
|
|
4374
4578
|
ANTHROPIC_DEFAULT_MAX_TOKENS,
|
|
4375
4579
|
ANTHROPIC_STYLE_PROVIDERS,
|
|
@@ -4408,6 +4612,7 @@ export {
|
|
|
4408
4612
|
LITELLM_COMPUTER_USE_MODELS,
|
|
4409
4613
|
LMSTUDIO_DEFAULT_TEMPERATURE,
|
|
4410
4614
|
MISTRAL_DEFAULT_TEMPERATURE,
|
|
4615
|
+
MODELS_BY_PROVIDER,
|
|
4411
4616
|
MODEL_ID_KEYS,
|
|
4412
4617
|
MOONSHOT_DEFAULT_TEMPERATURE,
|
|
4413
4618
|
OPENAI_AZURE_AI_INFERENCE_PATH,
|
|
@@ -4420,6 +4625,7 @@ export {
|
|
|
4420
4625
|
PROVIDER_SETTINGS_KEYS,
|
|
4421
4626
|
RooCodeEventName,
|
|
4422
4627
|
SECRET_STATE_KEYS,
|
|
4628
|
+
SINGLE_FILE_READ_MODELS,
|
|
4423
4629
|
TaskCommandName,
|
|
4424
4630
|
TaskStatus,
|
|
4425
4631
|
TelemetryEventName,
|
|
@@ -4466,7 +4672,8 @@ export {
|
|
|
4466
4672
|
experimentIds,
|
|
4467
4673
|
experimentIdsSchema,
|
|
4468
4674
|
experimentsSchema,
|
|
4469
|
-
|
|
4675
|
+
featherlessDefaultModelId,
|
|
4676
|
+
featherlessModels,
|
|
4470
4677
|
fireworksDefaultModelId,
|
|
4471
4678
|
fireworksModels,
|
|
4472
4679
|
followUpDataSchema,
|
|
@@ -4537,6 +4744,7 @@ export {
|
|
|
4537
4744
|
providerSettingsSchema,
|
|
4538
4745
|
providerSettingsSchemaDiscriminated,
|
|
4539
4746
|
providerSettingsWithIdSchema,
|
|
4747
|
+
reasoningEffortWithMinimalSchema,
|
|
4540
4748
|
reasoningEfforts,
|
|
4541
4749
|
reasoningEffortsSchema,
|
|
4542
4750
|
requestyDefaultModelId,
|
|
@@ -4549,6 +4757,7 @@ export {
|
|
|
4549
4757
|
rooModels,
|
|
4550
4758
|
sambaNovaDefaultModelId,
|
|
4551
4759
|
sambaNovaModels,
|
|
4760
|
+
shouldUseSingleFileRead,
|
|
4552
4761
|
staticAppPropertiesSchema,
|
|
4553
4762
|
suggestionItemSchema,
|
|
4554
4763
|
taskCommandSchema,
|