dsh-model-groups 0.3.6 → 0.3.8
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/README.md +49 -168
- package/docs/images/add-key-configuration.webp +0 -0
- package/docs/images/collapsed-key-configurations.webp +0 -0
- package/docs/images/key-configuration.webp +0 -0
- package/docs/images/multi-key-management.webp +0 -0
- package/docs/images/provider-multi-key-toggle.webp +0 -0
- package/docs/maintenance.md +47 -0
- package/lib/client.js +17 -14
- package/native/pi-ai.patch.json +735 -17
- package/package.json +11 -3
- package/src/client.js +2 -2
- package/src/maintenance-state.js +2 -2
- package/src/settings-page.js +12 -9
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-model-groups",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "DSH
|
|
3
|
+
"version": "0.3.8",
|
|
4
|
+
"description": "在 DSH 网页端按供应商和密钥配置选择模型,并为同一供应商的不同密钥分别设置模型和 API 协议。支持 DSH 0.2.2-rc.1。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -12,7 +12,13 @@
|
|
|
12
12
|
"bugs": {
|
|
13
13
|
"url": "https://github.com/betsunninda9-lgtm/dsh-model-groups/issues"
|
|
14
14
|
},
|
|
15
|
-
"keywords": [
|
|
15
|
+
"keywords": [
|
|
16
|
+
"dsh",
|
|
17
|
+
"deepseek-harness",
|
|
18
|
+
"models",
|
|
19
|
+
"multi-key",
|
|
20
|
+
"model-picker"
|
|
21
|
+
],
|
|
16
22
|
"publishConfig": {
|
|
17
23
|
"access": "public",
|
|
18
24
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -32,6 +38,8 @@
|
|
|
32
38
|
"!scripts/pi-ai-protocol.mjs",
|
|
33
39
|
"cordis.patch.yml",
|
|
34
40
|
"README.md",
|
|
41
|
+
"docs/maintenance.md",
|
|
42
|
+
"docs/images/*.webp",
|
|
35
43
|
"LICENSE"
|
|
36
44
|
],
|
|
37
45
|
"engines": {
|
package/src/client.js
CHANGED
|
@@ -21,8 +21,8 @@ export function apply(ctx) {
|
|
|
21
21
|
statusNotice.setAttribute('role', 'status');
|
|
22
22
|
statusNotice.style.cssText = 'position:fixed;bottom:16px;right:16px;max-width:min(360px,80vw);z-index:1000;background:var(--dsw-alias-bg-base,#fff);color:var(--dsw-alias-label-primary,#222);padding:12px;border:1px solid currentColor;border-radius:8px;box-sizing:border-box;pointer-events:none;';
|
|
23
23
|
statusNotice.textContent = status.failed
|
|
24
|
-
? '
|
|
25
|
-
: '
|
|
24
|
+
? '无法检查多密钥功能所需的 DSH 文件。请打开「设置 → 模型分组」查看详情,不要手动覆盖文件。'
|
|
25
|
+
: 'DSH 程序文件已更新。请先保存草稿,再重启 DSH 引擎并刷新网页。重启前请暂缓修改模型设置。';
|
|
26
26
|
document.body.appendChild(statusNotice);
|
|
27
27
|
}).catch(() => {});
|
|
28
28
|
ctx.on('dispose', () => { statusDisposed = true; statusNotice?.remove(); });
|
package/src/maintenance-state.js
CHANGED
|
@@ -69,8 +69,8 @@ export function maintenanceBlockerText(blocker) {
|
|
|
69
69
|
inspection_unknown: '无法确认运行状态,请先停止任务并使用安装诊断排查。',
|
|
70
70
|
profile_unknown: '无法确认当前配置档,不会执行维护。',
|
|
71
71
|
cross_profile_bundle: '其他配置档也在使用此插件,请先处理跨配置档依赖。',
|
|
72
|
-
alias_dependency: '
|
|
73
|
-
key_config_dependency: '
|
|
72
|
+
alias_dependency: '仍有会话或设置在使用多密钥模型。请先切换为普通模型;插件不会自动转换。',
|
|
73
|
+
key_config_dependency: '仍有供应商启用了多密钥。请先在「设置 → 模型」中关闭对应开关并保存;已保存的密钥会保留,配置不会自动转换。',
|
|
74
74
|
expression_unknown: '存在无法安全判断的配置表达式,请先人工检查配置。',
|
|
75
75
|
other_process: '其他引擎进程可能正在使用补丁,请先停止相关进程。',
|
|
76
76
|
};
|
package/src/settings-page.js
CHANGED
|
@@ -27,15 +27,15 @@ export function ModelGroupsSettingsPage() {
|
|
|
27
27
|
catch { setCopyStatus('无法复制,请检查浏览器剪贴板权限。'); }
|
|
28
28
|
};
|
|
29
29
|
return h('section', { className: 'mg-maintenance', 'aria-label': '模型分组设置', 'aria-busy': state.busy },
|
|
30
|
-
h('h2', null, '
|
|
31
|
-
h('p', null, '
|
|
32
|
-
snapshot?.pluginVersion && h('p', { className: 'mg-maintenance-help' },
|
|
30
|
+
h('h2', null, '多密钥管理'),
|
|
31
|
+
h('p', null, '在这里启用、更新或关闭多密钥。如果只想按供应商浏览模型,无需启用多密钥。'),
|
|
32
|
+
snapshot?.pluginVersion && h('p', { className: 'mg-maintenance-help' }, `插件 ${snapshot.pluginVersion} · DSH ${snapshot.compatibility?.hostVersion ?? '版本未确认'}`),
|
|
33
33
|
h('section', { className: 'mg-maintenance-card', 'aria-label': '当前状态' },
|
|
34
34
|
h('div', { className: 'mg-maintenance-row' }, h('h3', null, '当前状态'), h('button', { type: 'button', disabled: state.busy, onClick: refresh }, state.busy ? '处理中…' : '刷新检查')),
|
|
35
35
|
h('p', { role: 'status', 'aria-live': 'polite', className: 'mg-maintenance-help' }, state.busy ? '正在检查或执行维护,请勿关闭或重复操作。' : snapshot ? statusLabel : '尚无可验证状态,请刷新检查。'),
|
|
36
36
|
state.error && h('p', { role: 'alert', className: 'mg-maintenance-error' }, state.error),
|
|
37
|
-
state.patchedWarning && h('p', { role: 'alert', className: 'mg-maintenance-error' }, '
|
|
38
|
-
snapshot?.restartRequired && h('p', { role: 'status' }, '
|
|
37
|
+
state.patchedWarning && h('p', { role: 'alert', className: 'mg-maintenance-error' }, '从普通插件列表卸载只移除插件,不会还原 DSH 文件。需要卸载时,请使用此页的「关闭并卸载插件」。'),
|
|
38
|
+
snapshot?.restartRequired && h('p', { role: 'status' }, 'DSH 程序文件已更新,需要重启 DSH 引擎,再刷新网页。只刷新网页不会生效。'),
|
|
39
39
|
compatibilityGuidance(snapshot?.compatibility) && h('p', { role: 'status', className: 'mg-maintenance-help' }, compatibilityGuidance(snapshot.compatibility)),
|
|
40
40
|
updatesAvailable && h('p', { role: 'status' }, '多密钥补丁有更新可用;确认后将备份、校验并更新已识别的旧补丁。'),
|
|
41
41
|
snapshot?.phase === 'removed' && !snapshot.versionMismatch && h('p', { role: 'status' }, '卸载已确认:仅清理本插件的两个浏览器显示偏好,密钥、历史和备份均保留。'),
|
|
@@ -48,13 +48,16 @@ export function ModelGroupsSettingsPage() {
|
|
|
48
48
|
!anyAllowed && h('p', null, '请刷新检查或处理上方操作限制。检查提醒本身不会禁用按钮。'),
|
|
49
49
|
pending && h('div', { role: 'dialog', 'aria-labelledby': confirmationId, 'aria-describedby': `${confirmationId}-help`, className: 'mg-maintenance-dialog' },
|
|
50
50
|
h('h3', { id: confirmationId }, `确认${actions.find(([action]) => action === pending)[1]}?`),
|
|
51
|
-
h('p', { id: `${confirmationId}-help` }, pending === 'apply'
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
h('p', { id: `${confirmationId}-help` }, pending === 'apply'
|
|
52
|
+
? `插件会检查并备份 DSH 程序文件,再${updatesAvailable ? '更新多密钥补丁' : '启用多密钥'}。不会自动切换模型。`
|
|
53
|
+
: '插件会还原 DSH 程序文件,保留密钥、配置和聊天记录。请先将仍使用多密钥的会话和默认模型改为普通模型;残留的多密钥配置可能影响 DSH 启动。'),
|
|
54
|
+
h('p', null, '请先保存草稿并停止所有任务。完成后按提示重启 DSH 引擎,再刷新网页。'),
|
|
55
|
+
snapshot?.warnings.length > 0 && h('p', null, '部分使用情况无法检查,请先阅读页面中的检查详情。'),
|
|
56
|
+
pending === 'restore-and-uninstall' && h('p', null, '还原成功后才会卸载插件。确认卸载后会清除本浏览器中的模型菜单显示偏好;连接中断不代表卸载成功。'),
|
|
54
57
|
h('div', { className: 'mg-maintenance-actions' }, h('button', { type: 'button', onClick: () => setPending(null) }, '取消'), h('button', { type: 'button', disabled: state.busy || !maintenanceCanAction(snapshot, pending), onClick: confirm }, '确认执行')))),
|
|
55
58
|
h('details', { className: 'mg-maintenance-card' },
|
|
56
59
|
h('summary', null, '检查详情与脱敏诊断'),
|
|
57
|
-
h('p', null, '
|
|
60
|
+
h('p', null, '这里能检查 DSH 文件,但无法确认正在运行的引擎是否已加载更新。确认操作后会再次检查;如果状态变化,需要重新确认。无法识别的文件不会被覆盖。'),
|
|
58
61
|
snapshot?.warnings.length > 0 && h('ul', null, ...snapshot.warnings.map((warning, index) => h('li', { key: index }, maintenanceWarningText(warning)))),
|
|
59
62
|
snapshot && h('ul', null, ...snapshot.patches.map((patch, index) => h('li', { key: index }, `宿主文件 ${index + 1}:${patchLabels[patch.state]}${patch.applySupported === false ? '(此构建不支持新版补丁)' : patch.updateAvailable ? '(更新可用)' : ''}`))),
|
|
60
63
|
snapshot?.compatibility && h('ul', null, ...snapshot.compatibility.files.map(item => h('li', { key: item.id }, `${item.id} · ${item.installedVersion ?? '版本未知'} · ${item.code} · SHA-256 ${item.observedSha256 ?? '不可读取'}`))),
|