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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-model-groups",
3
- "version": "0.3.6",
4
- "description": "DSH 网页模型选择器:供应商与密钥配置分层折叠、多密钥独立协议与安全直升维护。支持 DSH 0.2.2-rc.1。",
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": ["dsh", "deepseek-harness", "models", "multi-key", "model-picker"],
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
- ? '多密钥自动补丁未完成。请回到 App 对话查看引擎日志或运行安装诊断,勿强制覆盖。请暂勿编辑模型配置;可到「设置 → 模型分组」检查并安全恢复。'
25
- : '多密钥补丁已自动安装。请先保存其他页面的草稿,再到 App 重启原引擎并刷新此网页。请暂勿编辑模型配置,避免新旧模块混用;维护入口仍可使用。';
24
+ ? '无法检查多密钥功能所需的 DSH 文件。请打开「设置 → 模型分组」查看详情,不要手动覆盖文件。'
25
+ : 'DSH 程序文件已更新。请先保存草稿,再重启 DSH 引擎并刷新网页。重启前请暂缓修改模型设置。';
26
26
  document.body.appendChild(statusNotice);
27
27
  }).catch(() => {});
28
28
  ctx.on('dispose', () => { statusDisposed = true; statusNotice?.remove(); });
@@ -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: '仍有多密钥配置依赖:请先禁用 multiKey 并清理 keyEntries 配置;已保存的密钥会保留。本预览不会自动转换。',
72
+ alias_dependency: '仍有会话或设置在使用多密钥模型。请先切换为普通模型;插件不会自动转换。',
73
+ key_config_dependency: '仍有供应商启用了多密钥。请先在「设置 → 模型」中关闭对应开关并保存;已保存的密钥会保留,配置不会自动转换。',
74
74
  expression_unknown: '存在无法安全判断的配置表达式,请先人工检查配置。',
75
75
  other_process: '其他引擎进程可能正在使用补丁,请先停止相关进程。',
76
76
  };
@@ -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, '选择操作,再确认一次即可。不会调用 AI,不会显示或删除 API 密钥。'),
32
- snapshot?.pluginVersion && h('p', { className: 'mg-maintenance-help' }, `插件后端 ${snapshot.pluginVersion} · 宿主 ${snapshot.compatibility?.hostVersion ?? '版本未确认'}`),
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
- h('p', null, '请先停止所有任务。部分使用情况未能检查不等于安全;检查提醒不会替代您的判断。'),
53
- pending === 'restore-and-uninstall' && h('p', null, '确认原版恢复成功后才卸载插件;只有确认卸载完成才清理本插件的两个浏览器显示偏好。连接中断不代表成功。'),
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 ?? '不可读取'}`))),