dsh-remote-plugin 0.7.5 → 0.7.6
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/package.json +1 -1
- package/public/app.js +101 -12
- package/public/chat-files.js +72 -4
- package/public/desktop/desktop.css +16 -2
- package/public/desktop/desktop.js +26 -9
- package/public/index.html +2 -2
- package/public/md.js +14 -7
- package/public/styles.css +20 -2
- package/public/update.json +6 -6
- package/public/version.json +1 -1
package/apk/dsh-remote.apk
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-remote-plugin",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.6",
|
|
4
4
|
"description": "DSH Remote 官方 bundle 插件:DSH 左侧原生边栏入口 + 右侧抽屉内嵌管理控制台;内置网关随 DSH 自动启停(systemd 独立单元),抽屉直显令牌与设备监控;网关提供 /fs/* 文件传输端点(列表/断点下载/上传),配合 Android App 远程操控会话/审批/提问/goal 与文件互传(多服务器测速切换、聊天记录离线缓存)。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.mjs",
|
package/public/app.js
CHANGED
|
@@ -1455,12 +1455,14 @@ function onResume() {
|
|
|
1455
1455
|
}
|
|
1456
1456
|
window.scrollTo(0, 0)
|
|
1457
1457
|
updateConn()
|
|
1458
|
+
void openPendingNavigation()
|
|
1458
1459
|
}
|
|
1459
1460
|
|
|
1460
1461
|
/* 回前台 / 定时兜底: 任何流不在 OPEN 就重连; 多服务器时顺便重测速 */
|
|
1461
1462
|
document.addEventListener('visibilitychange', () => {
|
|
1462
1463
|
if (document.visibilityState === 'visible') {
|
|
1463
1464
|
onResume()
|
|
1465
|
+
if (window.NativeBackground?.getPendingNavigation?.()) return
|
|
1464
1466
|
if (state.servers.length) selectFastestServer({ silent: true })
|
|
1465
1467
|
else if (state.token) repairMissingStreams()
|
|
1466
1468
|
}
|
|
@@ -1504,17 +1506,22 @@ function onMuxFrame(full) {
|
|
|
1504
1506
|
if (f.type === 'approval/requested') {
|
|
1505
1507
|
state.approvals = state.approvals.filter(a => a.approvalId !== f.approvalId)
|
|
1506
1508
|
state.approvals.push({ ...f, rpcId: full.rpcId })
|
|
1507
|
-
|
|
1509
|
+
notifyPendingRequest(full, t('notify.approvalTitle'), t('notify.approvalBody', { tool: f.toolName || t('tool.unknown') }))
|
|
1508
1510
|
renderPending(); return
|
|
1509
1511
|
}
|
|
1510
|
-
if (f.type === 'approval/resolved') { state.approvals = state.approvals.filter(a => a.approvalId !== f.approvalId); renderPending(); return }
|
|
1512
|
+
if (f.type === 'approval/resolved') { clearPendingNotification(f); state.approvals = state.approvals.filter(a => a.approvalId !== f.approvalId); renderPending(); return }
|
|
1511
1513
|
if (f.type === 'question/requested') {
|
|
1512
1514
|
state.questions = state.questions.filter(q => q.rpcId !== full.rpcId)
|
|
1513
1515
|
state.questions.push({ ...f, rpcId: full.rpcId })
|
|
1514
|
-
|
|
1516
|
+
notifyPendingRequest(full, t('notify.questionTitle'), f.questions?.map(q => q.question).join(' / ') || t('notify.questionBody'))
|
|
1517
|
+
renderPending(); return
|
|
1518
|
+
}
|
|
1519
|
+
if (f.type === 'question/resolved') {
|
|
1520
|
+
clearPendingNotification(f)
|
|
1521
|
+
state.questions = state.questions.filter(q => q.rpcId !== f.questionRpcId)
|
|
1522
|
+
if (state.questionModal?.rpcId === f.questionRpcId) { $('modal-question').classList.add('hidden'); state.questionModal = null }
|
|
1515
1523
|
renderPending(); return
|
|
1516
1524
|
}
|
|
1517
|
-
if (f.type === 'question/resolved') { state.questions = state.questions.filter(q => q.rpcId !== f.questionRpcId); renderPending(); return }
|
|
1518
1525
|
if (f.type === 'session/queue') { state.queues[f.sessionId] = f.items || []; renderQueue(); return }
|
|
1519
1526
|
if (f.type === 'session/jobs') { state.jobs[f.sessionId] = f.jobs || []; renderJobs(); return }
|
|
1520
1527
|
if (f.type === 'session/projection') { applyProjection(f.sessionId, f.key, f.value, f.seq); return }
|
|
@@ -3905,16 +3912,16 @@ function renderSessionPending() {
|
|
|
3905
3912
|
<div class="pc-desc">${esc(approvalDetail(item))}</div>
|
|
3906
3913
|
<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>
|
|
3907
3914
|
</article>`
|
|
3908
|
-
return `<
|
|
3909
|
-
<
|
|
3910
|
-
<
|
|
3911
|
-
</
|
|
3915
|
+
return `<button type="button" class="pending-card question" data-session-question="${esc(item.rpcId)}" aria-haspopup="dialog">
|
|
3916
|
+
<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>
|
|
3917
|
+
<span class="question-summary">${esc(questionSummary(item))}</span>
|
|
3918
|
+
</button>`
|
|
3912
3919
|
}).join('')}</div>`
|
|
3913
3920
|
box.querySelectorAll('[data-session-approve]').forEach(button => {
|
|
3914
3921
|
button.addEventListener('click', () => approveApproval(button.closest('[data-session-approval]')?.dataset.sessionApproval || '', button.dataset.sessionApprove === '1'))
|
|
3915
3922
|
})
|
|
3916
|
-
box.querySelectorAll('[data-session-
|
|
3917
|
-
button.addEventListener('click', () => openQuestionModal(state.questions.find(q => q.rpcId === button.
|
|
3923
|
+
box.querySelectorAll('[data-session-question]').forEach(button => {
|
|
3924
|
+
button.addEventListener('click', () => openQuestionModal(state.questions.find(q => q.rpcId === button.dataset.sessionQuestion)))
|
|
3918
3925
|
})
|
|
3919
3926
|
}
|
|
3920
3927
|
|
|
@@ -3933,21 +3940,42 @@ async function approveApproval(id, allow) {
|
|
|
3933
3940
|
}
|
|
3934
3941
|
if (!connection.valid()) return
|
|
3935
3942
|
toast(ok ? (allow ? t('pending.allowed') : t('pending.rejected')) : t('pending.stale'), ok ? 'ok' : 'err')
|
|
3943
|
+
if (ok) clearPendingNotification({ type: 'approval/resolved', approvalId: a.approvalId })
|
|
3936
3944
|
state.approvals = state.approvals.filter(x => x.rpcId !== a.rpcId)
|
|
3937
3945
|
renderPending()
|
|
3938
3946
|
}
|
|
3939
3947
|
|
|
3948
|
+
function questionSummary(q) {
|
|
3949
|
+
return (q.questions || []).map(item => String(item.question || '').replace(/\[([^\]]+)\]\([^)]+\)/g, '$1').replace(/[*_`#>]/g, '')).join(' / ').replace(/\s+/g, ' ').trim().slice(0, 240)
|
|
3950
|
+
}
|
|
3951
|
+
|
|
3952
|
+
function questionMarkup(item) {
|
|
3953
|
+
const text = String(item.question || '')
|
|
3954
|
+
return (item.header ? `<strong>${esc(item.header)}</strong>` : '') + (window.mdToHtml ? window.mdToHtml(text, { richContent: false, fileLinks: true }) : esc(text))
|
|
3955
|
+
}
|
|
3956
|
+
|
|
3957
|
+
function fitQuestionViewport() {
|
|
3958
|
+
const viewport = window.visualViewport
|
|
3959
|
+
const modal = $('modal-question')
|
|
3960
|
+
if (!modal || !viewport) return
|
|
3961
|
+
modal.style.top = viewport.offsetTop + 'px'
|
|
3962
|
+
modal.style.height = viewport.height + 'px'
|
|
3963
|
+
modal.style.bottom = 'auto'
|
|
3964
|
+
}
|
|
3965
|
+
|
|
3940
3966
|
function openQuestionModal(q) {
|
|
3941
3967
|
if (!q) return
|
|
3942
3968
|
state.questionModal = q
|
|
3943
3969
|
$('question-body').innerHTML = q.questions.map((item, i) => `
|
|
3944
3970
|
<div class="q-item">
|
|
3945
|
-
<div class="q-text">${
|
|
3971
|
+
<div class="q-text md">${questionMarkup(item)}</div>
|
|
3946
3972
|
${(item.options || []).map((o, j) => `
|
|
3947
3973
|
<label class="q-option"><input type="${item.multiSelect ? 'checkbox' : 'radio'}" name="q${i}" value="${esc(o.label)}" data-q="${i}"><span>${esc(o.label)}${o.description ? `<div class="muted">${esc(o.description)}</div>` : ''}</span></label>`).join('')}
|
|
3948
3974
|
<textarea rows="2" placeholder="${t('question.customPlaceholder')}" data-qcustom="${i}"></textarea>
|
|
3949
3975
|
</div>`).join('')
|
|
3950
3976
|
$('modal-question').classList.remove('hidden')
|
|
3977
|
+
$('question-body').scrollTop = 0
|
|
3978
|
+
fitQuestionViewport()
|
|
3951
3979
|
}
|
|
3952
3980
|
|
|
3953
3981
|
async function submitQuestion() {
|
|
@@ -3974,6 +4002,7 @@ async function submitQuestion() {
|
|
|
3974
4002
|
}
|
|
3975
4003
|
if (!connection.valid()) return
|
|
3976
4004
|
if (ok) {
|
|
4005
|
+
clearPendingNotification({ type: 'question/resolved', questionRpcId: q.rpcId })
|
|
3977
4006
|
toast(t('question.submitted'), 'ok')
|
|
3978
4007
|
if (state.questionModal === q) { $('modal-question').classList.add('hidden'); state.questionModal = null }
|
|
3979
4008
|
state.questions = state.questions.filter(x => x.rpcId !== q.rpcId)
|
|
@@ -5442,6 +5471,56 @@ async function downloadUpdate() {
|
|
|
5442
5471
|
|
|
5443
5472
|
/* ---------------- 通知 ---------------- */
|
|
5444
5473
|
const CAP = window.Capacitor || null
|
|
5474
|
+
const pendingNotificationSeen = new Set()
|
|
5475
|
+
function notifyPendingRequest(full, title, body) {
|
|
5476
|
+
const bridge = window.NativeBackground
|
|
5477
|
+
if (bridge?.handlePendingEvent) {
|
|
5478
|
+
bridge.handlePendingEvent(bgBase(), state.token || '', JSON.stringify(full), LS.get('notify', '0') === '1')
|
|
5479
|
+
return
|
|
5480
|
+
}
|
|
5481
|
+
const key = connectionGeneration + ':' + (full.payload?.approvalId || full.rpcId)
|
|
5482
|
+
if (LS.get('notify', '0') !== '1' || pendingNotificationSeen.has(key)) return
|
|
5483
|
+
if (pendingNotificationSeen.size >= 512) pendingNotificationSeen.delete(pendingNotificationSeen.values().next().value)
|
|
5484
|
+
pendingNotificationSeen.add(key)
|
|
5485
|
+
notify(title, body)
|
|
5486
|
+
}
|
|
5487
|
+
function clearPendingNotification(payload) {
|
|
5488
|
+
window.NativeBackground?.handlePendingEvent?.(bgBase(), state.token || '', JSON.stringify({ payload }), false)
|
|
5489
|
+
}
|
|
5490
|
+
|
|
5491
|
+
let pendingNavigationBusy = false, pendingNavigationReady = false
|
|
5492
|
+
async function openPendingNavigation() {
|
|
5493
|
+
const bridge = window.NativeBackground
|
|
5494
|
+
if (!pendingNavigationReady || pendingNavigationBusy || !bridge?.getPendingNavigation) return
|
|
5495
|
+
const raw = bridge.getPendingNavigation()
|
|
5496
|
+
if (!raw) return
|
|
5497
|
+
pendingNavigationBusy = true
|
|
5498
|
+
try {
|
|
5499
|
+
const target = JSON.parse(raw)
|
|
5500
|
+
const matches = (base, token) => bridge.matchesPendingNavigation(base, token, target.identity)
|
|
5501
|
+
if (!matches(bgBase(), state.token || '')) {
|
|
5502
|
+
const server = state.servers.find(s => matches(s.url, serverToken(s)))
|
|
5503
|
+
if (!server) { toast(t('notify.hostUnavailable'), 'err'); bridge.acknowledgePendingNavigation(raw); return }
|
|
5504
|
+
state.activeGroup = server.group
|
|
5505
|
+
state.groupActive[server.group] = server.id
|
|
5506
|
+
state.server = server.url; state.token = serverToken(server)
|
|
5507
|
+
LS.set('token', state.token)
|
|
5508
|
+
saveServers(); syncBgConfig(); renderServers(); openStreams()
|
|
5509
|
+
}
|
|
5510
|
+
bridge.acknowledgePendingNavigation(raw)
|
|
5511
|
+
const connection = captureConnection()
|
|
5512
|
+
await refreshSessions()
|
|
5513
|
+
if (!connection.valid()) return
|
|
5514
|
+
if (state.byId.has(target.sessionId)) await openSession(target.sessionId)
|
|
5515
|
+
else { showView('view-activity'); toast(t('question.stale'), 'err') }
|
|
5516
|
+
} catch (error) { toast(error.message, 'err') }
|
|
5517
|
+
finally {
|
|
5518
|
+
pendingNavigationBusy = false
|
|
5519
|
+
const next = bridge.getPendingNavigation()
|
|
5520
|
+
if (next && next !== raw) void openPendingNavigation()
|
|
5521
|
+
}
|
|
5522
|
+
}
|
|
5523
|
+
window.addEventListener('dsh-pending-navigation', () => void openPendingNavigation())
|
|
5445
5524
|
async function ensureNotify() {
|
|
5446
5525
|
// App 内走原生通知插件(WebView 的 Web Notification 在 MIUI 拿不到权限)
|
|
5447
5526
|
if (CAP?.isNativePlatform?.()) {
|
|
@@ -7267,6 +7346,8 @@ function bindUi() {
|
|
|
7267
7346
|
// 提问
|
|
7268
7347
|
$('question-submit').addEventListener('click', submitQuestion)
|
|
7269
7348
|
$('question-later').addEventListener('click', () => $('modal-question').classList.add('hidden'))
|
|
7349
|
+
window.visualViewport?.addEventListener('resize', fitQuestionViewport)
|
|
7350
|
+
window.visualViewport?.addEventListener('scroll', fitQuestionViewport)
|
|
7270
7351
|
// goal
|
|
7271
7352
|
$('goal-close').addEventListener('click', () => $('modal-goal').classList.add('hidden'))
|
|
7272
7353
|
$('goal-edit').addEventListener('click', submitGoalEdit)
|
|
@@ -7387,12 +7468,14 @@ function bindUi() {
|
|
|
7387
7468
|
toast(t(action === 'send' ? 'settings.mobileEnterSend' : 'settings.mobileEnterNewline'), 'ok')
|
|
7388
7469
|
})
|
|
7389
7470
|
$('opt-notify').checked = LS.get('notify', '0') === '1'
|
|
7471
|
+
window.NativeBackground?.setPendingNotificationsEnabled?.($('opt-notify').checked)
|
|
7390
7472
|
$('opt-notify').addEventListener('change', async (e) => {
|
|
7391
7473
|
if (e.target.checked) {
|
|
7392
7474
|
const ok = await ensureNotify()
|
|
7393
7475
|
if (!ok) { e.target.checked = false; return toast(t('settings.notifyDenied')) }
|
|
7394
7476
|
}
|
|
7395
7477
|
LS.set('notify', e.target.checked ? '1' : '0')
|
|
7478
|
+
window.NativeBackground?.setPendingNotificationsEnabled?.(e.target.checked)
|
|
7396
7479
|
})
|
|
7397
7480
|
$('opt-peak-remind').checked = peakRemindOn()
|
|
7398
7481
|
$('opt-peak-remind').addEventListener('change', async (e) => {
|
|
@@ -7475,7 +7558,11 @@ function bindUi() {
|
|
|
7475
7558
|
|
|
7476
7559
|
bindRail()
|
|
7477
7560
|
|
|
7478
|
-
|
|
7561
|
+
for (const id of ['history', 'question-body']) window.DshChatFiles?.bind($(id), () => {
|
|
7562
|
+
const c=captureConnection(),sessionId=id==='history'?state.current:state.questionModal?.sessionId
|
|
7563
|
+
return { ...c,sessionId,cwd:sessionCwd(state.byId.get(sessionId)),native:!!CAP?.isNativePlatform?.(),headers:{authorization:'Bearer '+c.token,...clientIdHeaders()},notice:toast,
|
|
7564
|
+
valid:()=>c.valid()&&sessionId===(id==='history'?state.current:state.questionModal?.sessionId) }
|
|
7565
|
+
})
|
|
7479
7566
|
initCustomSelects()
|
|
7480
7567
|
|
|
7481
7568
|
$('btn-history-latest').addEventListener('click',()=>{getConversationView().latest();if(state.history.tailEvicted)void loadHistory(true)})
|
|
@@ -7525,6 +7612,8 @@ async function boot() {
|
|
|
7525
7612
|
startAnnouncementPolling()
|
|
7526
7613
|
scheduleStartupNotices()
|
|
7527
7614
|
renderPending()
|
|
7615
|
+
pendingNavigationReady = true
|
|
7616
|
+
void openPendingNavigation()
|
|
7528
7617
|
}
|
|
7529
7618
|
|
|
7530
7619
|
document.addEventListener('DOMContentLoaded', boot)
|
package/public/chat-files.js
CHANGED
|
@@ -1,17 +1,85 @@
|
|
|
1
1
|
/* Explicit user downloads only; attachment IDs never become filesystem paths. */
|
|
2
2
|
(function(root,factory){const api=factory(root);if(typeof module==='object')module.exports=api;root.DshChatFiles=api})(typeof window!=='undefined'?window:globalThis,(root)=>{
|
|
3
3
|
const esc=v=>String(v??'').replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]))
|
|
4
|
+
function relativePath(path) {
|
|
5
|
+
return typeof path==='string' && !!path && path.length<=4096 && !/[\x00-\x1f]/.test(path) && !/^(?:[a-z][a-z0-9+.-]*:|[\\/]|#|\?)/i.test(path)
|
|
6
|
+
&& !/^[a-f0-9]{64}$/i.test(path) && !/[?#]/.test(path)
|
|
7
|
+
&& (/^\.{1,2}[\\/]/.test(path) || /(?:^|[\\/])[^\\/]+\.[^\\/.]+$/.test(path))
|
|
8
|
+
}
|
|
4
9
|
function pathOf(value,cwd='') {
|
|
5
10
|
if(typeof value!=='string'||value.length>4096||/[\x00-\x1f]/.test(value))return ''
|
|
6
11
|
let path=value.trim()
|
|
7
12
|
if(/^file:/i.test(path)){try{const u=new URL(path);if(u.hostname&&u.hostname!=='localhost')return '';path=decodeURIComponent(u.pathname);if(/^\/[a-z]:\//i.test(path))path=path.slice(1)}catch{return ''}}
|
|
8
13
|
if(/[\x00-\x1f]/.test(path))return ''
|
|
9
14
|
if(/^(?:[a-z]:[\\/]|\/(?!\/))/i.test(path))return path
|
|
10
|
-
if(
|
|
15
|
+
if(relativePath(path)){const base=pathOf(cwd);if(base)return base.replace(/[\\/]+$/,'')+'/'+path}
|
|
11
16
|
return ''
|
|
12
17
|
}
|
|
13
18
|
|
|
14
|
-
function render(block)
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
function render(block) {
|
|
20
|
+
const a=block.attachment||block,raw=a.path||block.path||''
|
|
21
|
+
const path=pathOf(raw)||(relativePath(raw)?raw:''),id=/^[a-f0-9]{64}$/.test(a.attachmentId||'')?a.attachmentId:''
|
|
22
|
+
const name=a.name||block.name||'file'
|
|
23
|
+
return `<div class="chat-file"><span class="chat-file-name">📎 ${esc(name)} <small>${esc(a.bytes??block.bytes??'')} bytes</small></span>${id||path?`<button type="button" ${id?'data-dsh-attachment="'+esc(id)+'"':''} ${path?'data-dsh-file-path="'+esc(path)+'"':''} data-dsh-file-name="${esc(name)}">下载文件</button>`:''}</div>`
|
|
24
|
+
}
|
|
25
|
+
async function trackDownload(id,control,c) {
|
|
26
|
+
// New shells expose DownloadManager state; older shells keep their enqueue-only contract.
|
|
27
|
+
for (;;) {
|
|
28
|
+
await new Promise(resolve=>setTimeout(resolve,1000))
|
|
29
|
+
if(!c.valid() || control.isConnected===false)return
|
|
30
|
+
const status=JSON.parse(root.NativeFile.getFileDownloadStatus(String(id))||'{}')
|
|
31
|
+
if(status.phase==='complete'){
|
|
32
|
+
control.textContent='下载完成 · 再次下载'
|
|
33
|
+
c.notice('下载完成:下载/dsh-remote/'+status.name,'ok');return
|
|
34
|
+
}
|
|
35
|
+
if(status.phase==='error')throw Error(status.error||'下载失败,请重试')
|
|
36
|
+
if(status.phase==='unknown')throw Error('系统下载任务已移除,请重试')
|
|
37
|
+
control.textContent=status.phase==='paused'?'下载暂停,等待网络…':'下载中…'
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function bind(target,config){target.addEventListener('click',async event=>{
|
|
41
|
+
const control=event.target.closest?.('[data-dsh-file-path],[data-dsh-attachment]')
|
|
42
|
+
if(!control||!target.contains(control)||control.getAttribute('aria-busy')==='true')return
|
|
43
|
+
event.preventDefault()
|
|
44
|
+
const c=config(),id=control.dataset.dshAttachment,path=pathOf(control.dataset.dshFilePath,c.cwd)
|
|
45
|
+
if(!c.valid())return
|
|
46
|
+
if(!id&&!path){c.notice('无法定位文件,请核对当前会话的工作目录','err');return}
|
|
47
|
+
const name=(control.dataset.dshFileName||path.split(/[\\/]/).pop()||'download').replace(/[\\/\x00-\x1f]/g,'_')
|
|
48
|
+
const makeUrl=attachment=>{
|
|
49
|
+
const url=new URL(c.server+(attachment?'/remote/api/session-file':'/fs/file'),root.location?.href)
|
|
50
|
+
if(attachment){url.searchParams.set('sessionId',c.sessionId);url.searchParams.set('attachmentId',id)}
|
|
51
|
+
else url.searchParams.set('path',path)
|
|
52
|
+
return url
|
|
53
|
+
}
|
|
54
|
+
const head=url=>fetch(url,{method:'HEAD',redirect:'error',headers:c.headers,signal:AbortSignal.timeout(15000)})
|
|
55
|
+
const original=control.textContent
|
|
56
|
+
control.setAttribute('aria-busy','true')
|
|
57
|
+
try{
|
|
58
|
+
let url=makeUrl(!!id),response=await head(url)
|
|
59
|
+
if(!c.valid())return
|
|
60
|
+
// Only an explicit host path can back up an unsupported attachment endpoint.
|
|
61
|
+
if(id&&path&&[404,405,501,503].includes(response.status)){
|
|
62
|
+
url=makeUrl(false);response=await head(url);if(!c.valid())return
|
|
63
|
+
}
|
|
64
|
+
if(!response.ok)throw Error(response.status===403?'主机不允许下载这个文件':response.status===404?'文件不存在或不属于当前会话':[405,501,503].includes(response.status)?'主机版本暂不支持附件下载,请更新主机插件':'文件下载失败(HTTP '+response.status+')')
|
|
65
|
+
if(c.native){
|
|
66
|
+
if(!root.NativeFile?.downloadToDownloads)throw Error('当前 App 不支持系统下载,请更新 App')
|
|
67
|
+
const task=root.NativeFile.downloadToDownloads(url.href,name,c.token)
|
|
68
|
+
if(root.NativeFile.getFileDownloadStatus&&!task)throw Error('系统下载未能启动,请重试')
|
|
69
|
+
c.notice('已交给系统下载,请在下载目录查看','ok')
|
|
70
|
+
if(root.NativeFile.getFileDownloadStatus&&task){
|
|
71
|
+
control.textContent='下载中…'
|
|
72
|
+
await trackDownload(task,control,c)
|
|
73
|
+
}
|
|
74
|
+
}else{
|
|
75
|
+
if(c.token)url.searchParams.set('token',c.token)
|
|
76
|
+
const link=document.createElement('a');link.href=url.href;link.download=name;link.referrerPolicy='no-referrer'
|
|
77
|
+
document.body.append(link);link.click();link.remove()
|
|
78
|
+
c.notice('已交给浏览器下载,请在下载目录查看','ok')
|
|
79
|
+
}
|
|
80
|
+
}catch(error){
|
|
81
|
+
if(c.valid()){control.textContent=original;c.notice(error.message,'err')}
|
|
82
|
+
}finally{control.removeAttribute('aria-busy')}
|
|
83
|
+
})}
|
|
84
|
+
return {pathOf,relativePath,render,bind}
|
|
17
85
|
})
|
|
@@ -297,9 +297,16 @@ button.ds-overview-attention-item, button.ds-overview-session-item { cursor:poin
|
|
|
297
297
|
.ds-presets-guide { padding: 2px 8px 10px; font-size: 11px; line-height: 1.5; }
|
|
298
298
|
.ds-session-cards { flex: none; max-height: 220px; overflow-y: auto; padding: 10px 22px 0; display: flex; flex-direction: column; gap: 8px; }
|
|
299
299
|
.ds-session-cards:empty { display: none; }
|
|
300
|
-
.ds-session-pending { flex:
|
|
300
|
+
.ds-session-pending { flex:0 1 auto; min-height:0; max-height:30vh; max-height:30dvh; display:flex; flex-direction:column; margin:10px 22px 0; padding:10px; border:1px solid var(--dsr-warning-line); border-radius:13px; background:var(--dsr-warning-soft); }
|
|
301
301
|
.ds-session-pending-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; color:var(--dsr-text); font-size:12px; font-weight:750; }
|
|
302
|
-
.ds-session-pending-
|
|
302
|
+
.ds-session-pending-head { flex:none; }
|
|
303
|
+
.ds-session-pending-list { min-height:0; overflow-y:auto; overscroll-behavior:contain; display:flex; flex-direction:column; gap:8px; }
|
|
304
|
+
.ds-session-pending-list > * { flex:none; }
|
|
305
|
+
.ds-session-pending button.question { width:100%; text-align:left; color:inherit; cursor:pointer; font:inherit; }
|
|
306
|
+
.ds-question-card-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:5px; }
|
|
307
|
+
.ds-question-card-head .ds-notif-head { min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
|
|
308
|
+
.ds-question-card-head .ds-btn { flex:none; white-space:nowrap; }
|
|
309
|
+
.ds-question-summary { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; font-size:13px; line-height:1.45; color:var(--dsr-muted); }
|
|
303
310
|
.ds-session-pending .ds-notif-card { min-width:0; box-shadow:none; animation:none; }
|
|
304
311
|
.ds-session-pending .ds-notif-title, .ds-session-pending .ds-notif-body { overflow-wrap:anywhere; word-break:break-word; }
|
|
305
312
|
.ds-card { background: var(--dsr-panel); border: 1px solid var(--dsr-line); border-radius: 12px; padding: 10px 12px; }
|
|
@@ -536,6 +543,13 @@ button.ds-overview-attention-item, button.ds-overview-session-item { cursor:poin
|
|
|
536
543
|
.ds-new-session-name { font-size: 13px; font-weight: 600; }
|
|
537
544
|
.ds-new-session-path { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dsr-muted); font-size: 11.5px; }
|
|
538
545
|
.ds-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
|
|
546
|
+
#modal-question .ds-modal-card { box-sizing:border-box; display:flex; flex-direction:column; min-height:0; max-height:calc(100dvh - 32px); overflow:hidden; }
|
|
547
|
+
#modal-question .ds-modal-title, #modal-question .ds-modal-actions { flex:none; }
|
|
548
|
+
#question-body { min-height:0; max-height:none; overscroll-behavior:contain; overflow-wrap:anywhere; }
|
|
549
|
+
#question-body > * { flex:none; }
|
|
550
|
+
#question-body .ds-q-option { min-height:36px; cursor:pointer; }
|
|
551
|
+
#question-body .ds-q-option > span { min-width:0; }
|
|
552
|
+
#question-body pre { white-space:pre-wrap; overflow-wrap:anywhere; }
|
|
539
553
|
.ds-q-item { border: 1px solid var(--dsr-line); border-radius: 10px; padding: 9px 11px; }
|
|
540
554
|
.ds-q-text { font-size: 13.5px; margin-bottom: 6px; }
|
|
541
555
|
.ds-q-option { display: flex; gap: 7px; align-items: flex-start; font-size: 13px; padding: 3px 0; }
|
|
@@ -1466,7 +1466,11 @@ function onMuxFrame(full) {
|
|
|
1466
1466
|
renderNotifStack()
|
|
1467
1467
|
return
|
|
1468
1468
|
}
|
|
1469
|
-
if (f.type === 'question/resolved') {
|
|
1469
|
+
if (f.type === 'question/resolved') {
|
|
1470
|
+
state.questions = state.questions.filter(q => q.rpcId !== f.questionRpcId)
|
|
1471
|
+
if (state.questionModal?.rpcId === f.questionRpcId) { $('modal-question').classList.add('hidden'); state.questionModal = null }
|
|
1472
|
+
renderNotifStack(); return
|
|
1473
|
+
}
|
|
1470
1474
|
if (f.type === 'session/queue') { state.queues[f.sessionId] = f.items || []; renderQueue(); return }
|
|
1471
1475
|
if (f.type === 'session/projection') { applyProjection(f.sessionId, f.key, f.value, f.seq); return }
|
|
1472
1476
|
if (f.type === 'stream/error') toast(f.error?.message || 'stream error', 'err')
|
|
@@ -2590,14 +2594,13 @@ function renderSessionPendingDesktop() {
|
|
|
2590
2594
|
<div class="ds-notif-body">${esc(desktopApprovalDetail(item))}</div>
|
|
2591
2595
|
<div class="ds-notif-actions"><button type="button" class="ds-btn allow" data-session-approve="1">${t('ds.allow')}</button><button type="button" class="ds-btn reject" data-session-approve="0">${t('ds.reject')}</button></div>
|
|
2592
2596
|
</article>`
|
|
2593
|
-
return `<
|
|
2594
|
-
<
|
|
2595
|
-
<
|
|
2596
|
-
|
|
2597
|
-
</article>`
|
|
2597
|
+
return `<button type="button" class="ds-notif-card question" data-session-question="${esc(item.rpcId)}" aria-haspopup="dialog">
|
|
2598
|
+
<span class="ds-question-card-head"><span class="ds-notif-head">❓ ${esc(item.questions?.[0]?.header || t('ds.questionNotify'))}</span><span class="ds-btn">${t('ds.submit')}</span></span>
|
|
2599
|
+
<span class="ds-question-summary">${esc(questionSummary(item))}</span>
|
|
2600
|
+
</button>`
|
|
2598
2601
|
}).join('')}</div>`
|
|
2599
2602
|
box.querySelectorAll('[data-session-approve]').forEach(button => button.addEventListener('click', () => approveApproval(button.closest('[data-session-approval]')?.dataset.sessionApproval || '', button.dataset.sessionApprove === '1')))
|
|
2600
|
-
box.querySelectorAll('[data-session-
|
|
2603
|
+
box.querySelectorAll('[data-session-question]').forEach(button => button.addEventListener('click', () => openQuestionModal(state.questions.find(q => q.rpcId === button.dataset.sessionQuestion))))
|
|
2601
2604
|
}
|
|
2602
2605
|
function renderNotifStack() {
|
|
2603
2606
|
const stack = $('notif-stack')
|
|
@@ -2660,17 +2663,27 @@ async function approveApproval(id, allow) {
|
|
|
2660
2663
|
state.approvals = state.approvals.filter(x => x.rpcId !== a.rpcId)
|
|
2661
2664
|
renderNotifStack()
|
|
2662
2665
|
}
|
|
2666
|
+
function questionSummary(q) {
|
|
2667
|
+
return (q.questions || []).map(item => String(item.question || '').replace(/\[([^\]]+)\]\([^)]+\)/g, '$1').replace(/[*_`#>]/g, '')).join(' / ').replace(/\s+/g, ' ').trim().slice(0, 240)
|
|
2668
|
+
}
|
|
2669
|
+
|
|
2670
|
+
function questionMarkup(item) {
|
|
2671
|
+
const text = String(item.question || '')
|
|
2672
|
+
return (item.header ? `<strong>${esc(item.header)}</strong>` : '') + (window.mdToHtml ? window.mdToHtml(text, { richContent: false, fileLinks: true }) : esc(text))
|
|
2673
|
+
}
|
|
2674
|
+
|
|
2663
2675
|
function openQuestionModal(q) {
|
|
2664
2676
|
if (!q) return
|
|
2665
2677
|
state.questionModal = q
|
|
2666
2678
|
$('question-body').innerHTML = q.questions.map((item, i) => `
|
|
2667
2679
|
<div class="ds-q-item">
|
|
2668
|
-
<div class="ds-q-text">${
|
|
2680
|
+
<div class="ds-q-text md">${questionMarkup(item)}</div>
|
|
2669
2681
|
${(item.options || []).map((o, j) => `
|
|
2670
2682
|
<label class="ds-q-option"><input type="${item.multiSelect ? 'checkbox' : 'radio'}" name="q${i}" value="${esc(o.label)}"><span>${esc(o.label)}${o.description ? `<div class="muted">${esc(o.description)}</div>` : ''}</span></label>`).join('')}
|
|
2671
2683
|
<textarea rows="2" placeholder="${t('ds.questionCustom')}" data-qcustom="${i}"></textarea>
|
|
2672
2684
|
</div>`).join('')
|
|
2673
2685
|
$('modal-question').classList.remove('hidden')
|
|
2686
|
+
$('question-body').scrollTop = 0
|
|
2674
2687
|
}
|
|
2675
2688
|
async function submitQuestion() {
|
|
2676
2689
|
const connection = captureConnection()
|
|
@@ -3757,7 +3770,11 @@ function bindUi() {
|
|
|
3757
3770
|
if (!e.target.closest('#model-menu') && !e.target.closest('#btn-model')) $('model-menu')?.classList.add('hidden')
|
|
3758
3771
|
})
|
|
3759
3772
|
$('btn-stats-top').addEventListener('click', toggleStatsDrawer)
|
|
3760
|
-
|
|
3773
|
+
for (const id of ['history', 'question-body']) window.DshChatFiles?.bind($(id), () => {
|
|
3774
|
+
const c=captureConnection(),sessionId=id==='history'?state.current:state.questionModal?.sessionId
|
|
3775
|
+
return { ...c,sessionId,cwd:sessionCwd(state.byId.get(sessionId)),native:false,headers:{authorization:'Bearer '+c.token,...clientIdHeaders()},notice:toast,
|
|
3776
|
+
valid:()=>c.valid()&&sessionId===(id==='history'?state.current:state.questionModal?.sessionId) }
|
|
3777
|
+
})
|
|
3761
3778
|
$('btn-insights').addEventListener('click', () => openInsights())
|
|
3762
3779
|
$('stats-drawer-close').addEventListener('click', toggleStatsDrawer)
|
|
3763
3780
|
// 赞赏支持
|
package/public/index.html
CHANGED
|
@@ -985,7 +985,7 @@
|
|
|
985
985
|
'session.stop': '停止本轮', 'session.history': '对话', 'session.errorMsg': '会话出错:{msg}', 'session.recovering': '恢复会话中…', 'session.recoveryReady': '会话已恢复', 'session.recoveryFailed': '会话恢复失败', 'session.recoveryCached': '正在查看缓存历史',
|
|
986
986
|
'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': '会话名称已更新',
|
|
987
987
|
'notify.approvalTitle': '工具审批', 'notify.approvalBody': '{tool} 需要批准', 'notify.questionTitle': 'DSH 提问', 'notify.questionBody': '需要你回答',
|
|
988
|
-
'notify.permissionFailed': '通知权限申请失败:{msg}',
|
|
988
|
+
'notify.permissionFailed': '通知权限申请失败:{msg}', 'notify.hostUnavailable': '此通知所属服务器已移除或令牌已变更,请重新连接后查看待处理事项',
|
|
989
989
|
'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': '重试',
|
|
990
990
|
'history.offlineCache': '离线缓存 {n} 条', 'history.count': '{n} 条', 'history.empty': '还没有消息',
|
|
991
991
|
'history.queueAndCount': '队列 {q} · 历史 {n}', 'history.countOnly': '历史 {n}',
|
|
@@ -1226,7 +1226,7 @@
|
|
|
1226
1226
|
'session.stop': 'Stop turn', 'session.history': 'Conversation', 'session.errorMsg': 'Session error: {msg}', 'session.recovering': 'Restoring session…', 'session.recoveryReady': 'Session ready', 'session.recoveryFailed': 'Session restore failed', 'session.recoveryCached': 'Viewing cached history',
|
|
1227
1227
|
'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',
|
|
1228
1228
|
'notify.approvalTitle': 'Tool approval', 'notify.approvalBody': '{tool} needs approval', 'notify.questionTitle': 'DSH question', 'notify.questionBody': 'Needs your answer',
|
|
1229
|
-
'notify.permissionFailed': 'Notification permission failed: {msg}',
|
|
1229
|
+
'notify.permissionFailed': 'Notification permission failed: {msg}', 'notify.hostUnavailable': 'This notification belongs to a removed server or changed credential. Reconnect to view pending requests.',
|
|
1230
1230
|
'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',
|
|
1231
1231
|
'history.offlineCache': 'Offline cache {n} items', 'history.count': '{n} items', 'history.empty': 'No messages yet',
|
|
1232
1232
|
'history.queueAndCount': 'Queue {q} · History {n}', 'history.countOnly': 'History {n}',
|
package/public/md.js
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* 同时支持浏览器全局 window.mdToHtml 与 Node CommonJS module.exports。
|
|
7
7
|
*/
|
|
8
8
|
(function (root, factory) {
|
|
9
|
-
if (typeof module === 'object' && module.exports) module.exports = factory(require('./genui.js'))
|
|
10
|
-
else root.mdToHtml = factory(root.DshGenUi)
|
|
11
|
-
})(typeof self !== 'undefined' ? self : this, function (genui) {
|
|
9
|
+
if (typeof module === 'object' && module.exports) module.exports = factory(require('./genui.js'), require('./chat-files.js'))
|
|
10
|
+
else root.mdToHtml = factory(root.DshGenUi, root.DshChatFiles)
|
|
11
|
+
})(typeof self !== 'undefined' ? self : this, function (genui, files) {
|
|
12
12
|
'use strict'
|
|
13
13
|
|
|
14
14
|
function escapeHtml(s) {
|
|
@@ -27,10 +27,17 @@
|
|
|
27
27
|
s = s.replace(/`([^`]+)`/g, '<code>$1</code>')
|
|
28
28
|
s = s.replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>')
|
|
29
29
|
s = s.replace(/(^|[^*])\*([^*\n]+)\*/g, '$1<em>$2</em>')
|
|
30
|
-
s = s.replace(/\[([^\]]+)\]\(([^)\
|
|
30
|
+
s = s.replace(/\[([^\]]+)\]\(([^)\n]+)\)/g, function (m, text, url) {
|
|
31
31
|
url = url.trim()
|
|
32
|
-
if (
|
|
33
|
-
|
|
32
|
+
if (url.startsWith('<') && url.endsWith('>')) url = url.slice(4, -4)
|
|
33
|
+
let path
|
|
34
|
+
const entities = { '&': '&', '"': '"', ''': "'", '<': '<', '>': '>' }
|
|
35
|
+
try {
|
|
36
|
+
const raw = url.replace(/&(?:amp|quot|lt|gt);|'/g, entity => entities[entity])
|
|
37
|
+
path = /^file:/i.test(raw) ? files?.pathOf(raw) : decodeURIComponent(raw)
|
|
38
|
+
} catch { return m }
|
|
39
|
+
if (fileLinks && (files?.pathOf(path) || files?.relativePath(path))) return '<a href="#" data-dsh-file-path="' + escapeHtml(path) + '">' + text + '</a>'
|
|
40
|
+
if (!/^https?:\/\//i.test(url) || /\s/.test(url)) return m
|
|
34
41
|
return '<a href="' + url + '" target="_blank" rel="noopener noreferrer">' + text + '</a>'
|
|
35
42
|
})
|
|
36
43
|
return s
|
|
@@ -175,7 +182,7 @@
|
|
|
175
182
|
if (code.slice(-1) === '\n') code = code.slice(0, -1)
|
|
176
183
|
var fence = code.match(/^([^\n]*)\n([\s\S]*)$/)
|
|
177
184
|
// Wait for the closing fence: streaming partial JSON stays readable as source.
|
|
178
|
-
if (genui && fence && i < parts.length - 1 && fence[2].length <= 200000) {
|
|
185
|
+
if (options?.richContent !== false && genui && fence && i < parts.length - 1 && fence[2].length <= 200000) {
|
|
179
186
|
var language = fence[1].trim().toLowerCase()
|
|
180
187
|
try {
|
|
181
188
|
if (/^(?:dsh-ui|json dsh-ui|dsh-ui json)$/.test(language)) {
|
package/public/styles.css
CHANGED
|
@@ -370,9 +370,17 @@ body.in-session .view {
|
|
|
370
370
|
.queue-dock-item:last-child { border-bottom: 0; }
|
|
371
371
|
.queue-dock-preview { flex: 1; min-width: 0; color: var(--dsr-text); font-size: 13px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
372
372
|
.queue-dock-action { flex: 0 0 auto; }
|
|
373
|
-
.session-pending { flex:0
|
|
373
|
+
.session-pending { flex:0 1 auto; min-height:0; max-height:30vh; max-height:30dvh; display:flex; flex-direction:column; margin:0 0 10px; padding:10px; border:1px solid var(--dsr-warning-line); border-radius:13px; background:var(--dsr-warning-soft); }
|
|
374
374
|
.session-pending-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; color:var(--dsr-text); font-size:12px; font-weight:750; }
|
|
375
|
-
.session-pending-
|
|
375
|
+
.session-pending-head { flex:none; }
|
|
376
|
+
.session-pending-list { min-height:0; overflow-y:auto; overscroll-behavior:contain; display:flex; flex-direction:column; gap:8px; }
|
|
377
|
+
.session-pending-list > * { flex:none; }
|
|
378
|
+
.session-pending button.question { width:100%; text-align:left; }
|
|
379
|
+
.session-pending .pc-title { display:block; }
|
|
380
|
+
.question-card-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
|
|
381
|
+
.question-card-head .pc-title { min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
|
|
382
|
+
.question-card-head .mini-btn { flex:none; white-space:nowrap; }
|
|
383
|
+
.question-summary { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; font-size:13px; line-height:1.45; margin-top:5px; color:var(--dsr-muted); }
|
|
376
384
|
.session-pending .pending-card { min-width:0; background:var(--dsr-panel); }
|
|
377
385
|
.session-pending .pc-title { line-height:1.45; overflow-wrap:anywhere; word-break:break-word; }
|
|
378
386
|
.session-pending .pc-desc { line-height:1.5; white-space:pre-wrap; overflow-wrap:anywhere; }
|
|
@@ -1107,6 +1115,16 @@ button.overview-attention-item, button.overview-session-item { cursor:pointer; }
|
|
|
1107
1115
|
border: 1px solid var(--dsr-line); border-radius: 10px; padding: 9px 11px; font: inherit; outline: none;
|
|
1108
1116
|
}
|
|
1109
1117
|
.modal-actions { display: flex; gap: 9px; margin-top: 14px; }
|
|
1118
|
+
#modal-question { box-sizing:border-box; padding:max(12px, var(--dsr-safe-top)) 12px max(12px, var(--dsr-safe-b)); }
|
|
1119
|
+
#modal-question .modal-card { box-sizing:border-box; display:flex; flex-direction:column; min-height:0; max-height:100%; overflow:hidden; }
|
|
1120
|
+
#modal-question .modal-title, #modal-question .modal-actions { flex:none; }
|
|
1121
|
+
#question-body { min-height:0; overflow-y:auto; overscroll-behavior:contain; overflow-wrap:anywhere; }
|
|
1122
|
+
#question-body .q-item { min-width:0; }
|
|
1123
|
+
#question-body .q-text { font-weight:400; }
|
|
1124
|
+
#question-body .q-text p { margin:6px 0; }
|
|
1125
|
+
#question-body .q-option { min-height:44px; cursor:pointer; }
|
|
1126
|
+
#question-body .q-option > span { min-width:0; overflow-wrap:anywhere; }
|
|
1127
|
+
#question-body pre { white-space:pre-wrap; overflow-wrap:anywhere; }
|
|
1110
1128
|
.archive-modal-desc { margin: 0 0 12px; color: var(--dsr-muted); line-height: 1.55; }
|
|
1111
1129
|
.archive-summary { border: 1px solid var(--dsr-line); border-radius: 12px; background: var(--dsr-panel); padding: 10px 12px; }
|
|
1112
1130
|
.archive-summary-row { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 10px; align-items: start; padding: 6px 0; font-size: 13px; }
|
package/public/update.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.7.
|
|
2
|
+
"version": "0.7.6",
|
|
3
3
|
"apkUrl": "dsh-remote.apk",
|
|
4
|
-
"sha256": "
|
|
5
|
-
"releasedAt": "2026-10-
|
|
6
|
-
"notes": "
|
|
4
|
+
"sha256": "33e85026a3b95f341ade14b1ee97db9ac2dea97a4ef3f55976be86e7a2655e1d",
|
|
5
|
+
"releasedAt": "2026-10-15T04:38:27.277Z",
|
|
6
|
+
"notes": "修复长提问占满会话导致无法回答,支持点击摘要卡片并在独立滚动弹窗中选择;补齐 Android 后台审批与提问通知、请求去重及会话跳转;支持普通相对路径聊天文件下载,并反馈系统下载完成或失败原因。",
|
|
7
7
|
"history": [
|
|
8
8
|
{
|
|
9
|
-
"version": "0.7.
|
|
10
|
-
"notes": "
|
|
9
|
+
"version": "0.7.6",
|
|
10
|
+
"notes": "修复长提问占满会话导致无法回答,支持点击摘要卡片并在独立滚动弹窗中选择;补齐 Android 后台审批与提问通知、请求去重及会话跳转;支持普通相对路径聊天文件下载,并反馈系统下载完成或失败原因。"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"version": "0.7.4",
|
package/public/version.json
CHANGED