@jeffreycao/copilot-api 1.14.19 → 1.14.21

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/README.md CHANGED
@@ -185,6 +185,7 @@ Here is an example `.claude/settings.json` file:
185
185
  "ANTHROPIC_BASE_URL": "http://localhost:4141",
186
186
  "ANTHROPIC_AUTH_TOKEN": "dummy",
187
187
  "ANTHROPIC_MODEL": "gpt-5.6-sol[1m]",
188
+ "ANTHROPIC_DEFAULT_OPUS_MODEL": "gpt-5.6-sol[1m]",
188
189
  "ANTHROPIC_DEFAULT_SONNET_MODEL": "gpt-5.6-sol[1m]",
189
190
  "ANTHROPIC_DEFAULT_HAIKU_MODEL": "gpt-5.6-luna[1m]",
190
191
  "CLAUDE_CODE_AUTO_COMPACT_WINDOW": "272000",
package/README.zh-CN.md CHANGED
@@ -187,6 +187,7 @@ npx @jeffreycao/copilot-api@latest start --claude-code
187
187
  "ANTHROPIC_BASE_URL": "http://localhost:4141",
188
188
  "ANTHROPIC_AUTH_TOKEN": "dummy",
189
189
  "ANTHROPIC_MODEL": "gpt-5.6-sol[1m]",
190
+ "ANTHROPIC_DEFAULT_OPUS_MODEL": "gpt-5.6-sol[1m]",
190
191
  "ANTHROPIC_DEFAULT_SONNET_MODEL": "gpt-5.6-sol[1m]",
191
192
  "ANTHROPIC_DEFAULT_HAIKU_MODEL": "gpt-5.6-luna[1m]",
192
193
  "CLAUDE_CODE_AUTO_COMPACT_WINDOW": "272000",
package/dist/main.js CHANGED
@@ -25,7 +25,7 @@ bindElectronFetch();
25
25
  const { auth } = await import("./auth-Rfz38SnR.js");
26
26
  const { debug } = await import("./debug-BijayADs.js");
27
27
  const { mcp } = await import("./mcp-BG6fpi6q.js");
28
- const { start } = await import("./start-CZSIsfb3.js");
28
+ const { start } = await import("./start-BHeD3nDG.js");
29
29
  await runMain(defineCommand({
30
30
  meta: {
31
31
  name: "copilot-api",
@@ -1463,12 +1463,12 @@ function resolveTokenUsageCost(input) {
1463
1463
  };
1464
1464
  }
1465
1465
  function resolveReportedProviderCost(input) {
1466
- const cost = normalizeReportedCost(input.cost);
1466
+ const cost = normalizePrice(input.cost);
1467
1467
  if (cost === null) return null;
1468
1468
  const totalCostNanos = Math.round(cost * COST_NANOS_PER_UNIT);
1469
- if (totalCostNanos <= 0) return null;
1469
+ if (totalCostNanos < 0) return null;
1470
1470
  return {
1471
- currency: input.pricingCurrency?.trim().toUpperCase() || "USD",
1471
+ currency: "USD",
1472
1472
  source: "upstream",
1473
1473
  total_cost_nanos: totalCostNanos
1474
1474
  };
@@ -1514,9 +1514,6 @@ function getInputTokenTotal(input) {
1514
1514
  function normalizePrice(value) {
1515
1515
  return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : null;
1516
1516
  }
1517
- function normalizeReportedCost(value) {
1518
- return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : null;
1519
- }
1520
1517
  function resolveProviderCurrency(providerName, configuredCurrency) {
1521
1518
  return configuredCurrency?.trim().toUpperCase() || BUILTIN_PROVIDER_CURRENCIES[providerName.toLowerCase()] || null;
1522
1519
  }
@@ -4098,7 +4095,7 @@ const mapOutputToAnthropicContent = (output, options) => {
4098
4095
  for (const item of output) switch (item.type) {
4099
4096
  case "reasoning": {
4100
4097
  const thinkingText = extractReasoningText(item);
4101
- if (thinkingText.length > 0) contentBlocks.push({
4098
+ if (thinkingText.length > 0 || item.id && item.encrypted_content) contentBlocks.push({
4102
4099
  type: "thinking",
4103
4100
  thinking: thinkingText,
4104
4101
  signature: (item.encrypted_content ?? "") + "@" + item.id
@@ -4171,7 +4168,6 @@ const extractReasoningText = (item) => {
4171
4168
  continue;
4172
4169
  }
4173
4170
  };
4174
- if (!item.summary || item.summary.length === 0) return THINKING_TEXT;
4175
4171
  collectFromBlocks(item.summary);
4176
4172
  return segments.join(REASONING_SUMMARY_SEPARATOR).trim();
4177
4173
  };
@@ -7217,4 +7213,4 @@ server.route("/:provider/images", providerImageRoutes);
7217
7213
  //#endregion
7218
7214
  export { server };
7219
7215
 
7220
- //# sourceMappingURL=server-d5b6HQB2.js.map
7216
+ //# sourceMappingURL=server-Dk788DUw.js.map