dsh-multi-router 0.6.11 → 1.0.0

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 (56) hide show
  1. package/README.md +2 -427
  2. package/package.json +5 -81
  3. package/CHANGELOG.md +0 -237
  4. package/LICENSE +0 -21
  5. package/THIRD_PARTY_NOTICES.md +0 -171
  6. package/cordis.patch.yml +0 -3
  7. package/lib/accounts.js +0 -19
  8. package/lib/accounts.js.map +0 -7
  9. package/lib/api-service.js +0 -11
  10. package/lib/api-service.js.map +0 -7
  11. package/lib/chunk-2UM45OXY.js +0 -181
  12. package/lib/chunk-2UM45OXY.js.map +0 -7
  13. package/lib/chunk-4L2CBGXN.js +0 -674
  14. package/lib/chunk-4L2CBGXN.js.map +0 -7
  15. package/lib/chunk-4V52V5GO.js +0 -105
  16. package/lib/chunk-4V52V5GO.js.map +0 -7
  17. package/lib/chunk-DNQPZMPF.js +0 -33
  18. package/lib/chunk-DNQPZMPF.js.map +0 -7
  19. package/lib/chunk-FLL3DUVP.js +0 -2017
  20. package/lib/chunk-FLL3DUVP.js.map +0 -7
  21. package/lib/chunk-GEBZMIMA.js +0 -287
  22. package/lib/chunk-GEBZMIMA.js.map +0 -7
  23. package/lib/chunk-KWXLQJS5.js +0 -1102
  24. package/lib/chunk-KWXLQJS5.js.map +0 -7
  25. package/lib/chunk-NZF36O5I.js +0 -5421
  26. package/lib/chunk-NZF36O5I.js.map +0 -7
  27. package/lib/chunk-S5KMFAQM.js +0 -50
  28. package/lib/chunk-S5KMFAQM.js.map +0 -7
  29. package/lib/chunk-TM5XDMGY.js +0 -332
  30. package/lib/chunk-TM5XDMGY.js.map +0 -7
  31. package/lib/chunk-WDIT4E2W.js +0 -120
  32. package/lib/chunk-WDIT4E2W.js.map +0 -7
  33. package/lib/chunk-YCAO7GCT.js +0 -2059
  34. package/lib/chunk-YCAO7GCT.js.map +0 -7
  35. package/lib/cli.js +0 -103
  36. package/lib/cli.js.map +0 -7
  37. package/lib/client.js +0 -2793
  38. package/lib/client.js.map +0 -7
  39. package/lib/clients.js +0 -30
  40. package/lib/clients.js.map +0 -7
  41. package/lib/host-v0.6.11.js +0 -414
  42. package/lib/host.js +0 -414
  43. package/lib/index.js +0 -414
  44. package/lib/index.js.map +0 -7
  45. package/lib/manager.js +0 -27
  46. package/lib/manager.js.map +0 -7
  47. package/lib/region-DO3KAV7V.js +0 -15
  48. package/lib/region-DO3KAV7V.js.map +0 -7
  49. package/lib/router.js +0 -14
  50. package/lib/router.js.map +0 -7
  51. package/lib/shim.js +0 -10
  52. package/lib/shim.js.map +0 -7
  53. package/lib/upstream-VP6J7LU2.js +0 -25
  54. package/lib/upstream-VP6J7LU2.js.map +0 -7
  55. package/router.example.json +0 -289
  56. package/upstream-lock.json +0 -17
@@ -1,287 +0,0 @@
1
- // src/reasoning.mjs
2
- var REASONING_EFFORTS = ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
3
- function reasoningModes(model, provider) {
4
- const r = model?.reasoning;
5
- if (!r || r.supports !== true && !Array.isArray(r.supported)) return [];
6
- const declared = r.supportedEfforts ?? r.supported ?? [];
7
- const disable = r.canDisableThinking === true || declared.includes("off");
8
- const off = disable && !(provider === "workbuddy" && r.onlyReasoning === true);
9
- return REASONING_EFFORTS.filter((e) => e === "off" ? off : declared.includes(e));
10
- }
11
- function routeReasoning(models) {
12
- const efforts = REASONING_EFFORTS.filter((e) => models.some(({ model, provider }) => reasoningModes(model, provider).includes(e)));
13
- if (!efforts.length) return void 0;
14
- return {
15
- supports: true,
16
- supportedEfforts: efforts,
17
- canDisableThinking: efforts.includes("off"),
18
- defaultEffort: efforts.includes("high") ? "high" : efforts[0]
19
- };
20
- }
21
-
22
- // src/config.mjs
23
- import { readFile, mkdir, rename, writeFile, chmod } from "node:fs/promises";
24
- import { dirname, resolve } from "node:path";
25
- import { randomUUID } from "node:crypto";
26
- import { withFileLock } from "@deepseek-ai/dsh-atomic-write";
27
- var PROVIDERS = ["workbuddy", "workbuddy-ai", "trae", "trae-global", "qoder", "qoder-global"];
28
- var PROVIDER_NAMES = {
29
- workbuddy: "WorkBuddy",
30
- "workbuddy-ai": "WorkBuddy AI",
31
- trae: "Trae CN",
32
- "trae-global": "Trae Global",
33
- qoder: "Qoder CN",
34
- "qoder-global": "Qoder Global"
35
- };
36
- var FLASH_PRESET = {
37
- name: "DeepSeek V4.1 Flash \xB7 \u81EA\u52A8\u8DEF\u7531",
38
- contextMode: "maximum",
39
- contextWindow: 2e5,
40
- maxTokens: 32e3,
41
- preferExpiringCredits: true,
42
- expiringWithinDays: 7,
43
- targets: ["workbuddy", "trae", "qoder"].map((provider) => ({ provider, models: provider.startsWith("qoder") ? ["dfmodel"] : ["deepseek-v4.1-flash", "DeepSeek-V4.1-Flash", "DeepSeek-V4.1-Flash-Official"] }))
44
- };
45
- var sharedPreset = (name, workbuddy, trae, qoder) => ({
46
- name: `${name} \xB7 \u81EA\u52A8\u8DEF\u7531`,
47
- contextMode: "maximum",
48
- contextWindow: 2e5,
49
- maxTokens: 32e3,
50
- preferExpiringCredits: true,
51
- expiringWithinDays: 7,
52
- targets: [["workbuddy", workbuddy], ["trae", trae], ["qoder", qoder]].filter(([, models]) => models).map(([provider, models]) => ({ provider, models: Array.isArray(models) ? models : [models] }))
53
- });
54
- var ROUTE_PRESETS = {
55
- free: {
56
- name: "Free \xB7 \u52A8\u6001\u514D\u8D39\u6A21\u578B",
57
- freeOnly: true,
58
- visible: true,
59
- contextMode: "maximum",
60
- contextWindow: 2e5,
61
- maxTokens: 32e3,
62
- strategy: "failover",
63
- preferExpiringCredits: false,
64
- targets: PROVIDERS.map((provider) => ({ provider }))
65
- },
66
- "deepseek-v4.1-flash": FLASH_PRESET,
67
- "deepseek-v4-pro": sharedPreset("DeepSeek V4 Pro", "deepseek-v4-pro", ["DeepSeek-V4-Pro-Official", "DeepSeek-V4-Pro"], "dmodel"),
68
- "glm-5.3": sharedPreset("GLM-5.3", "glm-5.3", "glm-5.3", "gmodel"),
69
- "glm-5.3-flash": sharedPreset("GLM-5.3-Flash", "glm-5.3-flash", "glm-5.3-flash", "gfmodel"),
70
- "kimi-k3": sharedPreset("Kimi-K3", "kimi-k3-1", "kimi-k3", "kmodel_latest"),
71
- "kimi-k2.8-preview": sharedPreset("Kimi-K2.8-Preview", "kimi-k2.8-preview", "kimi-k2.8-preview", "kmodel"),
72
- "minimax-m2.7": sharedPreset("MiniMax-M2.7", "minimax-m2.7", "minimax-m2.7", "mmodel"),
73
- // WorkBuddy does not advertise these models. Only bind verified Trae/Qoder IDs.
74
- "qwen3.8-max": sharedPreset("Qwen3.8-Max", null, "qwen3.8-max", "qmodel_38max"),
75
- "qwen3.8-flash": sharedPreset("Qwen3.8-Flash", null, "qwen3.8-flash", "qfmodel"),
76
- "hy4-preview": sharedPreset("Hy4 Preview", "hy4-preview", null, null)
77
- };
78
- var DEFAULT_ROUTES = {
79
- free: ROUTE_PRESETS.free,
80
- "ds4.1f": {
81
- name: "DeepSeek V4.1 Flash \xB7 Auto",
82
- contextMode: "maximum",
83
- contextWindow: 2e5,
84
- maxTokens: 32e3,
85
- preferExpiringCredits: true,
86
- expiringWithinDays: 7,
87
- targets: PROVIDERS.map((provider) => ({ provider }))
88
- },
89
- ...ROUTE_PRESETS
90
- };
91
- var LEGACY_ROUTE_PRESETS = [
92
- "free",
93
- "deepseek-v4.1-flash",
94
- "deepseek-v4-pro",
95
- "glm-5.3",
96
- "glm-5.3-flash",
97
- "kimi-k3",
98
- "kimi-k2.8-preview",
99
- "minimax-m2.7"
100
- ];
101
- function upgradeRoutePresets(raw) {
102
- const ids = Object.keys(ROUTE_PRESETS);
103
- if (ids.every((id) => raw.seenRoutePresets?.includes(id))) return raw;
104
- const routes = raw.routes ?? DEFAULT_ROUTES;
105
- const seen = /* @__PURE__ */ new Set([
106
- ...LEGACY_ROUTE_PRESETS,
107
- ...raw.seenRoutePresets ?? [],
108
- ...Object.keys(routes).filter((id) => Object.hasOwn(ROUTE_PRESETS, id))
109
- ]);
110
- const additions = ids.filter((id) => !seen.has(id));
111
- return {
112
- ...raw,
113
- ...additions.length ? { routes: {
114
- ...routes,
115
- ...Object.fromEntries(additions.map((id) => [id, structuredClone(ROUTE_PRESETS[id])]))
116
- } } : {},
117
- seenRoutePresets: [.../* @__PURE__ */ new Set([...seen, ...ids])]
118
- };
119
- }
120
- var object = (x) => x !== null && typeof x === "object" && !Array.isArray(x);
121
- var nonempty = (x) => typeof x === "string" && x.trim().length > 0;
122
- var positive = (x) => Number.isSafeInteger(x) && x > 0;
123
- var beijingDay = (at) => new Date(at).toLocaleDateString("en-CA", { timeZone: "Asia/Shanghai" });
124
- function creditRate(model, now = Date.now()) {
125
- const rate = model.creditMultiplier ?? /^x?(\d+(?:\.\d+)?)(?:\s+credits?)?$/i.exec(model.billing?.credits?.trim() ?? "")?.[1];
126
- const base = Number(rate);
127
- if (rate === void 0 || !Number.isFinite(base) || base < 0) return void 0;
128
- const live = (model.promotions ?? []).filter((p) => now >= p.start && now < p.end);
129
- if (!live.length) return base;
130
- const best = live.reduce((top, p) => !top || p.priority > top.priority ? p : top, void 0);
131
- return Number.isFinite(best.factor) ? base * best.factor : base;
132
- }
133
- function isFreeModel(model, now = Date.now()) {
134
- if (model.billing?.rateUnknown === true) return false;
135
- const rate = creditRate(model, now);
136
- if (rate === void 0 || rate !== 0) return false;
137
- if (model.promotions?.length && !model.promotions.some((p) => now >= p.start && now < p.end)) return false;
138
- return true;
139
- }
140
- function validateConfig(raw, file = resolve("router.json")) {
141
- if (!object(raw) || !Array.isArray(raw.accounts)) throw new Error("Config must contain an accounts array");
142
- const ids = /* @__PURE__ */ new Set();
143
- const accounts = raw.accounts.map((account) => {
144
- if (!object(account) || !/^[a-zA-Z0-9_-]{1,64}$/.test(account.id ?? "") || ids.has(account.id)) throw new Error("Account ids must be unique, 1\u201364 letters, digits, _ or -");
145
- ids.add(account.id);
146
- if (!PROVIDERS.includes(account.provider) || !nonempty(account.credentialFile)) throw new Error(`Invalid provider or credentialFile for ${account.id}`);
147
- if (account.enabled !== void 0 && typeof account.enabled !== "boolean") throw new Error(`Invalid enabled flag for ${account.id}`);
148
- if (account.autoCheckin !== void 0 && (typeof account.autoCheckin !== "boolean" || account.autoCheckin && !["workbuddy", "trae", "qoder", "qoder-global"].includes(account.provider))) throw new Error(`Invalid autoCheckin for ${account.id}`);
149
- if (account.name !== void 0 && (!nonempty(account.name) || account.name.length > 100)) throw new Error(`Invalid account name for ${account.id}`);
150
- if (account.identityFile !== void 0 && !nonempty(account.identityFile)) throw new Error(`Invalid identityFile for ${account.id}`);
151
- return {
152
- ...account,
153
- credentialFile: resolve(dirname(file), account.credentialFile),
154
- ...account.identityFile ? { identityFile: resolve(dirname(file), account.identityFile) } : {}
155
- };
156
- });
157
- if (!object(raw.routes ?? DEFAULT_ROUTES)) throw new Error("Routes must be an object");
158
- const routes = Object.fromEntries(Object.entries(raw.routes ?? DEFAULT_ROUTES).map(([id, route]) => {
159
- const { creditRates: _derivedRates, ...declared } = route ?? {};
160
- return [id, {
161
- ...declared,
162
- contextMode: declared.contextMode ?? (declared.contextWindow === 2e5 ? "maximum" : "custom"),
163
- preferExpiringCredits: declared.preferExpiringCredits ?? !declared.freeOnly,
164
- expiringWithinDays: declared.expiringWithinDays ?? 7,
165
- // Balance-aware rotation defaults on for paid routes; a free route may only hold the
166
- // default, so an explicit `true` is rejected by the check below rather than rewritten
167
- // here — a silently corrected manifest hides the mistake from whoever wrote it.
168
- balanceCredits: declared.balanceCredits ?? !declared.freeOnly,
169
- creditBalanceThreshold: declared.creditBalanceThreshold ?? 1e3,
170
- discountOrder: declared.discountOrder ?? !declared.freeOnly
171
- }];
172
- }));
173
- for (const [alias, route] of Object.entries(routes)) {
174
- if (!/^[a-zA-Z0-9_.-]{1,128}$/.test(alias) || !object(route) || !Array.isArray(route.targets) || !route.targets.length) throw new Error(`Invalid route ${alias}`);
175
- for (const key of ["contextWindow", "maxTokens"]) if (!positive(route[key])) throw new Error(`Route ${alias} needs a positive ${key}`);
176
- if (!["maximum", "custom"].includes(route.contextMode)) throw new Error(`Invalid contextMode in ${alias}`);
177
- if (route.maxTokens > route.contextWindow) throw new Error(`Route ${alias}: maxTokens exceeds contextWindow`);
178
- if (route.supportsImages !== void 0 && typeof route.supportsImages !== "boolean") throw new Error(`Invalid supportsImages for ${alias}`);
179
- if (route.visible !== void 0 && typeof route.visible !== "boolean") throw new Error(`Invalid visibility for ${alias}`);
180
- if (route.reasoningEffort != null && !REASONING_EFFORTS.includes(route.reasoningEffort)) throw new Error(`Invalid reasoningEffort for ${alias}`);
181
- if (route.name !== void 0 && (!nonempty(route.name) || route.name.length > 200)) throw new Error(`Invalid route name for ${alias}`);
182
- if (route.freeOnly !== void 0 && typeof route.freeOnly !== "boolean") throw new Error(`Invalid freeOnly for ${alias}`);
183
- if (route.freeModels !== void 0 && (!route.freeOnly || !object(route.freeModels) || Object.entries(route.freeModels).some(([id, p]) => !/^free_[a-f0-9]{24}$/.test(id) || !object(p) || Object.keys(p).some((k) => !["visible", "reasoningEffort", "contextWindow"].includes(k)) || p.visible !== void 0 && typeof p.visible !== "boolean" || p.contextWindow !== void 0 && p.contextWindow !== null && !positive(p.contextWindow) || p.reasoningEffort !== void 0 && p.reasoningEffort !== null && !REASONING_EFFORTS.includes(p.reasoningEffort)))) throw new Error("\u514D\u8D39\u6A21\u578B\u5C55\u793A\u6216\u63A8\u7406\u7B49\u7EA7\u8BBE\u7F6E\u65E0\u6548");
184
- if (route.freeOnly && (route.strategy && route.strategy !== "failover" || route.preferExpiringCredits)) throw new Error("Free \u8DEF\u7531\u4EC5\u4F7F\u7528\u514D\u8D39\u6A21\u578B\u6545\u969C\u5207\u6362\uFF0C\u4E0D\u4F7F\u7528\u79EF\u5206\u6216\u989D\u5EA6\u8F6E\u6362");
185
- if (route.balanceCredits !== void 0 && typeof route.balanceCredits !== "boolean") throw new Error(`Invalid balanceCredits flag in ${alias}`);
186
- if (route.freeOnly && route.balanceCredits === true) throw new Error("Free \u8DEF\u7531\u4E0D\u4F7F\u7528\u79EF\u5206\u5747\u8861\u5207\u6362");
187
- if (route.discountOrder !== void 0 && typeof route.discountOrder !== "boolean") throw new Error(`Invalid discountOrder flag in ${alias}`);
188
- if (route.freeOnly && route.discountOrder === true) throw new Error("Free \u8DEF\u7531\u4E0D\u4F7F\u7528\u79EF\u5206\u6298\u6263\u6392\u5E8F");
189
- if (route.creditBalanceThreshold !== void 0 && (typeof route.creditBalanceThreshold !== "number" || !Number.isFinite(route.creditBalanceThreshold) || route.creditBalanceThreshold <= 0)) throw new Error(`Invalid credit balance threshold in ${alias}`);
190
- if (route.preferExpiringCredits !== void 0 && typeof route.preferExpiringCredits !== "boolean") throw new Error(`Invalid expiring credits flag in ${alias}`);
191
- if (route.expiringWithinDays !== void 0 && (!positive(route.expiringWithinDays) || route.expiringWithinDays > 365)) throw new Error(`Invalid expiry horizon in ${alias}`);
192
- if (route.strategy !== void 0 && !["failover", "weighted", "tokens", "credits"].includes(route.strategy)) throw new Error(`Invalid strategy in ${alias}`);
193
- for (const target of route.targets) {
194
- if (!object(target)) throw new Error(`Invalid target in ${alias}`);
195
- if (target.weight !== void 0 && (!positive(target.weight) || target.weight > 1e3)) throw new Error(`Invalid target weight in ${alias}`);
196
- if (target.tokenBudget !== void 0 && !positive(target.tokenBudget)) throw new Error(`Invalid token budget in ${alias}`);
197
- if (target.creditBudget !== void 0 && (typeof target.creditBudget !== "number" || !Number.isFinite(target.creditBudget) || target.creditBudget <= 0)) throw new Error(`Invalid credit budget in ${alias}`);
198
- if (route.strategy === "tokens" && !positive(target.tokenBudget)) throw new Error(`Route ${alias} needs token budgets`);
199
- if (route.strategy === "credits" && !(target.creditBudget > 0)) throw new Error(`Route ${alias} needs credit budgets`);
200
- if (!object(target) || !PROVIDERS.includes(target.provider) || target.model !== void 0 && !nonempty(target.model)) throw new Error(`Invalid target in ${alias}`);
201
- if (target.models !== void 0 && (!Array.isArray(target.models) || !target.models.length || target.models.length > 20 || !target.models.every(nonempty))) throw new Error(`Invalid target models in ${alias}`);
202
- if (target.model !== void 0 && target.models !== void 0) throw new Error(`Choose model or models in ${alias}`);
203
- if (target.account !== void 0 && !accounts.some((a) => a.id === target.account && a.provider === target.provider)) throw new Error(`Unknown target account in ${alias}`);
204
- if (!target.model && !target.models && alias !== "ds4.1f" && !route.freeOnly) throw new Error(`Route ${alias} requires explicit target model ids`);
205
- }
206
- }
207
- const models = raw.models ?? {};
208
- if (!object(models)) throw new Error("Models must be an object");
209
- for (const [provider, preferences] of Object.entries(models)) {
210
- if (!PROVIDERS.includes(provider) || !object(preferences)) throw new Error("Invalid model provider");
211
- for (const [id, preference] of Object.entries(preferences)) {
212
- if (!nonempty(id) || id.length > 256 || !object(preference) || preference.name !== void 0 && (!nonempty(preference.name) || preference.name.length > 200) || preference.visible !== void 0 && typeof preference.visible !== "boolean" || preference.contextWindow !== void 0 && preference.contextWindow !== null && !positive(preference.contextWindow) || preference.supportsImages !== void 0 && typeof preference.supportsImages !== "boolean" || preference.reasoningEffort !== void 0 && preference.reasoningEffort !== null && !REASONING_EFFORTS.includes(preference.reasoningEffort)) throw new Error("Invalid model preference");
213
- }
214
- }
215
- const modelVisibility = raw.modelVisibility ?? {};
216
- if (!object(modelVisibility) || Object.entries(modelVisibility).some(([provider, visible]) => !PROVIDERS.includes(provider) || typeof visible !== "boolean")) throw new Error("Invalid modelVisibility");
217
- for (const key of ["cooldownMs", "requestTimeoutMs", "catalogTtlMs"]) if (raw[key] !== void 0 && !positive(raw[key])) throw new Error(`Invalid ${key}`);
218
- if (raw.retryServerErrors !== void 0 && typeof raw.retryServerErrors !== "boolean") throw new Error("Invalid retryServerErrors");
219
- if (raw.sidebarUsage !== void 0 && typeof raw.sidebarUsage !== "boolean") throw new Error("\u4FA7\u680F\u7528\u91CF\u5F00\u5173\u5FC5\u987B\u662F\u5E03\u5C14\u503C");
220
- if (raw.ignoredLocalAccounts !== void 0 && (!Array.isArray(raw.ignoredLocalAccounts) || raw.ignoredLocalAccounts.some((k) => typeof k !== "string" || k.length > 1024))) throw new Error("Invalid ignoredLocalAccounts");
221
- if (raw.seenRoutePresets !== void 0 && (!Array.isArray(raw.seenRoutePresets) || raw.seenRoutePresets.length > 500 || raw.seenRoutePresets.some((id) => typeof id !== "string" || !/^[a-zA-Z0-9_.-]{1,128}$/.test(id)))) throw new Error("Invalid seenRoutePresets");
222
- if (raw.usageRetentionDays !== void 0 && (!positive(raw.usageRetentionDays) || raw.usageRetentionDays > 365)) throw new Error("Token \u660E\u7EC6\u4FDD\u7559\u5929\u6570\u5FC5\u987B\u4E3A 1\u2013365 \u7684\u6574\u6570");
223
- const checkinSchedule = raw.checkinSchedule ?? { mode: "scheduled", time: "10:05" };
224
- if (!object(checkinSchedule) || !["startup", "scheduled"].includes(checkinSchedule.mode) || !/^([01]\d|2[0-3]):[0-5]\d$/.test(checkinSchedule.time ?? "") || Object.keys(checkinSchedule).some((k) => !["mode", "time"].includes(k))) throw new Error("\u7B7E\u5230\u8BA1\u5212\u5FC5\u987B\u9009\u62E9\u542F\u52A8\u6216\u5B9A\u65F6\uFF0C\u5E76\u586B\u5199\u6709\u6548\u7684\u5317\u4EAC\u65F6\u95F4\uFF08HH:mm\uFF09");
225
- return {
226
- ...raw,
227
- accounts,
228
- routes,
229
- models,
230
- modelVisibility,
231
- cooldownMs: raw.cooldownMs ?? 6e4,
232
- checkinSchedule: { ...checkinSchedule },
233
- sidebarUsage: raw.sidebarUsage ?? true,
234
- requestTimeoutMs: raw.requestTimeoutMs ?? 3e5,
235
- catalogTtlMs: raw.catalogTtlMs ?? 3e5,
236
- retryServerErrors: raw.retryServerErrors ?? false,
237
- usageRetentionDays: raw.usageRetentionDays ?? 30
238
- };
239
- }
240
- async function ensureConfig(file) {
241
- try {
242
- const raw = JSON.parse(await readFile(file, "utf8")), config = validateConfig(raw, resolve(file));
243
- if (upgradeRoutePresets(raw) === raw) return config;
244
- } catch (error) {
245
- if (error.code !== "ENOENT") throw error;
246
- }
247
- await mkdir(dirname(file), { recursive: true, mode: 448 });
248
- return withFileLock(file, async () => {
249
- let raw, created = false;
250
- try {
251
- raw = JSON.parse(await readFile(file, "utf8"));
252
- } catch (error) {
253
- if (error.code !== "ENOENT") throw error;
254
- raw = { accounts: [], routes: ROUTE_PRESETS };
255
- created = true;
256
- }
257
- validateConfig(raw, resolve(file));
258
- const next = upgradeRoutePresets(raw), config = validateConfig(next, resolve(file));
259
- if (created || next !== raw) await writePrivateJson(file, next);
260
- return config;
261
- }, { waitMs: 3e4 });
262
- }
263
- async function writePrivateJson(file, value) {
264
- await mkdir(dirname(file), { recursive: true, mode: 448 });
265
- const temp = `${file}.${randomUUID()}.tmp`;
266
- await writeFile(temp, `${JSON.stringify(value, null, 2)}
267
- `, { mode: 384, flag: "wx" });
268
- await rename(temp, file);
269
- await chmod(file, 384);
270
- }
271
-
272
- export {
273
- REASONING_EFFORTS,
274
- reasoningModes,
275
- routeReasoning,
276
- PROVIDERS,
277
- PROVIDER_NAMES,
278
- ROUTE_PRESETS,
279
- DEFAULT_ROUTES,
280
- beijingDay,
281
- creditRate,
282
- isFreeModel,
283
- validateConfig,
284
- ensureConfig,
285
- writePrivateJson
286
- };
287
- //# sourceMappingURL=chunk-GEBZMIMA.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/reasoning.mjs", "../src/config.mjs"],
4
- "sourcesContent": ["export const REASONING_EFFORTS = ['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'];\n\n// Keep declared modes only. A fixed-thinking model without a declared set uses platform default.\nexport function reasoningModes(model, provider) {\n const r = model?.reasoning;\n if (!r || (r.supports !== true && !Array.isArray(r.supported))) return [];\n const declared = r.supportedEfforts ?? r.supported ?? [];\n const disable = r.canDisableThinking === true || declared.includes('off');\n const off = disable && !(provider === 'workbuddy' && r.onlyReasoning === true);\n return REASONING_EFFORTS.filter(e => e === 'off' ? off : declared.includes(e));\n}\n\nexport function routeReasoning(models) {\n const efforts = REASONING_EFFORTS.filter(e => models.some(({ model, provider }) => reasoningModes(model, provider).includes(e)));\n if (!efforts.length) return undefined;\n return { supports: true, supportedEfforts: efforts, canDisableThinking: efforts.includes('off'),\n defaultEffort: efforts.includes('high') ? 'high' : efforts[0] };\n}\n", "import { readFile, mkdir, rename, writeFile, chmod } from 'node:fs/promises';\nimport { dirname, resolve } from 'node:path';\nimport { randomUUID } from 'node:crypto';\nimport { withFileLock } from '@deepseek-ai/dsh-atomic-write';\nimport { REASONING_EFFORTS } from './reasoning.mjs';\n\nexport const PROVIDERS = ['workbuddy', 'workbuddy-ai', 'trae', 'trae-global', 'qoder', 'qoder-global'];\nexport const PROVIDER_NAMES = { workbuddy: 'WorkBuddy', 'workbuddy-ai': 'WorkBuddy AI', trae: 'Trae CN',\n 'trae-global': 'Trae Global', qoder: 'Qoder CN', 'qoder-global': 'Qoder Global' };\nexport const FLASH_PRESET = {\n name: 'DeepSeek V4.1 Flash \u00B7 \u81EA\u52A8\u8DEF\u7531', contextMode: 'maximum', contextWindow: 200000, maxTokens: 32000, preferExpiringCredits: true, expiringWithinDays: 7,\n targets: ['workbuddy', 'trae', 'qoder'].map(provider => ({ provider, models: provider.startsWith('qoder')\n ? ['dfmodel'] : ['deepseek-v4.1-flash', 'DeepSeek-V4.1-Flash', 'DeepSeek-V4.1-Flash-Official'] })),\n};\n// IDs differ between providers; keep precise model/version bindings, never fuzzy-match variants.\nconst sharedPreset = (name, workbuddy, trae, qoder) => ({\n name: `${name} \u00B7 \u81EA\u52A8\u8DEF\u7531`, contextMode: 'maximum', contextWindow: 200000, maxTokens: 32000, preferExpiringCredits: true, expiringWithinDays: 7,\n targets: [['workbuddy', workbuddy], ['trae', trae], ['qoder', qoder]]\n .filter(([, models]) => models).map(([provider, models]) => ({ provider, models: Array.isArray(models) ? models : [models] })),\n});\nexport const ROUTE_PRESETS = {\n free: { name: 'Free \u00B7 \u52A8\u6001\u514D\u8D39\u6A21\u578B', freeOnly: true, visible: true, contextMode: 'maximum', contextWindow: 200000, maxTokens: 32000,\n strategy: 'failover', preferExpiringCredits: false, targets: PROVIDERS.map(provider => ({ provider })) },\n 'deepseek-v4.1-flash': FLASH_PRESET,\n 'deepseek-v4-pro': sharedPreset('DeepSeek V4 Pro', 'deepseek-v4-pro', ['DeepSeek-V4-Pro-Official', 'DeepSeek-V4-Pro'], 'dmodel'),\n 'glm-5.3': sharedPreset('GLM-5.3', 'glm-5.3', 'glm-5.3', 'gmodel'),\n 'glm-5.3-flash': sharedPreset('GLM-5.3-Flash', 'glm-5.3-flash', 'glm-5.3-flash', 'gfmodel'),\n 'kimi-k3': sharedPreset('Kimi-K3', 'kimi-k3-1', 'kimi-k3', 'kmodel_latest'),\n 'kimi-k2.8-preview': sharedPreset('Kimi-K2.8-Preview', 'kimi-k2.8-preview', 'kimi-k2.8-preview', 'kmodel'),\n 'minimax-m2.7': sharedPreset('MiniMax-M2.7', 'minimax-m2.7', 'minimax-m2.7', 'mmodel'),\n // WorkBuddy does not advertise these models. Only bind verified Trae/Qoder IDs.\n 'qwen3.8-max': sharedPreset('Qwen3.8-Max', null, 'qwen3.8-max', 'qmodel_38max'),\n 'qwen3.8-flash': sharedPreset('Qwen3.8-Flash', null, 'qwen3.8-flash', 'qfmodel'),\n 'hy4-preview': sharedPreset('Hy4 Preview', 'hy4-preview', null, null),\n};\nexport const DEFAULT_ROUTES = {\n free: ROUTE_PRESETS.free,\n 'ds4.1f': {\n name: 'DeepSeek V4.1 Flash \u00B7 Auto', contextMode: 'maximum', contextWindow: 200000, maxTokens: 32000, preferExpiringCredits: true, expiringWithinDays: 7,\n targets: PROVIDERS.map(provider => ({ provider })),\n },\n ...ROUTE_PRESETS,\n};\n// Before preset history existed, these were already shipped. Missing old IDs\n// represent user removals; only subsequently introduced presets are auto-added.\nconst LEGACY_ROUTE_PRESETS = ['free', 'deepseek-v4.1-flash', 'deepseek-v4-pro', 'glm-5.3',\n 'glm-5.3-flash', 'kimi-k3', 'kimi-k2.8-preview', 'minimax-m2.7'];\nexport function upgradeRoutePresets(raw) {\n const ids = Object.keys(ROUTE_PRESETS);\n if (ids.every(id => raw.seenRoutePresets?.includes(id))) return raw;\n const routes = raw.routes ?? DEFAULT_ROUTES;\n const seen = new Set([...LEGACY_ROUTE_PRESETS, ...(raw.seenRoutePresets ?? []),\n ...Object.keys(routes).filter(id => Object.hasOwn(ROUTE_PRESETS, id))]);\n const additions = ids.filter(id => !seen.has(id));\n return { ...raw, ...(additions.length ? { routes: { ...routes,\n ...Object.fromEntries(additions.map(id => [id, structuredClone(ROUTE_PRESETS[id])])) } } : {}),\n seenRoutePresets: [...new Set([...seen, ...ids])] };\n}\nconst object = x => x !== null && typeof x === 'object' && !Array.isArray(x);\nconst nonempty = x => typeof x === 'string' && x.trim().length > 0;\nconst positive = x => Number.isSafeInteger(x) && x > 0;\nexport const beijingDay = at => new Date(at).toLocaleDateString('en-CA', { timeZone: 'Asia/Shanghai' });\n/**\n * Effective credit rate for one model: how many credits a call spends per unit of\n * the platform's base price, so a smaller number is cheaper.\n *\n * Providers publish it differently \u2014 Trae as a number, WorkBuddy and Qoder as an\n * `x0.11` string \u2014 and a live promotion multiplies the base rate. Returns undefined\n * when the provider gave nothing usable, because an unknown rate is not a cheap one.\n */\nexport function creditRate(model, now = Date.now()) {\n const rate = model.creditMultiplier ?? (/^x?(\\d+(?:\\.\\d+)?)(?:\\s+credits?)?$/i.exec(model.billing?.credits?.trim() ?? '')?.[1]);\n const base = Number(rate);\n if (rate === undefined || !Number.isFinite(base) || base < 0) return undefined;\n // A promotion replaces the rate outright when its factor is zero.\n const live = (model.promotions ?? []).filter(p => now >= p.start && now < p.end);\n if (!live.length) return base;\n const best = live.reduce((top, p) => !top || p.priority > top.priority ? p : top, undefined);\n return Number.isFinite(best.factor) ? base * best.factor : base;\n}\nexport function isFreeModel(model, now = Date.now()) {\n if (model.billing?.rateUnknown === true) return false;\n // A badge or a zero adapter cost is not an account-scoped zero billing rate.\n const rate = creditRate(model, now);\n if (rate === undefined || rate !== 0) return false;\n if (model.promotions?.length && !model.promotions.some(p => now >= p.start && now < p.end)) return false;\n return true;\n}\nexport function validateConfig(raw, file = resolve('router.json')) {\n if (!object(raw) || !Array.isArray(raw.accounts)) throw new Error('Config must contain an accounts array');\n const ids = new Set();\n const accounts = raw.accounts.map(account => {\n if (!object(account) || !/^[a-zA-Z0-9_-]{1,64}$/.test(account.id ?? '') || ids.has(account.id)) throw new Error('Account ids must be unique, 1\u201364 letters, digits, _ or -');\n ids.add(account.id);\n if (!PROVIDERS.includes(account.provider) || !nonempty(account.credentialFile)) throw new Error(`Invalid provider or credentialFile for ${account.id}`);\n if (account.enabled !== undefined && typeof account.enabled !== 'boolean') throw new Error(`Invalid enabled flag for ${account.id}`);\n if (account.autoCheckin !== undefined && (typeof account.autoCheckin !== 'boolean' || (account.autoCheckin && !['workbuddy', 'trae', 'qoder', 'qoder-global'].includes(account.provider)))) throw new Error(`Invalid autoCheckin for ${account.id}`);\n if (account.name !== undefined && (!nonempty(account.name) || account.name.length > 100)) throw new Error(`Invalid account name for ${account.id}`);\n if (account.identityFile !== undefined && !nonempty(account.identityFile)) throw new Error(`Invalid identityFile for ${account.id}`);\n return { ...account, credentialFile: resolve(dirname(file), account.credentialFile),\n ...(account.identityFile ? { identityFile: resolve(dirname(file), account.identityFile) } : {}) };\n });\n if (!object(raw.routes ?? DEFAULT_ROUTES)) throw new Error('Routes must be an object');\n const routes = Object.fromEntries(Object.entries(raw.routes ?? DEFAULT_ROUTES).map(([id, route]) => {\n // `creditRates` is derived per publish from the model catalog, never configuration.\n // Dropping it here means a panel round-trip or a hand-edited file cannot freeze\n // yesterday's rates into router.json, where the next publish would have to clear it.\n const { creditRates: _derivedRates, ...declared } = route ?? {};\n return [id, { ...declared,\n contextMode: declared.contextMode ?? (declared.contextWindow === 200000 ? 'maximum' : 'custom'),\n preferExpiringCredits: declared.preferExpiringCredits ?? !declared.freeOnly, expiringWithinDays: declared.expiringWithinDays ?? 7,\n // Balance-aware rotation defaults on for paid routes; a free route may only hold the\n // default, so an explicit `true` is rejected by the check below rather than rewritten\n // here \u2014 a silently corrected manifest hides the mistake from whoever wrote it.\n balanceCredits: declared.balanceCredits ?? !declared.freeOnly,\n creditBalanceThreshold: declared.creditBalanceThreshold ?? 1000,\n discountOrder: declared.discountOrder ?? !declared.freeOnly }];\n }));\n for (const [alias, route] of Object.entries(routes)) {\n if (!/^[a-zA-Z0-9_.-]{1,128}$/.test(alias) || !object(route) || !Array.isArray(route.targets) || !route.targets.length) throw new Error(`Invalid route ${alias}`);\n for (const key of ['contextWindow', 'maxTokens']) if (!positive(route[key])) throw new Error(`Route ${alias} needs a positive ${key}`);\n if (!['maximum', 'custom'].includes(route.contextMode)) throw new Error(`Invalid contextMode in ${alias}`);\n if (route.maxTokens > route.contextWindow) throw new Error(`Route ${alias}: maxTokens exceeds contextWindow`);\n if (route.supportsImages !== undefined && typeof route.supportsImages !== 'boolean') throw new Error(`Invalid supportsImages for ${alias}`);\n if (route.visible !== undefined && typeof route.visible !== 'boolean') throw new Error(`Invalid visibility for ${alias}`);\n if (route.reasoningEffort != null && !REASONING_EFFORTS.includes(route.reasoningEffort)) throw new Error(`Invalid reasoningEffort for ${alias}`);\n if (route.name !== undefined && (!nonempty(route.name) || route.name.length > 200)) throw new Error(`Invalid route name for ${alias}`);\n if (route.freeOnly !== undefined && typeof route.freeOnly !== 'boolean') throw new Error(`Invalid freeOnly for ${alias}`);\n if (route.freeModels !== undefined && (!route.freeOnly || !object(route.freeModels) || Object.entries(route.freeModels).some(([id, p]) =>\n !/^free_[a-f0-9]{24}$/.test(id) || !object(p) || Object.keys(p).some(k => !['visible', 'reasoningEffort', 'contextWindow'].includes(k))\n || (p.visible !== undefined && typeof p.visible !== 'boolean')\n || (p.contextWindow !== undefined && p.contextWindow !== null && !positive(p.contextWindow))\n || (p.reasoningEffort !== undefined && p.reasoningEffort !== null && !REASONING_EFFORTS.includes(p.reasoningEffort))))) throw new Error('\u514D\u8D39\u6A21\u578B\u5C55\u793A\u6216\u63A8\u7406\u7B49\u7EA7\u8BBE\u7F6E\u65E0\u6548');\n if (route.freeOnly && ((route.strategy && route.strategy !== 'failover') || route.preferExpiringCredits)) throw new Error('Free \u8DEF\u7531\u4EC5\u4F7F\u7528\u514D\u8D39\u6A21\u578B\u6545\u969C\u5207\u6362\uFF0C\u4E0D\u4F7F\u7528\u79EF\u5206\u6216\u989D\u5EA6\u8F6E\u6362');\n if (route.balanceCredits !== undefined && typeof route.balanceCredits !== 'boolean') throw new Error(`Invalid balanceCredits flag in ${alias}`);\n if (route.freeOnly && route.balanceCredits === true) throw new Error('Free \u8DEF\u7531\u4E0D\u4F7F\u7528\u79EF\u5206\u5747\u8861\u5207\u6362');\n if (route.discountOrder !== undefined && typeof route.discountOrder !== 'boolean') throw new Error(`Invalid discountOrder flag in ${alias}`);\n if (route.freeOnly && route.discountOrder === true) throw new Error('Free \u8DEF\u7531\u4E0D\u4F7F\u7528\u79EF\u5206\u6298\u6263\u6392\u5E8F');\n if (route.creditBalanceThreshold !== undefined && (typeof route.creditBalanceThreshold !== 'number' || !Number.isFinite(route.creditBalanceThreshold) || route.creditBalanceThreshold <= 0)) throw new Error(`Invalid credit balance threshold in ${alias}`);\n if (route.preferExpiringCredits !== undefined && typeof route.preferExpiringCredits !== 'boolean') throw new Error(`Invalid expiring credits flag in ${alias}`);\n if (route.expiringWithinDays !== undefined && (!positive(route.expiringWithinDays) || route.expiringWithinDays > 365)) throw new Error(`Invalid expiry horizon in ${alias}`);\n if (route.strategy !== undefined && !['failover', 'weighted', 'tokens', 'credits'].includes(route.strategy)) throw new Error(`Invalid strategy in ${alias}`);\n for (const target of route.targets) {\n if (!object(target)) throw new Error(`Invalid target in ${alias}`);\n if (target.weight !== undefined && (!positive(target.weight) || target.weight > 1000)) throw new Error(`Invalid target weight in ${alias}`);\n if (target.tokenBudget !== undefined && !positive(target.tokenBudget)) throw new Error(`Invalid token budget in ${alias}`);\n if (target.creditBudget !== undefined && (typeof target.creditBudget !== 'number' || !Number.isFinite(target.creditBudget) || target.creditBudget <= 0)) throw new Error(`Invalid credit budget in ${alias}`);\n if (route.strategy === 'tokens' && !positive(target.tokenBudget)) throw new Error(`Route ${alias} needs token budgets`);\n if (route.strategy === 'credits' && !(target.creditBudget > 0)) throw new Error(`Route ${alias} needs credit budgets`);\n if (!object(target) || !PROVIDERS.includes(target.provider) || (target.model !== undefined && !nonempty(target.model))) throw new Error(`Invalid target in ${alias}`);\n if (target.models !== undefined && (!Array.isArray(target.models) || !target.models.length || target.models.length > 20 || !target.models.every(nonempty))) throw new Error(`Invalid target models in ${alias}`);\n if (target.model !== undefined && target.models !== undefined) throw new Error(`Choose model or models in ${alias}`);\n if (target.account !== undefined && !accounts.some(a => a.id === target.account && a.provider === target.provider)) throw new Error(`Unknown target account in ${alias}`);\n if (!target.model && !target.models && alias !== 'ds4.1f' && !route.freeOnly) throw new Error(`Route ${alias} requires explicit target model ids`);\n }\n }\n const models = raw.models ?? {};\n if (!object(models)) throw new Error('Models must be an object');\n for (const [provider, preferences] of Object.entries(models)) {\n if (!PROVIDERS.includes(provider) || !object(preferences)) throw new Error('Invalid model provider');\n for (const [id, preference] of Object.entries(preferences)) {\n if (!nonempty(id) || id.length > 256 || !object(preference)\n || (preference.name !== undefined && (!nonempty(preference.name) || preference.name.length > 200))\n || (preference.visible !== undefined && typeof preference.visible !== 'boolean')\n || (preference.contextWindow !== undefined && preference.contextWindow !== null && !positive(preference.contextWindow))\n || (preference.supportsImages !== undefined && typeof preference.supportsImages !== 'boolean')\n || (preference.reasoningEffort !== undefined && preference.reasoningEffort !== null && !REASONING_EFFORTS.includes(preference.reasoningEffort))) throw new Error('Invalid model preference');\n }\n }\n const modelVisibility = raw.modelVisibility ?? {};\n if (!object(modelVisibility) || Object.entries(modelVisibility).some(([provider, visible]) => !PROVIDERS.includes(provider) || typeof visible !== 'boolean')) throw new Error('Invalid modelVisibility');\n for (const key of ['cooldownMs', 'requestTimeoutMs', 'catalogTtlMs']) if (raw[key] !== undefined && !positive(raw[key])) throw new Error(`Invalid ${key}`);\n if (raw.retryServerErrors !== undefined && typeof raw.retryServerErrors !== 'boolean') throw new Error('Invalid retryServerErrors');\n if (raw.sidebarUsage !== undefined && typeof raw.sidebarUsage !== 'boolean') throw new Error('\u4FA7\u680F\u7528\u91CF\u5F00\u5173\u5FC5\u987B\u662F\u5E03\u5C14\u503C');\n if (raw.ignoredLocalAccounts !== undefined && (!Array.isArray(raw.ignoredLocalAccounts) || raw.ignoredLocalAccounts.some(k => typeof k !== 'string' || k.length > 1024))) throw new Error('Invalid ignoredLocalAccounts');\n if (raw.seenRoutePresets !== undefined && (!Array.isArray(raw.seenRoutePresets) || raw.seenRoutePresets.length > 500\n || raw.seenRoutePresets.some(id => typeof id !== 'string' || !/^[a-zA-Z0-9_.-]{1,128}$/.test(id)))) throw new Error('Invalid seenRoutePresets');\n if (raw.usageRetentionDays !== undefined && (!positive(raw.usageRetentionDays) || raw.usageRetentionDays > 365)) throw new Error('Token \u660E\u7EC6\u4FDD\u7559\u5929\u6570\u5FC5\u987B\u4E3A 1\u2013365 \u7684\u6574\u6570');\n const checkinSchedule = raw.checkinSchedule ?? { mode: 'scheduled', time: '10:05' };\n if (!object(checkinSchedule) || !['startup', 'scheduled'].includes(checkinSchedule.mode)\n || !/^([01]\\d|2[0-3]):[0-5]\\d$/.test(checkinSchedule.time ?? '')\n || Object.keys(checkinSchedule).some(k => !['mode', 'time'].includes(k))) throw new Error('\u7B7E\u5230\u8BA1\u5212\u5FC5\u987B\u9009\u62E9\u542F\u52A8\u6216\u5B9A\u65F6\uFF0C\u5E76\u586B\u5199\u6709\u6548\u7684\u5317\u4EAC\u65F6\u95F4\uFF08HH:mm\uFF09');\n return { ...raw, accounts, routes, models, modelVisibility, cooldownMs: raw.cooldownMs ?? 60000,\n checkinSchedule: { ...checkinSchedule }, sidebarUsage: raw.sidebarUsage ?? true,\n requestTimeoutMs: raw.requestTimeoutMs ?? 300000, catalogTtlMs: raw.catalogTtlMs ?? 300000,\n retryServerErrors: raw.retryServerErrors ?? false, usageRetentionDays: raw.usageRetentionDays ?? 30 };\n}\nexport async function readConfig(file) {\n return validateConfig(JSON.parse(await readFile(file, 'utf8')), resolve(file));\n}\nexport async function ensureConfig(file) {\n try {\n const raw = JSON.parse(await readFile(file, 'utf8')), config = validateConfig(raw, resolve(file));\n if (upgradeRoutePresets(raw) === raw) return config;\n } catch (error) { if (error.code !== 'ENOENT') throw error; }\n await mkdir(dirname(file), { recursive: true, mode: 0o700 });\n return withFileLock(file, async () => {\n let raw, created = false;\n try { raw = JSON.parse(await readFile(file, 'utf8')); } catch (error) {\n if (error.code !== 'ENOENT') throw error;\n raw = { accounts: [], routes: ROUTE_PRESETS }; created = true;\n }\n validateConfig(raw, resolve(file));\n const next = upgradeRoutePresets(raw), config = validateConfig(next, resolve(file));\n if (created || next !== raw) await writePrivateJson(file, next);\n return config;\n }, { waitMs: 30000 });\n}\nexport async function writePrivateJson(file, value) {\n await mkdir(dirname(file), { recursive: true, mode: 0o700 });\n const temp = `${file}.${randomUUID()}.tmp`;\n await writeFile(temp, `${JSON.stringify(value, null, 2)}\\n`, { mode: 0o600, flag: 'wx' });\n await rename(temp, file);\n await chmod(file, 0o600);\n}\n"],
5
- "mappings": ";AAAO,IAAM,oBAAoB,CAAC,OAAO,WAAW,OAAO,UAAU,QAAQ,SAAS,KAAK;AAGpF,SAAS,eAAe,OAAO,UAAU;AAC9C,QAAM,IAAI,OAAO;AACjB,MAAI,CAAC,KAAM,EAAE,aAAa,QAAQ,CAAC,MAAM,QAAQ,EAAE,SAAS,EAAI,QAAO,CAAC;AACxE,QAAM,WAAW,EAAE,oBAAoB,EAAE,aAAa,CAAC;AACvD,QAAM,UAAU,EAAE,uBAAuB,QAAQ,SAAS,SAAS,KAAK;AACxE,QAAM,MAAM,WAAW,EAAE,aAAa,eAAe,EAAE,kBAAkB;AACzE,SAAO,kBAAkB,OAAO,OAAK,MAAM,QAAQ,MAAM,SAAS,SAAS,CAAC,CAA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