@jeffreycao/copilot-api 2.3.9 → 2.3.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 CHANGED
@@ -30,7 +30,7 @@ if (isMcpFastPath(process.argv)) {
30
30
  const { auth } = await import("./auth-DgKX2oyO.js");
31
31
  const { debug } = await import("./debug-BHOitPm3.js");
32
32
  const { mcp } = await import("./mcp-fpSlKZxK.js");
33
- const { start } = await import("./start-CNoTESAC.js");
33
+ const { start } = await import("./start-Ccs4AOzy.js");
34
34
  await runMain(defineCommand({
35
35
  meta: {
36
36
  name: "copilot-api",
@@ -628,6 +628,17 @@ const builtinProviderModelRegistry = new class BuiltinProviderModelRegistry {
628
628
  output: .58
629
629
  }
630
630
  },
631
+ "hy4-preview": {
632
+ contextWindow: 1024e3,
633
+ inputModalities: ["text"],
634
+ maxOutputTokens: 64e3,
635
+ pricing: {
636
+ cachedInput: .042,
637
+ input: .834,
638
+ output: 2.501
639
+ },
640
+ reasoningEfforts: ["high"]
641
+ },
631
642
  "gpt-5.6-luna": { pricing: { tiers: [{
632
643
  cacheCreationInput: .125,
633
644
  cachedInput: .01,
@@ -713,6 +724,28 @@ const builtinProviderModelRegistry = new class BuiltinProviderModelRegistry {
713
724
  "high"
714
725
  ]
715
726
  },
727
+ "grok-4.6": {
728
+ contextWindow: 5e5,
729
+ defaultReasoningEffort: "high",
730
+ inputModalities: ["text", "image"],
731
+ maxOutputTokens: 64e3,
732
+ pricing: { tiers: [{
733
+ cachedInput: .5,
734
+ input: 2,
735
+ maxInputTokens: 2e5,
736
+ output: 6
737
+ }, {
738
+ cachedInput: 1,
739
+ input: 4,
740
+ output: 12
741
+ }] },
742
+ reasoningEfforts: [
743
+ "low",
744
+ "medium",
745
+ "high",
746
+ "xhigh"
747
+ ]
748
+ },
716
749
  "deepseek-v4-flash": {
717
750
  contextWindow: 1e6,
718
751
  inputModalities: ["text"],
@@ -828,6 +861,22 @@ const builtinProviderModelRegistry = new class BuiltinProviderModelRegistry {
828
861
  output: 6
829
862
  }
830
863
  },
864
+ "qwen3.8-flash": {
865
+ contextWindow: 1e6,
866
+ inputModalities: ["text", "image"],
867
+ maxOutputTokens: 131072,
868
+ pricing: {
869
+ cacheCreationInput: .2,
870
+ cachedInput: .016,
871
+ input: .15,
872
+ output: .47
873
+ },
874
+ reasoningEfforts: [
875
+ "low",
876
+ "medium",
877
+ "xhigh"
878
+ ]
879
+ },
831
880
  "minimax-m2.7": {
832
881
  contextWindow: 204800,
833
882
  inputModalities: ["text"],
@@ -7118,7 +7167,7 @@ const streamResponsesProviderMessages = ({ c, modelConfig, payload, pricingCurre
7118
7167
  }
7119
7168
  }
7120
7169
  if (!streamState.messageCompleted) {
7121
- const errorEvent = buildErrorEvent(`${provider} stream ended without a completion event`);
7170
+ const errorEvent = buildErrorEvent(`${provider} stream ended without a completion event, retry your request.`);
7122
7171
  await stream.writeSSE({
7123
7172
  event: errorEvent.type,
7124
7173
  data: JSON.stringify(errorEvent)
@@ -9235,18 +9284,18 @@ const EPHEMERAL_CACHE_CONTROL = { type: "ephemeral" };
9235
9284
  function applyEphemeralCacheControl(messages, system) {
9236
9285
  const lastSystemBlock = system.at(-1);
9237
9286
  if (lastSystemBlock) lastSystemBlock.cache_control = { ...EPHEMERAL_CACHE_CONTROL };
9238
- const lastMessage = messages.at(-1);
9239
- if (!lastMessage) return;
9240
- if (typeof lastMessage.content === "string") {
9241
- lastMessage.content = [{
9287
+ const lastUserMessage = messages.findLast((message) => message.role === "user");
9288
+ if (!lastUserMessage) return;
9289
+ if (typeof lastUserMessage.content === "string") {
9290
+ lastUserMessage.content = [{
9242
9291
  type: "text",
9243
- text: lastMessage.content,
9292
+ text: lastUserMessage.content,
9244
9293
  cache_control: { ...EPHEMERAL_CACHE_CONTROL }
9245
9294
  }];
9246
9295
  return;
9247
9296
  }
9248
- const lastBlock = lastMessage.content.at(-1);
9249
- if (!lastBlock || lastBlock.type === "thinking") return;
9297
+ const lastBlock = lastUserMessage.content.at(-1);
9298
+ if (!lastBlock) return;
9250
9299
  lastBlock.cache_control = { ...EPHEMERAL_CACHE_CONTROL };
9251
9300
  }
9252
9301
  function appendAssistantBlock(messages, block) {
@@ -10732,4 +10781,4 @@ server.route("/:provider/images", providerImageRoutes);
10732
10781
  //#endregion
10733
10782
  export { server };
10734
10783
 
10735
- //# sourceMappingURL=server-COi_U11S.js.map
10784
+ //# sourceMappingURL=server-BZe1LSIn.js.map