dsh-remote-plugin 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +2 -2
- package/README.md +2 -2
- package/apk/dsh-remote.apk +0 -0
- package/client.js +96 -115
- package/file-delivery.mjs +84 -0
- package/gateway.cjs +247 -3
- package/index.mjs +574 -48
- package/package.json +3 -2
- package/plugin-center.mjs +4 -0
- package/public/activity.js +8 -3
- package/public/announcements.json +10 -0
- package/public/app.js +60 -20
- package/public/approval-records.js +75 -3
- package/public/build.json +2 -2
- package/public/desktop/desktop.css +9 -1
- package/public/desktop/desktop.html +23 -4
- package/public/desktop/desktop.js +27 -13
- package/public/extensions.css +13 -0
- package/public/extensions.js +74 -3
- package/public/file-inbox.css +66 -0
- package/public/file-inbox.js +289 -0
- package/public/index.html +25 -9
- package/public/plugin.js +21 -6
- package/public/session-deck.css +73 -0
- package/public/session-deck.js +180 -0
- package/public/styles.css +22 -2
- package/public/update.json +8 -8
- package/public/version.json +1 -1
- package/skills/dsh-remote-doctor/references/wiki/plugins.md +22 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-remote-plugin",
|
|
3
|
-
"version": "0.8.
|
|
4
|
-
"description": "DSH Remote 官方 bundle
|
|
3
|
+
"version": "0.8.1",
|
|
4
|
+
"description": "DSH Remote 官方 bundle 插件:更多菜单中的手机连接入口、首次连接提示与浏览器管理控制台;内置网关自动启停,支持手机远程会话、审批、文件互传和设备管理。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.mjs",
|
|
7
7
|
"exports": {
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"skills.mjs",
|
|
30
30
|
"doctor-skill.mjs",
|
|
31
31
|
"doctor-target.mjs",
|
|
32
|
+
"file-delivery.mjs",
|
|
32
33
|
"skills",
|
|
33
34
|
"session-file.mjs"
|
|
34
35
|
],
|
package/plugin-center.mjs
CHANGED
|
@@ -229,6 +229,10 @@ export function createPluginCenter(ctx, options = {}) {
|
|
|
229
229
|
const errorLog = openSync(join(profile.dir, '.remote-plugin-center', 'worker-' + args[2] + '.log'), 'a', 0o600)
|
|
230
230
|
let child
|
|
231
231
|
try {
|
|
232
|
+
// 这里是短命的插件事务 worker:只在插件安装/更新期间存在,不构成对 DSH 安装目录的
|
|
233
|
+
// 长期占用,因此继续使用 process.execPath(桌面版会显式加 ELECTRON_RUN_AS_NODE)。
|
|
234
|
+
// 若将来出现同类 Windows 文件锁(占用 DSH 安装目录导致更新失败),再统一到
|
|
235
|
+
// packages/plugin/index.mjs 的 resolveGatewayRuntime()。
|
|
232
236
|
child = spawn(process.execPath, [...(desktop ? ['--expose-internals'] : []), workerFile, '--worker', ...args], {
|
|
233
237
|
cwd: profile.dir, detached: true, windowsHide: true, stdio: ['ignore', 'ignore', errorLog],
|
|
234
238
|
env: { ...process.env, ...(desktop ? { ELECTRON_RUN_AS_NODE: '1' } : {}) },
|
package/public/activity.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
;(function(root){
|
|
4
4
|
const esc=value=>String(value??'').replace(/[&<>"']/g,char=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[char]))
|
|
5
5
|
const text=(zh,en)=>root.I18N?.lang==='en'?en:zh
|
|
6
|
+
// Test a copy only: joiners remain significant inside real words and emoji.
|
|
7
|
+
const hasVisibleText=value=>String(value??'').replace(/[\u200b-\u200d\u2060\ufeff]/g,'').trim().length>0
|
|
6
8
|
const json=value=>{try{return typeof value==='string'?value:JSON.stringify(value,null,2)??''}catch{return String(value)}}
|
|
7
9
|
const cut=(value,length)=>{const source=String(value??'');return source.length>length?source.slice(0,length)+'…':source}
|
|
8
10
|
const brief=value=>cut(String(value??'').replace(/\s+/g,' ').trim(),100)
|
|
@@ -25,7 +27,8 @@
|
|
|
25
27
|
function tool(value={}){
|
|
26
28
|
const args=value.args,returned=Object.hasOwn(value,'result'),error=!!value.error
|
|
27
29
|
const section=(title,content)=>`<section><h4>${esc(title)}</h4><pre>${esc(cut(json(content),12000))}</pre></section>`
|
|
28
|
-
const
|
|
30
|
+
const translated=returned?root.DshApprovalRecords?.feedbackHtml(value.result):''
|
|
31
|
+
const body=(args===undefined?'':section(text('参数','Arguments'),args))+(returned?(translated||section(text('结果','Result'),value.result)):`<p class="activity-note">${esc(text('当前记录中尚无对应结果。','No matching result in the loaded history.'))}</p>`)
|
|
29
32
|
return shell('tool',value.key,value.name||text(returned?'工具结果':'工具调用',returned?'Tool result':'Tool call'),argumentHint(args),text(error?'返回错误':returned?'已返回':'已调用',error?'Error':returned?'Returned':'Called'),body,false,error)
|
|
30
33
|
}
|
|
31
34
|
const dataOf=entry=>entry.event?.data||{}
|
|
@@ -97,7 +100,9 @@
|
|
|
97
100
|
if(!reasoning.length)continue
|
|
98
101
|
const rest=parts.blocks.filter(block=>!reasoningKind(block))
|
|
99
102
|
const copy=stripReasoning(entry,rest)
|
|
100
|
-
|
|
103
|
+
// Tools and other block types can still carry content. Only text-only blanks
|
|
104
|
+
// are removed here; the block renderer decides whether tools are suppressed.
|
|
105
|
+
stripped.set(entry,{copy,empty:!rest.some(block=>block?.type!=='text'||hasVisibleText(block.text))})
|
|
101
106
|
reasoning.forEach((block,index)=>items.push({kind:'reasoning',seq:Number(entry.seq)+(index+1)/1000,text:String(block.text??block.content??''),key:'reasoning:'+entry.seq+':'+index}))
|
|
102
107
|
}
|
|
103
108
|
if(items.length>1){
|
|
@@ -177,7 +182,7 @@
|
|
|
177
182
|
return [...blocks].filter(([,value])=>value).map(([index,value])=>reasoning({text:value,key:`attempt:${event.seq}:${index}`})).join('')+failureHtml(failure(event),true)
|
|
178
183
|
}
|
|
179
184
|
const streamNotice=()=>`<div class="activity-note" role="status">${esc(text('弱网精简已隐藏实时思考,完成后可查看;可在网络设置中关闭精简。','Live reasoning is hidden in weak-network mode. View it after completion or disable trimming in network settings.'))}</div>`
|
|
180
|
-
const api={prepare,tool,toolEvent,reasoning,reasoningKey,group,failure,failureHtml,groupFailures,failureGroupHtml,attemptHtml,streamNotice}
|
|
185
|
+
const api={hasVisibleText,prepare,tool,toolEvent,reasoning,reasoningKey,group,failure,failureHtml,groupFailures,failureGroupHtml,attemptHtml,streamNotice}
|
|
181
186
|
if(typeof module!=='undefined'&&module.exports)module.exports=api
|
|
182
187
|
else root.DshActivity=api
|
|
183
188
|
})(typeof window==='undefined'?globalThis:window)
|
|
@@ -185,6 +185,16 @@
|
|
|
185
185
|
"minVersion": "",
|
|
186
186
|
"maxVersion": "",
|
|
187
187
|
"publishedAt": "2026-10-16T09:27:32.340Z"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"id": "release-0.8.0-stable",
|
|
191
|
+
"title": "DSH Remote 0.8.0 正式发布|1024 程序员节快乐!",
|
|
192
|
+
"content": "今天是 1024 程序员节,先祝每一位写代码、做项目、爱折腾的朋友节日快乐!不管你是在赶项目、学新东西,还是把脑海里的点子慢慢做出来,都希望今天的你能收获一点成就感。愿大家少一点 Bug,多一点灵感,写得顺手,也记得按时吃饭、好好休息。\n\n趁着这个日子,DSH Remote 0.8.0 正式版也和大家见面了。\n\n从最初希望用手机连上自己的 DSH,到现在逐步补齐会话、文件和插件相关操作,很多改进都来自大家实际使用时的一句反馈:某个地方不好找,某次切网后没恢复,某条历史消息打不开,或者希望在手机上也能看看团队和任务的进展。感谢每一位参与 RC 测试、提交问题、补充日志和提出建议的朋友,这些具体反馈帮助我们找到了需要改进的地方。\n\n【01|本次更新】\n\n「常用入口更清楚」\n围绕「会话、文件、更多」整理操作入口,补充新手引导,让第一次安装、配对和打开会话更容易跟上。蓝色大肥鱼主题也继续打磨,优化团队、任务看板和窄屏下的排版,同时保留已经选择的主题。\n\n「会话与文件操作继续补齐」\n改进远程对话、审批提问、历史恢复、弱网重连和发送回执,让你更容易看清操作有没有送达、连接是否正在恢复。文件预览、上传与断点续传也做了修复和优化,方便在手机与主机之间查看、交换资料。\n\n「更多主机插件信息可以在手机上查看」\n本次补充和优化了上下文、费用与额度、智能体团队、任务看板等适配,也改善了插件状态诊断和实验性插件的展示。你可以更方便地了解任务进展、团队状态,以及需要处理的提示;具体能力仍取决于主机安装并启用的插件和它们提供的接口。\n\n「出了问题,有文档可以一起查」\n新增操作与排障知识库,把连接、会话、文件、插件等常见问题整理到一起。你可以自己查找,也可以把文档交给正在协助你的 AI,让排查有具体步骤和依据。与此同时,本轮修复了特定文本导致的会话卡死,并继续完善插件远程自更新、网关启动和多平台兼容。\n\n项目仍保持单文件网关零运行时依赖、WebUI 零构建的形态。接下来也会继续根据真实反馈做修复和更新,让这些已经加入的功能更稳定、更好用。\n\n【02|云中转计划 · 尚未上线】\n\n不少朋友希望,离开家里或办公室后,也能用手机接着查看自己的 DSH:看看任务进行到哪一步,处理需要确认的操作,或者把需要的文件带走。因此,我们接下来会尝试推出付费云服务器中转服务,目标是减少公网访问和网络配置带来的麻烦,让手机和主机在能够正常联网的前提下,更方便地建立远程连接。\n\n这里也提前说明:「付费服务尚未正式上线」\n价格、流量额度、可用地区、开放时间和具体使用规则,会在测试后另行公布。电脑仍需开机,DSH 与 Remote 网关需保持运行;云中转的数据转发方式、运营维护安排和隐私边界,也会在开通前明确告知。当前已有的连接方式仍可按原方式使用,大家可以根据自己的网络环境选择。\n\n【03|你希望适配哪些插件?】\n\n你最希望把哪个 DSH 插件带到手机上?欢迎通过 QQ 群或 GitHub Issues 推荐,告诉我们三件事:\n\n• 插件名称或链接。\n• 最想在手机上完成的操作。\n• 具体使用场景,以及现在遇到的不方便。\n\n比如,你想在外面查看定时任务的执行情况、了解智能体团队卡在哪一步,或者查看某个常用插件的状态。这样的描述会帮助我们判断,手机端应该提供什么入口、展示哪些信息。后续会结合需求、插件接口和维护成本安排适配,确定方向后再说明实现范围与进展。\n\n【04|投票与问题反馈】\n\n今后的投票会说明参与方式与截止时间。投票结束后,我们会在一周内通过应用公告公布结果,并在群里同步后续安排;如果某个方向还需要调研,也会先说明评估进展。希望大家能看到自己的意见被如何考虑,也知道接下来可以期待什么。\n\n反馈问题时,欢迎附上 App、插件和 DSH 的版本,以及具体操作步骤和脱敏截图。请不要公开 Remote 令牌、中转密钥或模型 API Key。信息越清楚,我们越容易复现和定位。\n\n【05|交流与下载】\n\nQQ 交流群:1106138825。\n\n欢迎来聊聊使用体验、推荐想适配的插件、交流排障经验,也可以分享你正在用 DSH 做什么。无论是一个刚开始的小点子,还是已经跑起来的项目,都欢迎一起交流。\n\n0.8.0 正式版已发布,可以在下方链接查看更新并下载。建议同时更新手机 App 和主机上的 Remote 插件,更新后完整重启对应的 DSH;原有主机信息和令牌请妥善保留。\n\n下载:https://github.com/Blank-not-black/dsh-Remote/releases/tag/v0.8.0\n\n项目:https://github.com/Blank-not-black/dsh-Remote\n\n最后,再次感谢大家一路以来的支持。祝大家 1024 程序员节快乐!愿工具替你少跑腿,让你多留一点时间给有意思的事,也给屏幕之外的生活。",
|
|
193
|
+
"minVersion": "",
|
|
194
|
+
"maxVersion": "",
|
|
195
|
+
"publishedAt": "2026-10-24T08:42:27.788Z",
|
|
196
|
+
"actionUrl": "https://github.com/Blank-not-black/dsh-Remote/releases/tag/v0.8.0",
|
|
197
|
+
"actionText": "下载 0.8.0 正式版"
|
|
188
198
|
}
|
|
189
199
|
]
|
|
190
200
|
}
|
package/public/app.js
CHANGED
|
@@ -137,6 +137,8 @@ for (const key of ['server', 'token']) {
|
|
|
137
137
|
window.DshInsights?.close()
|
|
138
138
|
window.DshExtensions?.close()
|
|
139
139
|
window.DshExtensions?.invalidateCapabilities()
|
|
140
|
+
window.DshFileInbox?.reset()
|
|
141
|
+
window.DshSessionDeck?.reset()
|
|
140
142
|
if (typeof document !== 'undefined') document.getElementById('btn-insights')?.classList.add('hidden')
|
|
141
143
|
if(typeof document!=='undefined') {
|
|
142
144
|
const identityGeneration=connectionGeneration
|
|
@@ -328,6 +330,7 @@ async function copyText(text) {
|
|
|
328
330
|
} catch { return false }
|
|
329
331
|
}
|
|
330
332
|
function openFeedbackSheet() {
|
|
333
|
+
window.DshExtensions?.closeShortcuts()
|
|
331
334
|
$('feedback-backdrop').classList.remove('hidden')
|
|
332
335
|
$('feedback-sheet').classList.remove('hidden')
|
|
333
336
|
$('btn-feedback').setAttribute('aria-expanded', 'true')
|
|
@@ -2595,6 +2598,8 @@ function bindNativeBack() {
|
|
|
2595
2598
|
if (customSelectCurrent) { closeCustomSelect(); return }
|
|
2596
2599
|
if (groupDrawerOpen()) { closeGroupDrawer(); return }
|
|
2597
2600
|
if (typeof window !== 'undefined' && window.DshImagePreview?.isOpen?.()) { window.DshImagePreview.close(); return }
|
|
2601
|
+
if (typeof window !== 'undefined' && window.DshExtensions?.closeShortcuts(true)) return
|
|
2602
|
+
if (typeof window !== 'undefined' && window.DshFileInbox?.close()) return
|
|
2598
2603
|
const dialog = document.querySelector('dialog[open]')
|
|
2599
2604
|
if (dialog) { dialog.close(); return }
|
|
2600
2605
|
const openModal = [...document.querySelectorAll('.modal')].find(m => !m.classList.contains('hidden'))
|
|
@@ -3153,7 +3158,7 @@ function blockHtml(b,index=0,context={}) {
|
|
|
3153
3158
|
if (b.type==='tool-call'||b.type==='tool-result') return window.DshActivity.tool({key,name:b.name||b.toolName,...(b.type==='tool-call'?{args:b.arguments??b.args??b.input}:{result:b.result??b.output??b.content??b,error:!!(b.error||b.ok===false||b.isError)})})
|
|
3154
3159
|
}
|
|
3155
3160
|
switch (b.type) {
|
|
3156
|
-
case 'text': return `<div class="md">${window.mdToHtml ? window.mdToHtml(b.text ?? '', { fileLinks: true, imageLabel: t('block.image') }) : esc(b.text ?? '')}</div>`
|
|
3161
|
+
case 'text': return window.DshActivity.hasVisibleText(b.text) ? `<div class="md">${window.mdToHtml ? window.mdToHtml(b.text ?? '', { fileLinks: true, imageLabel: t('block.image') }) : esc(b.text ?? '')}</div>` : ''
|
|
3157
3162
|
case 'file': if (typeof window !== 'undefined' && window.DshChatFiles) return window.DshChatFiles.render(b); return `<div class="tool">📎 ${esc(b.attachment?.name || b.name || 'file')} <small>${esc(b.attachment?.bytes ?? b.bytes ?? '')} bytes</small></div>`
|
|
3158
3163
|
case 'image': {
|
|
3159
3164
|
if (b.attachment && window.DshImagePreview) return window.DshImagePreview.attachmentHtml(b.attachment, t('block.image'), state.current)
|
|
@@ -3246,27 +3251,25 @@ async function renderSessionCards() {
|
|
|
3246
3251
|
|
|
3247
3252
|
if (goal && !isGoalTerminal(goal)) {
|
|
3248
3253
|
const collapsed = isGoalCollapsed(sessionId, goal)
|
|
3249
|
-
html += `<div class="goal-disclosure${collapsed ? ' is-collapsed' : ''}">
|
|
3254
|
+
html += `<div data-deck-kind="goal" class="goal-disclosure${collapsed ? ' is-collapsed' : ''}">
|
|
3250
3255
|
<div id="goal-panel-mobile" class="card goal-card${collapsed ? ' hidden' : ''}">
|
|
3251
|
-
<div class="goal-card-head"><div class="card-title">${t('goal.title')}</div>
|
|
3256
|
+
<div class="goal-card-head"><div class="card-title">${esc(window.DshSessionDeck?.goalState(goal.phase) || goal.phase || t('goal.title'))}</div>
|
|
3252
3257
|
<button type="button" class="goal-collapse-btn" data-goal-collapse="1" aria-expanded="true" aria-controls="goal-panel-mobile" title="${esc(t('goal.collapse'))}"><span aria-hidden="true">›</span>${t('goal.collapseShort')}</button>
|
|
3253
3258
|
</div>
|
|
3254
3259
|
<div class="goal-obj">${esc(goal.objective || '')}</div>
|
|
3255
|
-
<div class="goal-phase">phase: ${esc(goal.phase || '?')} · revision ${goal.revision ?? '?'}</div>
|
|
3256
3260
|
<div class="goal-actions">
|
|
3257
3261
|
${goal.phase === 'active' ? '<button class="mini-btn" data-goal="pause">' + t('goal.pause') + '</button>' : '<button class="mini-btn" data-goal="resume">' + t('goal.resume') + '</button>'}
|
|
3258
3262
|
<button class="mini-btn" data-goal="complete">${t('goal.complete')}</button>
|
|
3259
|
-
<button class="mini-btn" data-goal="edit">${t('goal.edit')}</button>
|
|
3260
|
-
<button class="mini-btn" data-goal="clear">${t('goal.clear')}</button>
|
|
3263
|
+
<details class="deck-more" data-deck-details="goal-${esc(goal.id || '')}"><summary>${I18N.lang === 'en' ? 'More' : '更多'}</summary><div class="deck-full-content">${esc(goal.objective || '')}<p>revision ${esc(goal.revision ?? '?')}</p></div><div class="goal-actions"><button class="mini-btn" data-goal="edit">${t('goal.edit')}</button><button class="mini-btn" data-goal="clear">${t('goal.clear')}</button></div></details>
|
|
3261
3264
|
</div>
|
|
3262
3265
|
</div>
|
|
3263
3266
|
<button type="button" class="goal-side-tab${collapsed ? '' : ' hidden'}" data-goal-collapse="0" aria-expanded="false" aria-controls="goal-panel-mobile" aria-label="${esc(t('goal.expand'))}" title="${esc(t('goal.expand'))}"><span aria-hidden="true">‹</span><span>${t('goal.title')}</span><small>${t('goal.collapsedHint')}</small></button>
|
|
3264
3267
|
</div>`
|
|
3265
3268
|
}
|
|
3266
3269
|
if (todos?.items?.length) {
|
|
3267
|
-
html += `<div class="card"
|
|
3270
|
+
html += `<div data-deck-kind="todos" class="card">${window.DshSessionDeck?.taskHtml(todos.items) || `<div class="card-title">${t('todos.title')}</div>${todos.items.map(t =>
|
|
3268
3271
|
`<div><span class="pill ${t.status === 'completed' ? 'done' : t.status === 'in_progress' ? 'active' : ''}">${esc(t.status || 'pending')}</span>${esc(t.content || '')}</div>`
|
|
3269
|
-
).join('')}</div>`
|
|
3272
|
+
).join('')}`}</div>`
|
|
3270
3273
|
}
|
|
3271
3274
|
box.innerHTML = html
|
|
3272
3275
|
box.querySelectorAll('[data-goal]').forEach(btn =>
|
|
@@ -4358,13 +4361,14 @@ function renderPending() {
|
|
|
4358
4361
|
|
|
4359
4362
|
function approvalDetail(a) {
|
|
4360
4363
|
const lines = []
|
|
4361
|
-
if (a?.reason) lines.push(String(a.reason))
|
|
4364
|
+
if (a?.reason) lines.push(window.DshApprovalRecords?.displayReason(a.reason) || String(a.reason))
|
|
4362
4365
|
if (a?.arguments !== undefined) lines.push(safeJson(a.arguments))
|
|
4363
4366
|
if (a?.callId) lines.push(`callId: ${a.callId}`)
|
|
4364
4367
|
return lines.join('\n') || t('pending.noReason')
|
|
4365
4368
|
}
|
|
4366
4369
|
|
|
4367
4370
|
function renderSessionPending() {
|
|
4371
|
+
window.DshFileInbox?.render()
|
|
4368
4372
|
const box = $('session-pending')
|
|
4369
4373
|
if (!box) return
|
|
4370
4374
|
const sessionId = state.current
|
|
@@ -4375,11 +4379,11 @@ function renderSessionPending() {
|
|
|
4375
4379
|
box.classList.toggle('hidden', !sessionId || !items.length)
|
|
4376
4380
|
if (!sessionId || !items.length) { box.innerHTML = ''; return }
|
|
4377
4381
|
box.innerHTML = `<div class="session-pending-head"><span>${esc(t('overview.attention'))}</span><span>${esc(t('pending.count', { n: items.length }))}</span></div><div class="session-pending-list">${items.map(({ kind, item }) => {
|
|
4378
|
-
if (kind === 'approval') return `<article class="pending-card approval" data-session-approval="${esc(item.approvalId)}"
|
|
4382
|
+
if (kind === 'approval') return `<article class="pending-card approval" data-session-approval="${esc(item.approvalId)}">${window.DshSessionDeck?.approvalHtml(item, approvalDetail(item)) || `
|
|
4379
4383
|
<div class="pc-title">${esc(item.toolName || t('tool.default'))}</div>
|
|
4380
4384
|
<div class="pc-desc">${esc(approvalDetail(item))}</div>
|
|
4381
4385
|
<div class="goal-actions"><button type="button" class="mini-btn" data-session-approve="1">${t('pending.allow')}</button><button type="button" class="mini-btn" data-session-approve="0">${t('pending.reject')}</button></div>
|
|
4382
|
-
</article>`
|
|
4386
|
+
`}</article>`
|
|
4383
4387
|
return `<button type="button" class="pending-card question" data-session-question="${esc(item.rpcId)}" aria-haspopup="dialog">
|
|
4384
4388
|
<span class="question-card-head"><span class="pc-title">❓ ${esc(item.questions?.[0]?.header || t('notify.questionTitle'))}</span><span class="mini-btn">${t('pending.answer')}</span></span>
|
|
4385
4389
|
<span class="question-summary">${esc(questionSummary(item))}</span>
|
|
@@ -5493,7 +5497,7 @@ function renderAnnouncementBoard() {
|
|
|
5493
5497
|
return `<button class="overview-announcement-card ${poll ? 'poll' : 'notice'}" type="button" data-home-announcement="${esc(item.id)}">
|
|
5494
5498
|
<span class="overview-announcement-meta"><span class="overview-announcement-badge">${esc(t(poll ? 'overview.communityPoll' : 'overview.communityNotice'))}</span><span class="overview-announcement-new">${esc(t('overview.communityNew'))}</span><span class="overview-announcement-date">${esc(date)}</span></span>
|
|
5495
5499
|
<span class="overview-announcement-title">${esc(item.title)}</span>
|
|
5496
|
-
<span class="overview-announcement-copy">${esc(item.content)}</span>
|
|
5500
|
+
<span class="overview-announcement-copy">${esc(item.summary || item.content)}</span>
|
|
5497
5501
|
<span class="overview-announcement-footer"><span>${esc(action)}</span><span aria-hidden="true">›</span></span>
|
|
5498
5502
|
</button>`
|
|
5499
5503
|
}).join('')
|
|
@@ -5513,7 +5517,7 @@ function renderAnnouncementHistory() {
|
|
|
5513
5517
|
const pollAction = item.poll ? (vote
|
|
5514
5518
|
? `<div class="announcement-poll-status">${esc(t('announcement.voteThanks', { option: vote.option.label }))}</div>`
|
|
5515
5519
|
: `<button class="mini-btn" type="button" data-announcement-poll="${esc(item.id)}">${esc(t('announcement.voteFromHistory'))}</button>`) : ''
|
|
5516
|
-
return `<details class="announcement-history-item"><summary><span>${esc(item.title)}</span><small>${esc(date)}</small></summary><div class="announcement-history-content">${
|
|
5520
|
+
return `<details class="announcement-history-item"><summary><span>${esc(item.title)}</span><small>${esc(date)}</small></summary><div class="announcement-history-content">${announcementBodyHtml(item)}${action}${pollAction}</div></details>`
|
|
5517
5521
|
}).join('')
|
|
5518
5522
|
}
|
|
5519
5523
|
function openAnnouncementHistory() {
|
|
@@ -5531,6 +5535,30 @@ function announcementVersionMatch(item) {
|
|
|
5531
5535
|
if (max && cmpVersion(state.localVersion, max) > 0) return false
|
|
5532
5536
|
return true
|
|
5533
5537
|
}
|
|
5538
|
+
function normalizeAnnouncementPresentation(item) {
|
|
5539
|
+
if (typeof item?.summary !== 'string' || !Array.isArray(item.sections) || !item.sections.length || item.sections.length > 8) return {}
|
|
5540
|
+
const summary = item.summary.trim()
|
|
5541
|
+
if (!summary || summary.length > 2000) return {}
|
|
5542
|
+
let length = summary.length
|
|
5543
|
+
const sections = []
|
|
5544
|
+
for (const row of item.sections) {
|
|
5545
|
+
if (!row || typeof row.title !== 'string' || typeof row.content !== 'string') return {}
|
|
5546
|
+
const title = row.title.trim(), content = row.content.trim()
|
|
5547
|
+
if (!title || title.length > 160 || !content || content.length > 10000) return {}
|
|
5548
|
+
length += title.length + content.length
|
|
5549
|
+
if (length > 20000) return {}
|
|
5550
|
+
sections.push({ title, content, expanded: row.expanded === true })
|
|
5551
|
+
}
|
|
5552
|
+
return { summary, sections }
|
|
5553
|
+
}
|
|
5554
|
+
function announcementBodyHtml(item) {
|
|
5555
|
+
const text = value => esc(String(value ?? '').replace(/\r\n?/g, '\n')).replace(/\n/g, '<br>')
|
|
5556
|
+
const presentation = normalizeAnnouncementPresentation(item)
|
|
5557
|
+
if (!presentation.sections) return text(item?.content)
|
|
5558
|
+
return `<div class="announcement-summary">${text(presentation.summary)}</div><div class="announcement-sections">` + presentation.sections.map(section =>
|
|
5559
|
+
`<details class="announcement-section"${section.expanded ? ' open' : ''}><summary><span class="announcement-section-title">${esc(section.title)}</span><span class="announcement-section-expand">${esc(t('announcement.expand'))}</span><span class="announcement-section-collapse">${esc(t('announcement.collapse'))}</span></summary><div class="announcement-section-body">${text(section.content)}</div></details>`
|
|
5560
|
+
).join('') + '</div>'
|
|
5561
|
+
}
|
|
5534
5562
|
function normalizeAnnouncementPoll(value, announcementId) {
|
|
5535
5563
|
if (window.DshAnnouncementForms) return window.DshAnnouncementForms.normalize(value, announcementId)
|
|
5536
5564
|
if (!value || typeof value !== 'object') return null
|
|
@@ -5569,6 +5597,7 @@ function normalizeAnnouncement(item, base) {
|
|
|
5569
5597
|
}
|
|
5570
5598
|
return {
|
|
5571
5599
|
id, title, content, actionUrl,
|
|
5600
|
+
...normalizeAnnouncementPresentation(item),
|
|
5572
5601
|
actionText: String(item.actionText || '').trim().slice(0, 80),
|
|
5573
5602
|
publishedAt: Number.isFinite(startsAt) ? startsAt : 0,
|
|
5574
5603
|
force: item.force === true,
|
|
@@ -5612,7 +5641,7 @@ function renderAnnouncementModal() {
|
|
|
5612
5641
|
if (!item) return
|
|
5613
5642
|
state.announcement = item
|
|
5614
5643
|
$('announcement-title').textContent = item.title
|
|
5615
|
-
$('announcement-content').innerHTML =
|
|
5644
|
+
$('announcement-content').innerHTML = announcementBodyHtml(item)
|
|
5616
5645
|
renderAnnouncementPoll(item)
|
|
5617
5646
|
const action = $('announcement-action')
|
|
5618
5647
|
if (item.actionUrl) {
|
|
@@ -6880,7 +6909,8 @@ async function openModelConfigDocument() {
|
|
|
6880
6909
|
if (value?.opened) toast(t('settings.modelOpenedConfig'), 'ok')
|
|
6881
6910
|
}
|
|
6882
6911
|
/* ---------------- 视图切换 ---------------- */
|
|
6883
|
-
function showView(id) {
|
|
6912
|
+
function showView(id, pluginRoute = 'manage') {
|
|
6913
|
+
window.DshExtensions?.closeShortcuts()
|
|
6884
6914
|
if (id !== 'view-session') window.DshSubagents?.close()
|
|
6885
6915
|
document.body?.classList.toggle('viewing-subagent', id === 'view-session' && state.byId.get(state.current)?.origin === 'subagent')
|
|
6886
6916
|
window.DshWorkflow?.close()
|
|
@@ -6890,19 +6920,19 @@ function showView(id) {
|
|
|
6890
6920
|
for (const v of ['view-home', 'view-files', 'view-session', 'view-activity', 'view-plugins', 'view-settings']) $(v).classList.toggle('hidden', v !== id)
|
|
6891
6921
|
// 离开会话页必须清掉 in-session, 否则其他页面顶栏被 body 样式隐藏
|
|
6892
6922
|
document.body.classList.toggle('in-session', id === 'view-session')
|
|
6923
|
+
window.DshFileInbox?.render()
|
|
6924
|
+
window.DshSessionDeck?.refresh()
|
|
6893
6925
|
if (id === 'view-session') conversationView?.resume()
|
|
6894
6926
|
$('session-actions')?.close()
|
|
6895
6927
|
$('session-info')?.close()
|
|
6896
6928
|
document.querySelectorAll('.nav-btn').forEach(b => b.classList.toggle('active', b.dataset.view === id))
|
|
6897
|
-
// 主页已有上下文明确的刷新按钮,避免顶栏出现第二个同义入口。
|
|
6898
|
-
$('btn-refresh')?.classList.toggle('hidden', id === 'view-activity')
|
|
6899
6929
|
window.DshMotion?.view($(id))
|
|
6900
6930
|
window.scrollTo(0, 0)
|
|
6901
6931
|
if (id === 'view-files' && !state.fs.loaded) {
|
|
6902
6932
|
const workspace = workspaceById(state.fs.workspaceId)
|
|
6903
6933
|
loadFs(workspace?.path || null, { silent: true, resetRoot: true })
|
|
6904
6934
|
}
|
|
6905
|
-
if (id === 'view-plugins') openPluginPage()
|
|
6935
|
+
if (id === 'view-plugins') openPluginPage(pluginRoute)
|
|
6906
6936
|
else window.DshExtensions?.close()
|
|
6907
6937
|
if (id === 'view-settings') showSettingsHome()
|
|
6908
6938
|
if(id==='view-activity')startOverviewDetection(true);else {overviewDetector?.pause();overviewPulse?.pause()}
|
|
@@ -6935,7 +6965,7 @@ function updateConn() {
|
|
|
6935
6965
|
const ms = cur ? state.serverLatency[serverKey(cur)] : undefined
|
|
6936
6966
|
const curGroup = cur ? cur.group : state.activeGroup
|
|
6937
6967
|
const curLabel = cur ? (cur.note || cur.url) : (state.server || t('speed.origin'))
|
|
6938
|
-
const titleBase = t('conn.titleGroup', { group: curGroup, url: curLabel, ms: Number.isFinite(ms) ? ms + 'ms' : '—' })
|
|
6968
|
+
const titleBase = t('conn.titleGroup', { group: curGroup, url: curLabel, ms: Number.isFinite(ms) ? ms + 'ms' : '—' }) + ' · ' + t('conn.refresh')
|
|
6939
6969
|
if (!navigator.onLine) {
|
|
6940
6970
|
el.textContent = t('conn.offline')
|
|
6941
6971
|
el.className = 'topbar-btn conn-badge off'
|
|
@@ -7815,7 +7845,11 @@ function bindUi() {
|
|
|
7815
7845
|
$('btn-stats').addEventListener('click', () => { renderSessionCards(); $('modal-stats').classList.remove('hidden') })
|
|
7816
7846
|
$('btn-insights').addEventListener('click', () => openInsights())
|
|
7817
7847
|
$('stats-close').addEventListener('click', () => $('modal-stats').classList.add('hidden'))
|
|
7818
|
-
$('
|
|
7848
|
+
$('conn-badge').addEventListener('click', () => { toast(t('common.refreshing')); openStreams(); void refreshAll() })
|
|
7849
|
+
window.DshExtensions?.bindShortcuts({ trigger: $('btn-plugin-shortcuts'), menu: $('plugin-shortcuts-menu'),
|
|
7850
|
+
config: () => optionalPluginConfig(), connected: () => !!state.token, hasSession: () => !!state.current,
|
|
7851
|
+
beforeOpen: () => { closeFeedbackSheet(); closeGroupDrawer({ restoreFocus: false }) },
|
|
7852
|
+
open: route => { if (route === 'context') void openInsights('context', true); else showView('view-plugins', route) } })
|
|
7819
7853
|
$('overview-refresh').addEventListener('click', () => {
|
|
7820
7854
|
toast(t('common.refreshing'))
|
|
7821
7855
|
startOverviewDetection(true)
|
|
@@ -8391,3 +8425,9 @@ function openPluginPage(route = 'manage') {
|
|
|
8391
8425
|
|
|
8392
8426
|
// Operation logs stay on this device; users can copy or export them.
|
|
8393
8427
|
globalThis.DshDiagnostics?.configure({surface:"mobile",copy:copyText,snapshot:()=>({sessionId:state.current,server:state.server,loading:!!state.history.loading,loaded:!!state.history.loaded,count:state.history.visible.length,...globalThis.DshDiagnostics.nativeSnapshot()})})
|
|
8428
|
+
globalThis.DshFileInbox?.mount({ capture: captureConnection, url: apiUrl,
|
|
8429
|
+
context: () => ({ sessionId: state.current, inChat: !$('view-session').classList.contains('hidden') }),
|
|
8430
|
+
sessionTitle: id => sessionTitleValue(state.byId.get(id)), openFiles: () => showView('view-files'),
|
|
8431
|
+
headers: connection => ({ authorization: 'Bearer ' + connection.token, 'x-dsh-remote-client': CAP?.isNativePlatform?.() ? 'app' : 'web', ...clientIdHeaders() }),
|
|
8432
|
+
native: () => CAP?.isNativePlatform?.() ? window.NativeFile : null })
|
|
8433
|
+
globalThis.DshSessionDeck?.mount({ context: () => ({ sessionId: state.current, inChat: !$('view-session').classList.contains('hidden') }) })
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
const MAX_TEXT = 600
|
|
8
8
|
const AUTO_DENIED = /^Auto review rejected tool "([^"]+)"; its body was not executed(?::\s*([\s\S]*))?$/
|
|
9
9
|
const AUTO_ASKED = /^Auto review denied tool "([^"]+)"(?::\s*([\s\S]*))?$/
|
|
10
|
+
const AUTO_FAILED = /^Auto review of tool "([^"]+)" failed; its body was not executed(?::\s*([\s\S]*))?$/
|
|
10
11
|
const ESCALATION = /^escalate sandbox to ([a-z-]+):\s*([\s\S]*)$/
|
|
11
12
|
const OUTCOMES = {
|
|
12
13
|
'allowed-once': 'approval.outcomeAllowed',
|
|
@@ -38,6 +39,75 @@
|
|
|
38
39
|
))
|
|
39
40
|
const timeOf = value => Number.isFinite(Number(value)) && Number(value) > 0 ? Number(value) : 0
|
|
40
41
|
|
|
42
|
+
// 本地机械词句替换,不调用模型或外部翻译服务。未识别的原文保持不变。
|
|
43
|
+
// 先保护命令、路径、URL 和引号内容,避免翻译工具参数或改变其含义。
|
|
44
|
+
function chineseReference(value) {
|
|
45
|
+
const original = String(value || ''), protectedParts = []
|
|
46
|
+
let output = original.replace(/`[^`]*`|"[^"\n]*"|(?<![A-Za-z0-9])'[^'\n]*'|https?:\/\/[^\s]+|[A-Za-z]:[\\/][^\s,;]+|(?:\.{0,2}\/)[^\s,;]+/g, part => {
|
|
47
|
+
protectedParts.push(part); return '\uE000' + (protectedParts.length - 1) + '\uE001'
|
|
48
|
+
})
|
|
49
|
+
const phrases = [
|
|
50
|
+
[/\b(?:this|the) (?:command|action|operation) (?:would|will) delete files outside (?:of )?(?:the )?workspace\b/gi, '此操作将删除工作区之外的文件'],
|
|
51
|
+
[/\b(?:this|the) (?:command|action|operation) (?:could|may|might|can) delete files outside (?:of )?(?:the )?workspace\b/gi, '此操作可能删除工作区之外的文件'],
|
|
52
|
+
[/\bthe user (?:has not|hasn't) (?:explicitly )?authorized (?:this|the) (?:action|operation|command)\b/gi, '用户尚未明确授权此操作'],
|
|
53
|
+
[/\bthe user (?:did not|didn't) request\b/gi, '用户未要求'],
|
|
54
|
+
[/\bnot (?:explicitly )?requested by the user\b/gi, '用户未明确要求'],
|
|
55
|
+
[/\bno (?:explicit )?user (?:authorization|approval|consent)\b/gi, '没有明确的用户授权'],
|
|
56
|
+
[/\b(?:this|the) (?:command|action|operation|tool call) (?:could|may|might|can)\b/gi, '此操作可能'],
|
|
57
|
+
[/\b(?:this|the) (?:command|action|operation|tool call) (?:would|will)\b/gi, '此操作将'],
|
|
58
|
+
[/\b(?:is|are) not (?:explicitly )?authorized\b/gi, '未获明确授权'],
|
|
59
|
+
[/\b(?:is|are) not allowed\b/gi, '不允许'],
|
|
60
|
+
[/\b(?:does not|doesn't) (?:have|include) (?:explicit )?(?:user )?(?:authorization|approval)\b/gi, '未获得用户明确授权'],
|
|
61
|
+
[/\bwithout (?:explicit )?user (?:approval|authorization|consent)\b/gi, '未经用户明确批准'],
|
|
62
|
+
[/\b(?:requires?|needs?) (?:explicit )?user (?:approval|authorization|confirmation)\b/gi, '需要用户明确批准'],
|
|
63
|
+
[/\b(?:outside|out of) (?:of )?(?:the )?(?:(?:allowed|approved|current) )?workspace\b/gi, '在工作区之外'],
|
|
64
|
+
[/\boutside (?:the )?(?:authorized|approved) scope\b/gi, '超出已授权范围'],
|
|
65
|
+
[/\b(?:user |explicit )?(?:authorization|approval) is (?:missing|required|unclear|insufficient)\b/gi, '缺少明确的用户授权'],
|
|
66
|
+
[/\brecursive(?:ly)? delet(?:e|es|ion|ing)\b/gi, '递归删除'],
|
|
67
|
+
[/\bdelet(?:e|es|ing) (?:existing )?files\b/gi, '删除文件'],
|
|
68
|
+
[/\b(?:overwrite|overwrites|overwriting) (?:existing )?(?:files|data)\b/gi, '覆盖已有文件或数据'],
|
|
69
|
+
[/\birreversible (?:actions?|operations?|changes?)\b/gi, '不可逆操作'],
|
|
70
|
+
[/\bdestructive (?:actions?|operations?|changes?)\b/gi, '破坏性操作'],
|
|
71
|
+
[/\b(?:expose|leak|exfiltrate) (?:secrets|credentials|tokens|sensitive data)\b/gi, '泄露密钥、凭据或敏感数据'],
|
|
72
|
+
[/\b(?:send|transmit|upload) (?:private|sensitive|local) (?:data|files)\b/gi, '发送私有或敏感数据'],
|
|
73
|
+
[/\buntrusted (?:server|endpoint|service|destination)\b/gi, '不可信的服务'],
|
|
74
|
+
[/\bexternal (?:server|endpoint|service|destination)\b/gi, '外部服务'],
|
|
75
|
+
[/\b(?:elevated|administrator|admin) privileges\b/gi, '管理员权限'],
|
|
76
|
+
[/\bpermission denied\b/gi, '权限被拒绝'], [/\baccess denied\b/gi, '访问被拒绝'],
|
|
77
|
+
[/\bread[- ]only\b/gi, '只读'], [/\bnetwork access\b/gi, '网络访问'],
|
|
78
|
+
[/\b(?:review|request) timed out\b/gi, '审查请求超时'], [/\btimeout\b/gi, '超时'],
|
|
79
|
+
[/\b(?:risk of|may cause) data loss\b/gi, '可能导致数据丢失'],
|
|
80
|
+
]
|
|
81
|
+
for (const [pattern, replacement] of phrases) output = output.replace(pattern, replacement)
|
|
82
|
+
return output.replace(/\uE000(\d+)\uE001/g, (_match, index) => protectedParts[Number(index)] ?? _match)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function feedback(value) {
|
|
86
|
+
const raw = String(value || ''), denied = AUTO_DENIED.exec(raw), asked = AUTO_ASKED.exec(raw), failed = AUTO_FAILED.exec(raw)
|
|
87
|
+
const match = denied || asked || failed
|
|
88
|
+
if (!match || root.I18N?.lang === 'en') return { text: raw, translated: false }
|
|
89
|
+
const prefix = failed ? '自动审查失败,工具未执行' : denied ? '自动审查拒绝,工具未执行' : '自动审查未通过,等待人工决定'
|
|
90
|
+
return { text: prefix + '(' + match[1] + ')' + (match[2] ? ':' + chineseReference(match[2]) : ''), translated: true }
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function displayReason(value) {
|
|
94
|
+
const raw = String(value || ''), rendered = feedback(raw)
|
|
95
|
+
return rendered.translated ? rendered.text + '\n\n原文:' + raw : raw
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function feedbackHtml(value) {
|
|
99
|
+
let raw = typeof value === 'string' ? value : ''
|
|
100
|
+
if (!raw && value && typeof value === 'object') {
|
|
101
|
+
const blocks = Array.isArray(value) ? value : value.content
|
|
102
|
+
raw = Array.isArray(blocks) ? blocks.filter(block => block?.type === 'text').map(block => String(block.text || '')).join('\n') : typeof value.text === 'string' ? value.text : ''
|
|
103
|
+
}
|
|
104
|
+
const rendered = feedback(raw)
|
|
105
|
+
if (!rendered.translated) return ''
|
|
106
|
+
let original
|
|
107
|
+
try { original = typeof value === 'string' ? value : JSON.stringify(value, null, 2) } catch { original = raw }
|
|
108
|
+
return `<section class="approval-translation"><h4>自动审查反馈 · 中文参考</h4><p>${esc(rendered.text.slice(0, 12000))}</p><details><summary>查看原文</summary><pre>${esc(String(original).slice(0, 12000))}</pre></details></section>`
|
|
109
|
+
}
|
|
110
|
+
|
|
41
111
|
function kindOf(reason) {
|
|
42
112
|
if (AUTO_ASKED.test(reason || '') || AUTO_DENIED.test(reason || '')) return 'auto'
|
|
43
113
|
if (ESCALATION.test(reason || '')) return 'escalation'
|
|
@@ -156,8 +226,10 @@
|
|
|
156
226
|
function reasonHtml(record, t) {
|
|
157
227
|
const info = summary(record)
|
|
158
228
|
const label = t(KIND[info.kind] || KIND.request)
|
|
159
|
-
const
|
|
160
|
-
|
|
229
|
+
const raw = info.text || t('approval.noReason')
|
|
230
|
+
const localized = root.I18N?.lang !== 'en' && ['auto', 'auto-deny'].includes(info.kind) ? chineseReference(raw) : raw
|
|
231
|
+
const original = localized !== raw ? `<details class="approval-original"><summary>查看原文 · 中文为机械翻译参考</summary><div>${esc(raw)}</div></details>` : ''
|
|
232
|
+
return `<div class="approval-record-reason"><span class="approval-record-kind">${esc(label)}</span><div class="approval-record-copy">${esc(localized)}${original}</div></div>`
|
|
161
233
|
}
|
|
162
234
|
|
|
163
235
|
function recordHtml(record, t, { session = '', now = Date.now() } = {}) {
|
|
@@ -224,6 +296,6 @@
|
|
|
224
296
|
|
|
225
297
|
root.DshApprovalRecords = {
|
|
226
298
|
create, fromEvent, fromFrame, summary, kindOf, list, recordHtml, lineHtml,
|
|
227
|
-
outcomeKey, isPending, serialize, restore, relTime, MAX: MAX_RECORDS,
|
|
299
|
+
outcomeKey, isPending, serialize, restore, relTime, chineseReference, displayReason, feedbackHtml, MAX: MAX_RECORDS,
|
|
228
300
|
}
|
|
229
301
|
})(window)
|
package/public/build.json
CHANGED
|
@@ -184,7 +184,9 @@ html.reorder-scroll-lock body { overscroll-behavior: none; }
|
|
|
184
184
|
.ds-text-input { width: 100%; box-sizing: border-box; min-height: 42px; padding: 10px 12px; border: 1px solid var(--dsr-line); border-radius: 10px; background: var(--dsr-bg-2); color: var(--dsr-text); font: inherit; outline: none; }
|
|
185
185
|
.ds-text-input:focus { border-color: var(--dsr-accent-line); }
|
|
186
186
|
.ds-top-right { display: flex; align-items: center; gap: 10px; }
|
|
187
|
-
.ds-conn { font-size: 11px; color: var(--dsr-muted); }
|
|
187
|
+
.ds-conn { min-height:36px; padding:6px 8px; border:1px solid var(--dsr-line); border-radius:10px; background:var(--dsr-bg-2); font:inherit; font-size: 11px; color: var(--dsr-muted); cursor:pointer; }
|
|
188
|
+
.ds-conn:focus-visible { outline:2px solid var(--dsr-accent); outline-offset:2px; }
|
|
189
|
+
.ds-topbar { position:relative; z-index:25; }
|
|
188
190
|
.ds-conn.on { color: var(--dsr-success); }
|
|
189
191
|
.ds-conn.ing { color: var(--dsr-warning); }
|
|
190
192
|
.ds-server { font-size: 12px; color: var(--dsr-muted); max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
@@ -469,6 +471,12 @@ button.ds-overview-attention-item, button.ds-overview-session-item { cursor:poin
|
|
|
469
471
|
.approval-record-badge.pending, .approval-event-badge.pending { color: var(--dsr-warning); border-color: var(--dsr-warning-line); border-style: dashed; }
|
|
470
472
|
.approval-record-reason { display: flex; gap: 6px; font-size: 12px; line-height: 1.5; color: var(--dsr-text); }
|
|
471
473
|
.approval-record-kind { flex: none; font-size: 10px; font-weight: 700; color: var(--dsr-muted); border: 1px solid var(--dsr-line); border-radius: 6px; padding: 0 5px; }
|
|
474
|
+
.approval-record-kind { align-self:flex-start; }
|
|
475
|
+
.approval-record-copy { min-width:0; flex:1; overflow-wrap:anywhere; }
|
|
476
|
+
.approval-original { margin-top:6px; color:var(--dsr-muted); font-size:11px; }
|
|
477
|
+
.approval-original summary { cursor:pointer; }
|
|
478
|
+
.approval-original div { margin-top:6px; white-space:pre-wrap; }
|
|
479
|
+
.approval-translation p { white-space:pre-wrap; overflow-wrap:anywhere; }
|
|
472
480
|
.approval-record-why { font-size: 11.5px; line-height: 1.45; color: var(--dsr-muted); }
|
|
473
481
|
.approval-record-meta { font-size: 10.5px; color: var(--dsr-muted); }
|
|
474
482
|
.approval-event { font-size: 12.5px; color: var(--dsr-text); padding: 3px 0; }
|
|
@@ -121,7 +121,12 @@
|
|
|
121
121
|
<div class="ds-top-right">
|
|
122
122
|
<button id="btn-subagents" class="subagents-entry hidden" type="button" aria-haspopup="dialog" aria-controls="subagent-page" data-i18n="subagent.title">子代理</button>
|
|
123
123
|
<button id="btn-session-more" class="ds-icon-btn" type="button" aria-haspopup="dialog" aria-controls="session-actions" data-i18n-aria="ds.sessionMore" aria-label="更多操作">⋯</button>
|
|
124
|
-
<
|
|
124
|
+
<div class="ext-shortcuts">
|
|
125
|
+
<button id="btn-plugin-shortcuts" class="ds-btn" type="button" aria-haspopup="menu" aria-controls="plugin-shortcuts-menu" aria-expanded="false" data-i18n="ds.plugins">插件</button>
|
|
126
|
+
<div id="plugin-shortcuts-menu" class="ext-shortcuts-menu hidden" role="menu" data-i18n-aria="ds.plugins"></div>
|
|
127
|
+
</div>
|
|
128
|
+
<button class="ds-conn" id="conn-badge" type="button" aria-describedby="conn-refresh-hint" data-i18n-title="ds.connRefresh" data-i18n-aria="ds.connRefresh">●</button>
|
|
129
|
+
<span id="conn-refresh-hint" class="ext-sr-only" data-i18n="ds.connRefresh">点击刷新连接与数据</span>
|
|
125
130
|
<span class="ds-server" id="server-badge"></span>
|
|
126
131
|
</div>
|
|
127
132
|
</header>
|
|
@@ -179,9 +184,16 @@
|
|
|
179
184
|
|
|
180
185
|
<!-- 会话详情 -->
|
|
181
186
|
<section id="view-chat" class="ds-view">
|
|
182
|
-
<
|
|
183
|
-
|
|
184
|
-
|
|
187
|
+
<section id="session-deck" class="session-deck">
|
|
188
|
+
<div id="session-deck-stage" class="session-deck-stage">
|
|
189
|
+
<div id="session-cards" class="ds-session-cards"></div>
|
|
190
|
+
<div id="queue-dock" class="ds-queue-dock hidden" aria-live="polite"></div>
|
|
191
|
+
<div class="session-attention">
|
|
192
|
+
<section id="session-pending" class="ds-session-pending hidden" aria-live="polite"></section>
|
|
193
|
+
<section id="file-inbox-session" class="file-inbox-session" aria-label="待接收文件" aria-live="polite" hidden></section>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
</section>
|
|
185
197
|
<div id="history-source" class="history-source" role="status" aria-live="polite"></div>
|
|
186
198
|
<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>
|
|
187
199
|
<div class="ds-composer">
|
|
@@ -221,6 +233,7 @@
|
|
|
221
233
|
<!-- 文件传输 -->
|
|
222
234
|
<section id="view-files" class="ds-view hidden">
|
|
223
235
|
<div class="ds-section-label" data-i18n="ds.files">文件传输</div>
|
|
236
|
+
<section id="file-inbox-files" class="file-inbox-files" aria-label="文件收件箱"></section>
|
|
224
237
|
<div class="ds-fs-bar">
|
|
225
238
|
<button id="fs-up" class="ds-btn" data-i18n="ds.fsUp">上级</button>
|
|
226
239
|
<select id="fs-root" class="ds-fs-root hidden" data-i18n-aria="ds.fsRoot" aria-label="允许根目录"></select>
|
|
@@ -567,6 +580,7 @@
|
|
|
567
580
|
'ds.attention': '需要你处理', 'ds.runtime': '运行指标', 'ds.recentActivity': '近期活动', 'ds.dshVersion': 'DSH 版本', 'ds.gatewayStatus': '网关状态', 'ds.activeSessions': '活跃会话', 'ds.connectionMode': '连接模式', 'ds.liveWs': '实时 WS', 'ds.poll': '降级轮询', 'ds.running': '运行中', 'ds.noReason': '无说明', 'ds.noActivity': '暂无后台活动', 'ds.noSessions': '暂无会话', 'ds.refreshOverview': '刷新总览', 'ds.pendingCount': '{n} 项待处理', 'ds.activeCount': '{n} 个活跃会话', 'ds.nothingPending': '暂无事项', 'ds.action.openSession': '打开最近会话', 'ds.action.newSession': '新建会话', 'ds.action.attention': '处理待办', 'ds.action.connect': '去设置连接', 'ds.action.refresh': '重新检查连接',
|
|
568
581
|
'ds.sortLabel': '会话排序', 'ds.sortTime': '按时间', 'ds.sortWorkspace': '按工作区', 'ds.workspace': '工作区', 'ds.workspaceUnknown': '未指定工作区', 'ds.wbOrderSaved': '顺序已保存到当前设备',
|
|
569
582
|
'ds.insights': '上下文与费用',
|
|
583
|
+
'ds.connRefresh': '点击刷新连接与数据',
|
|
570
584
|
'ds.insightsContext': '上下文分析',
|
|
571
585
|
'ds.insightsCost': '费用与额度',
|
|
572
586
|
'ds.files': '文件传输', 'ds.plugins': '插件', 'ds.settings': '设置', 'ds.stats': '统计', 'ds.menu': '导航',
|
|
@@ -696,6 +710,7 @@
|
|
|
696
710
|
'ds.attention': 'Needs attention', 'ds.runtime': 'Runtime metrics', 'ds.recentActivity': 'Recent activity', 'ds.dshVersion': 'DSH version', 'ds.gatewayStatus': 'Gateway status', 'ds.activeSessions': 'Active sessions', 'ds.connectionMode': 'Connection mode', 'ds.liveWs': 'Live WS', 'ds.poll': 'Degraded polling', 'ds.running': 'Running', 'ds.noReason': 'No reason given', 'ds.noActivity': 'No background activity', 'ds.noSessions': 'No sessions yet', 'ds.refreshOverview': 'Refresh overview', 'ds.pendingCount': '{n} pending', 'ds.activeCount': '{n} active sessions', 'ds.nothingPending': 'Nothing pending', 'ds.action.openSession': 'Open recent session', 'ds.action.newSession': 'New session', 'ds.action.attention': 'Review pending', 'ds.action.connect': 'Set up connection', 'ds.action.refresh': 'Check connection',
|
|
697
711
|
'ds.sortLabel': 'Session sort', 'ds.sortTime': 'By time', 'ds.sortWorkspace': 'By workspace', 'ds.workspace': 'Workspace', 'ds.workspaceUnknown': 'No workspace', 'ds.wbOrderSaved': 'Order saved on this device',
|
|
698
712
|
'ds.insights': 'Context & costs',
|
|
713
|
+
'ds.connRefresh': 'Click to refresh connection and data',
|
|
699
714
|
'ds.insightsContext': 'Context analysis',
|
|
700
715
|
'ds.insightsCost': 'Cost & quotas',
|
|
701
716
|
'ds.files': 'Files', 'ds.plugins': 'Plugins', 'ds.settings': 'Settings', 'ds.stats': 'Stats', 'ds.menu': 'Menu',
|
|
@@ -858,6 +873,10 @@
|
|
|
858
873
|
<script src="../permission-presets.js"></script>
|
|
859
874
|
<script src="../approval-records.js"></script>
|
|
860
875
|
<script src="../doctor-entry.js"></script>
|
|
876
|
+
<link rel="stylesheet" href="../file-inbox.css">
|
|
877
|
+
<script src="../file-inbox.js"></script>
|
|
878
|
+
<link rel="stylesheet" href="../session-deck.css">
|
|
879
|
+
<script src="../session-deck.js"></script>
|
|
861
880
|
<script src="desktop.js"></script>
|
|
862
881
|
</body>
|
|
863
882
|
</html>
|