@jeffreycao/copilot-api 1.14.19 → 1.14.20
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-d5b6HQB2.js → server-DFKKcrgz.js} +3 -6
- package/dist/server-DFKKcrgz.js.map +1 -0
- package/dist/{start-CZSIsfb3.js → start-RTCk-bpf.js} +2 -2
- package/dist/{start-CZSIsfb3.js.map → start-RTCk-bpf.js.map} +1 -1
- package/package.json +1 -1
- package/dist/server-d5b6HQB2.js.map +0 -1
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-
|
|
28
|
+
const { start } = await import("./start-RTCk-bpf.js");
|
|
29
29
|
await runMain(defineCommand({
|
|
30
30
|
meta: {
|
|
31
31
|
name: "copilot-api",
|
|
@@ -1463,10 +1463,10 @@ function resolveTokenUsageCost(input) {
|
|
|
1463
1463
|
};
|
|
1464
1464
|
}
|
|
1465
1465
|
function resolveReportedProviderCost(input) {
|
|
1466
|
-
const 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
|
|
1469
|
+
if (totalCostNanos < 0) return null;
|
|
1470
1470
|
return {
|
|
1471
1471
|
currency: input.pricingCurrency?.trim().toUpperCase() || "USD",
|
|
1472
1472
|
source: "upstream",
|
|
@@ -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
|
}
|
|
@@ -7217,4 +7214,4 @@ server.route("/:provider/images", providerImageRoutes);
|
|
|
7217
7214
|
//#endregion
|
|
7218
7215
|
export { server };
|
|
7219
7216
|
|
|
7220
|
-
//# sourceMappingURL=server-
|
|
7217
|
+
//# sourceMappingURL=server-DFKKcrgz.js.map
|