dsh-remote-plugin 0.8.0-rc.2 → 0.8.0-rc.4

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/public/index.html CHANGED
@@ -19,6 +19,7 @@
19
19
  <link rel="stylesheet" href="insights.css">
20
20
  <link rel="stylesheet" href="workflow.css">
21
21
  <link rel="stylesheet" href="relay-settings.css">
22
+ <link rel="stylesheet" href="subagents.css">
22
23
  </head>
23
24
  <body>
24
25
  <header class="topbar">
@@ -115,6 +116,7 @@
115
116
  <button id="session-title" class="session-title" type="button" aria-haspopup="dialog" aria-controls="session-info" data-i18n="session.loading">加载中…</button>
116
117
 
117
118
  </div>
119
+ <button id="btn-subagents" class="subagents-entry" type="button" aria-haspopup="dialog" aria-controls="subagent-page" data-i18n="subagent.title">子代理</button>
118
120
  <button id="btn-session-more" class="icon-btn" type="button" aria-haspopup="dialog" aria-controls="session-actions" data-i18n-aria="session.more">⋯</button>
119
121
  <button id="btn-fs-send" class="session-send-btn hidden" type="button">发送</button>
120
122
 
@@ -443,8 +445,8 @@
443
445
  <label class="switch"><input type="checkbox" id="opt-notify"><span class="slider"></span></label>
444
446
  </div>
445
447
  <div class="setting-row">
446
- <div><div class="setting-name" data-i18n="settings.peakRemindTitle">峰谷计费提醒</div><div class="setting-desc" data-i18n="settings.peakRemindDesc">工作日推送峰谷切换;周末全天谷时,仅 9:00 提醒一次(App 内有效)</div></div>
447
- <label class="switch"><input type="checkbox" id="opt-peak-remind"><span class="slider"></span></label>
448
+ <div><div class="setting-name" data-i18n="settings.peakRemindTitle">峰谷计费提醒 · dsh-cost-meter</div><div class="setting-desc" data-i18n="settings.peakRemindDesc">按费用插件的峰谷窗口、节假日、提前量与提醒类型发送 Android 通知。无需保持 DSH 页面打开;请允许通知并将系统省电设为无限制。</div><div id="peak-remind-status" class="setting-desc" role="status"></div></div>
449
+ <label class="switch"><input type="checkbox" id="opt-peak-remind" aria-label="峰谷计费提醒 · dsh-cost-meter"><span class="slider"></span></label>
448
450
  </div>
449
451
  <div class="setting-row">
450
452
  <div><div class="setting-name" data-i18n="settings.testNotifyTitle">测试通知</div><div class="setting-desc" data-i18n="settings.testNotifyDesc">立即排一条 3 秒后的本地通知,用于排查系统通知限制</div></div>
@@ -514,6 +516,8 @@
514
516
  <div class="setting-row">
515
517
  <div><div class="setting-name" data-i18n="settings.updateTitle">检查更新</div><div class="setting-desc" id="update-desc" data-i18n="settings.updateLoading">加载中…</div>
516
518
  <button id="btn-download-update" class="mini-btn hidden" style="margin-top:6px" data-i18n="settings.downloadUpdate">下载并安装更新</button>
519
+ <button id="btn-force-download-update" class="mini-btn" style="margin-top:6px" data-i18n="settings.redownloadApk">重新下载安装包</button>
520
+ <div class="setting-desc expanded" data-i18n="settings.redownloadApkDesc">同版本补丁也可重新下载,以当前主机提供的安装包为准。</div>
517
521
  <div id="update-download-progress" class="update-download-progress hidden">
518
522
  <div id="update-download-status" role="status" aria-live="polite"></div>
519
523
  <progress id="update-download-bar" max="100" aria-label="APK download progress"></progress>
@@ -649,6 +653,12 @@
649
653
  <input id="fb-contact" class="fb-input" maxlength="200" data-i18n-placeholder="feedback.contactPlaceholder" placeholder="联系方式(可选):邮箱 / 微信 / B站 ID">
650
654
  <label class="fb-diagnostics"><input id="fb-include-diagnostics" type="checkbox"> <span data-i18n="feedback.includeDiagnostics">附带兼容性诊断日志(可选)</span><small data-i18n="feedback.diagnosticsPrivacy">仅上传网关/协议版本、接口失败摘要和实时链路状态;不包含令牌、Cookie、对话内容或文件路径。</small></label>
651
655
  <label class="fb-diagnostics"><input id="fb-include-crashes" type="checkbox"> <span data-i18n="feedback.includeCrashes">附带崩溃日志摘要(可选)</span><small data-i18n="feedback.crashPrivacy">默认仅在本机记录。勾选后上传最近 3 条退出、重启和错误位置摘要,不含对话、密钥或完整路径。</small></label>
656
+ <section class="client-diagnostics" aria-label="操作诊断日志">
657
+ <p data-log-label="privacy">操作日志仅保存在此设备,记录操作阶段、耗时、错误位置与连接状态。可复制或导出后自行反馈。</p>
658
+ <details id="fb-client-log-details"><summary data-log-label="details">查看操作诊断日志</summary><pre id="fb-client-log-preview"></pre></details>
659
+ <div class="client-log-actions"><button id="fb-log-preview" type="button" data-log-label="refresh">刷新预览</button><button id="fb-log-copy" type="button" data-log-label="copy">复制日志</button><button id="fb-log-export" type="button" data-log-label="export">导出日志</button><button id="fb-log-clear" type="button" data-log-label="clear">清除日志</button></div>
660
+ <p id="fb-client-log-status" role="status" aria-live="polite"></p>
661
+ </section>
652
662
  <details id="fb-crash-details" class="crash-preview"><summary data-i18n="feedback.crashPreview">查看拟上传的日志摘要</summary><pre id="fb-crash-preview"></pre></details>
653
663
  </div>
654
664
  <div class="modal-actions">
@@ -734,6 +744,14 @@
734
744
  </div>
735
745
  </div>
736
746
 
747
+ <div id="image-lightbox" class="image-lightbox hidden" role="dialog" aria-modal="true" aria-label="图片预览" tabindex="-1">
748
+ <button id="image-lightbox-close" class="image-lightbox-close" type="button" data-image-lightbox-close aria-label="关闭">×</button>
749
+ <div class="image-lightbox-stage" data-image-lightbox-stage>
750
+ <img data-image-lightbox-img alt="" draggable="false">
751
+ </div>
752
+ <div class="image-lightbox-hint" data-image-lightbox-hint>双击放大 · 点空白处关闭</div>
753
+ </div>
754
+
737
755
  <div id="modal-archive" class="modal hidden" role="dialog" aria-modal="true">
738
756
  <div class="modal-card archive-modal-card">
739
757
  <div class="modal-title" data-i18n="session.archiveTitle">确认归档会话</div>
@@ -890,7 +908,7 @@
890
908
  <div id="announcement-content" class="modal-body announcement-content"></div>
891
909
  <div id="announcement-poll" class="announcement-poll hidden">
892
910
  <div id="announcement-poll-question" class="announcement-poll-question"></div>
893
- <div id="announcement-poll-options" class="announcement-poll-options" role="radiogroup"></div>
911
+ <div id="announcement-poll-options" class="announcement-poll-options"></div>
894
912
  <div id="announcement-poll-status" class="announcement-poll-status hidden"></div>
895
913
  <button id="announcement-poll-submit" class="btn primary" type="button" data-i18n="announcement.voteSubmit">提交投票</button>
896
914
  </div>
@@ -965,16 +983,16 @@
965
983
  'speed.switched': '已切换到最快服务器:{url}({ms}ms)', 'speed.alreadyBest': '当前已是最快:{url}({ms}ms)',
966
984
  'speed.allDown': '全部服务器不可达',
967
985
  'servers.empty': '未添加备用服务器 · 默认使用当前页面地址', 'servers.untested': '未测速',
968
- 'servers.current': ' · 当前', 'servers.unreachable': '不可达', 'servers.delete': '删除服务器', 'servers.tokenSet': '令牌已配置', 'servers.tokenMissing': '未配置令牌',
986
+ 'servers.current': ' · 当前', 'servers.currentOnly': '当前', 'servers.unreachable': '不可达', 'servers.delete': '删除服务器', 'servers.tokenSet': '令牌已配置', 'servers.tokenMissing': '未配置令牌',
969
987
  'servers.currentDesc': '当前: {url}', 'servers.notSet': '未设置服务器', 'servers.defaultDesc': '默认 = 当前页面地址',
970
988
  'servers.needAddress': '请输入服务器地址', 'servers.badProtocol': '地址需以 http:// 或 https:// 开头',
971
989
  'servers.duplicate': '相同地址和令牌已在列表中', 'servers.added': '已添加服务器', 'servers.removedActive': '已删除当前服务器,重新测速…',
972
- 'servers.currentDescGroup': '当前:{group} · {url}({ms})',
990
+ 'servers.currentDescGroup': '当前:{group} · {url}',
973
991
  'servers.edit': '编辑', 'servers.manualSelected': '已切换至:{url}',
974
992
  'servers.promptNote': '服务器备注(可留空):', 'servers.promptEditNote': '编辑备注({url}):', 'servers.promptEditToken': '编辑服务器令牌(留空保持不变):',
975
993
  'servers.promptEditUrl': '编辑服务器地址:', 'servers.promptEditGroup': '所属组:', 'servers.edited': '服务器已更新',
976
994
  'speed.switchedOrigin': '已切换到当前页面(同源)', 'speed.manualUsing': '手动模式:{url}({ms})',
977
- 'groups.current': '当前组', 'groups.add': '+ 组', 'groups.noServer': '组内暂无服务器',
995
+ 'groups.current': '当前组', 'groups.currentLabel': '当前组:{group}', 'groups.add': '+ 组', 'groups.noServer': '组内暂无服务器',
978
996
  'groups.speedTest': '测速', 'groups.autoSelect': '自动选择最快', 'groups.delete': '删除组',
979
997
  'groups.autoOn': '{group} 已切换为自动选择', 'groups.autoOff': '{group} 已切换为手动选择',
980
998
  'groups.switched': '已切换到组:{group}', 'groups.switchHint': '点击切换当前组,双击重命名', 'groups.promptAdd': '新组名:', 'groups.duplicate': '组名已存在',
@@ -989,6 +1007,7 @@
989
1007
  'session.confirmStop': '停止当前回合?排队中的消息不会被删除。', 'session.stopFailed': '停止失败', 'session.stopRequested': '已请求停止本轮', 'session.archive': '归档', 'session.archiveConfirm': '归档这个会话?归档后可在“显示已归档会话”中打开。', 'session.archiveFailed': '归档失败:{msg}', 'session.archived': '会话已归档', 'session.archiveTitle': '确认归档会话', 'session.archiveDesc': '归档后会话将从普通列表隐藏,但不会删除对话记录。', 'session.archiveConversation': '对话', 'session.archiveWorkspace': '工作区', 'session.archiveCancel': '取消', 'session.archiveConfirmAction': '确认归档', 'session.rename': '重命名会话', 'session.renameTitle': '重命名会话', 'session.renamePlaceholder': '输入新的会话名称', 'session.renameCancel': '取消', 'session.renameConfirm': '保存', 'session.renameEmpty': '会话名称不能为空', 'session.renameFailed': '重命名失败', 'session.renamed': '会话名称已更新',
990
1008
  'notify.approvalTitle': '工具审批', 'notify.approvalBody': '{tool} 需要批准', 'notify.questionTitle': 'DSH 提问', 'notify.questionBody': '需要你回答',
991
1009
  'notify.permissionFailed': '通知权限申请失败:{msg}', 'notify.hostUnavailable': '此通知所属服务器已移除或令牌已变更,请重新连接后查看待处理事项',
1010
+ 'history.renderFailed': '部分记录显示失败,请重试',
992
1011
  'history.cached': '本地缓存', 'history.syncing': '本地缓存 · 正在同步', 'history.synced': '最新记录已同步', 'history.saved': '最新记录 · 已缓存', 'history.offline': '本地记录 · 网络不可用', 'history.earlier': '加载更早的记录', 'history.loadingEarlier': '正在加载更早的记录…', 'history.latest': '回到最新', 'history.cacheFailed': '已同步 · 本地缓存未保存', 'history.loading': '加载历史…', 'history.cacheFallback': '网络不可用:显示本地缓存的历史', 'history.loadFailed': '加载历史失败:{msg}', 'history.retry': '重试',
993
1012
  'history.offlineCache': '离线缓存 {n} 条', 'history.count': '{n} 条', 'history.empty': '还没有消息',
994
1013
  'history.queueAndCount': '队列 {q} · 历史 {n}', 'history.countOnly': '历史 {n}',
@@ -997,6 +1016,7 @@
997
1016
  'event.taskStart': '▶ 任务开始', 'event.taskEnd': '■ 任务结束',
998
1017
  'event.systemReminder': '系统提示',
999
1018
  'block.image': '图片', 'block.thinking': '🧠 思考过程', 'block.thinkingLive': '🧠 思考中…', 'block.toolCall': '工具调用', 'block.toolResult': '工具结果', 'block.unknown': '块 · {type}',
1019
+ 'activity.group': '工具与思考 · {n} 项', 'activity.groupRunning': '运行中',
1000
1020
  'truncated': '…(截断)',
1001
1021
  'insights.title': '上下文与费用',
1002
1022
  'insights.contextTitle': '上下文分析',
@@ -1010,6 +1030,7 @@
1010
1030
  'goal.actionFailed': '目标操作失败', 'goal.actionSubmitted': '目标操作已提交',
1011
1031
  'goal.cannotEmpty': '目标不能为空', 'goal.updateFailed': '更新失败', 'goal.updated': '目标已更新',
1012
1032
  'todos.title': '任务清单',
1033
+ 'session.migrationRequired': '请先在 DSH 中打开原会话完成迁移,然后刷新。',
1013
1034
  'subagent.title': '子代理', 'subagent.count': '子代理 · {n} 个', 'subagent.expand': '展开子代理', 'subagent.collapse': '收起子代理', 'subagent.diagnostic': '诊断项', 'subagent.running': '· 运行中', 'subagent.interrupt': '中断',
1014
1035
  'subagent.confirmInterrupt': '中断这个子代理当前回合?', 'subagent.interruptFailed': '中断失败', 'subagent.interruptSubmitted': '中断请求已提交',
1015
1036
  'queue.title': '排队消息', 'queue.steer': '插话', 'queue.steerUnavailable': '仅运行中可插话', 'queue.steerSubmitted': '插话请求已提交', 'queue.steerFailed': '插话失败:{msg}', 'queue.image': '图片消息',
@@ -1057,6 +1078,8 @@
1057
1078
  'update.checkFailedDesc': '检查失败:{msg}', 'update.checkFailed': '检查更新失败:{msg}',
1058
1079
  'update.phase.downloading': '正在下载…', 'update.phase.verifying': '正在校验安装包…', 'update.phase.complete': '下载完成', 'update.phase.legacy': '系统正在下载安装包;安装新版后可显示完整进度', 'update.busy': '已有更新下载正在进行',
1059
1080
  'update.downloadStarted': '开始下载,完成后会弹出安装页', 'update.downloadFailed': '无法启动下载:{msg}',
1081
+ 'update.phase.checking': '正在获取主机安装包信息…', 'settings.redownloadApk': '重新下载安装包', 'settings.redownloadApkDesc': '同版本补丁也可重新下载,以当前主机提供的安装包为准。',
1082
+ 'update.patchMismatch': '安装包与校验信息不一致,请同步主机安装包后重试。',
1060
1083
  'update.corrupted': '下载文件损坏,请重试', 'update.serverFileMissing': '服务器上还没有对应版本的文件,请稍后再试',
1061
1084
  'update.hashMissing': '更新包缺少 SHA-256 校验值,已取消下载',
1062
1085
  'update.installUnsupported': '当前版本不支持 App 内安装,已转浏览器下载',
@@ -1098,7 +1121,7 @@
1098
1121
  'settings.notifyTitle': '通知', 'settings.notifyDesc': '收到审批/提问时推送', 'settings.announcementHistoryTitle': '历史公告', 'settings.announcementHistoryDesc': '查看以前收到的公告', 'settings.announcementHistory': '查看记录',
1099
1122
  'settings.testNotifyTitle': '测试通知', 'settings.testNotifyDesc': '立即排一条 3 秒后的本地通知,用于排查系统通知限制', 'settings.testNotify': '发送测试通知',
1100
1123
  'settings.testNotifySent': '测试通知已排定,3 秒后到达', 'settings.testNotifyFailed': '发送测试通知失败:{msg}', 'settings.testNotifyUnavailable': '测试通知仅在 App 内可用',
1101
- 'settings.peakRemindTitle': '峰谷计费提醒', 'settings.peakRemindDesc': '工作日推送峰谷切换;周末全天谷时,仅 9:00 提醒一次(App 内有效)',
1124
+ 'settings.peakRemindTitle': '峰谷计费提醒 · dsh-cost-meter', 'settings.peakRemindDesc': '按费用插件的峰谷窗口、节假日、提前量与提醒类型发送 Android 通知。无需保持 DSH 页面打开;请允许通知并将系统省电设为无限制。',
1102
1125
  'peakRemind.enterPeak': '已进入高峰计费时段', 'peakRemind.enterOff': '已进入空闲计费时段',
1103
1126
  'peakRemind.peak0912': '高峰 9:00-12:00', 'peakRemind.off1214': '空闲 12:00-14:00',
1104
1127
  'peakRemind.peak1418': '高峰 14:00-18:00', 'peakRemind.off1809': '空闲 18:00-次日 9:00',
@@ -1124,6 +1147,8 @@
1124
1147
  'theme.default': '默认深空', 'theme.dark': '落日', 'theme.light': '易北爱乐厅', 'theme.neutral': '草原孤塔', 'theme.mono': '黑曜白',
1125
1148
  'theme.panelTitle': '选择配色', 'theme.close': '关闭',
1126
1149
  'settings.tokenTitle': '访问令牌', 'settings.change': '更换',
1150
+ 'settings.unknown': '未知', 'settings.dshRecovering': '正在等待网关恢复并核验操作结果…',
1151
+ 'settings.hostHealth': '{status} · HTTP {http} · mux {mux} / host {host} · 检查于 {time}',
1127
1152
  'settings.hostTitle': 'DSH 状态', 'settings.hostProbing': '探测中…', 'settings.probe': '探测', 'settings.probeFailed': '探测失败',
1128
1153
  'settings.dshControlTitle': '远程启动 DSH', 'settings.dshExperimental': 'Windows 实验性', 'settings.dshControlProbing': '正在向网关查询本机 DSH 服务…', 'settings.dshRunning': '运行中', 'settings.dshStopped': '已停止', 'settings.dshUnsupported': '当前系统未配置可控的 DSH 服务', 'settings.dshStart': '启动', 'settings.dshRestart': '重启', 'settings.dshStarting': '正在{action} DSH…', 'settings.dshStarted': 'DSH 已{action}', 'settings.dshFailed': 'DSH 操作失败:{msg}',
1129
1154
  'settings.dshRunningDetail': '运行中 · {service} · PID {pid} · {state}', 'settings.dshStoppedDetail': '已停止 · {service} · {state}', 'settings.dshStatusFailed': '服务状态查询失败:{msg}',
@@ -1206,16 +1231,16 @@
1206
1231
  'speed.switched': 'Switched to fastest server: {url} ({ms}ms)', 'speed.alreadyBest': 'Already on fastest: {url} ({ms}ms)',
1207
1232
  'speed.allDown': 'All servers unreachable',
1208
1233
  'servers.empty': 'No backup servers · using the current page URL', 'servers.untested': 'Untested',
1209
- 'servers.current': ' · current', 'servers.unreachable': 'Unreachable', 'servers.delete': 'Remove server', 'servers.tokenSet': 'Token set', 'servers.tokenMissing': 'No token',
1234
+ 'servers.current': ' · current', 'servers.currentOnly': 'Current', 'servers.unreachable': 'Unreachable', 'servers.delete': 'Remove server', 'servers.tokenSet': 'Token set', 'servers.tokenMissing': 'No token',
1210
1235
  'servers.currentDesc': 'Current: {url}', 'servers.notSet': 'No server set', 'servers.defaultDesc': 'Default = current page URL',
1211
1236
  'servers.needAddress': 'Enter a server address', 'servers.badProtocol': 'Address must start with http:// or https://',
1212
1237
  'servers.duplicate': 'The same address and token is already in the list', 'servers.added': 'Server added', 'servers.removedActive': 'Removed active server, re-testing…',
1213
- 'servers.currentDescGroup': 'Current: {group} · {url} ({ms})',
1238
+ 'servers.currentDescGroup': 'Current: {group} · {url}',
1214
1239
  'servers.edit': 'Edit', 'servers.manualSelected': 'Switched to: {url}',
1215
1240
  'servers.promptNote': 'Server note (optional):', 'servers.promptEditNote': 'Edit note ({url}):', 'servers.promptEditToken': 'Edit server token (blank keeps the current token):',
1216
1241
  'servers.promptEditUrl': 'Edit server URL:', 'servers.promptEditGroup': 'Group:', 'servers.edited': 'Server updated',
1217
1242
  'speed.switchedOrigin': 'Switched to current page (same origin)', 'speed.manualUsing': 'Manual mode: {url} ({ms})',
1218
- 'groups.current': 'Current group', 'groups.add': '+ Group', 'groups.noServer': 'No servers in this group',
1243
+ 'groups.current': 'Current group', 'groups.currentLabel': 'Current group: {group}', 'groups.add': '+ Group', 'groups.noServer': 'No servers in this group',
1219
1244
  'groups.speedTest': 'Speed test', 'groups.autoSelect': 'Auto-select fastest', 'groups.delete': 'Delete group',
1220
1245
  'groups.autoOn': '{group} is now auto-select', 'groups.autoOff': '{group} is now manual',
1221
1246
  'groups.switched': 'Switched to group: {group}', 'groups.switchHint': 'Click to switch group, double-click to rename', 'groups.promptAdd': 'New group name:', 'groups.duplicate': 'Group already exists',
@@ -1230,6 +1255,7 @@
1230
1255
  'session.confirmStop': 'Stop the current turn? Queued messages will be kept.', 'session.stopFailed': 'Stop failed', 'session.stopRequested': 'Stop requested', 'session.archive': 'Archive', 'session.archiveConfirm': 'Archive this session? You can open it from “Show archived”.', 'session.archiveFailed': 'Archive failed: {msg}', 'session.archived': 'Session archived', 'session.archiveTitle': 'Confirm archive', 'session.archiveDesc': 'The session will be hidden from the normal list, but its conversation will not be deleted.', 'session.archiveConversation': 'Conversation', 'session.archiveWorkspace': 'Workspace', 'session.archiveCancel': 'Cancel', 'session.archiveConfirmAction': 'Archive session', 'session.rename': 'Rename session', 'session.renameTitle': 'Rename session', 'session.renamePlaceholder': 'Enter a new session name', 'session.renameCancel': 'Cancel', 'session.renameConfirm': 'Save', 'session.renameEmpty': 'Session name cannot be empty', 'session.renameFailed': 'Rename failed', 'session.renamed': 'Session name updated',
1231
1256
  'notify.approvalTitle': 'Tool approval', 'notify.approvalBody': '{tool} needs approval', 'notify.questionTitle': 'DSH question', 'notify.questionBody': 'Needs your answer',
1232
1257
  'notify.permissionFailed': 'Notification permission failed: {msg}', 'notify.hostUnavailable': 'This notification belongs to a removed server or changed credential. Reconnect to view pending requests.',
1258
+ 'history.renderFailed': 'Some records could not be displayed. Retry.',
1233
1259
  'history.cached': 'Local cache', 'history.syncing': 'Local cache · Syncing', 'history.synced': 'Latest history synced', 'history.saved': 'Latest history · Cached', 'history.offline': 'Local history · Offline', 'history.earlier': 'Load earlier history', 'history.loadingEarlier': 'Loading earlier history…', 'history.latest': 'Jump to latest', 'history.cacheFailed': 'Synced · Cache could not be saved', 'history.loading': 'Loading history…', 'history.cacheFallback': 'Network unavailable: showing cached history', 'history.loadFailed': 'Failed to load history: {msg}', 'history.retry': 'Retry',
1234
1260
  'history.offlineCache': 'Offline cache {n} items', 'history.count': '{n} items', 'history.empty': 'No messages yet',
1235
1261
  'history.queueAndCount': 'Queue {q} · History {n}', 'history.countOnly': 'History {n}',
@@ -1238,6 +1264,7 @@
1238
1264
  'event.taskStart': '▶ Task started', 'event.taskEnd': '■ Task finished',
1239
1265
  'event.systemReminder': 'System reminder',
1240
1266
  'block.image': 'Image', 'block.thinking': '🧠 Thinking', 'block.thinkingLive': '🧠 Thinking…', 'block.toolCall': 'Tool call', 'block.toolResult': 'Tool result', 'block.unknown': 'Block · {type}',
1267
+ 'activity.group': 'Tools and thinking · {n}', 'activity.groupRunning': 'Running',
1241
1268
  'truncated': '…(truncated)',
1242
1269
  'insights.title': 'Context & costs',
1243
1270
  'insights.contextTitle': 'Context analysis',
@@ -1251,6 +1278,7 @@
1251
1278
  'goal.actionFailed': 'Goal action failed', 'goal.actionSubmitted': 'Goal action submitted',
1252
1279
  'goal.cannotEmpty': 'Goal cannot be empty', 'goal.updateFailed': 'Update failed', 'goal.updated': 'Goal updated',
1253
1280
  'todos.title': 'Todos',
1281
+ 'session.migrationRequired': 'Open the source session in DSH to complete migration, then refresh.',
1254
1282
  'subagent.title': 'Subagents', 'subagent.count': 'Subagents · {n}', 'subagent.expand': 'Expand subagents', 'subagent.collapse': 'Collapse subagents', 'subagent.diagnostic': 'Diagnostic', 'subagent.running': '· running', 'subagent.interrupt': 'Interrupt',
1255
1283
  'subagent.confirmInterrupt': 'Interrupt this subagent\'s current turn?', 'subagent.interruptFailed': 'Interrupt failed', 'subagent.interruptSubmitted': 'Interrupt requested',
1256
1284
  'queue.title': 'Queued messages', 'queue.steer': 'Interject', 'queue.steerUnavailable': 'Only available while running', 'queue.steerSubmitted': 'Interjection requested', 'queue.steerFailed': 'Interjection failed: {msg}', 'queue.image': 'Image message',
@@ -1298,6 +1326,8 @@
1298
1326
  'update.checkFailedDesc': 'Check failed: {msg}', 'update.checkFailed': 'Update check failed: {msg}',
1299
1327
  'update.phase.downloading': 'Downloading…', 'update.phase.verifying': 'Verifying APK…', 'update.phase.complete': 'Download complete', 'update.phase.legacy': 'System download started; install this update for full progress', 'update.busy': 'An update is already downloading',
1300
1328
  'update.downloadStarted': 'Downloading, the install page will open when ready', 'update.downloadFailed': 'Could not start download: {msg}',
1329
+ 'update.phase.checking': 'Fetching the host package information…', 'settings.redownloadApk': 'Download package again', 'settings.redownloadApkDesc': 'Download same-version patches too. The package comes from the current host.',
1330
+ 'update.patchMismatch': 'Package checksum mismatch. Refresh the package on the host, then try again.',
1301
1331
  'update.corrupted': 'Downloaded file is corrupted, please retry', 'update.serverFileMissing': 'The file for this version is not on the server yet, please try again later',
1302
1332
  'update.hashMissing': 'The update package has no SHA-256 checksum; download cancelled',
1303
1333
  'update.installUnsupported': 'This version cannot install in-app, opening browser download',
@@ -1339,7 +1369,7 @@
1339
1369
  'settings.notifyTitle': 'Notifications', 'settings.notifyDesc': 'Push on approvals / questions', 'settings.announcementHistoryTitle': 'Announcement history', 'settings.announcementHistoryDesc': 'Review announcements you received before', 'settings.announcementHistory': 'View history',
1340
1370
  'settings.testNotifyTitle': 'Test notification', 'settings.testNotifyDesc': 'Schedule a local notification in 3 seconds to verify the notification pipeline', 'settings.testNotify': 'Send test notification',
1341
1371
  'settings.testNotifySent': 'Test notification scheduled, arriving in 3s', 'settings.testNotifyFailed': 'Failed to send test notification: {msg}', 'settings.testNotifyUnavailable': 'Test notification is only available in the app',
1342
- 'settings.peakRemindTitle': 'Peak/off-peak reminders', 'settings.peakRemindDesc': 'Weekday transitions; weekends are off-peak all day with one reminder at 9:00 (app only)',
1372
+ 'settings.peakRemindTitle': 'Peak/off-peak reminders · dsh-cost-meter', 'settings.peakRemindDesc': 'Android notifications follow the plugin’s windows, holidays, lead time and reminder type. The DSH page can be closed. Allow notifications and unrestricted battery use.',
1343
1373
  'peakRemind.enterPeak': 'Peak pricing period started', 'peakRemind.enterOff': 'Off-peak pricing period started',
1344
1374
  'peakRemind.peak0912': 'Peak 9:00-12:00', 'peakRemind.off1214': 'Off-peak 12:00-14:00',
1345
1375
  'peakRemind.peak1418': 'Peak 14:00-18:00', 'peakRemind.off1809': 'Off-peak 18:00-9:00 next day',
@@ -1365,6 +1395,8 @@
1365
1395
  'theme.default': 'Default', 'theme.dark': 'Sunset', 'theme.light': 'Elbphilharmonie', 'theme.neutral': 'Prairie Tower', 'theme.mono': 'Monochrome',
1366
1396
  'theme.panelTitle': 'Choose theme', 'theme.close': 'Close',
1367
1397
  'settings.tokenTitle': 'Access token', 'settings.change': 'Change',
1398
+ 'settings.unknown': 'Unknown', 'settings.dshRecovering': 'Waiting for the gateway and verifying the operation…',
1399
+ 'settings.hostHealth': '{status} · HTTP {http} · mux {mux} / host {host} · Checked {time}',
1368
1400
  'settings.hostTitle': 'DSH status', 'settings.hostProbing': 'Probing…', 'settings.probe': 'Probe', 'settings.probeFailed': 'Probe failed',
1369
1401
  'settings.dshControlTitle': 'Remote DSH control', 'settings.dshExperimental': 'Windows experimental', 'settings.dshControlProbing': 'Querying the gateway for the local DSH service…', 'settings.dshRunning': 'Running', 'settings.dshStopped': 'Stopped', 'settings.dshUnsupported': 'No controllable DSH service is configured', 'settings.dshStart': 'Start', 'settings.dshRestart': 'Restart', 'settings.dshStarting': '{action}ing DSH…', 'settings.dshStarted': 'DSH {action}ed', 'settings.dshFailed': 'DSH operation failed: {msg}',
1370
1402
  'settings.dshRunningDetail': 'Running · {service} · PID {pid} · {state}', 'settings.dshStoppedDetail': 'Stopped · {service} · {state}', 'settings.dshStatusFailed': 'Service status query failed: {msg}',
@@ -1414,13 +1446,20 @@
1414
1446
  <script src="plugin-center.js"></script>
1415
1447
  <script src="skills.js"></script>
1416
1448
  <script src="insights.js"></script>
1449
+ <script src="teams.js"></script>
1417
1450
  <script src="extensions.js"></script>
1451
+ <script src="diagnostics.js"></script>
1418
1452
  <script src="history.js"></script>
1453
+ <script src="announcement-forms.js"></script>
1454
+ <script src="activity.js"></script>
1455
+ <script src="turn-results.js"></script>
1456
+ <script src="image-preview.js"></script>
1419
1457
  <script src="link-check.js"></script>
1420
1458
  <script src="network.js"></script>
1421
1459
  <script src="operations.js"></script>
1422
1460
  <script src="workflow.js"></script>
1423
1461
  <script src="relay-settings.js"></script>
1462
+ <script src="subagents.js"></script>
1424
1463
  <script src="app.js"></script>
1425
1464
  </body>
1426
1465
  </html>
package/public/md.js CHANGED
@@ -23,7 +23,46 @@
23
23
  })
24
24
  }
25
25
 
26
+ function decodeEntities(s) {
27
+ const entities = { '&amp;': '&', '&quot;': '"', '&#39;': "'", '&lt;': '<', '&gt;': '>' }
28
+ return String(s).replace(/&(?:amp|quot|lt|gt|#39);/g, entity => entities[entity])
29
+ }
30
+
31
+ let imageLabel = '图片'
32
+
33
+ /**
34
+ * Markdown images become preview buttons. Remote/data URLs can load directly;
35
+ * local paths are placeholders that the client resolves through the authenticated file API.
36
+ * Returns null when the target is neither an image URL nor a local path.
37
+ */
38
+ function imageHtml(altEscaped, urlEscaped, fileLinks) {
39
+ let raw = String(urlEscaped || '').trim()
40
+ if (raw.startsWith('&lt;') && raw.endsWith('&gt;')) raw = raw.slice(4, -4)
41
+ let target = decodeEntities(raw)
42
+ if (/^file:/i.test(target) && files?.pathOf) target = files.pathOf(target) || target
43
+ const alt = decodeEntities(String(altEscaped || '')).replace(/<[^>]*>/g, '').trim()
44
+ const label = escapeHtml(alt || imageLabel)
45
+ if (/^(?:data:image\/|https?:\/\/|\/api\/)/i.test(target)) {
46
+ return '<button type="button" class="chat-image" data-chat-image aria-label="' + label + '">' +
47
+ '<img src="' + escapeHtml(target) + '" alt="' + label + '" loading="lazy" draggable="false"></button>'
48
+ }
49
+ if (!fileLinks) return null
50
+ const local = /^(?:[A-Za-z]:[\\/]|\\\\|\/|\.{1,2}[\\/]|[^:\s]+[\\/])/.test(target)
51
+ || /^[^:\s]+\.(?:png|jpe?g|gif|webp|bmp|svg|avif)$/i.test(target)
52
+ if (!local) return null
53
+ return '<button type="button" class="chat-image is-loading" data-chat-image data-chat-image-path="' + escapeHtml(target) +
54
+ '" data-chat-image-alt="' + label + '" aria-label="' + label + '"><span class="chat-image-status">' + label + '</span></button>'
55
+ }
56
+
26
57
  function inline(s, fileLinks) {
58
+ // Pull images out before inline emphasis/link rules so alt text and URLs stay intact.
59
+ const images = []
60
+ s = s.replace(/!\[([^\]]*)\]\(([^)\n]+)\)/g, function (m, alt, url) {
61
+ const html = imageHtml(alt, url, fileLinks)
62
+ if (!html) return m
63
+ images.push(html)
64
+ return '\u0000IMAGE' + (images.length - 1) + '\u0000'
65
+ })
27
66
  s = s.replace(/`([^`]+)`/g, '<code>$1</code>')
28
67
  s = s.replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>')
29
68
  s = s.replace(/(^|[^*])\*([^*\n]+)\*/g, '$1<em>$2</em>')
@@ -40,7 +79,7 @@
40
79
  if (!/^https?:\/\//i.test(url) || /\s/.test(url)) return m
41
80
  return '<a href="' + url + '" target="_blank" rel="noopener noreferrer">' + text + '</a>'
42
81
  })
43
- return s
82
+ return images.length ? s.replace(/\u0000IMAGE(\d+)\u0000/g, (m, index) => images[Number(index)] || '') : s
44
83
  }
45
84
 
46
85
  function tableCells(line) {
@@ -172,6 +211,7 @@
172
211
  }
173
212
 
174
213
  function mdToHtml(text, options) {
214
+ if (options?.imageLabel) imageLabel = String(options.imageLabel)
175
215
  var raw = String(text == null ? '' : text)
176
216
  var parts = raw.split(/```/)
177
217
  var out = ''
package/public/network.js CHANGED
@@ -15,8 +15,12 @@
15
15
  return {weak,historyPageSize:weak?20:60,readTimeout:weak?90000:45000,pingTimeout:weak?12000:6000,pollTimeout:weak?45000:30000}
16
16
  }
17
17
  function setMode(value){if(!['auto','weak','normal'].includes(value))return;try{root.localStorage.setItem('dshNetworkModeV1',value)}catch{};return profile()}
18
+ // 弱网下可选关闭流式输出:只保留已完成的消息与工具结果。
19
+ const STREAM_KEY='dshWeakStreamOff'
20
+ function streamSetting(){try{return root.localStorage.getItem(STREAM_KEY)!=='0'}catch{return true}}
21
+ function streamTrimmed(){return streamSetting()&&profile().weak}
18
22
  class PollLoop {
19
- constructor(options){this.options=options;this.jobs={};this.setTimer=options.setTimer||setTimeout;this.clearTimer=options.clearTimer||clearTimeout}
23
+ constructor(options){this.options=options;this.jobs={};this.setTimer=options.setTimer||((fn,ms)=>setTimeout(fn,ms));this.clearTimer=options.clearTimer||(timer=>clearTimeout(timer))}
20
24
  stop(){for(const job of Object.values(this.jobs)){job.controller.abort();this.clearTimer(job.timer)}this.jobs={}}
21
25
  tick(){
22
26
  if(!this.options.active()){this.stop();return Promise.resolve()}
@@ -42,21 +46,41 @@
42
46
  }
43
47
  function preferences(){
44
48
  const panel=root.document?.getElementById('settings-page-general');if(!panel)return
49
+ const desktop=panel.classList.contains('ds-settings')
45
50
  let row=root.document.getElementById('network-preferences')
46
51
  if(!row){
47
- row=root.document.createElement('div');row.id='network-preferences';row.className=panel.classList.contains('ds-settings')?'ds-setting-row':'setting-row'
52
+ row=root.document.createElement('div');row.id='network-preferences';row.className=desktop?'ds-setting-row':'setting-row'
48
53
  const copy=root.document.createElement('div'),title=root.document.createElement('div'),detail=root.document.createElement('div'),select=root.document.createElement('select')
49
- title.dataset.networkTitle='';detail.dataset.networkDetail='';detail.className='muted';select.id='network-mode';select.className='setting-select'
54
+ title.dataset.networkTitle='';detail.dataset.networkDetail='';title.className=desktop?'ds-setting-name':'setting-name';detail.className=desktop?'ds-setting-desc':'setting-desc';select.id='network-mode';select.className='setting-select'
50
55
  for(const value of ['auto','weak','normal']){const option=root.document.createElement('option');option.value=value;select.append(option)}
51
- copy.append(title,detail);row.append(copy,select);panel.append(row)
52
- select.addEventListener('change',()=>{setMode(select.value);root.enhanceCustomSelect?.(select)})
56
+ copy.append(title,detail);row.append(copy,select)
57
+ const target=panel.querySelector('[data-workflow-settings-slot="input"]')||panel
58
+ target.append(row)
59
+ const section=target.closest?.('.workflow-settings-section');if(section)section.hidden=false
60
+ select.addEventListener('change',()=>{setMode(select.value);root.applyStreamPreference?.();root.enhanceCustomSelect?.(select)})
61
+ }
62
+ let streamRow=root.document.getElementById('network-stream-preferences')
63
+ if(!streamRow){
64
+ streamRow=root.document.createElement('div');streamRow.id='network-stream-preferences';streamRow.className=desktop?'ds-setting-row':'setting-row'
65
+ const copy=root.document.createElement('div'),title=root.document.createElement('div'),detail=root.document.createElement('div'),label=root.document.createElement('label'),input=root.document.createElement('input'),slider=root.document.createElement('span')
66
+ title.dataset.streamTitle='';detail.dataset.streamDetail='';title.className=desktop?'ds-setting-name':'setting-name';detail.className=desktop?'ds-setting-desc':'setting-desc'
67
+ input.type='checkbox';input.id='opt-weak-stream-off';label.className=desktop?'ds-switch':'switch';slider.className=desktop?'ds-slider':'slider'
68
+ label.append(input,slider);copy.append(title,detail);streamRow.append(copy,label)
69
+ const target=panel.querySelector('[data-workflow-settings-slot="input"]')||panel
70
+ target.append(streamRow)
71
+ const section=target.closest?.('.workflow-settings-section');if(section)section.hidden=false
72
+ input.addEventListener('change',()=>{try{root.localStorage.setItem(STREAM_KEY,input.checked?'1':'0')}catch{};root.applyStreamPreference?.()})
53
73
  }
54
74
  const english=root.I18N?.lang==='en'
55
75
  row.querySelector('[data-network-title]').textContent=english?'Network mode':'网络模式'
56
76
  row.querySelector('[data-network-detail]').textContent=english?'Weak mode loads fewer history entries and allows longer read waits. Sending is never retried automatically.':'弱网模式减少每页历史条数、延长读取等待;发送操作不会自动重试。'
57
77
  const select=row.querySelector('select');select.setAttribute('aria-label',english?'Network mode':'网络模式');['auto','weak','normal'].forEach((v,i)=>select.options[i].textContent=(english?['Automatic','Weak network','Standard']:['自动判断','弱网优先','标准模式'])[i]);select.value=mode();root.enhanceCustomSelect?.(select);root.syncCustomSelect?.(select)
78
+ const streamInput=streamRow.querySelector('input');if(streamInput){streamInput.checked=streamSetting();streamInput.setAttribute('aria-label',english?'Disable streaming on weak networks':'弱网时关闭流式输出')}
79
+ const streamTitle=streamRow.querySelector('[data-stream-title]'),streamDetail=streamRow.querySelector('[data-stream-detail]')
80
+ if(streamTitle)streamTitle.textContent=english?'No streaming on weak networks':'弱网时关闭流式输出'
81
+ if(streamDetail)streamDetail.textContent=english?'Show only finished messages and tool results on weak networks; live thinking and calls that have not returned stay hidden.':'弱网下只显示已完成的消息和工具结果,隐藏流式思考和尚未返回的工具调用;标准网络不受影响。'
58
82
  }
59
- const api={profile,setMode,PollLoop,shareRead,observeLatency:ms=>{if(Number.isFinite(ms))measuredLatency=ms},preferences}
83
+ const api={profile,setMode,PollLoop,shareRead,observeLatency:ms=>{if(Number.isFinite(ms))measuredLatency=ms},preferences,streamTrimmed}
60
84
  if(typeof module!=='undefined'&&module.exports)module.exports=api
61
85
  else{root.DshNetwork=api;root.document.addEventListener('DOMContentLoaded',()=>{preferences();new MutationObserver(preferences).observe(root.document.documentElement,{attributes:true,attributeFilter:['lang']})})}
62
86
  })(typeof window==='undefined'?globalThis:window)
@@ -1,7 +1,7 @@
1
1
  /* Durable write receipts. POST once, recover using GET only; zero dependencies. */
2
2
  ;(function(root) {
3
3
  'use strict'
4
- const methods = new Set(['session.create','session.prompt','session.updateQueue','session.selectModel',
4
+ const methods = new Set(['session.fork','session.create','session.prompt','session.updateQueue','session.selectModel',
5
5
  'session.rename','session.cancel','workspace.create','workspace.archiveSession',
6
6
  'goal.edit','goal.pause','goal.resume','goal.complete','goal.clear'])
7
7
  const pending = new Map()
@@ -11,6 +11,8 @@
11
11
  GATEWAY_UNAVAILABLE:['请先在主机上启动 Remote 网关。','Start the Remote gateway on the host first.'],
12
12
  RELAY_OPERATION_BUSY:['主机正在处理上一次操作,请稍后刷新状态。','The previous operation is still running. Refresh shortly.'],
13
13
  unauthorized:['请先连接主机,再设置云服务器中转。','Connect to your host before configuring its relay.'],
14
+ INVALID_RESPONSE:['主机返回了无法识别的中转状态,请检查连接地址和主机 Remote 版本。','Unrecognized relay response. Check the host URL and Remote version.'],
15
+ UNSUPPORTED_GATEWAY:['此主机尚不支持云中转设置,请更新主机 Remote。','Update the host Remote to use cloud relay settings.'],
14
16
  }
15
17
  function mount(target, { connection, path = '/relay', credentials } = {}) {
16
18
  if (!target || target.dataset.relayMounted) return
@@ -28,19 +30,19 @@
28
30
  const actions=el('div','relay-actions'),toggle=el('button'),refresh=el('button'),takeover=el('button');toggle.type=refresh.type=takeover.type='button';actions.append(takeover,toggle,refresh)
29
31
  const hint=el('p','relay-muted'),notice=el('p','relay-notice');notice.setAttribute('role','status')
30
32
  target.append(heading,intro,status,address,quota,binding,form,actions,hint,notice)
31
- let identity='',value=null,lastRead=0,busy=false,loading=false,controller=null,destroyed=false
33
+ let identity='',value=null,lastRead=0,busy=false,loading=false,controller=null,destroyed=false,readError=false,failures=0
32
34
  function context() { const ctx=connection();return { ...ctx, endpoint:ctx.url(path) } }
33
35
  function current(ctx) { return !destroyed && ctx.valid() && identity===JSON.stringify([ctx.endpoint,ctx.headers?.authorization||'']) }
34
36
  function syncIdentity() {
35
37
  const ctx=context(),next=JSON.stringify([ctx.endpoint,ctx.headers?.authorization||''])
36
- if(next!==identity){identity=next;controller?.abort();controller=null;keyInput.value='';adminInput.value='';value=null;notice.textContent='';lastRead=0;loading=false;busy=false;render()}
38
+ if(next!==identity){identity=next;controller?.abort();controller=null;keyInput.value='';adminInput.value='';value=null;notice.textContent='';lastRead=0;loading=false;busy=false;readError=false;failures=0;render()}
37
39
  return ctx
38
40
  }
39
41
  function render() {
40
42
  title.textContent=text('云服务器中转','Cloud relay')
41
43
  intro.textContent=text('让手机通过公网连接这台主机。每位用户使用自己的中转密钥,首次开通会绑定此主机。','Connect to this host over the internet. Your personal relay key binds to this host when activated.')
42
- const phase=value?.phase||'unconfigured'
43
- const names={unconfigured:['尚未开通','Not configured'],disabled:['已停用','Disabled'],connecting:['正在连接','Connecting'],online:['已连接','Connected'],reconnecting:['正在重连','Reconnecting'],expired:['授权已到期','Expired'],'authorization-inactive':['授权已撤销或到期','Authorization inactive'],'quota-exceeded':['今日流量已用完','Daily quota reached'],'quota-unavailable':['流量服务暂不可用','Quota service unavailable'],error:['连接异常','Connection error']}
44
+ const phase=value?.phase||(readError?'unavailable':loading?'loading':'unconfigured')
45
+ const names={loading:['正在读取','Loading'],unavailable:['状态读取失败','Status unavailable'],unconfigured:['尚未开通','Not configured'],disabled:['已停用','Disabled'],connecting:['正在连接','Connecting'],online:['已连接','Connected'],reconnecting:['正在重连','Reconnecting'],expired:['授权已到期','Expired'],'authorization-inactive':['授权已撤销或到期','Authorization inactive'],'quota-exceeded':['今日流量已用完','Daily quota reached'],'quota-unavailable':['流量服务暂不可用','Quota service unavailable'],error:['连接异常','Connection error']}
44
46
  badge.textContent=text(...(names[phase]||names.error));badge.dataset.phase=phase
45
47
  status.textContent=busy?text('正在保存并绑定,请稍候…','Saving and binding…'):value?.error?text('请检查主机配置或刷新状态。','Check the host configuration or refresh.'):text('开通后会随 Remote 网关启动,无需单独运行工具。','Starts with the Remote gateway after activation.')
46
48
  let safeUrl=''
@@ -71,19 +73,26 @@
71
73
  }
72
74
  async function load(force=false) {
73
75
  const ctx=syncIdentity()
74
- if(busy||loading||!force&&(document.hidden||!target.getClientRects().length||Date.now()-lastRead<5000))return
75
- loading=true;lastRead=Date.now();const abort=new AbortController();controller=abort;const timer=setTimeout(()=>abort.abort(),10000)
76
+ if(ctx.connected===false){notice.textContent=text('请先连接主机,再查看中转状态。','Connect to your host to read relay status.');return}
77
+ if(busy||loading||!force&&(document.hidden||!target.getClientRects().length||Date.now()-lastRead<Math.min(60000,5000*2**Math.min(failures,4))))return
78
+ loading=true;lastRead=Date.now();const abort=new AbortController();controller=abort
79
+ const timeout=Math.max(15000,root.DshNetwork?.profile().readTimeout||30000)
80
+ const timer=setTimeout(()=>abort.abort(),timeout)
76
81
  render()
77
82
  try {
78
83
  const response=await root.fetch(ctx.endpoint,{headers:ctx.headers,credentials,cache:'no-store',signal:abort.signal})
79
- const data=await response.json()
84
+ let data
85
+ try{data=await response.json()}catch{throw Object.assign(Error('INVALID_RESPONSE'),{code:'INVALID_RESPONSE',status:response.status})}
80
86
  if(!current(ctx))return
81
87
  if(response.status===429&&data.daily){value={phase:'quota-exceeded',daily:data.daily,configured:false};notice.textContent=text('今日额度已用完。请用主机本地地址进入设置,或等待零点恢复。','Daily quota reached. Use the local host address or wait until reset.');return}
82
88
  if(!response.ok)throw Object.assign(Error(data.error||'HTTP_'+response.status),{code:data.error,status:response.status})
83
- if(data.supported!==true)throw Error('UNSUPPORTED_GATEWAY')
84
- value=data;notice.textContent=''
89
+ if(data.supported!==true)throw Object.assign(Error('UNSUPPORTED_GATEWAY'),{code:'UNSUPPORTED_GATEWAY'})
90
+ value=data;notice.textContent='';readError=false;failures=0
85
91
  }catch(error){
86
- if(current(ctx)&&!busy&&controller===abort)notice.textContent=error.status===404?text('请将此主机 Remote 升级到 0.8.0-rc.2 后使用。','Upgrade this host Remote to 0.8.0-rc.2.'):messages[error.code]?text(...messages[error.code]):text('暂时无法读取中转状态,可稍后刷新。','Unable to read relay status. Refresh shortly.')
92
+ if(current(ctx)&&!busy&&controller===abort){
93
+ readError=true;failures++
94
+ notice.textContent=error.status===401?text('访问令牌无效,请在主机与连接中重新连接。','Invalid access token. Reconnect in Hosts and connections.'):error.status===404?text('请将此主机 Remote 升级到 0.8.0-rc.2 或更新版本后使用。','Upgrade this host Remote to 0.8.0-rc.2 or later.'):messages[error.code]?text(...messages[error.code]):abort.signal.aborted?text('读取中转状态超时,请检查网络后刷新。','Relay status timed out. Check the network and refresh.'):text('暂时无法连接主机读取中转状态,可稍后刷新。','Cannot reach the host for relay status. Refresh shortly.')
95
+ }
87
96
  }finally{clearTimeout(timer);if(current(ctx)&&controller===abort){loading=false;render()}}
88
97
  }
89
98
  async function change(action) {
package/public/styles.css CHANGED
@@ -868,9 +868,9 @@ button.overview-attention-item, button.overview-session-item { cursor:pointer; }
868
868
  .about { text-align: center; color: var(--dsr-muted); font-size: 12px; margin-top: 16px; line-height: 1.8; }
869
869
 
870
870
  /* 多服务器列表(分组) */
871
- .group-bar { display: flex; align-items: center; gap: 8px; padding: 0 14px 10px; }
872
- .group-bar-label { font-size: 12px; color: var(--dsr-muted); white-space: nowrap; }
873
- .group-select { flex: 1; min-width: 0; position: relative; }
871
+ .group-bar { display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; padding: 0 14px 10px; }
872
+ .group-bar-label { flex-shrink: 0; font-size: 12px; color: var(--dsr-muted); white-space: nowrap; }
873
+ .group-select { flex: 1 1 auto; min-width: 0; position: relative; }
874
874
  .group-select-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 6px; background: var(--dsr-bg-2); color: var(--dsr-text); border: 1px solid var(--dsr-line); border-radius: 10px; padding: 7px 9px; font: inherit; font-size: 13px; outline: none; cursor: pointer; }
875
875
  .group-select-btn .caret { color: var(--dsr-muted); font-size: 10px; transition: transform .15s ease; }
876
876
  .group-select-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; max-height: 220px; overflow-y: auto; background: var(--dsr-panel); border: 1px solid var(--dsr-line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.28); padding: 4px; display: flex; flex-direction: column; gap: 2px; }
@@ -880,9 +880,10 @@ button.overview-attention-item, button.overview-session-item { cursor:pointer; }
880
880
  .server-list { padding: 0 14px 10px; display: flex; flex-direction: column; gap: 6px; }
881
881
  .server-empty { font-size: 12px; color: var(--dsr-muted); }
882
882
  .srv-group { border: 1px solid var(--dsr-line); border-radius: 12px; background: var(--dsr-panel); overflow: hidden; }
883
- .srv-group-head { display: flex; align-items: center; gap: 6px; padding: 7px 9px; }
884
- .srv-group-name { flex: 1; min-width: 0; text-align: left; background: none; border: none; color: var(--dsr-text); font: inherit; font-size: 13px; font-weight: 600; padding: 2px 0; display: flex; align-items: center; gap: 6px; }
885
- .srv-group-count { font-size: 10.5px; color: var(--dsr-muted); background: var(--dsr-bg-2); border-radius: 999px; padding: 0 7px; line-height: 16px; }
883
+ .srv-group-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; }
884
+ .srv-group-name { flex: 1 1 auto; min-width: 0; text-align: left; background: none; border: none; color: var(--dsr-text); font: inherit; font-size: 13px; font-weight: 600; padding: 2px 0; display: flex; align-items: center; gap: 6px; }
885
+ .srv-group-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
886
+ .srv-group-count { flex-shrink: 0; font-size: 10.5px; color: var(--dsr-muted); background: var(--dsr-bg-2); border-radius: 999px; padding: 0 7px; line-height: 16px; }
886
887
  .srv-group-speed { flex-shrink: 0; padding: 3px 8px; font-size: 12px; }
887
888
  .srv-group-del { flex-shrink: 0; width: 22px; height: 22px; border-radius: 7px; background: var(--dsr-panel); border: 1px solid var(--dsr-line); color: var(--dsr-muted); font-size: 11px; }
888
889
  .srv-group-del:active { color: var(--dsr-error); }
@@ -891,25 +892,24 @@ button.overview-attention-item, button.overview-session-item { cursor:pointer; }
891
892
  .switch.small .slider::before { width: 15px; height: 15px; left: 2px; top: 2px; }
892
893
  .switch.small input:checked + .slider::before { transform: translateX(15px); }
893
894
  .server-row {
894
- display: flex; align-items: center; gap: 8px;
895
+ display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 5px 6px;
895
896
  background: var(--dsr-bg-2); border: 1px solid var(--dsr-line); border-radius: 10px;
896
- padding: 8px 10px;
897
+ padding: 9px 8px 9px 11px;
897
898
  }
898
899
  .server-row.active { border-color: var(--dsr-info-line); background: var(--dsr-info-soft); }
899
- .server-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
900
- .server-note { font-size: 13px; word-break: break-all; }
901
- .server-url { flex: 1; min-width: 0; font-size: 11.5px; color: var(--dsr-muted); word-break: break-all; }
902
- .server-token-badge { color: var(--dsr-muted); font-size: 10px; }
900
+ .server-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
901
+ .server-note { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; min-width: 0; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
902
+ .server-url { min-width: 0; font-size: 11.5px; line-height: 1.4; color: var(--dsr-muted); overflow-wrap: anywhere; }
903
903
  .server-badge {
904
- flex-shrink: 0; font-size: 11px; padding: 1px 7px; border-radius: 999px;
904
+ justify-self: end; flex-shrink: 0; min-width: 52px; text-align: center; font-size: 10.5px; padding: 1px 6px; border-radius: 999px;
905
905
  background: var(--dsr-accent-soft); color: var(--dsr-accent-strong);
906
906
  border: 1px solid var(--dsr-accent-line); white-space: nowrap;
907
907
  }
908
908
  .server-badge.good { background: var(--dsr-success-soft); color: var(--dsr-success); border-color: var(--dsr-success-line); }
909
909
  .server-badge.bad { background: var(--dsr-warning-soft); color: var(--dsr-warning); border-color: var(--dsr-warning-line); }
910
910
  .server-edit, .server-del {
911
- flex-shrink: 0; width: 24px; height: 24px; border-radius: 7px;
912
- background: var(--dsr-panel); border: 1px solid var(--dsr-line); color: var(--dsr-muted); font-size: 12px;
911
+ flex-shrink: 0; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
912
+ background: var(--dsr-panel); border: 1px solid var(--dsr-line); color: var(--dsr-muted); font-size: 13px;
913
913
  }
914
914
  .server-edit:active { color: var(--dsr-accent-strong); }
915
915
  .server-del:active { color: var(--dsr-error); }