@dianshuv/copilot-api 0.7.0 → 0.7.1

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.
Files changed (2) hide show
  1. package/dist/main.mjs +15 -13
  2. package/package.json +1 -1
package/dist/main.mjs CHANGED
@@ -1213,7 +1213,7 @@ const patchClaude = defineCommand({
1213
1213
 
1214
1214
  //#endregion
1215
1215
  //#region package.json
1216
- var version = "0.7.0";
1216
+ var version = "0.7.1";
1217
1217
 
1218
1218
  //#endregion
1219
1219
  //#region src/lib/adaptive-rate-limiter.ts
@@ -4587,25 +4587,27 @@ function handleNonStreamResponse(c, response, model, ctx, payload) {
4587
4587
  //#endregion
4588
4588
  //#region src/routes/gemini/model-alias.ts
4589
4589
  /**
4590
- * Maps Gemini model names that aren't available on GitHub Copilot
4591
- * to equivalent models that are.
4590
+ * Maps Gemini model names to equivalent models available on GitHub Copilot.
4592
4591
  *
4593
- * The Gemini CLI's routing classifier requests gemini-2.5-flash-lite
4594
- * and gemini-2.5-flash, which Copilot doesn't serve. We map them to
4595
- * the closest available flash model.
4592
+ * Two types of aliases:
4596
4593
  *
4597
- * Aliases are only applied when the requested model is absent from
4598
- * the Copilot model list, so if Copilot adds support for these models
4599
- * natively, requests will go through unchanged.
4594
+ * - **Forced**: Always applied regardless of Copilot model availability.
4595
+ * Use when the old model name should never reach the backend.
4596
+ *
4597
+ * - **Conditional**: Only applied when the requested model is absent from
4598
+ * the Copilot model list, so if Copilot adds native support the request
4599
+ * goes through unchanged.
4600
4600
  */
4601
- const GEMINI_MODEL_ALIASES = {
4601
+ const GEMINI_FORCED_ALIASES = { "gemini-2.5-pro": "gemini-3.1-pro-preview" };
4602
+ const GEMINI_CONDITIONAL_ALIASES = {
4602
4603
  "gemini-2.5-flash-lite": "gemini-3-flash-preview",
4603
4604
  "gemini-2.5-flash": "gemini-3-flash-preview"
4604
4605
  };
4605
4606
  function resolveGeminiModelAlias(model) {
4606
- if (!(model in GEMINI_MODEL_ALIASES)) return model;
4607
- if (state.models?.data.some((m) => m.id === model)) return model;
4608
- return GEMINI_MODEL_ALIASES[model];
4607
+ if (model in GEMINI_FORCED_ALIASES) return GEMINI_FORCED_ALIASES[model];
4608
+ if (!(model in GEMINI_CONDITIONAL_ALIASES)) return model;
4609
+ if (findModelById(model)) return model;
4610
+ return GEMINI_CONDITIONAL_ALIASES[model];
4609
4611
  }
4610
4612
 
4611
4613
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dianshuv/copilot-api",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Turn GitHub Copilot into OpenAI/Anthropic API compatible server. Usable with Claude Code!",
5
5
  "author": "dianshuv",
6
6
  "type": "module",