@jeffreycao/copilot-api 2.6.8 → 2.6.10
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/main.js +1 -1
- package/dist/{server-Dj5GGJWN.js → server-YjTkYHJ4.js} +34 -223
- package/dist/server-YjTkYHJ4.js.map +1 -0
- package/dist/{start-Ok-mpEDJ.js → start-BeVQ_Cd1.js} +2 -2
- package/dist/{start-Ok-mpEDJ.js.map → start-BeVQ_Cd1.js.map} +1 -1
- package/package.json +3 -2
- package/dist/server-Dj5GGJWN.js.map +0 -1
package/dist/main.js
CHANGED
|
@@ -30,7 +30,7 @@ if (isMcpFastPath(process.argv)) {
|
|
|
30
30
|
const { auth } = await import("./auth-BTdaexGw.js");
|
|
31
31
|
const { debug } = await import("./debug-DXGZGaoU.js");
|
|
32
32
|
const { mcp } = await import("./mcp-Byz9h_xz.js");
|
|
33
|
-
const { start } = await import("./start-
|
|
33
|
+
const { start } = await import("./start-BeVQ_Cd1.js");
|
|
34
34
|
await runMain(defineCommand({
|
|
35
35
|
meta: {
|
|
36
36
|
name: "copilot-api",
|
|
@@ -535,37 +535,20 @@ const builtinProviderModelRegistry = new class BuiltinProviderModelRegistry {
|
|
|
535
535
|
}] } }
|
|
536
536
|
},
|
|
537
537
|
dashscope: {
|
|
538
|
-
"glm-5.
|
|
539
|
-
contextWindow: 202752,
|
|
540
|
-
inputModalities: ["text"],
|
|
541
|
-
maxOutputTokens: 64e3,
|
|
542
|
-
pricing: { tiers: [{
|
|
543
|
-
cachedInput: 1.2,
|
|
544
|
-
cacheCreationInput: 7.5,
|
|
545
|
-
explicitCachedInput: .6,
|
|
546
|
-
input: 6,
|
|
547
|
-
maxInputTokens: 32e3,
|
|
548
|
-
output: 24
|
|
549
|
-
}, {
|
|
550
|
-
cachedInput: 1.6,
|
|
551
|
-
cacheCreationInput: 10,
|
|
552
|
-
explicitCachedInput: .8,
|
|
553
|
-
input: 8,
|
|
554
|
-
maxInputTokens: 2e5,
|
|
555
|
-
output: 28
|
|
556
|
-
}] }
|
|
557
|
-
},
|
|
558
|
-
"glm-5.2": {
|
|
538
|
+
"glm-5.3": {
|
|
559
539
|
contextWindow: 1e6,
|
|
560
540
|
inputModalities: ["text"],
|
|
561
541
|
maxOutputTokens: 64e3,
|
|
562
542
|
pricing: {
|
|
563
543
|
cachedInput: 2,
|
|
564
|
-
cacheCreationInput: 10,
|
|
565
|
-
explicitCachedInput: .8,
|
|
566
544
|
input: 8,
|
|
567
545
|
output: 28
|
|
568
|
-
}
|
|
546
|
+
},
|
|
547
|
+
reasoningEfforts: [
|
|
548
|
+
"low",
|
|
549
|
+
"high",
|
|
550
|
+
"max"
|
|
551
|
+
]
|
|
569
552
|
},
|
|
570
553
|
"ZHIPU/GLM-5.3": {
|
|
571
554
|
contextWindow: 1048576,
|
|
@@ -597,17 +580,20 @@ const builtinProviderModelRegistry = new class BuiltinProviderModelRegistry {
|
|
|
597
580
|
"max"
|
|
598
581
|
]
|
|
599
582
|
},
|
|
600
|
-
"
|
|
601
|
-
contextWindow:
|
|
602
|
-
inputModalities: ["text"],
|
|
603
|
-
maxOutputTokens:
|
|
583
|
+
"ZHIPU/GLM-5.3-FlashX": {
|
|
584
|
+
contextWindow: 1048576,
|
|
585
|
+
inputModalities: ["text", "image"],
|
|
586
|
+
maxOutputTokens: 131072,
|
|
604
587
|
pricing: {
|
|
605
|
-
cachedInput:
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
588
|
+
cachedInput: .57,
|
|
589
|
+
input: 2,
|
|
590
|
+
output: 7
|
|
591
|
+
},
|
|
592
|
+
reasoningEfforts: [
|
|
593
|
+
"low",
|
|
594
|
+
"high",
|
|
595
|
+
"max"
|
|
596
|
+
]
|
|
611
597
|
},
|
|
612
598
|
"qwen3.8-max": {
|
|
613
599
|
contextWindow: 1e6,
|
|
@@ -645,22 +631,6 @@ const builtinProviderModelRegistry = new class BuiltinProviderModelRegistry {
|
|
|
645
631
|
output: 2.7
|
|
646
632
|
}
|
|
647
633
|
},
|
|
648
|
-
"deepseek-v4-flash-0731": {
|
|
649
|
-
contextWindow: 1e6,
|
|
650
|
-
inputModalities: ["text"],
|
|
651
|
-
maxOutputTokens: 64e3,
|
|
652
|
-
pricing: {
|
|
653
|
-
cachedInput: .3,
|
|
654
|
-
input: 3,
|
|
655
|
-
offPeak: {
|
|
656
|
-
cachedInput: .15,
|
|
657
|
-
input: 1.5,
|
|
658
|
-
output: 4.5
|
|
659
|
-
},
|
|
660
|
-
output: 9,
|
|
661
|
-
peakWindows: dashscopePeakWindows
|
|
662
|
-
}
|
|
663
|
-
},
|
|
664
634
|
"deepseek-v4.1-flash": {
|
|
665
635
|
contextWindow: 1e6,
|
|
666
636
|
inputModalities: ["text", "image"],
|
|
@@ -753,17 +723,6 @@ const builtinProviderModelRegistry = new class BuiltinProviderModelRegistry {
|
|
|
753
723
|
}
|
|
754
724
|
},
|
|
755
725
|
"opencode-go": {
|
|
756
|
-
hy3: {
|
|
757
|
-
contextWindow: 256e3,
|
|
758
|
-
inputModalities: ["text"],
|
|
759
|
-
maxOutputTokens: 64e3,
|
|
760
|
-
pricing: {
|
|
761
|
-
cachedInput: .035,
|
|
762
|
-
input: .14,
|
|
763
|
-
output: .58
|
|
764
|
-
},
|
|
765
|
-
reasoningField: "reasoning"
|
|
766
|
-
},
|
|
767
726
|
"hy4-preview": {
|
|
768
727
|
contextWindow: 1024e3,
|
|
769
728
|
inputModalities: ["text"],
|
|
@@ -776,28 +735,18 @@ const builtinProviderModelRegistry = new class BuiltinProviderModelRegistry {
|
|
|
776
735
|
reasoningEfforts: ["high"],
|
|
777
736
|
reasoningField: "reasoning"
|
|
778
737
|
},
|
|
779
|
-
"gpt-
|
|
738
|
+
"gpt-6-luna": { pricing: { tiers: [{
|
|
780
739
|
cacheCreationInput: .125,
|
|
781
740
|
cachedInput: .01,
|
|
782
741
|
input: .1,
|
|
783
742
|
maxInputTokens: 272e3,
|
|
784
|
-
output: .
|
|
743
|
+
output: .5
|
|
785
744
|
}, {
|
|
786
745
|
cacheCreationInput: .25,
|
|
787
746
|
cachedInput: .02,
|
|
788
747
|
input: .2,
|
|
789
|
-
output: .
|
|
748
|
+
output: .75
|
|
790
749
|
}] } },
|
|
791
|
-
"glm-5.2": {
|
|
792
|
-
contextWindow: 1e6,
|
|
793
|
-
inputModalities: ["text"],
|
|
794
|
-
maxOutputTokens: 64e3,
|
|
795
|
-
pricing: {
|
|
796
|
-
cachedInput: .26,
|
|
797
|
-
input: 1.4,
|
|
798
|
-
output: 4.4
|
|
799
|
-
}
|
|
800
|
-
},
|
|
801
750
|
"glm-5.3": {
|
|
802
751
|
contextWindow: 1e6,
|
|
803
752
|
inputModalities: ["text"],
|
|
@@ -823,23 +772,6 @@ const builtinProviderModelRegistry = new class BuiltinProviderModelRegistry {
|
|
|
823
772
|
"max"
|
|
824
773
|
]
|
|
825
774
|
},
|
|
826
|
-
"muse-spark-1.2-contributor": {
|
|
827
|
-
contextWindow: 1048576,
|
|
828
|
-
inputModalities: ["text", "image"],
|
|
829
|
-
maxOutputTokens: 131072,
|
|
830
|
-
pricing: {
|
|
831
|
-
cachedInput: .002,
|
|
832
|
-
input: .1,
|
|
833
|
-
output: .2
|
|
834
|
-
},
|
|
835
|
-
reasoningEfforts: [
|
|
836
|
-
"minimal",
|
|
837
|
-
"low",
|
|
838
|
-
"medium",
|
|
839
|
-
"high",
|
|
840
|
-
"xhigh"
|
|
841
|
-
]
|
|
842
|
-
},
|
|
843
775
|
"muse-spark-1.3-contributor": {
|
|
844
776
|
contextWindow: 1048576,
|
|
845
777
|
inputModalities: ["text", "image"],
|
|
@@ -857,49 +789,6 @@ const builtinProviderModelRegistry = new class BuiltinProviderModelRegistry {
|
|
|
857
789
|
"xhigh"
|
|
858
790
|
]
|
|
859
791
|
},
|
|
860
|
-
"grok-4.5": {
|
|
861
|
-
contextWindow: 5e5,
|
|
862
|
-
defaultReasoningEffort: "high",
|
|
863
|
-
inputModalities: ["text", "image"],
|
|
864
|
-
maxOutputTokens: 64e3,
|
|
865
|
-
pricing: { tiers: [{
|
|
866
|
-
cachedInput: .5,
|
|
867
|
-
input: 2,
|
|
868
|
-
maxInputTokens: 2e5,
|
|
869
|
-
output: 6
|
|
870
|
-
}, {
|
|
871
|
-
cachedInput: 1,
|
|
872
|
-
input: 4,
|
|
873
|
-
output: 12
|
|
874
|
-
}] },
|
|
875
|
-
reasoningEfforts: [
|
|
876
|
-
"low",
|
|
877
|
-
"medium",
|
|
878
|
-
"high"
|
|
879
|
-
]
|
|
880
|
-
},
|
|
881
|
-
"grok-4.6": {
|
|
882
|
-
contextWindow: 5e5,
|
|
883
|
-
defaultReasoningEffort: "high",
|
|
884
|
-
inputModalities: ["text", "image"],
|
|
885
|
-
maxOutputTokens: 64e3,
|
|
886
|
-
pricing: { tiers: [{
|
|
887
|
-
cachedInput: .5,
|
|
888
|
-
input: 2,
|
|
889
|
-
maxInputTokens: 2e5,
|
|
890
|
-
output: 6
|
|
891
|
-
}, {
|
|
892
|
-
cachedInput: 1,
|
|
893
|
-
input: 4,
|
|
894
|
-
output: 12
|
|
895
|
-
}] },
|
|
896
|
-
reasoningEfforts: [
|
|
897
|
-
"low",
|
|
898
|
-
"medium",
|
|
899
|
-
"high",
|
|
900
|
-
"xhigh"
|
|
901
|
-
]
|
|
902
|
-
},
|
|
903
792
|
"grok-4.7": {
|
|
904
793
|
contextWindow: 5e5,
|
|
905
794
|
defaultReasoningEffort: "high",
|
|
@@ -943,43 +832,6 @@ const builtinProviderModelRegistry = new class BuiltinProviderModelRegistry {
|
|
|
943
832
|
"max"
|
|
944
833
|
]
|
|
945
834
|
},
|
|
946
|
-
"deepseek-v4-flash": {
|
|
947
|
-
contextWindow: 1e6,
|
|
948
|
-
inputModalities: ["text"],
|
|
949
|
-
maxOutputTokens: 64e3,
|
|
950
|
-
pricing: {
|
|
951
|
-
cachedInput: .006,
|
|
952
|
-
input: .3,
|
|
953
|
-
offPeak: {
|
|
954
|
-
cachedInput: .003,
|
|
955
|
-
input: .15,
|
|
956
|
-
output: .6
|
|
957
|
-
},
|
|
958
|
-
output: 1.2,
|
|
959
|
-
peakWindows: deepseekPeakWindows
|
|
960
|
-
}
|
|
961
|
-
},
|
|
962
|
-
"deepseek-v4-flash-vision-exp": {
|
|
963
|
-
contextWindow: 1e6,
|
|
964
|
-
inputModalities: ["text", "image"],
|
|
965
|
-
maxOutputTokens: 384e3,
|
|
966
|
-
pricing: {
|
|
967
|
-
cachedInput: .006,
|
|
968
|
-
input: .3,
|
|
969
|
-
offPeak: {
|
|
970
|
-
cachedInput: .003,
|
|
971
|
-
input: .15,
|
|
972
|
-
output: .6
|
|
973
|
-
},
|
|
974
|
-
output: 1.2,
|
|
975
|
-
peakWindows: deepseekPeakWindows
|
|
976
|
-
},
|
|
977
|
-
reasoningEfforts: [
|
|
978
|
-
"low",
|
|
979
|
-
"high",
|
|
980
|
-
"max"
|
|
981
|
-
]
|
|
982
|
-
},
|
|
983
835
|
"deepseek-v4-pro": {
|
|
984
836
|
contextWindow: 1e6,
|
|
985
837
|
inputModalities: ["text"],
|
|
@@ -996,16 +848,6 @@ const builtinProviderModelRegistry = new class BuiltinProviderModelRegistry {
|
|
|
996
848
|
peakWindows: deepseekPeakWindows
|
|
997
849
|
}
|
|
998
850
|
},
|
|
999
|
-
"kimi-k2.7-code": {
|
|
1000
|
-
contextWindow: 262144,
|
|
1001
|
-
inputModalities: ["text", "image"],
|
|
1002
|
-
maxOutputTokens: 64e3,
|
|
1003
|
-
pricing: {
|
|
1004
|
-
cachedInput: .19,
|
|
1005
|
-
input: .95,
|
|
1006
|
-
output: 4
|
|
1007
|
-
}
|
|
1008
|
-
},
|
|
1009
851
|
"kimi-k3": {
|
|
1010
852
|
contextWindow: 1048576,
|
|
1011
853
|
inputModalities: ["text", "image"],
|
|
@@ -1016,26 +858,6 @@ const builtinProviderModelRegistry = new class BuiltinProviderModelRegistry {
|
|
|
1016
858
|
output: 15
|
|
1017
859
|
}
|
|
1018
860
|
},
|
|
1019
|
-
"mimo-v2.5": {
|
|
1020
|
-
contextWindow: 1e6,
|
|
1021
|
-
inputModalities: ["text", "image"],
|
|
1022
|
-
maxOutputTokens: 64e3,
|
|
1023
|
-
pricing: {
|
|
1024
|
-
cachedInput: .0028,
|
|
1025
|
-
input: .14,
|
|
1026
|
-
output: .28
|
|
1027
|
-
}
|
|
1028
|
-
},
|
|
1029
|
-
"mimo-v2.5-pro": {
|
|
1030
|
-
contextWindow: 1048576,
|
|
1031
|
-
inputModalities: ["text"],
|
|
1032
|
-
maxOutputTokens: 64e3,
|
|
1033
|
-
pricing: {
|
|
1034
|
-
cachedInput: .0145,
|
|
1035
|
-
input: 1.74,
|
|
1036
|
-
output: 3.48
|
|
1037
|
-
}
|
|
1038
|
-
},
|
|
1039
861
|
"mimo-v2.6-flash": {
|
|
1040
862
|
contextWindow: 1048576,
|
|
1041
863
|
inputModalities: ["text", "image"],
|
|
@@ -1074,17 +896,6 @@ const builtinProviderModelRegistry = new class BuiltinProviderModelRegistry {
|
|
|
1074
896
|
output: 4.8
|
|
1075
897
|
}] }
|
|
1076
898
|
},
|
|
1077
|
-
"qwen3.7-max": {
|
|
1078
|
-
contextWindow: 1e6,
|
|
1079
|
-
inputModalities: ["text"],
|
|
1080
|
-
maxOutputTokens: 64e3,
|
|
1081
|
-
pricing: {
|
|
1082
|
-
cacheCreationInput: 3.125,
|
|
1083
|
-
cachedInput: .5,
|
|
1084
|
-
input: 2.5,
|
|
1085
|
-
output: 7.5
|
|
1086
|
-
}
|
|
1087
|
-
},
|
|
1088
899
|
"qwen3.8-max": {
|
|
1089
900
|
contextWindow: 1e6,
|
|
1090
901
|
inputModalities: ["text", "image"],
|
|
@@ -1112,16 +923,6 @@ const builtinProviderModelRegistry = new class BuiltinProviderModelRegistry {
|
|
|
1112
923
|
"xhigh"
|
|
1113
924
|
]
|
|
1114
925
|
},
|
|
1115
|
-
"minimax-m2.7": {
|
|
1116
|
-
contextWindow: 204800,
|
|
1117
|
-
inputModalities: ["text"],
|
|
1118
|
-
maxOutputTokens: 64e3,
|
|
1119
|
-
pricing: {
|
|
1120
|
-
cachedInput: .06,
|
|
1121
|
-
input: .3,
|
|
1122
|
-
output: 1.2
|
|
1123
|
-
}
|
|
1124
|
-
},
|
|
1125
926
|
"minimax-m3": {
|
|
1126
927
|
contextWindow: 1e6,
|
|
1127
928
|
inputModalities: ["text", "image"],
|
|
@@ -3366,8 +3167,17 @@ const applyDashScopePreserveThinkingDefault = (payload, providerConfig) => {
|
|
|
3366
3167
|
if (!isDashScopeAliyunProvider(providerConfig)) return;
|
|
3367
3168
|
if (!Object.hasOwn(payload, "preserve_thinking")) payload.preserve_thinking = true;
|
|
3368
3169
|
};
|
|
3170
|
+
const normalizeDashScopeAssistantTextContent = (messages) => {
|
|
3171
|
+
for (const message of messages) {
|
|
3172
|
+
if (message.role !== "assistant" || !Array.isArray(message.content)) continue;
|
|
3173
|
+
const textParts = message.content.filter((part) => part.type === "text");
|
|
3174
|
+
if (textParts.length === 0 || textParts.length !== message.content.length) continue;
|
|
3175
|
+
message.content = textParts.map((part) => part.text).join("");
|
|
3176
|
+
}
|
|
3177
|
+
};
|
|
3369
3178
|
const applyOpenAICompatibleContextCache = (payload) => {
|
|
3370
3179
|
if (payload.model.includes("/")) return;
|
|
3180
|
+
if (!payload.model.toLowerCase().includes("qwen")) return;
|
|
3371
3181
|
const messageIndexes = selectContextCacheMessageIndexes(payload.messages);
|
|
3372
3182
|
for (const messageIndex of messageIndexes) applyContextCacheControl(payload.messages[messageIndex]);
|
|
3373
3183
|
};
|
|
@@ -8547,6 +8357,7 @@ const createOpenAICompatiblePayload = (payload, modelConfig, providerConfig) =>
|
|
|
8547
8357
|
applyMiMoThinking(openAIPayload, payload);
|
|
8548
8358
|
applyDashScopePreserveThinkingDefault(openAIPayload, providerConfig);
|
|
8549
8359
|
if (!Object.hasOwn(openAIPayload, "parallel_tool_calls")) openAIPayload.parallel_tool_calls = true;
|
|
8360
|
+
if (isDashScopeProvider) normalizeDashScopeAssistantTextContent(openAIPayload.messages);
|
|
8550
8361
|
if (modelConfig?.contextCache ?? isDashScopeProvider) applyOpenAICompatibleContextCache(openAIPayload);
|
|
8551
8362
|
return openAIPayload;
|
|
8552
8363
|
};
|
|
@@ -12875,4 +12686,4 @@ createServer();
|
|
|
12875
12686
|
//#endregion
|
|
12876
12687
|
export { createServer };
|
|
12877
12688
|
|
|
12878
|
-
//# sourceMappingURL=server-
|
|
12689
|
+
//# sourceMappingURL=server-YjTkYHJ4.js.map
|