dsh-multi-router 0.6.8 → 0.6.9
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/CHANGELOG.md +9 -0
- package/README.md +5 -1
- package/cordis.patch.yml +2 -2
- package/lib/accounts.js +2 -2
- package/lib/api-service.js +3 -3
- package/lib/{chunk-YZIARLWT.js → chunk-2UM45OXY.js} +2 -2
- package/lib/{chunk-A4OIPIFX.js → chunk-BK2JVL3Q.js} +3 -3
- package/lib/{chunk-Q6A57FN3.js → chunk-D726WROP.js} +12 -2
- package/lib/{chunk-Q6A57FN3.js.map → chunk-D726WROP.js.map} +2 -2
- package/lib/{chunk-XD52ZGZ5.js → chunk-GEBZMIMA.js} +30 -14
- package/lib/chunk-GEBZMIMA.js.map +7 -0
- package/lib/{chunk-JV4DLVV4.js → chunk-I2CZXH2A.js} +15 -7
- package/lib/chunk-I2CZXH2A.js.map +7 -0
- package/lib/{chunk-CZKROASU.js → chunk-KHBV4LKT.js} +3 -3
- package/lib/{chunk-TKVFF7LN.js → chunk-RMIZSZ6B.js} +3 -3
- package/lib/cli.js +4 -4
- package/lib/client.js +10 -3
- package/lib/client.js.map +2 -2
- package/lib/clients.js +3 -3
- package/lib/{host-v0.6.8.js → host-v0.6.9.js} +7 -7
- package/lib/host.js +7 -7
- package/lib/index.js +7 -7
- package/lib/manager.js +6 -6
- package/lib/router.js +2 -2
- package/lib/shim.js +3 -3
- package/package.json +1 -1
- package/lib/chunk-JV4DLVV4.js.map +0 -7
- package/lib/chunk-XD52ZGZ5.js.map +0 -7
- /package/lib/{chunk-YZIARLWT.js.map → chunk-2UM45OXY.js.map} +0 -0
- /package/lib/{chunk-A4OIPIFX.js.map → chunk-BK2JVL3Q.js.map} +0 -0
- /package/lib/{chunk-CZKROASU.js.map → chunk-KHBV4LKT.js.map} +0 -0
- /package/lib/{chunk-TKVFF7LN.js.map → chunk-RMIZSZ6B.js.map} +0 -0
|
@@ -6,20 +6,20 @@ import {
|
|
|
6
6
|
refreshWorkBuddyCheckinCredential,
|
|
7
7
|
supportsCheckin,
|
|
8
8
|
workbuddyToken
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RMIZSZ6B.js";
|
|
10
10
|
import {
|
|
11
11
|
discoverLocalAccounts,
|
|
12
12
|
importAccount,
|
|
13
13
|
localAccountKey,
|
|
14
14
|
normalizeLocalAccountKey,
|
|
15
15
|
readPortableCredential
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-2UM45OXY.js";
|
|
17
17
|
import {
|
|
18
18
|
modelWithCurrentPromotion
|
|
19
19
|
} from "./chunk-KWXLQJS5.js";
|
|
20
20
|
import {
|
|
21
21
|
ApiService
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-BK2JVL3Q.js";
|
|
23
23
|
import {
|
|
24
24
|
hostIsLoopback
|
|
25
25
|
} from "./chunk-DNQPZMPF.js";
|
|
@@ -28,23 +28,24 @@ import {
|
|
|
28
28
|
contextInfo,
|
|
29
29
|
matchModel,
|
|
30
30
|
resolveContext
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-D726WROP.js";
|
|
32
32
|
import {
|
|
33
33
|
PROVIDERS,
|
|
34
34
|
PROVIDER_NAMES,
|
|
35
35
|
ROUTE_PRESETS,
|
|
36
36
|
beijingDay,
|
|
37
|
+
creditRate,
|
|
37
38
|
isFreeModel,
|
|
38
39
|
routeReasoning,
|
|
39
40
|
validateConfig,
|
|
40
41
|
writePrivateJson
|
|
41
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-GEBZMIMA.js";
|
|
42
43
|
|
|
43
44
|
// src/manager.mjs
|
|
44
45
|
import { createHash, randomBytes as randomBytes3, timingSafeEqual } from "node:crypto";
|
|
45
46
|
|
|
46
47
|
// package.json
|
|
47
|
-
var version = "0.6.
|
|
48
|
+
var version = "0.6.9";
|
|
48
49
|
|
|
49
50
|
// src/manager.mjs
|
|
50
51
|
import { readFile as readFile4, mkdir as mkdir2, mkdtemp as mkdtemp2, rm as rm3 } from "node:fs/promises";
|
|
@@ -1387,6 +1388,12 @@ var Manager = class {
|
|
|
1387
1388
|
const context = resolveContext(sources.map((s) => s.model), row.contextMode === "custom" ? row.contextWindow : null, row.contextWindow);
|
|
1388
1389
|
const eligible = sources.filter((s) => contextInfo(s.model).maxContextWindow >= context.contextWindow);
|
|
1389
1390
|
const models = eligible.map((s) => s.model), reasoning = routeReasoning(eligible);
|
|
1391
|
+
const rates = {};
|
|
1392
|
+
for (const source of eligible) {
|
|
1393
|
+
const rate = creditRate(source.model, this.telemetry.now());
|
|
1394
|
+
if (rate === void 0) continue;
|
|
1395
|
+
rates[source.accountId] = rates[source.accountId] === void 0 ? rate : Math.min(rates[source.accountId], rate);
|
|
1396
|
+
}
|
|
1390
1397
|
return {
|
|
1391
1398
|
...row,
|
|
1392
1399
|
...context,
|
|
@@ -1394,6 +1401,7 @@ var Manager = class {
|
|
|
1394
1401
|
supportsImages: models.length > 0 && models.every((m) => m.supportsImages),
|
|
1395
1402
|
reasoning,
|
|
1396
1403
|
eligibleAccountIds: [...new Set(eligible.map((s) => s.accountId))],
|
|
1404
|
+
creditRates: rates,
|
|
1397
1405
|
maxTokens: Math.min(row.maxTokens, context.contextWindow, ...models.map((m) => m.maxTokens)),
|
|
1398
1406
|
id,
|
|
1399
1407
|
name: row.name ?? id,
|
|
@@ -2048,4 +2056,4 @@ export {
|
|
|
2048
2056
|
Manager,
|
|
2049
2057
|
managementHandler
|
|
2050
2058
|
};
|
|
2051
|
-
//# sourceMappingURL=chunk-
|
|
2059
|
+
//# sourceMappingURL=chunk-I2CZXH2A.js.map
|