dsh-remote-plugin 0.8.7 → 0.8.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/apk/dsh-remote.apk +0 -0
- package/gateway.cjs +134 -54
- package/index.mjs +32 -1
- package/package.json +1 -1
- package/public/activity.js +144 -49
- package/public/admin.html +33 -32
- package/public/admin.js +2 -1
- package/public/app.js +139 -51
- package/public/build.json +2 -2
- package/public/desktop/desktop.html +83 -74
- package/public/desktop/desktop.js +39 -26
- package/public/diagnostics.js +30 -4
- package/public/e2ee-transport.js +154 -7
- package/public/history.js +15 -2
- package/public/index.html +93 -76
- package/public/operations.js +22 -9
- package/public/plugin.html +27 -26
- package/public/skins/blue-fish/preview.html +3 -3
- package/public/skins/bocchi/preview.html +5 -5
- package/public/skins/kita/preview.html +6 -6
- package/public/skins/nijika/preview.html +6 -6
- package/public/skins/penguin/preview.html +3 -3
- package/public/skins/penguin-logistics/cargo.svg +4 -0
- package/public/skins/penguin-logistics/console.svg +4 -0
- package/public/skins/penguin-logistics/mark.svg +4 -0
- package/public/skins/penguin-logistics/radio.svg +4 -0
- package/public/skins/penguin-logistics/skin.css +292 -0
- package/public/skins/penguin-logistics/standing.png +0 -0
- package/public/skins/ryo/preview.html +6 -6
- package/public/slash-suggestions.css +43 -0
- package/public/slash-suggestions.js +184 -0
- package/public/subagents.css +2 -0
- package/public/subagents.js +31 -10
- package/public/theme-vars.css +37 -2
- package/public/theme.js +4 -2
- package/public/update.json +8 -8
- package/public/version.json +1 -1
- package/public/workflow.css +17 -9
- package/public/workflow.js +7 -3
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
<!doctype html>
|
|
2
2
|
<html lang="zh-CN">
|
|
3
3
|
<head>
|
|
4
|
-
<meta name="dsh-remote-build" content="
|
|
4
|
+
<meta name="dsh-remote-build" content="84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184">
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
7
7
|
<title>DSH Remote · 桌面</title>
|
|
8
|
-
<script>/* 首帧前应用皮肤 */ (function(){try{var t=localStorage.getItem('dshTheme');if(t!=='default'&&t!=='dark'&&t!=='light'&&t!=='neutral'&&t!=='mono'&&t!=='fish'&&t!=='penguin'&&t!=='penguin-night'&&t!=='bocchi'&&t!=='nijika'&&t!=='ryo'&&t!=='kita'){t='fish'}}catch(e){t='fish'}document.documentElement.setAttribute('data-theme',t)})()</script>
|
|
9
|
-
<link rel="stylesheet" href="../theme-vars.css?dsr-build=
|
|
10
|
-
<link rel="stylesheet" href="desktop.css?dsr-build=
|
|
11
|
-
<link rel="stylesheet" href="../
|
|
12
|
-
<link rel="stylesheet" href="../
|
|
13
|
-
<link rel="stylesheet" href="../
|
|
14
|
-
<link rel="stylesheet" href="../
|
|
15
|
-
<link rel="stylesheet" href="../
|
|
16
|
-
<link rel="stylesheet" href="../
|
|
17
|
-
<link rel="stylesheet" href="../
|
|
18
|
-
<link rel="stylesheet" href="../
|
|
19
|
-
<link rel="stylesheet" href="../
|
|
20
|
-
<link rel="stylesheet" href="../skins/
|
|
21
|
-
<link rel="stylesheet" href="../skins/
|
|
22
|
-
<link rel="stylesheet" href="../skins/
|
|
23
|
-
<link rel="stylesheet" href="../skins/
|
|
24
|
-
<link rel="stylesheet" href="../skins/
|
|
25
|
-
<link rel="stylesheet" href="../skins/
|
|
26
|
-
<link rel="stylesheet" href="../
|
|
8
|
+
<script>/* 首帧前应用皮肤 */ (function(){try{var t=localStorage.getItem('dshTheme');if(t!=='default'&&t!=='dark'&&t!=='light'&&t!=='neutral'&&t!=='mono'&&t!=='fish'&&t!=='penguin'&&t!=='penguin-night'&&t!=='bocchi'&&t!=='nijika'&&t!=='ryo'&&t!=='kita'&&t!=='penguin-logistics'){t='fish'}}catch(e){t='fish'}document.documentElement.setAttribute('data-theme',t)})()</script>
|
|
9
|
+
<link rel="stylesheet" href="../theme-vars.css?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184">
|
|
10
|
+
<link rel="stylesheet" href="desktop.css?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184">
|
|
11
|
+
<link rel="stylesheet" href="../slash-suggestions.css?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184">
|
|
12
|
+
<link rel="stylesheet" href="../plugin-center.css?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184">
|
|
13
|
+
<link rel="stylesheet" href="../skills.css?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184">
|
|
14
|
+
<link rel="stylesheet" href="../doctor.css?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184">
|
|
15
|
+
<link rel="stylesheet" href="../extensions.css?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184">
|
|
16
|
+
<link rel="stylesheet" href="../insights.css?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184">
|
|
17
|
+
<link rel="stylesheet" href="../workflow.css?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184">
|
|
18
|
+
<link rel="stylesheet" href="../relay-settings.css?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184">
|
|
19
|
+
<link rel="stylesheet" href="../subagents.css?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184">
|
|
20
|
+
<link rel="stylesheet" href="../skins/blue-fish/skin.css?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184">
|
|
21
|
+
<link rel="stylesheet" href="../skins/penguin/skin.css?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184">
|
|
22
|
+
<link rel="stylesheet" href="../skins/bocchi/skin.css?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184">
|
|
23
|
+
<link rel="stylesheet" href="../skins/kessoku/skin.css?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184">
|
|
24
|
+
<link rel="stylesheet" href="../skins/nijika/skin.css?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184">
|
|
25
|
+
<link rel="stylesheet" href="../skins/ryo/skin.css?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184">
|
|
26
|
+
<link rel="stylesheet" href="../skins/kita/skin.css?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184">
|
|
27
|
+
<link rel="stylesheet" href="../skins/penguin-logistics/skin.css?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184">
|
|
28
|
+
<link rel="stylesheet" href="../theme-picker.css?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184">
|
|
27
29
|
</head>
|
|
28
30
|
<body>
|
|
29
31
|
<div class="ds-app" id="ds-app">
|
|
@@ -175,17 +177,21 @@
|
|
|
175
177
|
<div class="ds-history-wrap"><div id="history" class="ds-history"></div><button id="btn-history-latest" class="history-latest hidden" type="button" data-i18n="ds.historyLatest">回到最新</button></div>
|
|
176
178
|
<div class="ds-composer">
|
|
177
179
|
<div id="composer-status" class="ds-composer-status hidden" role="status" aria-live="polite"><span class="ds-composer-status-dot" aria-hidden="true"></span><span id="composer-status-text" data-i18n="ds.composerRunning">运行中…</span></div>
|
|
178
|
-
<
|
|
180
|
+
<div class="ds-composer-input">
|
|
181
|
+
<textarea id="composer" rows="1" data-i18n-placeholder="ds.composerPlaceholder" placeholder="输入消息…"></textarea>
|
|
182
|
+
</div>
|
|
179
183
|
<div class="ds-composer-actions">
|
|
180
184
|
<div class="ds-composer-left">
|
|
181
185
|
<div style="position:relative">
|
|
182
186
|
<button id="btn-cmd" class="ds-btn" data-i18n="ds.commands">指令</button>
|
|
183
187
|
<div id="cmd-menu" class="ds-group-menu hidden" style="width:280px; left:0; right:auto; top:auto; bottom:calc(100% + 8px)">
|
|
184
|
-
<
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
188
|
+
<div id="desktop-command-list" style="display:contents">
|
|
189
|
+
<button class="ds-action-item" data-ds-cmd="/compact" data-i18n="ds.cmdCompact">/compact 压缩对话历史</button>
|
|
190
|
+
<button class="ds-action-item" data-ds-cmd="/export" data-i18n="ds.cmdExport">/export 导出会话日志 ZIP</button>
|
|
191
|
+
<button class="ds-action-item" data-ds-cmd="/feedback" data-i18n="ds.cmdFeedback">/feedback 反馈当前会话</button>
|
|
192
|
+
<button class="ds-action-item" data-ds-cmd="/goal" data-i18n="ds.cmdGoal">/goal 设置/查看任务目标</button>
|
|
193
|
+
<button class="ds-action-item" data-ds-cmd="/plan" data-i18n="ds.cmdPlan">/plan 进入/退出计划模式</button>
|
|
194
|
+
</div>
|
|
189
195
|
<div class="ds-cmd-section-title" data-i18n="perm.groupLabel">权限模式</div>
|
|
190
196
|
<div id="cmd-perm-inline" class="ds-cmd-perm-inline"></div>
|
|
191
197
|
</div>
|
|
@@ -303,7 +309,7 @@
|
|
|
303
309
|
<div class="ds-setting-name" data-i18n="ds.groupTheme">皮肤</div>
|
|
304
310
|
</div>
|
|
305
311
|
<div class="ds-setting-row">
|
|
306
|
-
<div><div class="ds-setting-name" data-i18n="ds.themeTitle">皮肤</div><div class="ds-setting-desc" data-i18n="ds.themeDesc"
|
|
312
|
+
<div><div class="ds-setting-name" data-i18n="ds.themeTitle">皮肤</div><div class="ds-setting-desc" data-i18n="ds.themeDesc">十三套皮肤</div></div>
|
|
307
313
|
<button id="btn-theme" class="ds-btn">默认深空</button>
|
|
308
314
|
</div>
|
|
309
315
|
</div>
|
|
@@ -564,6 +570,7 @@
|
|
|
564
570
|
'ds.insightsContext': '上下文分析',
|
|
565
571
|
'ds.insightsCost': '费用与额度',
|
|
566
572
|
'ds.files': '文件传输', 'ds.plugins': '插件', 'ds.settings': '设置', 'ds.stats': '统计', 'ds.menu': '导航',
|
|
573
|
+
'slash.suggestions': '命令和技能', 'slash.command': '命令', 'slash.skill': '技能',
|
|
567
574
|
'ds.send': '发送', 'ds.composerPlaceholder': '输入消息,Enter 发送…', 'ds.composerRunning': '运行中…', 'ds.presets': '预设', 'ds.sessionRename': '重命名会话', 'ds.sessionRenameTitle': '重命名会话', 'ds.sessionRenamePlaceholder': '输入新的会话名称', 'ds.sessionRenameConfirm': '保存', 'ds.sessionRenameFailed': '重命名失败', 'ds.sessionRenameEmpty': '会话名称不能为空', 'ds.sessionRenamed': '会话名称已更新', 'ds.sessionArchive': '归档', 'ds.sessionArchiveConfirm': '归档这个会话?归档后可在“显示已归档”中打开。', 'ds.sessionArchived': '会话已归档', 'ds.sessionStop': '停止本轮', 'ds.sessionStopConfirm': '停止当前回合?排队中的消息不会被删除。', 'ds.sessionStopFailed': '停止失败', 'ds.sessionStopRequested': '已请求停止本轮', 'ds.sessionRecovering': '恢复会话中…', 'ds.sessionReady': '会话已恢复', 'ds.sessionRecoveryFailed': '会话恢复失败',
|
|
568
575
|
'ds.commands': '指令',
|
|
569
576
|
'ds.cmdCompact': '/compact 压缩对话历史', 'ds.cmdExport': '/export 导出会话日志 ZIP', 'ds.commandTimedOut': '命令执行超时,未作为普通消息发送', 'ds.exportStarted': '会话日志已开始下载,请在浏览器下载中查看', 'ds.exportFailed': '无法导出会话日志:{msg}', 'ds.compacting': '正在压缩对话 · 已用时 {elapsed}', 'ds.compactComplete': '对话压缩完成', 'ds.compactFailed': '对话压缩未完成:{msg}', 'ds.commandRunning': '正在执行 /{command} · 已用时 {elapsed}', 'ds.commandComplete': '/{command} 已完成', 'ds.commandFailed': '/{command} 未完成:{msg}',
|
|
@@ -598,7 +605,7 @@
|
|
|
598
605
|
'ds.back': '‹ 返回', 'ds.emptyGroup': '暂无设置项',
|
|
599
606
|
'ds.serversTitle': '服务器(分组)', 'ds.speedTest': '测速', 'ds.currentGroup': '当前组',
|
|
600
607
|
'ds.addGroup': '+ 组', 'ds.addServer': '添加', 'ds.saveToken': '保存并连接', 'ds.tokenTitle': '访问令牌', 'ds.copyToken': '复制',
|
|
601
|
-
'ds.themeTitle': '皮肤', 'ds.themeDesc': '默认深空 / 落日 / 易北爱乐厅 / 草原孤塔 / 黑曜白 / 蓝色大肥鱼 / 企鹅女管·白昼 / 企鹅女管·极夜 / 波奇酱 / 伊地知虹夏 / 山田凉 / 喜多郁代', 'ds.langTitle': '语言 / Language',
|
|
608
|
+
'ds.themeTitle': '皮肤', 'ds.themeDesc': '默认深空 / 落日 / 易北爱乐厅 / 草原孤塔 / 黑曜白 / 蓝色大肥鱼 / 企鹅女管·白昼 / 企鹅女管·极夜 / 波奇酱 / 伊地知虹夏 / 山田凉 / 喜多郁代 / 企鹅物流', 'ds.langTitle': '语言 / Language',
|
|
602
609
|
'ds.feedbackTitle': '反馈渠道', 'ds.feedbackDesc': 'GitHub / Gitee / B站:反馈 bug、提建议、唠嗑',
|
|
603
610
|
'ds.feedback': '反馈', 'ds.feedbackGithubDesc': '反馈 bug / 提建议', 'ds.feedbackGiteeDesc': '国内镜像,无需代理',
|
|
604
611
|
'ds.feedbackDoctor': 'AI 排查问题', 'ds.feedbackDoctorDesc': '使用你的 DSH 和模型,只读诊断',
|
|
@@ -654,7 +661,7 @@
|
|
|
654
661
|
'ds.groupsConfirmDelete': '删除组「{group}」?组内服务器将归入默认组。', 'ds.groupsDeleted': '组已删除',
|
|
655
662
|
'ds.groupsDrawerOpen': '切换服务器组', 'ds.groupsDrawerClose': '关闭组列表', 'ds.groupsDrawerEyebrow': '快速切换', 'ds.groupsDrawerTitle': '切换服务器组', 'ds.groupsDrawerCurrent': '当前连接组',
|
|
656
663
|
'ds.groupsDrawerManage': '管理服务器与组', 'ds.groupsDrawerManageDesc': '编辑、测速和调整组', 'ds.groupsServerCount': '{count} 台服务器',
|
|
657
|
-
'ds.theme.default': '默认深空', 'ds.theme.dark': '落日', 'ds.theme.light': '易北爱乐厅', 'ds.theme.neutral': '草原孤塔', 'ds.theme.mono': '黑曜白', 'ds.theme.fish': '蓝色大肥鱼', 'ds.theme.penguin': '企鹅女管·白昼', 'ds.theme.penguin-night': '企鹅女管·极夜', 'ds.theme.bocchi': '波奇酱', 'ds.theme.nijika': '伊地知虹夏', 'ds.theme.ryo': '山田凉', 'ds.theme.kita': '喜多郁代',
|
|
664
|
+
'ds.theme.default': '默认深空', 'ds.theme.dark': '落日', 'ds.theme.light': '易北爱乐厅', 'ds.theme.neutral': '草原孤塔', 'ds.theme.mono': '黑曜白', 'ds.theme.fish': '蓝色大肥鱼', 'ds.theme.penguin': '企鹅女管·白昼', 'ds.theme.penguin-night': '企鹅女管·极夜', 'ds.theme.bocchi': '波奇酱', 'ds.theme.nijika': '伊地知虹夏', 'ds.theme.ryo': '山田凉', 'ds.theme.kita': '喜多郁代', 'ds.theme.penguin-logistics': '企鹅物流',
|
|
658
665
|
'ds.role.me': '我', 'ds.role.dsh': 'DSH', 'ds.toolDefault': '工具',
|
|
659
666
|
'ds.eventSystemReminder': '系统提示',
|
|
660
667
|
'ds.questionOptions': '选项', 'ds.questionCustom': '自定义回答',
|
|
@@ -695,6 +702,7 @@
|
|
|
695
702
|
'ds.insightsContext': 'Context analysis',
|
|
696
703
|
'ds.insightsCost': 'Cost & quotas',
|
|
697
704
|
'ds.files': 'Files', 'ds.plugins': 'Plugins', 'ds.settings': 'Settings', 'ds.stats': 'Stats', 'ds.menu': 'Menu',
|
|
705
|
+
'slash.suggestions': 'Commands and skills', 'slash.command': 'Command', 'slash.skill': 'Skill',
|
|
698
706
|
'ds.send': 'Send', 'ds.composerPlaceholder': 'Type a message, Enter to send…', 'ds.composerRunning': 'Running…', 'ds.presets': 'Presets', 'ds.sessionRename': 'Rename session', 'ds.sessionRenameTitle': 'Rename session', 'ds.sessionRenamePlaceholder': 'Enter a new session name', 'ds.sessionRenameConfirm': 'Save', 'ds.sessionRenameFailed': 'Rename failed', 'ds.sessionRenameEmpty': 'Session name cannot be empty', 'ds.sessionRenamed': 'Session name updated', 'ds.sessionArchive': 'Archive', 'ds.sessionArchiveConfirm': 'Archive this session? You can open it from “Show archived”.', 'ds.sessionArchived': 'Session archived', 'ds.sessionStop': 'Stop turn', 'ds.sessionStopConfirm': 'Stop the current turn? Queued messages will be kept.', 'ds.sessionStopFailed': 'Stop failed', 'ds.sessionStopRequested': 'Stop requested', 'ds.sessionRecovering': 'Restoring session…', 'ds.sessionReady': 'Session ready', 'ds.sessionRecoveryFailed': 'Session restore failed',
|
|
699
707
|
'ds.commands': 'Commands',
|
|
700
708
|
'ds.cmdCompact': '/compact Compress conversation history', 'ds.cmdExport': '/export Export session log ZIP', 'ds.commandTimedOut': 'Command timed out and was not sent as a chat message', 'ds.exportStarted': 'Session log download started; check your browser downloads', 'ds.exportFailed': 'Could not export session log: {msg}', 'ds.compacting': 'Compressing conversation · {elapsed} elapsed', 'ds.compactComplete': 'Conversation compression complete', 'ds.compactFailed': 'Conversation compression did not finish: {msg}', 'ds.commandRunning': 'Running /{command} · {elapsed} elapsed', 'ds.commandComplete': '/{command} complete', 'ds.commandFailed': '/{command} did not finish: {msg}',
|
|
@@ -728,7 +736,7 @@
|
|
|
728
736
|
'ds.back': '‹ Back', 'ds.emptyGroup': 'No settings here',
|
|
729
737
|
'ds.serversTitle': 'Servers (groups)', 'ds.speedTest': 'Test', 'ds.currentGroup': 'Current group',
|
|
730
738
|
'ds.addGroup': '+ Group', 'ds.addServer': 'Add', 'ds.saveToken': 'Save and connect', 'ds.tokenTitle': 'Access token', 'ds.copyToken': 'Copy',
|
|
731
|
-
'ds.themeTitle': 'Theme', 'ds.themeDesc': 'Deep Space / Sunset / Elbphilharmonie / Prairie Tower / Monochrome / Blue Fat Fish / Penguin Admin Day / Penguin Admin Night / Bocchi / Nijika / Ryo / Kita', 'ds.langTitle': 'Language',
|
|
739
|
+
'ds.themeTitle': 'Theme', 'ds.themeDesc': 'Deep Space / Sunset / Elbphilharmonie / Prairie Tower / Monochrome / Blue Fat Fish / Penguin Admin Day / Penguin Admin Night / Bocchi / Nijika / Ryo / Kita / Penguin Logistics', 'ds.langTitle': 'Language',
|
|
732
740
|
'ds.feedbackTitle': 'Feedback', 'ds.feedbackDesc': 'GitHub / Gitee / Bilibili: report bugs, suggest features, or just chat',
|
|
733
741
|
'ds.feedback': 'Feedback', 'ds.feedbackGithubDesc': 'Report bugs · suggest features', 'ds.feedbackGiteeDesc': 'Mirror in China, no proxy needed',
|
|
734
742
|
'ds.feedbackDoctor': 'AI diagnosis', 'ds.feedbackDoctorDesc': 'Read-only diagnosis with your own DSH and model',
|
|
@@ -785,7 +793,7 @@
|
|
|
785
793
|
'ds.groupsConfirmDelete': 'Delete group "{group}"? Its servers move to the default group.', 'ds.groupsDeleted': 'Group deleted',
|
|
786
794
|
'ds.groupsDrawerOpen': 'Switch server group', 'ds.groupsDrawerClose': 'Close group list', 'ds.groupsDrawerEyebrow': 'QUICK SWITCH', 'ds.groupsDrawerTitle': 'Switch server group', 'ds.groupsDrawerCurrent': 'Current connection group',
|
|
787
795
|
'ds.groupsDrawerManage': 'Manage servers and groups', 'ds.groupsDrawerManageDesc': 'Edit, test, and organize groups', 'ds.groupsServerCount': '{count} servers',
|
|
788
|
-
'ds.theme.default': 'Deep Space', 'ds.theme.dark': 'Sunset', 'ds.theme.light': 'Elbphilharmonie', 'ds.theme.neutral': 'Prairie Tower', 'ds.theme.mono': 'Monochrome', 'ds.theme.fish': 'Blue Fat Fish', 'ds.theme.penguin': 'Penguin Admin Day', 'ds.theme.penguin-night': 'Penguin Admin Night', 'ds.theme.bocchi': 'Bocchi', 'ds.theme.nijika': 'Nijika', 'ds.theme.ryo': 'Ryo', 'ds.theme.kita': 'Kita',
|
|
796
|
+
'ds.theme.default': 'Deep Space', 'ds.theme.dark': 'Sunset', 'ds.theme.light': 'Elbphilharmonie', 'ds.theme.neutral': 'Prairie Tower', 'ds.theme.mono': 'Monochrome', 'ds.theme.fish': 'Blue Fat Fish', 'ds.theme.penguin': 'Penguin Admin Day', 'ds.theme.penguin-night': 'Penguin Admin Night', 'ds.theme.bocchi': 'Bocchi', 'ds.theme.nijika': 'Nijika', 'ds.theme.ryo': 'Ryo', 'ds.theme.kita': 'Kita', 'ds.theme.penguin-logistics': 'Penguin Logistics',
|
|
789
797
|
'ds.role.me': 'Me', 'ds.role.dsh': 'DSH', 'ds.toolDefault': 'tool',
|
|
790
798
|
'ds.eventSystemReminder': 'System reminder',
|
|
791
799
|
'ds.questionOptions': 'Options', 'ds.questionCustom': 'Custom answer',
|
|
@@ -824,48 +832,49 @@
|
|
|
824
832
|
</div>
|
|
825
833
|
<div class="image-lightbox-hint" data-image-lightbox-hint>双击放大 · 点空白处关闭</div>
|
|
826
834
|
</div>
|
|
827
|
-
<script src="i18n.js?dsr-build=
|
|
828
|
-
<link rel="stylesheet" href="../genui.css?dsr-build=
|
|
829
|
-
<script src="../genui.js?dsr-build=
|
|
830
|
-
<script src="../chat-files.js?dsr-build=
|
|
831
|
-
<script src="../md.js?dsr-build=
|
|
832
|
-
<script src="../vendor/gsap/gsap.min.js?dsr-build=
|
|
833
|
-
<script src="../motion.js?dsr-build=
|
|
834
|
-
<script type="module" src="../morphicons-init.js?dsr-build=
|
|
835
|
-
<script src="../plugin-center.js?dsr-build=
|
|
836
|
-
<script src="../skills.js?dsr-build=
|
|
837
|
-
<script src="../insights.js?dsr-build=
|
|
838
|
-
<script src="../teams.js?dsr-build=
|
|
839
|
-
<script src="../task-board.js?dsr-build=
|
|
840
|
-
<script src="../extensions.js?dsr-build=
|
|
841
|
-
<script src="../sha256.js?dsr-build=
|
|
842
|
-
<script src="../diagnostics.js?dsr-build=
|
|
843
|
-
<script src="../doctor.js?dsr-build=
|
|
844
|
-
<script src="../history.js?dsr-build=
|
|
845
|
-
<script src="../activity.js?dsr-build=
|
|
846
|
-
<script src="../turn-results.js?dsr-build=
|
|
847
|
-
<script src="../image-cache.js?dsr-build=
|
|
848
|
-
<script src="../chat-copy.js?dsr-build=
|
|
849
|
-
<script src="../image-preview.js?dsr-build=
|
|
850
|
-
<script src="../link-check.js?dsr-build=
|
|
851
|
-
<script src="../network.js?dsr-build=
|
|
852
|
-
<script src="../operations.js?dsr-build=
|
|
853
|
-
<script src="../workflow.js?dsr-build=
|
|
854
|
-
<script src="../sponsor-entry.js?dsr-build=
|
|
855
|
-
<script src="../relay-devices.js?dsr-build=
|
|
856
|
-
<script src="../relay-settings.js?dsr-build=
|
|
857
|
-
<script src="../subagents.js?dsr-build=
|
|
858
|
-
<script src="../session-presets.js?dsr-build=
|
|
859
|
-
<script src="../permission-presets.js?dsr-build=
|
|
860
|
-
<script src="../approval-records.js?dsr-build=
|
|
861
|
-
<script src="../approval-summary.js?dsr-build=
|
|
862
|
-
<script src="../doctor-entry.js?dsr-build=
|
|
863
|
-
<link rel="stylesheet" href="../file-inbox.css?dsr-build=
|
|
864
|
-
<script src="../file-inbox.js?dsr-build=
|
|
865
|
-
<link rel="stylesheet" href="../session-deck.css?dsr-build=
|
|
866
|
-
<script src="../session-deck.js?dsr-build=
|
|
867
|
-
<script src="../theme.js?dsr-build=
|
|
868
|
-
<script src="../cache-upgrade.js?dsr-build=
|
|
869
|
-
<script src="
|
|
835
|
+
<script src="i18n.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
836
|
+
<link rel="stylesheet" href="../genui.css?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184">
|
|
837
|
+
<script src="../genui.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
838
|
+
<script src="../chat-files.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
839
|
+
<script src="../md.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
840
|
+
<script src="../vendor/gsap/gsap.min.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
841
|
+
<script src="../motion.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
842
|
+
<script type="module" src="../morphicons-init.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
843
|
+
<script src="../plugin-center.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
844
|
+
<script src="../skills.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
845
|
+
<script src="../insights.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
846
|
+
<script src="../teams.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
847
|
+
<script src="../task-board.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
848
|
+
<script src="../extensions.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
849
|
+
<script src="../sha256.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
850
|
+
<script src="../diagnostics.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
851
|
+
<script src="../doctor.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
852
|
+
<script src="../history.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
853
|
+
<script src="../activity.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
854
|
+
<script src="../turn-results.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
855
|
+
<script src="../image-cache.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
856
|
+
<script src="../chat-copy.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
857
|
+
<script src="../image-preview.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
858
|
+
<script src="../link-check.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
859
|
+
<script src="../network.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
860
|
+
<script src="../operations.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
861
|
+
<script src="../workflow.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
862
|
+
<script src="../sponsor-entry.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
863
|
+
<script src="../relay-devices.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
864
|
+
<script src="../relay-settings.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
865
|
+
<script src="../subagents.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
866
|
+
<script src="../session-presets.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
867
|
+
<script src="../permission-presets.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
868
|
+
<script src="../approval-records.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
869
|
+
<script src="../approval-summary.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
870
|
+
<script src="../doctor-entry.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
871
|
+
<link rel="stylesheet" href="../file-inbox.css?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184">
|
|
872
|
+
<script src="../file-inbox.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
873
|
+
<link rel="stylesheet" href="../session-deck.css?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184">
|
|
874
|
+
<script src="../session-deck.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
875
|
+
<script src="../theme.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
876
|
+
<script src="../cache-upgrade.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
877
|
+
<script src="../slash-suggestions.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
878
|
+
<script src="desktop.js?dsr-build=84d998ae3a1302b3e1d02d3cdde5d8f3ad3f8bd963ec0323fd18a675015e1184"></script>
|
|
870
879
|
</body>
|
|
871
880
|
</html>
|
|
@@ -39,7 +39,8 @@ const THEME_META = [
|
|
|
39
39
|
{ id: 'bocchi', sw: ['#FFD9E8', '#FFFFFF', '#D0105A'] },
|
|
40
40
|
{ id: 'nijika', sw: ['#FFF3D5', '#FFFFFF', '#94600C'] },
|
|
41
41
|
{ id: 'ryo', sw: ['#E9F1FA', '#FFFFFF', '#315D91'] },
|
|
42
|
-
{ id: 'kita', sw: ['#FFE9E5', '#FFFFFF', '#B6373C'] }
|
|
42
|
+
{ id: 'kita', sw: ['#FFE9E5', '#FFFFFF', '#B6373C'] },
|
|
43
|
+
{ id: 'penguin-logistics', sw: ['#12161B', '#1D252E', '#E9B66F'] }
|
|
43
44
|
]
|
|
44
45
|
function themeGet() {
|
|
45
46
|
const v = LS.get('dshTheme', '')
|
|
@@ -123,6 +124,7 @@ for (const key of ['server', 'token']) {
|
|
|
123
124
|
if (next === value) return
|
|
124
125
|
cancelHistoryLoad()
|
|
125
126
|
value = next; connectionGeneration++
|
|
127
|
+
window.DshSlashSuggestions?.close()
|
|
126
128
|
window.DshImagePreview?.reset?.()
|
|
127
129
|
clearTimeout(state.refreshTimer); state.refreshTimer = null
|
|
128
130
|
state.sessions = []; state.byId.clear(); state.pendingProjections.clear(); state.runtimeErrors = new Map()
|
|
@@ -301,7 +303,10 @@ function toggleCmdMenuDesktop() {
|
|
|
301
303
|
const menu = $('cmd-menu')
|
|
302
304
|
if (!menu) return
|
|
303
305
|
const willOpen = menu.classList.contains('hidden')
|
|
304
|
-
if (willOpen)
|
|
306
|
+
if (willOpen) {
|
|
307
|
+
void window.DshSlashSuggestions?.openPanel()
|
|
308
|
+
void refreshPermissionPresetsDesktop()
|
|
309
|
+
}
|
|
305
310
|
menu.classList.toggle('hidden', !willOpen)
|
|
306
311
|
}
|
|
307
312
|
|
|
@@ -2350,7 +2355,7 @@ async function loadHistory(reset = true) {
|
|
|
2350
2355
|
|
|
2351
2356
|
const INTERESTING_EVENTS = new Set([
|
|
2352
2357
|
'turn/start', 'turn/end',
|
|
2353
|
-
'user/message', 'assistant/message', 'assistant/attempt', 'tool/call', 'tool/result',
|
|
2358
|
+
'user/message', 'assistant/message', 'assistant/attempt', 'tool/call', 'tool/result', 'tool/ptc-dispatch-start', 'tool/ptc-dispatch',
|
|
2354
2359
|
'agent/status', 'checkpoint/created', 'compaction/complete', 'compaction/summary',
|
|
2355
2360
|
'goal/created', 'goal/updated', 'goal/completed', 'goal/cleared',
|
|
2356
2361
|
'todo/updated', 'plan/updated', 'question/asked', 'question/resolved',
|
|
@@ -2461,18 +2466,6 @@ function systemReminderText(blocks) {
|
|
|
2461
2466
|
.map(b => String(b.text ?? ''))
|
|
2462
2467
|
.join('\n')
|
|
2463
2468
|
}
|
|
2464
|
-
function activityGroupHtml(group) {
|
|
2465
|
-
const items = group.items || []
|
|
2466
|
-
if (!items.length) return ''
|
|
2467
|
-
const tools = items.filter(item => item.kind === 'tool').map(item => item.entry)
|
|
2468
|
-
const running = !!group.running
|
|
2469
|
-
const failed = tools.some(entry => entry.view?.toolActivity?.error || entry.event?.data?.error)
|
|
2470
|
-
const body = items.map(item => item.kind === 'reasoning'
|
|
2471
|
-
? window.DshActivity.reasoning({ text: item.text, key: item.key })
|
|
2472
|
-
: eventHtml(item.entry)).join('')
|
|
2473
|
-
return `<details class="chat-activity-group${failed ? ' is-error' : ''}${running ? ' is-running' : ''}" data-activity-key="activity-group:${items[0]?.seq ?? ''}"><summary><span class="activity-group-title">${esc(t('ds.activity.group', { n: items.length }))}</span>${running ? `<span class="activity-group-live"><i aria-hidden="true"></i>${esc(t('ds.activity.groupRunning'))}</span>` : ''}<span class="activity-chevron" aria-hidden="true"></span></summary><div class="activity-group-body">${body}</div></details>`
|
|
2474
|
-
}
|
|
2475
|
-
|
|
2476
2469
|
function eventHtml(entry) {
|
|
2477
2470
|
if (entry.view?.failureGroup) return window.DshActivity.failureGroupHtml(entry.view.failureGroup, item => eventHtml(item))
|
|
2478
2471
|
const ev = entry.event || {}
|
|
@@ -2482,9 +2475,10 @@ function eventHtml(entry) {
|
|
|
2482
2475
|
if (entry.view?.turnResult) return failure + window.DshTurnResults.html(entry.view.turnResult)
|
|
2483
2476
|
if (type === 'turn/start' || type === 'turn/end') return failure
|
|
2484
2477
|
if (type === 'assistant/attempt') return window.DshActivity?.attemptHtml?.(ev) || ''
|
|
2485
|
-
if (entry.view?.
|
|
2478
|
+
if (entry.view?.activityTurn) return window.DshActivity.turnHtml(entry.view.activityTurn)
|
|
2479
|
+
if (entry.view?.activityGroup) return window.DshActivity.groupHtml(entry.view.activityGroup, eventHtml)
|
|
2486
2480
|
if (!shouldShowEvent(type, ev)) return ''
|
|
2487
|
-
if (window.DshActivity
|
|
2481
|
+
if (window.DshActivity?.isToolEvent?.(type)) return window.DshActivity.toolEvent(entry)
|
|
2488
2482
|
if (type === 'user/message' || type === 'assistant/message') {
|
|
2489
2483
|
const msg = data.message || {}
|
|
2490
2484
|
const role = data.role || msg.role || (type.startsWith('user') ? 'user' : 'assistant')
|
|
@@ -2554,11 +2548,13 @@ function renderHistory(reset=false, mode='auto') {
|
|
|
2554
2548
|
let prepared=window.DshActivity?.prepare(state.history.visible)||state.history.visible
|
|
2555
2549
|
if(weakStreamTrim())prepared=prepared.filter(entry=>entry.event?.type!=='tool/call'||entry.view?.toolActivity)
|
|
2556
2550
|
state.history.suppressBlockTools = state.history.visible.some(entry => entry.event?.type === 'tool/call')
|
|
2557
|
-
|
|
2558
|
-
const
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2551
|
+
const activity = window.DshActivity
|
|
2552
|
+
const groupLive = activity?.group && !weakStreamTrim()
|
|
2553
|
+
if(activity?.group)prepared=activity.group(prepared, {
|
|
2554
|
+
liveReasoning: groupLive ? [...state.history.partialReasoning.values()] : [],
|
|
2555
|
+
running: !!state.byId.get(state.current)?.running,
|
|
2556
|
+
suppressBlockTools: state.history.suppressBlockTools,
|
|
2557
|
+
})
|
|
2562
2558
|
if (window.DshTurnResults) {
|
|
2563
2559
|
prepared = window.DshTurnResults.decorate(prepared, state.history.visible, { sessionId: state.current, canFork: canForkTurnResult() })
|
|
2564
2560
|
bindTurnResultActions()
|
|
@@ -2567,7 +2563,7 @@ function renderHistory(reset=false, mode='auto') {
|
|
|
2567
2563
|
const hostError = state.runtimeErrors?.get(state.current)
|
|
2568
2564
|
const recordedError = state.history.visible.some(entry => window.DshActivity?.failure?.(entry.event)?.message === hostError)
|
|
2569
2565
|
const runtimeHtml = hostError && !recordedError ? window.DshActivity?.failureHtml?.(hostError) || '' : ''
|
|
2570
|
-
getConversationView().set(prepared,{reset,follow:mode==='bottom',live:partialReasoningHtml()+runtimeHtml,hasMore:state.history.hasMore,loading:state.history.loading,emptyLabel:t('ds.historyEmpty')})
|
|
2566
|
+
getConversationView().set(prepared,{reset,follow:mode==='bottom',live:(groupLive?'':partialReasoningHtml())+runtimeHtml,hasMore:state.history.hasMore,loading:state.history.loading,emptyLabel:t('ds.historyEmpty')})
|
|
2571
2567
|
window.DshImagePreview?.hydrate?.($('history'))
|
|
2572
2568
|
}
|
|
2573
2569
|
window.applyStreamPreference=()=>{if(state.current)renderHistory(false,'auto')}
|
|
@@ -2710,7 +2706,7 @@ async function interruptSubagent(childId, parentId = state.current) {
|
|
|
2710
2706
|
const result = await safeRpc('subagent.interrupt', { parentSessionId: parentId, childSessionId: childId, mode: 'continuable' }, t('subagent.interruptFailed'))
|
|
2711
2707
|
if (result == null || !connection.valid() || state.current !== rootId) return
|
|
2712
2708
|
toast(t('subagent.interruptSubmitted'), 'ok')
|
|
2713
|
-
|
|
2709
|
+
return true
|
|
2714
2710
|
}
|
|
2715
2711
|
|
|
2716
2712
|
const NO_FALLBACK_SLASH_COMMANDS = new Set(['compact', 'export'])
|
|
@@ -2826,6 +2822,7 @@ async function waitCommandOperation(sessionId, initial, connection) {
|
|
|
2826
2822
|
}
|
|
2827
2823
|
|
|
2828
2824
|
async function sendMessage(requestedMode = 'queue') {
|
|
2825
|
+
if (typeof window !== 'undefined') window.DshSlashSuggestions?.close()
|
|
2829
2826
|
if (state.byId.get(state.current)?.origin === 'subagent') { toast('子代理记录为只读 / Subagent records are read only'); return false }
|
|
2830
2827
|
const input = $('composer')
|
|
2831
2828
|
const originalText = input.value, text = originalText.trim()
|
|
@@ -4080,6 +4077,7 @@ function openDesktopPlugins(route = 'manage') {
|
|
|
4080
4077
|
}
|
|
4081
4078
|
|
|
4082
4079
|
function showView(id, pluginRoute = 'manage') {
|
|
4080
|
+
window.DshSlashSuggestions?.close()
|
|
4083
4081
|
window.DshExtensions?.closeShortcuts()
|
|
4084
4082
|
if (id !== 'view-chat') window.DshSubagents?.close()
|
|
4085
4083
|
document.body?.classList.toggle('viewing-subagent', id === 'view-chat' && state.byId.get(state.current)?.origin === 'subagent')
|
|
@@ -4275,8 +4273,23 @@ function bindUi() {
|
|
|
4275
4273
|
$('rename-confirm').addEventListener('click', confirmRenameSession)
|
|
4276
4274
|
$('rename-session-input').addEventListener('keydown', e => { if (e.key === 'Enter' && !e.isComposing) confirmRenameSession() })
|
|
4277
4275
|
$('modal-rename').addEventListener('click', e => { if (e.target === $('modal-rename')) closeRenameSession() })
|
|
4278
|
-
$('composer')
|
|
4279
|
-
|
|
4276
|
+
const composer = $('composer')
|
|
4277
|
+
window.DshSlashSuggestions?.mount({
|
|
4278
|
+
input: composer, t,
|
|
4279
|
+
panel: $('desktop-command-list'), chipClass: 'ds-action-item', chipAttribute: 'data-ds-cmd',
|
|
4280
|
+
context() {
|
|
4281
|
+
const connection = captureConnection(), sessionId = state.current, history = state.history
|
|
4282
|
+
if (!sessionId || state.byId.get(sessionId)?.origin === 'subagent') return null
|
|
4283
|
+
return {
|
|
4284
|
+
sessionId, url: path => connection.server + path,
|
|
4285
|
+
headers: { authorization: 'Bearer ' + connection.token, ...clientIdHeaders() },
|
|
4286
|
+
valid: () => connection.valid() && state.current === sessionId && state.history === history,
|
|
4287
|
+
}
|
|
4288
|
+
},
|
|
4289
|
+
readSkills: sessionId => rpc('skills.list', { sessionId }, 5000),
|
|
4290
|
+
})
|
|
4291
|
+
composer.addEventListener('keydown', (e) => {
|
|
4292
|
+
if (!e.defaultPrevented && e.key === 'Enter' && !e.shiftKey && !e.isComposing) { e.preventDefault(); sendMessage() }
|
|
4280
4293
|
})
|
|
4281
4294
|
renderPresetMenuDesktop()
|
|
4282
4295
|
renderPresetSummary()
|
package/public/diagnostics.js
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
'use strict'
|
|
3
3
|
function createDiagnosticSchema() {
|
|
4
4
|
const MAX_EVENTS=160,MAX_CRITICAL=40,MAX_BYTES=48000
|
|
5
|
-
const kinds=new Set(['rpc','history.load','history.cache','history.render','history.row','session.open','session.back','stream.state','stream.retry','poll.state','client.lifecycle','client.error','feedback.submit','announcement.storage','announcement.fetch','announcement.show','announcement.close','announcement.vote','storage.write','diagnostics.persist'])
|
|
5
|
+
const kinds=new Set(['rpc','history.load','history.cache','history.render','history.row','session.open','session.back','stream.state','stream.retry','poll.state','client.lifecycle','client.error','feedback.submit','announcement.storage','announcement.fetch','announcement.show','announcement.close','announcement.vote','storage.write','diagnostics.persist','relay.http','relay.fetch'])
|
|
6
|
+
kinds.add('relay.native')
|
|
6
7
|
const enums={phase:['start','response','prepared','rendered','complete','failed','navigate','cleanup','hit','miss','retry'],channel:['mux','host'],status:['open','closed','connecting','poll','ws','visible','hidden','online','offline','running','stopped','starting','disabled','start-failed','timeout','error','unknown','granted','denied','default'],category:['authentication','timeout','network','render','syntax','upstream','unknown'],errorName:['Error','TypeError','RangeError','SyntaxError','ReferenceError','AbortError','TimeoutError','NetworkError']}
|
|
7
8
|
enums.serviceState=['starting','running','stopped','disabled','start-failed','system-timeout','auth-expired']
|
|
8
9
|
enums.storageKey=['seen','history','votes']
|
|
@@ -13,8 +14,18 @@ function createDiagnosticSchema() {
|
|
|
13
14
|
enums.category.push('storage','validation')
|
|
14
15
|
enums.errorName.push('QuotaExceededError','SecurityError','InvalidStateError','DataError','UnknownError')
|
|
15
16
|
enums.reason=['already-open','already-read','version-warning','empty','http','network','invalid-json','too-large','unavailable']
|
|
17
|
+
enums.httpMethod=['GET','OPTIONS','POST']
|
|
18
|
+
enums.relayRoute=['session.list','session.history','ws-ticket','operations']
|
|
19
|
+
enums.relayStage=['received','opening-channel','forwarding-headers','waiting-response','response','local-busy','connect-failed','forward-failed','request-closed','closed-before-response','response-timeout','response-invalid','response-header-limit','resolve-failed','fetch-failed','accepted','reading-headers','worker-rejected','accept-interrupted','header-eof','header-timeout','header-too-large','header-read-failed','request-line-rejected','request-headers-rejected','listener-closed']
|
|
20
|
+
enums.relayStage.push('native-response','native-timeout','native-network','native-unavailable','native-too-large','native-invalid','native-aborted')
|
|
21
|
+
enums.relayCors=['allowed','missing','mismatch']
|
|
22
|
+
enums.relayMode=['mapped','direct']
|
|
23
|
+
enums.relayListenerBefore=['open','closed','missing']
|
|
24
|
+
enums.relayListenerAfter=['open','closed','missing']
|
|
16
25
|
const numbers=['durationMs','httpStatus','closeCode','attempt','delayMs','count','rawCount','renderedCount','renderErrors','lastSuccessAt','intervalMin','apiLevel','storageChars','storageKeys','legacyCacheChars','legacyCacheKeys','historyCacheChars','sessionCacheChars','announcementChars','diagnosticChars','droppedEvents']
|
|
17
|
-
|
|
26
|
+
numbers.push('relayProxyId','relayAcceptNumber','relayAcceptBefore','relayAcceptAfter')
|
|
27
|
+
numbers.push('relaySlotLimit','relaySlotsUsedBefore','relaySlotsUsedAfter','relayBusyBefore','relayBusyAfter')
|
|
28
|
+
const booleans=['reset','cached','loading','loaded','hasMore','online','enabled','serviceRunning','loginExpired','powerSave','ignoreBatteryOptimizations','notificationsEnabled','persisted','indexedDbAvailable','storageAvailable','relayForwarded','relayBodyForwarded']
|
|
18
29
|
const methods=new Set(['session.list','session.history','session.create','session.prompt','session.fork','session.cancel','session.rename','session.selectModel','session.updateQueue','session.getModels','session.getQueue','session.getCompactionStatus','workspace.list','workspace.create','workspace.archiveSession','host.describe','subagent.list','subagent.interrupt','goal.edit','goal.pause','goal.resume','goal.complete','goal.clear'])
|
|
19
30
|
for(const method of ['session.models','llm.discoverModels','llm.providers','credentials.describe','credentials.set','credentials.unset','settings.describe','settings.mutate','settings.openDocument'])methods.add(method)
|
|
20
31
|
const hex=(v,n)=>typeof v==='string'&&new RegExp('^[a-f0-9]{'+n+'}$').test(v)?v:undefined
|
|
@@ -84,7 +95,22 @@ function createDiagnosticSchema() {
|
|
|
84
95
|
storageAt=now();storageInventory=value;return value
|
|
85
96
|
}
|
|
86
97
|
function snapshot(force=false){let value={};try{value=config.snapshot?.()||{}}catch{};return schema.facts({...value,...storageFacts(force),droppedEvents,sessionRef:pseudonym(value.sessionId),serverRef:pseudonym(value.server||env.location?.origin),online:env.navigator?.onLine!==false})}
|
|
87
|
-
function
|
|
98
|
+
function nativeHttpEvents() {
|
|
99
|
+
try {
|
|
100
|
+
const native = JSON.parse(env.NativeE2ee?.httpDiagnostics?.() || '[]')
|
|
101
|
+
if (!Array.isArray(native)) return []
|
|
102
|
+
const active = new Set(['accepted','reading-headers','received','opening-channel','forwarding-headers','waiting-response'])
|
|
103
|
+
return native.slice(-64).filter(row => Number.isFinite(row?.at)).map(row => ({
|
|
104
|
+
...row, kind:'relay.http',
|
|
105
|
+
phase: active.has(row.relayStage) ? 'start' : row.relayStage === 'response' && row.httpStatus < 400 ? 'response' : 'failed',
|
|
106
|
+
}))
|
|
107
|
+
} catch { return [] }
|
|
108
|
+
}
|
|
109
|
+
function makeReport(force=false){
|
|
110
|
+
trim()
|
|
111
|
+
const events=force?[...rows,...nativeHttpEvents()].sort((a,b)=>a.at-b.at):rows
|
|
112
|
+
return schema.sanitizeReport({schema:1,reportId:random(),capturedAt:now(),client:{...metadata,surface:config.surface||'mobile'},snapshot:snapshot(force),persistence,events})
|
|
113
|
+
}
|
|
88
114
|
const report=()=>makeReport(true)
|
|
89
115
|
function openDatabase(){
|
|
90
116
|
if(database)return database
|
|
@@ -151,7 +177,7 @@ function createDiagnosticSchema() {
|
|
|
151
177
|
function start(kind,fields={}){const begun=now(),traceId=run.slice(0,12)+(++sequence).toString(16).padStart(12,'0');record(kind,{...fields,phase:'start',traceId});return {traceId,end:value=>record(kind,{...fields,...value,traceId,durationMs:now()-begun}),fail:error=>record(kind,{...fields,...errorFacts(error),phase:'failed',traceId,durationMs:now()-begun})}}
|
|
152
178
|
function nativeSnapshot(){try{const value=JSON.parse(env.NativeBackground?.getBackgroundConfig?.()||'{}');return schema.facts({...value,httpStatus:value.lastHttpStatus})}catch{return {}}}
|
|
153
179
|
function configure(value){config=value;record('client.lifecycle',{status:env.document?.visibilityState==='hidden'?'hidden':'visible',...nativeSnapshot()});mount()}
|
|
154
|
-
function clear(){epoch++;rows=[];droppedEvents=0;flush();refreshPreview()}
|
|
180
|
+
function clear(){epoch++;rows=[];droppedEvents=0;try{env.NativeE2ee?.clearHttpDiagnostics?.()}catch{};flush();refreshPreview()}
|
|
155
181
|
function storageFailure(key,error,backend='local'){const category=/^historyCache/.test(key)?'history':/^sessionsCache/.test(key)?'session-list':key==='seenAnnouncementsV1'?'seen':key==='announcementHistoryV1'?'history':key==='announcementVotesV1'?'votes':/^dshApprovalRecordsV1/.test(key)?'approvals':'settings';storageFacts(true);return record('storage.write',{phase:'failed',storageKey:category,storageBackend:backend,...errorFacts(error)})}
|
|
156
182
|
function text(){return JSON.stringify(report(),null,2)}
|
|
157
183
|
const label=(zh,en)=>env.I18N?.lang==='en'?en:zh
|