dsh-connect-modelscope-token-plan 0.5.0 → 0.6.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/CHANGELOG.md +244 -208
- package/README.md +3 -1
- package/client.js +152 -29
- package/cordis.patch.yml +36 -5
- package/lib/host-config.js +194 -33
- package/lib/index.js +364 -105
- package/lib/llm-adapter.js +8 -2
- package/locale/en.json +2 -2
- package/locale/zh.json +2 -2
- package/package.json +115 -115
package/lib/llm-adapter.js
CHANGED
|
@@ -558,6 +558,11 @@ function withUsageObserver(inner, sinks, onError) {
|
|
|
558
558
|
* `fs`)的服务解析器。
|
|
559
559
|
* @param {string[]} [options.unavailableModelIds] - 额度耗尽的模型 id,从 offer 里
|
|
560
560
|
* 排除,避免发出注定 429 的请求。
|
|
561
|
+
* @param {object} [options.maxTokensOverrides] - 逐模型输出上限覆盖(id → tokens),
|
|
562
|
+
* 归一后的 `ResolvedSettings.maxTokensOverrides`。**构造期读入**(apply 时随
|
|
563
|
+
* wiring 一次性 `resolveSettings`,与 `apiBase` 同理):改 patch 要 reload
|
|
564
|
+
* (apply 重跑)才生效,不是下一轮目录轮询。魔搭目录从不声明该字段,所以这是
|
|
565
|
+
* 输出上限唯一的真值来源(见 llm-models.ts 的 `maxTokensFor`)。
|
|
561
566
|
* @param {UsageSinks} [options.usage] - 本地计数的写入口(usage-store 的两条
|
|
562
567
|
* 方法)。**这是面板「今日次数 / 模型分布 / 趋势 / 429 事件流」唯一的生产
|
|
563
568
|
* 者**——probe 那条写入路径已随目录表删除,缺了它四块面板恒为 0 与空。
|
|
@@ -567,12 +572,13 @@ function withUsageObserver(inner, sinks, onError) {
|
|
|
567
572
|
* 应该可见——否则用户发现计数不对时没有任何线索。
|
|
568
573
|
* @returns {{adapter: object, providerIds: string[]}} 适配器与它拥有的 ids。
|
|
569
574
|
*/
|
|
570
|
-
function createModelScopeAdapter({ entries, enabledIds = [], baseUrl, resolveApiKey, get, unavailableModelIds = [], usage, onError }) {
|
|
575
|
+
function createModelScopeAdapter({ entries, enabledIds = [], baseUrl, resolveApiKey, get, unavailableModelIds = [], maxTokensOverrides = {}, usage, onError }) {
|
|
571
576
|
const models = buildDescriptors(entries, {
|
|
572
577
|
providerId: LLM_PROVIDER_ID,
|
|
573
578
|
baseUrl,
|
|
574
579
|
enabledIds,
|
|
575
|
-
unavailableModelIds
|
|
580
|
+
unavailableModelIds,
|
|
581
|
+
maxTokensOverrides
|
|
576
582
|
});
|
|
577
583
|
const built = assemblePiAiAdapter({
|
|
578
584
|
providerId: LLM_PROVIDER_ID,
|
package/locale/en.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
|
-
"title": "ModelScope
|
|
4
|
-
"description": "ModelScope
|
|
3
|
+
"title": "ModelScope Model Access",
|
|
4
|
+
"description": "Register ModelScope's language models and draw tool into DSH with one toggle: image-recognition capability and context windows auto-filled, usable the moment it is registered (both default off); the free-quota panel — official Magicube balance, local call counts, trends, rate-limit events — works even without registering."
|
|
5
5
|
}
|
|
6
6
|
}
|
package/locale/zh.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
|
-
"title": "
|
|
4
|
-
"description": "
|
|
3
|
+
"title": "魔搭模型接入",
|
|
4
|
+
"description": "一键把魔搭(ModelScope)的语言模型与生图工具注册进 DSH:自动填入图片识别能力与上下文窗口,注册即可用(均默认关);不注册也能看免费额度面板:官方魔粒余额、本地调用计数、趋势、限流事件。"
|
|
5
5
|
}
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dsh-connect-modelscope-token-plan",
|
|
3
|
-
"displayName": "DSH Connect ModelScope Token Plan",
|
|
4
|
-
"icon": "./icon.svg",
|
|
5
|
-
"version": "0.
|
|
6
|
-
"homepage": "https://github.com/eghrhegpe/dsh-connect-modelscope-token-plan",
|
|
7
|
-
"bugs": {
|
|
8
|
-
"url": "https://github.com/eghrhegpe/dsh-connect-modelscope-token-plan/issues"
|
|
9
|
-
},
|
|
10
|
-
"author": "eghrhegpe",
|
|
11
|
-
"description": "ModelScope (modelscope.cn)
|
|
12
|
-
"keywords": [
|
|
13
|
-
"dsh-plugin",
|
|
14
|
-
"deepseek-harness",
|
|
15
|
-
"modelscope",
|
|
16
|
-
"token-plan",
|
|
17
|
-
"quota",
|
|
18
|
-
"api-inference"
|
|
19
|
-
],
|
|
20
|
-
"type": "module",
|
|
21
|
-
"main": "./lib/index.js",
|
|
22
|
-
"exports": {
|
|
23
|
-
".": "./lib/index.js",
|
|
24
|
-
"./client": "./client.js",
|
|
25
|
-
"./locale/*.json": "./locale/*.json",
|
|
26
|
-
"./package.json": "./package.json"
|
|
27
|
-
},
|
|
28
|
-
"files": [
|
|
29
|
-
"lib",
|
|
30
|
-
"client.js",
|
|
31
|
-
"icon.svg",
|
|
32
|
-
"locale",
|
|
33
|
-
"assets",
|
|
34
|
-
"cordis.patch.yml",
|
|
35
|
-
"README.md",
|
|
36
|
-
"CHANGELOG.md",
|
|
37
|
-
"LICENSE",
|
|
38
|
-
"screenshots.json"
|
|
39
|
-
],
|
|
40
|
-
"scripts": {
|
|
41
|
-
"typecheck": "tsc -p tsconfig.json",
|
|
42
|
-
"build:client": "tsdown -c tsdown.config.mjs",
|
|
43
|
-
"duplicate-check": "jscpd src --min-tokens 70 --reporters console-full",
|
|
44
|
-
"test": "node test/run-all.mjs",
|
|
45
|
-
"test:mutate": "node tools/dev/mutate.mjs tools/dev/mutate-spec.json",
|
|
46
|
-
"doctor": "node tools/doctor.mjs",
|
|
47
|
-
"doctor:json": "node tools/doctor.mjs --json",
|
|
48
|
-
"build": "tsdown -c tsdown.config.mjs",
|
|
49
|
-
"prepack": "npm run build"
|
|
50
|
-
},
|
|
51
|
-
"dsh": {
|
|
52
|
-
"bundle": {
|
|
53
|
-
"patch": "./cordis.patch.yml"
|
|
54
|
-
},
|
|
55
|
-
"client": {
|
|
56
|
-
"platform": "web",
|
|
57
|
-
"immediately": true,
|
|
58
|
-
"inject": [
|
|
59
|
-
"@deepseek-ai/dsh-client-locale",
|
|
60
|
-
"@deepseek-ai/dsh-client-ui-renderer"
|
|
61
|
-
]
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
"peerDependencies": {
|
|
65
|
-
"@deepseek-ai/cordis": ">=4.0.2 <5.0.0",
|
|
66
|
-
"@deepseek-ai/dsh-client-locale": ">=0.1.5 <0.3",
|
|
67
|
-
"@deepseek-ai/dsh-client-ui-layout": ">=0.1.5 <0.3",
|
|
68
|
-
"@deepseek-ai/dsh-client-ui-renderer": ">=0.1.5 <0.3",
|
|
69
|
-
"@deepseek-ai/dsh-credentials": ">=0.1.5 <0.3",
|
|
70
|
-
"@deepseek-ai/dsh-home-paths": ">=0.1.5 <0.3",
|
|
71
|
-
"@deepseek-ai/dsh-host-webserver": ">=0.1.5 <0.3",
|
|
72
|
-
"@deepseek-ai/dsh-llm": ">=0.1.5 <0.3",
|
|
73
|
-
"@deepseek-ai/dsh-llm-pi-ai": ">=0.1.5 <0.3",
|
|
74
|
-
"@deepseek-ai/dsh-settings": ">=0.1.5 <0.3",
|
|
75
|
-
"@deepseek-ai/dsh-tools": ">=0.1.5 <0.3",
|
|
76
|
-
"@deepseek-ai/schemastery": "^3.18.2",
|
|
77
|
-
"@earendil-works/pi-ai": "^0.85.1"
|
|
78
|
-
},
|
|
79
|
-
"peerDependenciesMeta": {
|
|
80
|
-
"@deepseek-ai/cordis": { "optional": true },
|
|
81
|
-
"@deepseek-ai/dsh-client-locale": { "optional": true },
|
|
82
|
-
"@deepseek-ai/dsh-client-ui-layout": { "optional": true },
|
|
83
|
-
"@deepseek-ai/dsh-client-ui-renderer": { "optional": true },
|
|
84
|
-
"@deepseek-ai/dsh-credentials": { "optional": true },
|
|
85
|
-
"@deepseek-ai/dsh-home-paths": { "optional": true },
|
|
86
|
-
"@deepseek-ai/dsh-host-webserver": { "optional": true },
|
|
87
|
-
"@deepseek-ai/dsh-llm": { "optional": true },
|
|
88
|
-
"@deepseek-ai/dsh-llm-pi-ai": { "optional": true },
|
|
89
|
-
"@deepseek-ai/dsh-settings": { "optional": true },
|
|
90
|
-
"@deepseek-ai/dsh-tools": { "optional": true },
|
|
91
|
-
"@deepseek-ai/schemastery": { "optional": true },
|
|
92
|
-
"@earendil-works/pi-ai": { "optional": true }
|
|
93
|
-
},
|
|
94
|
-
"engines": {
|
|
95
|
-
"node": "^22.19.0 || >=24.0.0"
|
|
96
|
-
},
|
|
97
|
-
"repository": {
|
|
98
|
-
"type": "git",
|
|
99
|
-
"url": "git+https://github.com/eghrhegpe/dsh-connect-modelscope-token-plan.git"
|
|
100
|
-
},
|
|
101
|
-
"license": "MIT",
|
|
102
|
-
"devDependencies": {
|
|
103
|
-
"@types/node": "^22.19.0",
|
|
104
|
-
"jscpd": "^5.4.0",
|
|
105
|
-
"jsdom": "^30.1.3",
|
|
106
|
-
"react": "18.3.1",
|
|
107
|
-
"react-dom": "18.3.1",
|
|
108
|
-
"tsdown": "0.23.0",
|
|
109
|
-
"typescript": "5.9.3"
|
|
110
|
-
},
|
|
111
|
-
"overrides": {
|
|
112
|
-
"rolldown": "1.2.12",
|
|
113
|
-
"rolldown-plugin-dts": "0.28.6"
|
|
114
|
-
}
|
|
115
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-connect-modelscope-token-plan",
|
|
3
|
+
"displayName": "DSH Connect ModelScope Token Plan",
|
|
4
|
+
"icon": "./icon.svg",
|
|
5
|
+
"version": "0.6.2",
|
|
6
|
+
"homepage": "https://github.com/eghrhegpe/dsh-connect-modelscope-token-plan",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/eghrhegpe/dsh-connect-modelscope-token-plan/issues"
|
|
9
|
+
},
|
|
10
|
+
"author": "eghrhegpe",
|
|
11
|
+
"description": "ModelScope (modelscope.cn) access bundle for DSH: opt-in registration of ModelScope language models and draw tool as an OpenAI-compatible provider (vision and context windows auto-filled, usable the moment registered), plus a free-quota panel with the official Magicube balance, per-model local call counts, daily trends and 429 event list — usable without registering.",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"dsh-plugin",
|
|
14
|
+
"deepseek-harness",
|
|
15
|
+
"modelscope",
|
|
16
|
+
"token-plan",
|
|
17
|
+
"quota",
|
|
18
|
+
"api-inference"
|
|
19
|
+
],
|
|
20
|
+
"type": "module",
|
|
21
|
+
"main": "./lib/index.js",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": "./lib/index.js",
|
|
24
|
+
"./client": "./client.js",
|
|
25
|
+
"./locale/*.json": "./locale/*.json",
|
|
26
|
+
"./package.json": "./package.json"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"lib",
|
|
30
|
+
"client.js",
|
|
31
|
+
"icon.svg",
|
|
32
|
+
"locale",
|
|
33
|
+
"assets",
|
|
34
|
+
"cordis.patch.yml",
|
|
35
|
+
"README.md",
|
|
36
|
+
"CHANGELOG.md",
|
|
37
|
+
"LICENSE",
|
|
38
|
+
"screenshots.json"
|
|
39
|
+
],
|
|
40
|
+
"scripts": {
|
|
41
|
+
"typecheck": "tsc -p tsconfig.json",
|
|
42
|
+
"build:client": "tsdown -c tsdown.config.mjs",
|
|
43
|
+
"duplicate-check": "jscpd src --min-tokens 70 --reporters console-full",
|
|
44
|
+
"test": "node test/run-all.mjs",
|
|
45
|
+
"test:mutate": "node tools/dev/mutate.mjs tools/dev/mutate-spec.json",
|
|
46
|
+
"doctor": "node tools/doctor.mjs",
|
|
47
|
+
"doctor:json": "node tools/doctor.mjs --json",
|
|
48
|
+
"build": "tsdown -c tsdown.config.mjs",
|
|
49
|
+
"prepack": "npm run build"
|
|
50
|
+
},
|
|
51
|
+
"dsh": {
|
|
52
|
+
"bundle": {
|
|
53
|
+
"patch": "./cordis.patch.yml"
|
|
54
|
+
},
|
|
55
|
+
"client": {
|
|
56
|
+
"platform": "web",
|
|
57
|
+
"immediately": true,
|
|
58
|
+
"inject": [
|
|
59
|
+
"@deepseek-ai/dsh-client-locale",
|
|
60
|
+
"@deepseek-ai/dsh-client-ui-renderer"
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"peerDependencies": {
|
|
65
|
+
"@deepseek-ai/cordis": ">=4.0.2 <5.0.0",
|
|
66
|
+
"@deepseek-ai/dsh-client-locale": ">=0.1.5 <0.3",
|
|
67
|
+
"@deepseek-ai/dsh-client-ui-layout": ">=0.1.5 <0.3",
|
|
68
|
+
"@deepseek-ai/dsh-client-ui-renderer": ">=0.1.5 <0.3",
|
|
69
|
+
"@deepseek-ai/dsh-credentials": ">=0.1.5 <0.3",
|
|
70
|
+
"@deepseek-ai/dsh-home-paths": ">=0.1.5 <0.3",
|
|
71
|
+
"@deepseek-ai/dsh-host-webserver": ">=0.1.5 <0.3",
|
|
72
|
+
"@deepseek-ai/dsh-llm": ">=0.1.5 <0.3",
|
|
73
|
+
"@deepseek-ai/dsh-llm-pi-ai": ">=0.1.5 <0.3",
|
|
74
|
+
"@deepseek-ai/dsh-settings": ">=0.1.5 <0.3",
|
|
75
|
+
"@deepseek-ai/dsh-tools": ">=0.1.5 <0.3",
|
|
76
|
+
"@deepseek-ai/schemastery": "^3.18.2",
|
|
77
|
+
"@earendil-works/pi-ai": "^0.85.1"
|
|
78
|
+
},
|
|
79
|
+
"peerDependenciesMeta": {
|
|
80
|
+
"@deepseek-ai/cordis": { "optional": true },
|
|
81
|
+
"@deepseek-ai/dsh-client-locale": { "optional": true },
|
|
82
|
+
"@deepseek-ai/dsh-client-ui-layout": { "optional": true },
|
|
83
|
+
"@deepseek-ai/dsh-client-ui-renderer": { "optional": true },
|
|
84
|
+
"@deepseek-ai/dsh-credentials": { "optional": true },
|
|
85
|
+
"@deepseek-ai/dsh-home-paths": { "optional": true },
|
|
86
|
+
"@deepseek-ai/dsh-host-webserver": { "optional": true },
|
|
87
|
+
"@deepseek-ai/dsh-llm": { "optional": true },
|
|
88
|
+
"@deepseek-ai/dsh-llm-pi-ai": { "optional": true },
|
|
89
|
+
"@deepseek-ai/dsh-settings": { "optional": true },
|
|
90
|
+
"@deepseek-ai/dsh-tools": { "optional": true },
|
|
91
|
+
"@deepseek-ai/schemastery": { "optional": true },
|
|
92
|
+
"@earendil-works/pi-ai": { "optional": true }
|
|
93
|
+
},
|
|
94
|
+
"engines": {
|
|
95
|
+
"node": "^22.19.0 || >=24.0.0"
|
|
96
|
+
},
|
|
97
|
+
"repository": {
|
|
98
|
+
"type": "git",
|
|
99
|
+
"url": "git+https://github.com/eghrhegpe/dsh-connect-modelscope-token-plan.git"
|
|
100
|
+
},
|
|
101
|
+
"license": "MIT",
|
|
102
|
+
"devDependencies": {
|
|
103
|
+
"@types/node": "^22.19.0",
|
|
104
|
+
"jscpd": "^5.4.0",
|
|
105
|
+
"jsdom": "^30.1.3",
|
|
106
|
+
"react": "18.3.1",
|
|
107
|
+
"react-dom": "18.3.1",
|
|
108
|
+
"tsdown": "0.23.0",
|
|
109
|
+
"typescript": "5.9.3"
|
|
110
|
+
},
|
|
111
|
+
"overrides": {
|
|
112
|
+
"rolldown": "1.2.12",
|
|
113
|
+
"rolldown-plugin-dts": "0.28.6"
|
|
114
|
+
}
|
|
115
|
+
}
|