dsh-unified-router 0.7.1 → 0.7.2
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/lib/backend.js +11 -8
- package/lib/channel-specs.js +1 -1
- package/lib/client.js +8 -8
- package/package.json +1 -1
package/lib/backend.js
CHANGED
|
@@ -3206,12 +3206,9 @@ function raccoonSupportsImage(modelId, tags) {
|
|
|
3206
3206
|
}
|
|
3207
3207
|
var RACCOON = {
|
|
3208
3208
|
id: "raccoon",
|
|
3209
|
-
// ⚠️
|
|
3210
|
-
//
|
|
3211
|
-
|
|
3212
|
-
// ⚠️ 也不要用『Raccoon Work (商汤)』—— 那个词组在 Channel Pack 的 provider
|
|
3213
|
-
// Tab 里**触发换行**(用户报障)。
|
|
3214
|
-
displayName: "Raccoon \u514D\u8D39\u7248",
|
|
3209
|
+
// ⚠️ 展示名必须能一眼区分体验版 / 订阅版,且避免用「免费版」误导模型或用户以为零消耗。
|
|
3210
|
+
// 合并统一模式下由宿主挂载层覆写为不带后缀的 `Raccoon`。
|
|
3211
|
+
displayName: "Raccoon \u4F53\u9A8C\u7248",
|
|
3215
3212
|
apiBase: RACCOON_API_BASE,
|
|
3216
3213
|
authApiPrefix: "/api/web/auth/v1",
|
|
3217
3214
|
llmApiPrefix: "/api/web/llm/v2",
|
|
@@ -14093,7 +14090,13 @@ function mountRaccoon({ ctx, pool, throwIfAllAccountsRateLimited, readImage, rea
|
|
|
14093
14090
|
if (credential === void 0) return [];
|
|
14094
14091
|
return await raccoonPro.fetchModelsWithCredential(credential);
|
|
14095
14092
|
};
|
|
14096
|
-
const
|
|
14093
|
+
const raccoonProduct = {
|
|
14094
|
+
...RACCOON,
|
|
14095
|
+
get displayName() {
|
|
14096
|
+
return unified() ? "Raccoon" : RACCOON.displayName;
|
|
14097
|
+
}
|
|
14098
|
+
};
|
|
14099
|
+
const raccoonAdapter = mountRaccoon2(raccoonProduct, raccoon, "free", proRemoteFetch);
|
|
14097
14100
|
const raccoonProAdapter = mountRaccoon2(
|
|
14098
14101
|
RACCOON_PRO,
|
|
14099
14102
|
raccoonPro,
|
|
@@ -14215,7 +14218,7 @@ var CHANNEL_SPECS = Object.freeze([
|
|
|
14215
14218
|
// 只有代表账号池的 `raccoon` 置 claim —— `raccoon-pro` 再跑一次会重复调度同一账号。
|
|
14216
14219
|
Object.freeze({
|
|
14217
14220
|
id: "raccoon",
|
|
14218
|
-
title: "Raccoon \
|
|
14221
|
+
title: "Raccoon \u4F53\u9A8C\u7248",
|
|
14219
14222
|
kind: "pack",
|
|
14220
14223
|
card: true,
|
|
14221
14224
|
claim: true,
|
package/lib/channel-specs.js
CHANGED
package/lib/client.js
CHANGED
|
@@ -885,7 +885,7 @@ const CHANNEL_SPECS = Object.freeze([
|
|
|
885
885
|
// 只有代表账号池的 `raccoon` 置 claim —— `raccoon-pro` 再跑一次会重复调度同一账号。
|
|
886
886
|
Object.freeze({
|
|
887
887
|
id: 'raccoon',
|
|
888
|
-
title: 'Raccoon
|
|
888
|
+
title: 'Raccoon 体验版',
|
|
889
889
|
kind: 'pack',
|
|
890
890
|
card: true,
|
|
891
891
|
claim: true,
|
|
@@ -4264,10 +4264,10 @@ function packSettings(provider) {
|
|
|
4264
4264
|
id: accountId, name: nickname, enabled,
|
|
4265
4265
|
toggle: ['save', accountId, nickname, !enabled],
|
|
4266
4266
|
tags: [
|
|
4267
|
-
//
|
|
4267
|
+
// 统一模型开关打开后不再区分体验/订阅:合并的意义就是「一个模型面」,
|
|
4268
4268
|
// 再挂套餐标签会让人以为还要按套餐挑账号。关闭时照旧按套餐标注。
|
|
4269
4269
|
caps.accountPlan && !unifiedModelsOn(state)
|
|
4270
|
-
&& (plan === 'pro' ? ['订阅', 'info'] : plan === 'free' ? ['
|
|
4270
|
+
&& (plan === 'pro' ? ['订阅', 'info'] : plan === 'free' ? ['体验版', 'success'] : ['套餐未知', 'warn']),
|
|
4271
4271
|
!enabled && ['已停用'],
|
|
4272
4272
|
account.expiresAt > 0 && account.expiresAt <= Date.now() && ['凭据过期', 'warn'],
|
|
4273
4273
|
limited > 0 && [`受限 ${limited}`, 'warn'],
|
|
@@ -4343,13 +4343,13 @@ function packSettings(provider) {
|
|
|
4343
4343
|
toggleLabel: state.statuses[side.id]?.closed !== false ? (family ? '打开模型提供方' : '打开渠道') : (family ? '关闭模型提供方' : '关闭渠道'),
|
|
4344
4344
|
}))),
|
|
4345
4345
|
...(caps.unifiedModels && state.automation?.unifiedModelProviders?.includes(id) ? [{
|
|
4346
|
-
id: 'unified-models', name: '
|
|
4347
|
-
//
|
|
4346
|
+
id: 'unified-models', name: '统一体验与订阅模型',
|
|
4347
|
+
// 合并后是一个模型面:说明按「谁有额度用谁」讲,不再强调体验/订阅的先后,
|
|
4348
4348
|
// 否则用户会以为还要按套餐挑账号。
|
|
4349
4349
|
meta: '合并为一个模型面 · 额度用尽自动切换账号',
|
|
4350
4350
|
enabled: state.automation?.config?.raccoonUnifiedModels === true,
|
|
4351
4351
|
toggle: ['setAutomationConfig', { raccoonUnifiedModels: !(state.automation?.config?.raccoonUnifiedModels === true) }],
|
|
4352
|
-
toggleLabel: '
|
|
4352
|
+
toggleLabel: '统一体验与订阅模型',
|
|
4353
4353
|
}] : []),
|
|
4354
4354
|
]
|
|
4355
4355
|
},
|
|
@@ -4843,7 +4843,7 @@ const raccoon = {
|
|
|
4843
4843
|
title: 'Raccoon',
|
|
4844
4844
|
pack: true,
|
|
4845
4845
|
family: [
|
|
4846
|
-
{ id: 'raccoon', title: '
|
|
4846
|
+
{ id: 'raccoon', title: '体验模型' },
|
|
4847
4847
|
{ id: 'raccoon-pro', title: '订阅模型' },
|
|
4848
4848
|
],
|
|
4849
4849
|
// 两个能力位是**不同维度**,不要合并:
|
|
@@ -6121,7 +6121,7 @@ function quotaPillData(id, type, snapshot, selection, viewedId, model) {
|
|
|
6121
6121
|
const packages = bal?.packages ?? []
|
|
6122
6122
|
const shownPackages = displayCreditPackages(packages)
|
|
6123
6123
|
return { id: account.id, label: account.nickname, at: bal?.updatedAt, stale: bal?.stale,
|
|
6124
|
-
plan: account.plan === 'free' ? '
|
|
6124
|
+
plan: unified ? '' : (account.plan === 'free' ? '体验版' : account.plan === 'pro' ? '订阅' : ''),
|
|
6125
6125
|
amount: bal?.total ?? null, unit: '积分', packages, details: shownPackages.map(pkg => ({
|
|
6126
6126
|
label: pkg.name || '额度包', value: pkg.remaining === null ? '' : quotaValue(pkg.remaining, pkg.unit),
|
|
6127
6127
|
expires: pkg.active === false ? null : pkg.expiresAt, note: pkg.active === false ? '已失效' : '',
|