dsh-remote-plugin 0.8.0-rc.9 → 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 +4 -2
- package/README.md +4 -2
- package/apk/dsh-remote.apk +0 -0
- package/client.js +96 -115
- package/file-delivery.mjs +84 -0
- package/gateway.cjs +248 -3
- package/index.mjs +594 -52
- package/insights.mjs +33 -2
- package/package.json +4 -2
- package/plugin-center.mjs +14 -1
- package/public/activity.js +8 -3
- package/public/announcements.json +10 -0
- package/public/app.js +65 -20
- package/public/approval-records.js +75 -3
- package/public/build.json +2 -2
- package/public/desktop/desktop.css +10 -2
- package/public/desktop/desktop.html +24 -4
- package/public/desktop/desktop.js +32 -13
- package/public/extensions.css +109 -1
- package/public/extensions.js +116 -7
- package/public/file-inbox.css +66 -0
- package/public/file-inbox.js +289 -0
- package/public/index.html +26 -9
- package/public/insights.css +5 -0
- package/public/insights.js +40 -11
- package/public/md.js +7 -1
- package/public/plugin-center.css +3 -0
- package/public/plugin-center.js +58 -9
- package/public/plugin.js +21 -6
- package/public/session-deck.css +73 -0
- package/public/session-deck.js +180 -0
- package/public/skills.js +16 -5
- package/public/skins/blue-fish/skin.css +39 -0
- package/public/styles.css +22 -2
- package/public/task-board.js +109 -0
- package/public/teams.js +35 -13
- package/public/update.json +12 -12
- package/public/version.json +1 -1
- package/public/workflow.css +6 -12
- package/skills/dsh-remote-doctor/SKILL.md +16 -0
- package/skills/dsh-remote-doctor/references/wiki/README.md +40 -0
- package/skills/dsh-remote-doctor/references/wiki/ai-guide.md +61 -0
- package/skills/dsh-remote-doctor/references/wiki/connection.md +74 -0
- package/skills/dsh-remote-doctor/references/wiki/errors.md +26 -0
- package/skills/dsh-remote-doctor/references/wiki/evidence.md +44 -0
- package/skills/dsh-remote-doctor/references/wiki/files.md +31 -0
- package/skills/dsh-remote-doctor/references/wiki/maintenance.md +30 -0
- package/skills/dsh-remote-doctor/references/wiki/notifications.md +29 -0
- package/skills/dsh-remote-doctor/references/wiki/operations.md +32 -0
- package/skills/dsh-remote-doctor/references/wiki/plugins.md +90 -0
- package/skills/dsh-remote-doctor/references/wiki/sessions.md +45 -0
- package/skills/dsh-remote-doctor/references/wiki/sources.md +27 -0
- package/task-board.mjs +57 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/* Task board: a bounded read-only view of the selected host workspace. */
|
|
2
|
+
;(function(root) {
|
|
3
|
+
'use strict'
|
|
4
|
+
const esc = value => String(value ?? '').replace(/[&<>"']/g, c => ({ '&':'&', '<':'<', '>':'>', '"':'"', "'":''' }[c]))
|
|
5
|
+
const text = (zh, en) => root.I18N?.lang === 'en' ? en : zh
|
|
6
|
+
const statuses = { backlog: ['待整理','Backlog'], todo: ['待执行','To do'], running: ['运行中','Running'], done: ['已完成','Done'], failed: ['失败','Failed'],
|
|
7
|
+
succeeded: ['执行成功','Run succeeded'], cancelled: ['已取消','Cancelled'], unknown: ['未知','Unknown'] }
|
|
8
|
+
const label = value => statuses[value] ? text(...statuses[value]) : text('未知','Unknown')
|
|
9
|
+
const date = (value, zone) => {
|
|
10
|
+
if (typeof value !== 'number' || !Number.isFinite(value) || value <= 0) return '—'
|
|
11
|
+
try { return new Date(value).toLocaleString(root.I18N?.lang === 'en' ? 'en-GB' : 'zh-CN', { timeZone: zone || undefined }) }
|
|
12
|
+
catch { return text('时间或时区不可用','Time or timezone unavailable') }
|
|
13
|
+
}
|
|
14
|
+
function taskHtml(task, index, timeZone) {
|
|
15
|
+
const run = task.executions?.at(-1), verification = run?.verification
|
|
16
|
+
const accepted = verification?.stage === 'quality' && verification.passed === true && !verification.inFlight && !verification.failedReason
|
|
17
|
+
const verdict = !verification ? text('未提供验收记录','No verification record') : verification.inFlight ? text('验收中','Verification running')
|
|
18
|
+
: verification.applicability !== 'enforced' ? text('未启用独立验收','Independent verification not enforced') : accepted ? text('验收记录通过','Verification record passed')
|
|
19
|
+
: verification.stage === 'quality' && verification.passed === false ? text('验收未通过','Verification did not pass') : text('尚无有效验收通过记录','No valid passing verification record')
|
|
20
|
+
const schedule = task.schedule
|
|
21
|
+
const errors = [...new Set([run?.error,verification?.failedReason].filter(Boolean))]
|
|
22
|
+
const tone = task.status === 'running' ? 'active' : task.status === 'failed' ? 'attention' : 'neutral'
|
|
23
|
+
return `<article class="task-card" data-task-id="${esc(task.id)}"><header class="ext-panel-head"><h3>${esc(task.title || text('未命名任务','Untitled task'))}</h3><span class="ext-badge" data-tone="${tone}">${esc(label(task.status))}${task.archivedAt ? ' · ' + esc(text('已归档','Archived')) : ''}</span></header>
|
|
24
|
+
${task.description ? `<p class="ext-copy task-description">${esc(task.description)}</p>` : ''}<dl class="ext-facts task-outcomes"><div><dt>${esc(text('最近执行','Latest run'))}</dt><dd>${esc(run ? run.result ? label(run.result) : run.endedAt ? text('结果未知','Outcome unknown') : text('执行尚未结束','Run has not ended') : text('尚无执行记录','No execution record'))}${run?.external ? `<small>${esc(text('外部报告','Externally reported'))}</small>` : ''}</dd></div><div><dt>${esc(text('独立验收','Verification'))}</dt><dd>${esc(verdict)}</dd></div></dl>
|
|
25
|
+
${errors.length ? `<aside class="ext-alert"><strong>${esc(text('需要关注','Needs attention'))}</strong>${errors.map(error => `<p class="ext-copy">${esc(error)}</p>`).join('')}</aside>` : ''}
|
|
26
|
+
${schedule ? `<div class="task-schedule"><div class="task-schedule-head"><span>${esc(text('执行计划','Schedule'))}</span><span>${esc(schedule.enabled ? text('已启用','Enabled') : text('未启用','Disabled'))}</span></div><p class="task-schedule-rule">${esc(schedule.mode === 'once' ? text('单次执行','Run once') : schedule.mode === 'cron' ? schedule.cron : text('未知计划','Unknown schedule'))}</p>${schedule.enabled ? `<dl class="ext-facts"><div><dt>${esc(text('下次执行','Next run'))}</dt><dd>${esc(date(schedule.nextRunAt,schedule.timeZone || timeZone))}<small>${esc(schedule.timeZone || timeZone || text('时区未知','Timezone unknown'))}</small></dd></div></dl>` : ''}</div>` : ''}
|
|
27
|
+
${run?.summary ? `<details class="ext-disclosure" data-task-detail="${esc(task.id)}"><summary><span>${esc(text('最近执行摘要','Latest run summary'))}</span></summary><div class="ext-detail-body ext-copy">${esc(run.summary)}</div></details>` : ''}
|
|
28
|
+
${task.parentId ? `<dl class="ext-facts task-parent"><div><dt>${esc(text('父任务','Parent task'))}</dt><dd class="ext-identifier">${esc(task.parentId)}</dd></div></dl>` : ''}
|
|
29
|
+
<footer class="task-footer"><span>${esc(text('更新于','Updated'))}<time>${esc(date(task.updatedAt,timeZone))}</time></span>${run?.sessionId ? `<button class="ext-button" type="button" data-task-open="${index}">${esc(text('打开执行会话','Open execution session'))}<span aria-hidden="true">↗</span></button>` : ''}</footer></article>`
|
|
30
|
+
}
|
|
31
|
+
let current
|
|
32
|
+
function close() { if (current) { current.controller.abort(); clearInterval(current.timer); current = null } }
|
|
33
|
+
async function mount(config, target) {
|
|
34
|
+
close()
|
|
35
|
+
const workspaces = (config.getWorkspaces?.() || []).filter(row => row?.workspaceId)
|
|
36
|
+
const s = { config, target, controller: new AbortController(), request: 0, data: null, expanded: new Set() }
|
|
37
|
+
current = s
|
|
38
|
+
const valid = () => current === s && config.valid()
|
|
39
|
+
s.workspaceId = workspaces.find(row => row.workspaceId === config.getWorkspaceId?.())?.workspaceId || workspaces[0]?.workspaceId || ''
|
|
40
|
+
target.innerHTML = `<section class="task-board"><div class="ext-heading"><span class="ext-eyebrow">${esc(text('工作概览','WORK OVERVIEW'))}</span><h2>${esc(text('任务看板','Task board'))}</h2><p>${esc(text('跟进任务进度、执行结果与验收状态。','Track task progress, execution results and verification.'))}</p></div>
|
|
41
|
+
<div class="task-controls ext-toolbar"><label class="ext-field ext-workspace">${esc(text('工作区','Workspace'))}<select data-task-workspace>${workspaces.map(row => `<option value="${esc(row.workspaceId)}">${esc(row.title || row.workspaceId)}</option>`).join('')}</select></label>
|
|
42
|
+
<label class="ext-field">${esc(text('状态','Status'))}<select data-task-status><option value="">${esc(text('全部状态','All statuses'))}</option>${Object.keys(statuses).slice(0,5).map(value => `<option value="${value}">${esc(label(value))}</option>`).join('')}</select></label>
|
|
43
|
+
<label class="ext-field ext-search">${esc(text('搜索','Search'))}<input type="search" data-task-search placeholder="${esc(text('搜索任务','Search tasks'))}"></label><label class="ext-check"><input type="checkbox" data-task-archived> ${esc(text('显示归档任务','Show archived tasks'))}</label>
|
|
44
|
+
<button class="ext-button" type="button" data-task-refresh>${esc(text('刷新','Refresh'))}</button></div><p class="ext-note task-scope">${esc(text('只读查看当前工作区,未指定工作区的任务不在此列表。','Read-only view of this workspace; unassigned tasks are excluded.'))}</p><div class="task-summary"><p class="ext-note" data-task-count></p><p class="ext-note" role="status" aria-live="polite" data-task-note></p></div><div class="task-list" data-task-content></div></section>`
|
|
45
|
+
const selector = target.querySelector('[data-task-workspace]'), filter = target.querySelector('[data-task-status]'), search = target.querySelector('[data-task-search]')
|
|
46
|
+
const archived = target.querySelector('[data-task-archived]'), content = target.querySelector('[data-task-content]'), note = target.querySelector('[data-task-note]'), count = target.querySelector('[data-task-count]')
|
|
47
|
+
selector.value = s.workspaceId; filter.value = ''; search.value = ''; archived.checked = false
|
|
48
|
+
function render() {
|
|
49
|
+
if (!valid() || !s.data) return
|
|
50
|
+
const query = search.value.trim().toLowerCase(), renderKey = JSON.stringify([s.data.tasks,s.data.timeZone,query,filter.value,archived.checked])
|
|
51
|
+
if (renderKey === s.renderKey) return
|
|
52
|
+
s.renderKey = renderKey
|
|
53
|
+
const focusedTask = document.activeElement?.closest?.('[data-task-id]')?.dataset.taskId
|
|
54
|
+
for (const el of content.querySelectorAll('details')) { if (el.open) s.expanded.add(el.dataset.taskDetail); else s.expanded.delete(el.dataset.taskDetail) }
|
|
55
|
+
const rows = s.data.tasks.map((task, index) => ({ task, index })).filter(({ task }) => (!filter.value || task.status === filter.value) && (archived.checked || !task.archivedAt)
|
|
56
|
+
&& [task.title,task.description].join(' ').toLowerCase().includes(query))
|
|
57
|
+
count.textContent = `${text('显示','Showing')} ${rows.length}${rows.length !== s.data.tasks.length ? ' / ' + s.data.tasks.length : ''} ${text('个任务','tasks')}`
|
|
58
|
+
content.innerHTML = rows.length ? rows.map(({ task,index }) => taskHtml(task,index,s.data.timeZone)).join('') : `<p class="ext-empty">${esc(text('没有匹配的任务。','No matching tasks.'))}</p>`
|
|
59
|
+
for (const el of content.querySelectorAll('details')) el.open = s.expanded.has(el.dataset.taskDetail)
|
|
60
|
+
if (focusedTask) [...content.querySelectorAll('[data-task-open]')].find(el => s.data.tasks[Number(el.dataset.taskOpen)]?.id === focusedTask)?.focus({ preventScroll:true })
|
|
61
|
+
}
|
|
62
|
+
async function load(clear = false) {
|
|
63
|
+
if (!valid()) { if (current === s) close(); return }
|
|
64
|
+
if (s.loading && !clear) return
|
|
65
|
+
s.readController?.abort(); s.readController = new AbortController()
|
|
66
|
+
const request = ++s.request; s.loading = true
|
|
67
|
+
if (clear) { s.data = null; s.renderKey = ''; s.expanded.clear(); content.replaceChildren(); count.textContent = '' }
|
|
68
|
+
if (!s.workspaceId) { s.loading = false; note.textContent = text('请先登记一个 DSH 工作区。','Register a DSH workspace first.'); return }
|
|
69
|
+
note.textContent = text('正在读取任务…','Loading tasks…')
|
|
70
|
+
try {
|
|
71
|
+
const response = await fetch(config.url('/remote/api/task-board?workspaceId=' + encodeURIComponent(s.workspaceId)), { headers: config.headers,
|
|
72
|
+
signal: AbortSignal.any([s.controller.signal,s.readController.signal,AbortSignal.timeout(25000)]) })
|
|
73
|
+
const body = await response.text()
|
|
74
|
+
if (!valid() || request !== s.request) return
|
|
75
|
+
if (body.length > 2 * 1024 * 1024) throw Error('large')
|
|
76
|
+
const data = JSON.parse(body)
|
|
77
|
+
if (!response.ok || data.ok !== true) { root.DshExtensions?.reportAvailability?.(config,'tasks',{ code: response.status === 401 || response.status === 403 ? 'host-denied' : data.code || (response.status === 404 ? 'not-installed' : 'read-failed') }); throw Error('read') }
|
|
78
|
+
if (data.schema !== 1 || data.available !== false && (!Array.isArray(data.tasks) || data.source !== 'task-board' || data.workspaceId !== s.workspaceId)) throw Error('schema')
|
|
79
|
+
root.DshExtensions?.reportAvailability?.(config,'tasks',data)
|
|
80
|
+
if (data.available === false) { s.data = null; s.renderKey = ''; content.replaceChildren(); count.textContent = ''; note.textContent = text('主机未提供兼容的任务看板服务,请返回插件列表查看诊断。','No compatible task-board service. Check diagnostics in the plugin list.'); return }
|
|
81
|
+
s.data = data; render()
|
|
82
|
+
note.textContent = (data.truncated ? text('仅载入前 200 个任务 · ','Loaded the first 200 tasks · ') : text('已更新 · ','Updated · ')) + date(data.generatedAt, data.timeZone)
|
|
83
|
+
} catch (error) {
|
|
84
|
+
if (valid() && request === s.request) {
|
|
85
|
+
if (error.message !== 'read') root.DshExtensions?.reportAvailability?.(config,'tasks',{ code: error.message === 'schema' ? 'unsupported' : error.name === 'TimeoutError' ? 'timeout' : 'read-failed' })
|
|
86
|
+
note.textContent = s.data ? text('刷新失败,保留上次结果,可重试。','Refresh failed. Showing the previous result; retry available.') : text('读取失败,请重试或查看插件诊断。','Read failed. Retry or check plugin diagnostics.')
|
|
87
|
+
}
|
|
88
|
+
} finally { if (request === s.request) s.loading = false }
|
|
89
|
+
}
|
|
90
|
+
selector.addEventListener('change', () => { if (!valid()) return; s.workspaceId = selector.value; void load(true) })
|
|
91
|
+
filter.addEventListener('change', render); search.addEventListener('input', render); archived.addEventListener('change', render)
|
|
92
|
+
target.querySelector('[data-task-refresh]').addEventListener('click', () => void load())
|
|
93
|
+
content.addEventListener('click', async event => {
|
|
94
|
+
const button = event.target.closest?.('[data-task-open]')
|
|
95
|
+
if (!button || !valid() || !s.data) return
|
|
96
|
+
const task = s.data.tasks[Number(button.dataset.taskOpen)], sessionId = task?.executions?.at(-1)?.sessionId
|
|
97
|
+
if (!sessionId || !config.openTaskSession) return
|
|
98
|
+
button.disabled = true
|
|
99
|
+
try { await config.openTaskSession(sessionId,s.workspaceId) }
|
|
100
|
+
catch { if (valid()) note.textContent = text('执行会话暂不可用,请刷新后重试。','Execution session unavailable. Refresh and retry.') }
|
|
101
|
+
finally { if (valid()) button.disabled = false }
|
|
102
|
+
})
|
|
103
|
+
s.timer = setInterval(() => { if (valid() && !document.hidden) void load(); else if (!valid()) close() }, 15000)
|
|
104
|
+
await load()
|
|
105
|
+
}
|
|
106
|
+
const api = { mount, close, taskHtml }
|
|
107
|
+
if (typeof module !== 'undefined' && module.exports) module.exports = api
|
|
108
|
+
else root.DshTasks = api
|
|
109
|
+
})(typeof window === 'undefined' ? globalThis : window)
|
package/public/teams.js
CHANGED
|
@@ -6,15 +6,26 @@
|
|
|
6
6
|
let current
|
|
7
7
|
function status(value) {
|
|
8
8
|
const names = { staged: ['待确认计划','Plan awaiting review'], running: ['运行中','Running'], working: ['工作中','Working'], idle: ['未运行','Idle'], unknown: ['未知','Unknown'],
|
|
9
|
-
open: ['待执行','Open'], blocked: ['受阻','Blocked'], completed: ['已完成','Completed'], failed: ['失败','Failed'], cancelled: ['已取消','Cancelled'], in_progress: ['执行中','In progress'], removed: ['已移除','Removed']
|
|
9
|
+
open: ['待执行','Open'], blocked: ['受阻','Blocked'], completed: ['已完成','Completed'], failed: ['失败','Failed'], cancelled: ['已取消','Cancelled'], in_progress: ['执行中','In progress'], removed: ['已移除','Removed'],
|
|
10
|
+
pending: ['待审查','Pending review'], approved: ['已通过','Approved'], rejected: ['未通过','Rejected'], not_required: ['无需审查','Not required'],
|
|
11
|
+
awaiting_review: ['等待计划审查','Awaiting plan review'], awaiting_feedback: ['等待审查反馈','Awaiting review feedback'] }
|
|
10
12
|
return names[value] ? text(...names[value]) : value || text('未知','Unknown')
|
|
11
13
|
}
|
|
12
14
|
function teamHtml(team, index, archived) {
|
|
13
|
-
const button = (label, member = '') => `<button type="button" data-team-open="${index}"${member ? ` data-team-member="${esc(member)}"` : ''}>${esc(label)}
|
|
14
|
-
const
|
|
15
|
-
const
|
|
15
|
+
const button = (label, member = '') => `<button class="ext-button${member ? '' : ' ext-button-primary'}" type="button" data-team-open="${index}"${member ? ` data-team-member="${esc(member)}"` : ''}>${esc(label)}<span aria-hidden="true">↗</span></button>`
|
|
16
|
+
const badge = (value, title) => `<span class="ext-badge" data-tone="${['blocked','failed','rejected'].includes(value) ? 'attention' : ['working','running','in_progress'].includes(value) ? 'active' : 'neutral'}">${esc(title || status(value))}</span>`
|
|
17
|
+
const members = (team.members || []).map(member => {
|
|
18
|
+
const states = [...new Set([member.activity,member.status].filter(Boolean).map(status))]
|
|
19
|
+
return `<li class="team-member"><div class="ext-panel-head"><strong>${esc(member.name)}</strong><span class="team-member-state">${states.map(esc).join(' · ')}</span></div>${member.role ? `<p class="ext-copy team-role">${esc(member.role)}</p>` : ''}<dl class="ext-facts team-member-facts">${member.provider || member.model ? `<div><dt>${esc(text('模型','Model'))}</dt><dd class="ext-identifier">${esc([member.provider,member.model].filter(Boolean).join(' / '))}</dd></div>` : ''}${member.currentTask ? `<div><dt>${esc(text('当前任务','Current task'))}</dt><dd class="ext-copy">${esc(member.currentTask)}</dd></div>` : ''}</dl>${!archived && member.id ? `<footer class="team-member-action">${button(text('打开成员记录','Open member record'), member.id)}</footer>` : ''}</li>`
|
|
20
|
+
}).join('')
|
|
21
|
+
const tasks = (team.tasks || []).map(task => `<li class="team-task"><div class="ext-panel-head"><strong>${esc(task.subject || task.id)}</strong>${badge(task.state || task.status)}</div>${task.subject && task.id ? `<span class="ext-identifier team-task-id">${esc(task.id)}</span>` : ''}${task.description ? `<p class="ext-copy">${esc(task.description)}</p>` : ''}<dl class="ext-facts"><div><dt>${esc(text('负责人','Assignee'))}</dt><dd>${esc(task.assignee || '—')}</dd></div><div><dt>${esc(text('依赖','Depends on'))}</dt><dd class="ext-identifier">${esc((task.dependencies || []).join(', ') || '—')}</dd></div></dl>${task.verdictStale ? `<p class="ext-alert ext-copy">${esc(task.verdictStale)}</p>` : ''}</li>`).join('')
|
|
16
22
|
const delivery = team.deliverable === true && team.delivery?.ok === true ? text('插件报告可交付','Plugin reports deliverable') : text('交付尚未确认','Delivery not confirmed')
|
|
17
|
-
|
|
23
|
+
const count = (label, value) => `<span>${esc(label)}<b>${value}</b></span>`
|
|
24
|
+
const detail = (key, label, count, body, open = false) => `<details class="ext-disclosure"${open ? ' open' : ''} data-team-detail="${key}:${esc(team.teamId)}"><summary><span>${esc(label)}</span><span class="ext-count">${esc(count)}</span></summary><div class="ext-detail-body">${body}</div></details>`
|
|
25
|
+
const blockers = team.delivery?.blockers || [], warnings = team.delivery?.warnings || []
|
|
26
|
+
const attention = team.delivery?.ok === false || blockers.length || warnings.length
|
|
27
|
+
? `<aside class="ext-alert"><strong>${esc(team.delivery?.ok === false ? text('交付检查未通过','Delivery checks have not passed') : text('交付提醒','Delivery notes'))}</strong>${blockers.length ? `<ul aria-label="${esc(text('交付阻断','Delivery blockers'))}">${blockers.map(value => `<li class="ext-copy">${esc(value)}</li>`).join('')}</ul>` : ''}${warnings.length ? detail('warnings',text('交付警告','Delivery warnings'),warnings.length,`<ul>${warnings.map(value => `<li class="ext-copy">${esc(value)}</li>`).join('')}</ul>`) : ''}</aside>` : ''
|
|
28
|
+
return `<article class="teams-card" data-team-id="${esc(team.teamId)}"><header class="ext-panel-head"><h3>${esc(team.name)}</h3>${badge(archived ? 'archived' : team.halted ? 'blocked' : team.phase, archived ? text('已归档','Archived') : team.halted ? text('已暂停调度','Scheduling halted') : status(team.phase))}</header>${team.description ? `<p class="ext-copy team-description">${esc(team.description)}</p>` : ''}<div class="team-overview">${count(text('成员','Members'),(team.members || []).length + (team.membersTruncated ? '+' : ''))}${count(text('任务','Tasks'),(team.tasks || []).length + (team.tasksTruncated ? '+' : ''))}${count(text('受阻','Blocked'),(team.tasks || []).filter(task => (task.state || task.status) === 'blocked').length)}</div><dl class="ext-facts team-checks">${team.planReviewState ? `<div><dt>${esc(text('计划审查','Plan review'))}</dt><dd>${esc(status(team.planReviewState))}</dd></div>` : ''}<div><dt>${esc(text('交付状态','Delivery'))}</dt><dd>${esc(delivery)}</dd></div></dl>${attention}<div class="team-captain-action">${button(text('打开队长会话','Open captain session'))}</div>${detail('members',text('成员','Members'),(team.members || []).length + (team.membersTruncated ? '+' : ''),`<ul class="team-members">${members || `<li class="ext-empty">${esc(text('暂无成员','No members'))}</li>`}</ul>`,true)}${detail('tasks',text('任务与依赖','Tasks and dependencies'),(team.tasks || []).length + (team.tasksTruncated ? '+' : ''),`<ul class="team-tasks">${tasks || `<li class="ext-empty">${esc(text('暂无任务','No tasks'))}</li>`}</ul>`)}${detail('messages',text('队长未读消息预览','Unread captain messages'),team.messageCount ?? '—',`<ul class="team-messages">${(team.captainInbox || []).map(row => `<li><strong>${esc(row.from)}</strong><p class="ext-copy">${esc(row.content)}</p></li>`).join('') || `<li class="ext-empty">${esc(text('暂无预览消息','No message previews'))}</li>`}</ul>`)}</article>`
|
|
18
29
|
}
|
|
19
30
|
function close() { if (current) { current.controller.abort(); clearInterval(current.timer); current = null } }
|
|
20
31
|
async function mount(config, target) {
|
|
@@ -24,20 +35,26 @@
|
|
|
24
35
|
const valid = () => current === s && config.valid()
|
|
25
36
|
const workspaces = (config.getWorkspaces?.() || []).filter(w => w?.workspaceId)
|
|
26
37
|
s.workspaceId = workspaces.some(w => w.workspaceId === config.getWorkspaceId?.()) ? config.getWorkspaceId() : workspaces[0]?.workspaceId || ''
|
|
27
|
-
target.innerHTML = `<section class="teams-page"><h2>${esc(text('智能体团队','Agent teams'))}</h2><p>${esc(text('
|
|
38
|
+
target.innerHTML = `<section class="teams-page"><div class="ext-heading"><span class="ext-eyebrow">${esc(text('协作概览','COLLABORATION'))}</span><h2>${esc(text('智能体团队','Agent teams'))}</h2><p>${esc(text('掌握团队进展,查看成员分工与交付阻断。','Follow team progress, member assignments and delivery blockers.'))}</p></div><div class="teams-controls ext-toolbar"><label class="ext-field ext-workspace">${esc(text('工作区','Workspace'))}<select data-teams-workspace>${workspaces.map(w => `<option value="${esc(w.workspaceId)}">${esc(w.title || w.path || w.workspaceId)}</option>`).join('')}</select></label><label class="ext-check"><input type="checkbox" data-teams-archived> ${esc(text('查看归档团队','Archived teams'))}</label><button class="ext-button" type="button" data-teams-refresh>${esc(text('刷新','Refresh'))}</button></div><p class="ext-note" data-teams-status role="status" aria-live="polite"></p><div class="teams-list" data-teams-content></div></section>`
|
|
28
39
|
const selector = target.querySelector('[data-teams-workspace]'), content = target.querySelector('[data-teams-content]'), note = target.querySelector('[data-teams-status]')
|
|
29
40
|
selector.value = s.workspaceId
|
|
30
41
|
function render(data) {
|
|
42
|
+
const key = JSON.stringify([data.teams,s.archived])
|
|
43
|
+
if (key === s.renderKey) return
|
|
44
|
+
s.renderKey = key
|
|
45
|
+
const active = document.activeElement, focused = active?.closest?.('[data-team-open]')
|
|
46
|
+
const focusedTeam = focused?.closest?.('[data-team-id]')?.dataset.teamId, focusedMember = focused?.dataset.teamMember || ''
|
|
31
47
|
for (const detail of content.querySelectorAll('details[data-team-detail]')) s.expanded.set(detail.dataset.teamDetail, detail.open)
|
|
32
|
-
content.innerHTML = data.teams.length ? data.teams.map((team, index) => teamHtml(team, index, s.archived)).join('') : `<p>${esc(text('此工作区暂无团队。','No teams in this workspace.'))}</p>`
|
|
48
|
+
content.innerHTML = data.teams.length ? data.teams.map((team, index) => teamHtml(team, index, s.archived)).join('') : `<p class="ext-empty">${esc(text('此工作区暂无团队。','No teams in this workspace.'))}</p>`
|
|
33
49
|
for (const detail of content.querySelectorAll('details[data-team-detail]')) if (s.expanded.has(detail.dataset.teamDetail)) detail.open = s.expanded.get(detail.dataset.teamDetail)
|
|
50
|
+
if (focusedTeam) [...content.querySelectorAll('[data-team-open]')].find(el => data.teams[Number(el.dataset.teamOpen)]?.teamId === focusedTeam && (el.dataset.teamMember || '') === focusedMember)?.focus({ preventScroll:true })
|
|
34
51
|
}
|
|
35
52
|
async function load(clear = false) {
|
|
36
53
|
if (!valid()) { if (current === s) close(); return }
|
|
37
54
|
s.readController?.abort()
|
|
38
55
|
s.readController = new AbortController()
|
|
39
56
|
const request = ++s.request
|
|
40
|
-
if (clear) { s.data = null; s.expanded.clear(); content.replaceChildren() }
|
|
57
|
+
if (clear) { s.data = null; s.renderKey = ''; s.expanded.clear(); content.replaceChildren() }
|
|
41
58
|
if (!s.workspaceId) { note.textContent = text('请先登记一个 DSH 工作区。','Register a DSH workspace first.'); return }
|
|
42
59
|
note.textContent = text('正在读取团队…','Loading teams…')
|
|
43
60
|
try {
|
|
@@ -46,12 +63,17 @@
|
|
|
46
63
|
if (!valid() || request !== s.request) return
|
|
47
64
|
if (body.length > 2 * 1024 * 1024) throw Error('large')
|
|
48
65
|
const data = JSON.parse(body)
|
|
49
|
-
if (!response.ok || data.ok !== true
|
|
50
|
-
if (data.available
|
|
66
|
+
if (!response.ok || data.ok !== true) { root.DshExtensions?.reportAvailability?.(config, 'teams', { code: response.status === 401 || response.status === 403 ? 'host-denied' : data.code || (response.status === 404 ? 'not-installed' : 'read-failed') }); throw Error('read') }
|
|
67
|
+
if (data.schema !== 1 || data.available !== false && (!Array.isArray(data.teams) || data.workspaceId !== s.workspaceId)) throw Error('schema')
|
|
68
|
+
root.DshExtensions?.reportAvailability?.(config, 'teams', data)
|
|
69
|
+
if (data.available === false) { s.data = null; s.renderKey = ''; content.replaceChildren(); note.textContent = text('主机未提供兼容的智能体团队接口。','No compatible AgentTeams endpoint on this host.'); return }
|
|
51
70
|
render(data); s.data = data
|
|
52
|
-
note.textContent = data.truncated ? text('团队较多,仅显示前 40 个。','Showing the first 40 teams.') : text('已更新','Updated')
|
|
53
|
-
} catch {
|
|
54
|
-
if (valid() && request === s.request)
|
|
71
|
+
note.textContent = data.truncated ? text('团队较多,仅显示前 40 个。','Showing the first 40 teams.') : `${data.teams.length} ${text('个团队 · 已更新','teams · Updated')}`
|
|
72
|
+
} catch (error) {
|
|
73
|
+
if (valid() && request === s.request) {
|
|
74
|
+
if (error.message !== 'read') root.DshExtensions?.reportAvailability?.(config, 'teams', { code: error.message === 'schema' ? 'unsupported' : error.name === 'TimeoutError' ? 'timeout' : 'read-failed' })
|
|
75
|
+
note.textContent = s.data ? text('刷新失败,保留上次结果,可重试。','Refresh failed. Showing the previous result; retry is available.') : text('读取失败,请检查插件状态后重试。','Unable to load. Check plugin status and retry.')
|
|
76
|
+
}
|
|
55
77
|
}
|
|
56
78
|
}
|
|
57
79
|
selector.addEventListener('change', () => { s.workspaceId = selector.value; void load(true) })
|
package/public/update.json
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.8.
|
|
2
|
+
"version": "0.8.1",
|
|
3
3
|
"apkUrl": "dsh-remote.apk",
|
|
4
|
-
"sha256": "
|
|
5
|
-
"releasedAt": "2026-10-
|
|
6
|
-
"notes": "0.8.
|
|
4
|
+
"sha256": "0019d620b16539caf4d2c68035b42e1567a74a2cbf100c78b467359759db4ebb",
|
|
5
|
+
"releasedAt": "2026-10-26T01:09:29.360Z",
|
|
6
|
+
"notes": "0.8.1:修复 Windows 常驻插件网关占用 DSH 安装目录导致 DSH 更新失败,完善解释器回退、真实路径检查与运行状态显示;修复网关输出流断开引发的重启;手机连接入口移至 DSH「更多」,增加首次使用提示;点击顶栏连接状态即可刷新,并可快捷打开已适配插件界面;会话目标、任务、审批、提问、文件和队列改为可切换卡片,精简摘要并保留完整详情,隐藏无内容消息气泡;自动审查反馈提供本地中文参考并保留原文;公告支持摘要及分段展开、收起;新增文件收件箱,DSH 可向指定设备投递单个文件,经用户确认后接收并查询结果,修复系统下载任务失踪后的重试和接收完成后的键盘焦点。",
|
|
7
7
|
"history": [
|
|
8
|
+
{
|
|
9
|
+
"version": "0.8.1",
|
|
10
|
+
"notes": "0.8.1:修复 Windows 常驻插件网关占用 DSH 安装目录导致 DSH 更新失败,完善解释器回退、真实路径检查与运行状态显示;修复网关输出流断开引发的重启;手机连接入口移至 DSH「更多」,增加首次使用提示;点击顶栏连接状态即可刷新,并可快捷打开已适配插件界面;会话目标、任务、审批、提问、文件和队列改为可切换卡片,精简摘要并保留完整详情,隐藏无内容消息气泡;自动审查反馈提供本地中文参考并保留原文;公告支持摘要及分段展开、收起;新增文件收件箱,DSH 可向指定设备投递单个文件,经用户确认后接收并查询结果,修复系统下载任务失踪后的重试和接收完成后的键盘焦点。"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"version": "0.8.0",
|
|
14
|
+
"notes": "0.8.0:整理手机与桌面操作入口,新增新手引导与插件排障知识库;优化智能体团队、任务看板及蓝色大肥鱼皮肤,改善窄屏排版;补充插件适配诊断、自定义渠道余额与额度、计划审查和交付阻断信息;实验性插件默认折叠并正确显示安装状态;增强发送回执、防重复发送、会话恢复与弱网历史加载;修复文件上传、续传、插件远程自更新及 macOS 网关启动问题;修复含 CRLF 文本的会话与缓存历史渲染卡死;完善权限与审批记录,Android 版本码改为独立递增计数。"
|
|
15
|
+
},
|
|
8
16
|
{
|
|
9
17
|
"version": "0.7.6",
|
|
10
18
|
"notes": "修复长提问占满会话导致无法回答,支持点击摘要卡片并在独立滚动弹窗中选择;补齐 Android 后台审批与提问通知、请求去重及会话跳转;支持普通相对路径聊天文件下载,并反馈系统下载完成或失败原因。"
|
|
@@ -36,14 +44,6 @@
|
|
|
36
44
|
{
|
|
37
45
|
"version": "0.6.25",
|
|
38
46
|
"notes": "0.6.25:适配 DSH 0.1.5 的实时思考、文件消息与 V3 会话统计;修复 Windows 跨盘文件访问和空会话持久归档;完善 APK 下载进度与校验;新增 dsh-ui 常用组件及柱状图、折线图、环形图只读预览,HTML 代码块支持隔离预览,未支持的高级组件保留原始规格。"
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"version": "0.6.24",
|
|
42
|
-
"notes": "0.6.24:同步 App 与宽屏客户端的会话命名体验;未命名会话显示为“新会话”并保留短标识,创建会话时可选择指定工作区;补充空会话清理与相关回归验证。"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"version": "0.6.23",
|
|
46
|
-
"notes": "0.6.23:加强 DSH 版本兼容。旧版点号 RPC 与新版 slash Remote API 可自动协商和回退,修复部分新版 DSH 中 host.describe、创建会话等请求返回 404 的问题;DSH 重启或升级后会重新识别协议并恢复实时通道。反馈时可由用户选择附带脱敏兼容性诊断,便于定位接口问题;诊断不包含令牌、Cookie、对话内容或文件路径。"
|
|
47
47
|
}
|
|
48
48
|
]
|
|
49
49
|
}
|
package/public/version.json
CHANGED
package/public/workflow.css
CHANGED
|
@@ -207,14 +207,18 @@ body.workflow-v8.in-session .history { padding-bottom:calc(var(--composer-height
|
|
|
207
207
|
.workflow-subpage-body { display:grid; gap:24px; min-width:0; }
|
|
208
208
|
.workflow-settings-section { min-width:0; }
|
|
209
209
|
.workflow-settings-section > h2 { margin:0 0 10px 4px; color:var(--dsr-muted); font-size:12px; font-weight:500; line-height:1.5; }
|
|
210
|
-
.workflow-settings-card { min-width:0; border:0; border-radius:var(--flow-radius); background:var(--dsr-panel); }
|
|
210
|
+
.workflow-settings-card { container-type:inline-size; min-width:0; border:0; border-radius:var(--flow-radius); background:var(--dsr-panel); }
|
|
211
211
|
.workflow-settings-card > :first-child { border-top-left-radius:inherit; border-top-right-radius:inherit; }
|
|
212
212
|
.workflow-settings-card > :last-child { border-bottom-left-radius:inherit; border-bottom-right-radius:inherit; }
|
|
213
213
|
.workflow-v8 .workflow-subpage :is(.setting-row,.ds-setting-row) { box-sizing:border-box; display:flex; align-items:center; flex-wrap:wrap; gap:12px; min-height:72px; margin:0; padding:16px; border:0; border-radius:0; background:transparent; }
|
|
214
214
|
.workflow-v8 .workflow-subpage :is(.setting-row,.ds-setting-row) + :is(.setting-row,.ds-setting-row) { border-top:1px solid var(--dsr-divider); }
|
|
215
215
|
.workflow-v8 .workflow-subpage :is(.setting-row,.ds-setting-row) > div:first-child { flex:1; min-width:min(100%,150px); }
|
|
216
216
|
.workflow-v8 .workflow-subpage :is(.setting-name,.ds-setting-name) { white-space:normal; overflow:visible; font-size:14px; line-height:1.45; font-weight:550; overflow-wrap:anywhere; }
|
|
217
|
-
.workflow-v8 .workflow-subpage :is(.setting-desc,.ds-setting-desc) { margin-top:5px; white-space:normal; overflow:visible; text-overflow:clip; word-break:normal; overflow-wrap:
|
|
217
|
+
.workflow-v8 .workflow-subpage :is(.setting-desc,.ds-setting-desc) { margin-top:5px; white-space:normal; overflow:visible; text-overflow:clip; word-break:normal; overflow-wrap:break-word; text-wrap:pretty; font-size:12px; line-height:1.65; }
|
|
218
|
+
/* Give explanations their own row when a selector would squeeze them into a narrow column. */
|
|
219
|
+
@container(max-width:360px) {
|
|
220
|
+
.workflow-v8 .workflow-subpage :is(.setting-row,.ds-setting-row):has(select) > div:first-child { flex-basis:100%; }
|
|
221
|
+
}
|
|
218
222
|
.workflow-v8 .workflow-subpage :is(.mini-btn,.ds-btn,.custom-select-trigger,.setting-select,.group-select-btn,.ds-select-btn) { min-height:44px; padding:10px 12px; border:1px solid var(--dsr-divider); border-radius:var(--flow-control-radius); box-shadow:none; font-size:13px; line-height:1.4; }
|
|
219
223
|
.workflow-v8 .workflow-subpage :is(.mini-btn,.ds-btn) { white-space:normal; }
|
|
220
224
|
.workflow-v8 .workflow-subpage button { min-width:44px; min-height:44px; }
|
|
@@ -348,16 +352,6 @@ body.image-preview-open { overflow:hidden; }
|
|
|
348
352
|
.announcement-form-field legend{padding:0 4px;font-size:14px;font-weight:600;overflow-wrap:anywhere}
|
|
349
353
|
.announcement-form-field textarea{box-sizing:border-box;width:100%;min-height:72px;padding:10px;border:1px solid var(--dsr-divider);border-radius:8px;background:var(--dsr-bg);color:var(--dsr-text);font:inherit;font-size:16px;resize:vertical}
|
|
350
354
|
.announcement-form-hint{margin:0 0 8px;color:var(--dsr-muted);font-size:12px}
|
|
351
|
-
.teams-page{max-width:960px;margin:0 auto;color:var(--dsr-text)}
|
|
352
|
-
.teams-page h2{font-size:24px}.teams-page p{overflow-wrap:anywhere;white-space:pre-wrap}
|
|
353
|
-
.teams-controls{display:flex;align-items:center;flex-wrap:wrap;gap:12px}.teams-controls label{display:flex;align-items:center;gap:8px;min-width:0}
|
|
354
|
-
.teams-controls select{max-width:min(100%,320px);min-width:0;padding:10px;border:1px solid var(--dsr-divider);border-radius:8px;background:var(--dsr-panel);color:var(--dsr-text);font-size:16px}
|
|
355
|
-
.teams-page button{min-height:44px;padding:8px 12px;border:1px solid var(--dsr-divider);border-radius:8px;background:var(--dsr-panel);color:var(--dsr-text);font:inherit;cursor:pointer}
|
|
356
|
-
.teams-card{padding:16px;margin:16px 0;background:var(--dsr-panel);border:1px solid var(--dsr-divider);border-radius:16px}
|
|
357
|
-
.teams-card header{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap}.teams-card h3{margin:0;font-size:18px;overflow-wrap:anywhere}
|
|
358
|
-
.teams-card details{margin-top:12px}.teams-card summary{min-height:44px;display:flex;align-items:center;cursor:pointer}
|
|
359
|
-
.teams-card ul{list-style:none;margin:0;padding:0}.teams-card li{padding:12px 0;border-bottom:1px solid var(--dsr-divider);overflow-wrap:anywhere}
|
|
360
|
-
.teams-card small{display:block;color:var(--dsr-muted)}.teams-state{display:inline-block;margin-left:8px;color:var(--dsr-accent)}.teams-error{color:var(--dsr-error)}
|
|
361
355
|
.client-diagnostics{margin:16px 0;padding:12px;border:1px solid var(--dsr-divider);border-radius:12px;min-width:0}
|
|
362
356
|
.client-diagnostics label{display:flex;align-items:center;gap:8px;min-height:44px}.client-diagnostics p{font-size:12px;color:var(--dsr-muted);overflow-wrap:anywhere}
|
|
363
357
|
.client-diagnostics summary{cursor:pointer;min-height:44px;display:flex;align-items:center}.client-diagnostics pre{max-height:240px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px}
|
|
@@ -21,6 +21,22 @@ If a tool approval is denied, do not work around it. Mark the evidence as unavai
|
|
|
21
21
|
|
|
22
22
|
## First establish the shape of the problem
|
|
23
23
|
|
|
24
|
+
### Local operation and troubleshooting knowledge base
|
|
25
|
+
|
|
26
|
+
Read [the local knowledge index](references/wiki/README.md) and
|
|
27
|
+
[the AI reading guide](references/wiki/ai-guide.md), then only the scenario
|
|
28
|
+
relevant to this report. Resolve these paths against this skill's resourceBase,
|
|
29
|
+
not against the diagnostic workspace. The same source lives in `docs/wiki/`
|
|
30
|
+
in the repository and is copied into the plugin during synchronization.
|
|
31
|
+
|
|
32
|
+
Use KB identifiers and source/test pointers to explain the basis for a finding.
|
|
33
|
+
The documented source baseline may include unpublished changes: compare it with
|
|
34
|
+
the installed plugin, gateway and client before recommending an operation.
|
|
35
|
+
An operation recipe does not authorize you to execute it. This Doctor remains
|
|
36
|
+
read-only unless the user explicitly authorizes the concrete next action.
|
|
37
|
+
If local references are missing in an older package, say so and continue from
|
|
38
|
+
available evidence; do not invent their contents or probe external URLs.
|
|
39
|
+
|
|
24
40
|
### Diagnosis target and working directory
|
|
25
41
|
|
|
26
42
|
The Remote panel defaults the independent diagnostic session to the directory
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# DSH Remote 操作与排障知识库
|
|
2
|
+
|
|
3
|
+
这是供用户和用户的 AI 共同使用的 Wiki 式入口。先按操作或症状找文章,再按证据判断原因。正文保存在仓库内,与代码一起审阅;插件包也携带同一份知识库,断网时可查。
|
|
4
|
+
|
|
5
|
+
核对基线:2026-10-23,Remote 源码 `0.8.0-rc.9`,包含尚未发布的正式版准备与实验性插件折叠改动。真实 DSH 联调记录包含 `0.2.1-rc.2`,不是全部旧版和未来版本的兼容承诺。不同版本的实际界面、capability、安装包和运行状态优先于这里的基线。
|
|
6
|
+
|
|
7
|
+
## 我要操作
|
|
8
|
+
|
|
9
|
+
| 任务 | 入口 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| 连接主机、选工作区、发送、审批、文件、通知 | [日常操作手册](operations.md) |
|
|
12
|
+
| 安装、更新、停用、卸载插件,查看实验性插件 | [插件管理与升级](plugins.md) |
|
|
13
|
+
| 查看历史、思考、插队、分支与子智能体 | [会话、历史与发送结果](sessions.md) |
|
|
14
|
+
| 上传、续传、下载,检查允许目录 | [文件传输](files.md) |
|
|
15
|
+
| 开启后台通知与峰谷提醒 | [通知与后台](notifications.md) |
|
|
16
|
+
|
|
17
|
+
## 我遇到问题
|
|
18
|
+
|
|
19
|
+
| 症状或检索词 | 文章与编号 |
|
|
20
|
+
| --- | --- |
|
|
21
|
+
| 网关待启动、拒绝连接、端口占用、upstream、401 | [连接与网关](connection.md):KB-CONN-01~04 |
|
|
22
|
+
| 本机正常手机打不开、VPN、Tailscale、中转 HOST_OFFLINE | [连接与网关](connection.md):KB-CONN-03、05 |
|
|
23
|
+
| 加载中、历史非零却空白、迁移、fallback、instruction-hint | [会话与历史](sessions.md):KB-SESSION-01、02 |
|
|
24
|
+
| 发送结果未知、重复消息、插队没有马上中断 | [会话与历史](sessions.md):KB-SESSION-03、04 |
|
|
25
|
+
| 插件只读、列表漏显、更新卡住、pnpm 发布时间限制 | [插件管理](plugins.md):KB-PLUGIN-01~04 |
|
|
26
|
+
| 适配诊断、任务看板、费用余额、团队计划审查与交付警告 | [插件适配数据](plugins.md):KB-PLUGIN-02、05 |
|
|
27
|
+
| 403、路径不在允许范围、409、422、上传中断 | [文件传输](files.md):KB-FILE-01、02 |
|
|
28
|
+
| 息屏断连、没有审批通知、峰谷规则不可用 | [通知与后台](notifications.md):KB-NOTIFY-01、02 |
|
|
29
|
+
| 找到错误码但不知道归谁处理 | [错误与状态索引](errors.md) |
|
|
30
|
+
|
|
31
|
+
## 给 AI 与维护者
|
|
32
|
+
|
|
33
|
+
- [AI 阅读与执行指引](ai-guide.md):先确认版本与实际目标,区分操作请求和排障请求。
|
|
34
|
+
- [证据采集与反馈模板](evidence.md):最小、脱敏、可复核,不上传原始会话。
|
|
35
|
+
- [源码与验证依据](sources.md):每类结论对应实现、回归测试和专题文档。
|
|
36
|
+
- [维护约定](maintenance.md):新问题如何入库、适用版本与证据如何更新。
|
|
37
|
+
|
|
38
|
+
仓库入口是 `docs/wiki/README.md`;已安装插件中的离线入口是 `skills/dsh-remote-doctor/references/wiki/README.md`。后者由 `npm run sync-plugin` 生成,不能直接修改。根 `llms.txt` 提供给外部 AI 的简短索引。
|
|
39
|
+
|
|
40
|
+
历史 issue 已关闭、测试通过、构建成功或公告写了“修复”,都不自动证明用户当前主机已安装修复或原设备已经验收。先读 [AI 指引](ai-guide.md)。
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# 给用户 AI 的阅读与执行指引
|
|
2
|
+
|
|
3
|
+
[知识库首页](README.md)
|
|
4
|
+
|
|
5
|
+
## 先确认任务和目标
|
|
6
|
+
|
|
7
|
+
1. 用户是在问“怎么用”,还是授权进行某项操作,还是要求诊断故障?讲解操作步骤不等于授权你执行安装、重启、发送消息或删除。
|
|
8
|
+
2. 确认问题属于 Android、手机浏览器、桌面 Web、DSH 插件面板、独立网关还是中转;不要把多个端当成同一进程。
|
|
9
|
+
3. 核对实际 DSH profile、已加载插件、网关 `/health`、客户端版本与 buildId。源码、安装目录和正在运行的进程是三份证据。
|
|
10
|
+
4. 只读当前相关文档与有限日志,不全盘搜索用户的会话、文件和凭据。不假设用户目录、DSH 端口或仓库路径。
|
|
11
|
+
|
|
12
|
+
如果从源码仓库开始,先读取根 `package.json` 和相关实现;从安装包开始,先读取插件自己的 `package.json` 与本地知识库。本文中的仓库路径只是定位索引,不是用户电脑上可照抄的绝对路径。
|
|
13
|
+
|
|
14
|
+
## 按最短路径阅读
|
|
15
|
+
|
|
16
|
+
| 用户意图 | 首先阅读 | 然后检查 |
|
|
17
|
+
| --- | --- | --- |
|
|
18
|
+
| 单纯操作 | [日常操作](operations.md) | 该端是否有入口、该主机是否提供能力 |
|
|
19
|
+
| 连接或网关故障 | [连接](connection.md) | 回环 health → DSH 上游 → mux/host → 手机网络 |
|
|
20
|
+
| 历史或发送异常 | [会话](sessions.md) | 读失败、渲染失败、迁移失败、写操作回执分别判断 |
|
|
21
|
+
| 插件安装/升级 | [插件](plugins.md) | 当前 profile、管理能力、任务阶段、明确目标版本 |
|
|
22
|
+
| 文件或后台 | [文件](files.md)、[通知](notifications.md) | 目录授权、系统权限、规则来源和当前连接 |
|
|
23
|
+
| 准备反馈 | [证据与模板](evidence.md) | 最小复现、已确认事实、未验证项 |
|
|
24
|
+
|
|
25
|
+
按需查 [错误索引](errors.md) 和 [源码依据](sources.md),不要一次将所有历史报告当作当前事实。
|
|
26
|
+
|
|
27
|
+
## 操作权限
|
|
28
|
+
|
|
29
|
+
- 默认用只读检查回答故障原因。优先使用用户已经提供的脱敏诊断,不重复读取敏感材料。
|
|
30
|
+
- 写操作须落在用户明确授权的范围内。说明目标 profile/主机、影响、验证与恢复方法;已有明确授权时不重复索要相同授权。
|
|
31
|
+
- 新建会话、发送提示词、AI 排查本身可能使用模型额度;创建工作区、切换权限、安装插件、重启或还原都有实际影响。
|
|
32
|
+
- 发送超时或回执 unknown 时,不把“重试”解释为重新提交。先核对历史和原操作回执。
|
|
33
|
+
- 工具审批被拒或权限不足时,记录缺失证据;不改策略、不绕过审批。
|
|
34
|
+
- 不读取或输出 token/Cookie/API key/二维码内容、完整对话、上传文件或个人路径。不要 dump 环境变量。
|
|
35
|
+
- 不自动访问日志或陌生消息中的 URL,不探测未知公网主机。内置 Doctor 默认只做回环健康检查。
|
|
36
|
+
- 不自动提交反馈、Issue、问卷或日志;先交给用户审阅。
|
|
37
|
+
|
|
38
|
+
## 输出一个可复核结论
|
|
39
|
+
|
|
40
|
+
按“已确认事实 → 可能原因 → 下一步 → 验收结果”组织回答。每项关键结论标注来源:用户截图、运行状态、有限日志、源码或测试。给出本文的 KB 编号与相应文档链接,让下一轮排查能接续。
|
|
41
|
+
|
|
42
|
+
结果只能写到证据支持的程度:
|
|
43
|
+
|
|
44
|
+
- 测试验证调用参数,不能写成真机现象消失。
|
|
45
|
+
- 新源码有修复,不能写成已部署。
|
|
46
|
+
- 安装完成,仍要读回实际进程与资源版本。
|
|
47
|
+
- health 可响应,仍要核对上游、事件通道和真实操作。
|
|
48
|
+
- 上游不支持某能力时应说明限制;不要发明 RPC 或直接改原始会话文件替代。
|
|
49
|
+
|
|
50
|
+
## 可以复制给 AI 的请求
|
|
51
|
+
|
|
52
|
+
~~~text
|
|
53
|
+
请先读取 DSH Remote 的 docs/wiki/README.md;若只有安装包,读取
|
|
54
|
+
skills/dsh-remote-doctor/references/wiki/README.md 和 ai-guide.md。
|
|
55
|
+
我的任务是:[操作说明 / 执行已授权操作 / 只读诊断]。
|
|
56
|
+
现象或目标:[填写]。使用端:[填写]。最近变更:[填写]。
|
|
57
|
+
请先确认实际主机、profile 和各组件版本,只读检查相关证据;
|
|
58
|
+
区分已确认事实、可能原因和未验证项,引用相关 KB 编号。
|
|
59
|
+
涉及写入、重启、安装、发送、付费调用或公开反馈时,遵守我明确授权的范围;
|
|
60
|
+
不要输出凭据或整段会话,不要将超时当作肯定未执行。
|
|
61
|
+
~~~
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# 连接、认证与网关排障
|
|
2
|
+
|
|
3
|
+
[首页](README.md) · [错误索引](errors.md)
|
|
4
|
+
|
|
5
|
+
## 先画清实际链路
|
|
6
|
+
|
|
7
|
+
手机/App → 局域网/VPN/中转 → Remote 网关 → DSH 主机。插件内嵌面板另外处于 DSH 登录边界内。不要用其中一段成功证明整条链路可用。
|
|
8
|
+
|
|
9
|
+
默认网关为 8787,DSH 独立部署示例为 3080;Desktop 的 DSH 可能使用动态端口。插件网关端口优先级:`DSH_REMOTE_GATEWAY_PORT` → 运行账户的 `.dsh-remote/gateway-port` → 8787。独立网关使用 `PORT`。以实际配置为准。
|
|
10
|
+
|
|
11
|
+
在主机做有限的只读检查(将示例端口改为已确认的本机端口):
|
|
12
|
+
|
|
13
|
+
~~~powershell
|
|
14
|
+
$health = Invoke-RestMethod -Uri 'http://127.0.0.1:8787/health' -TimeoutSec 3
|
|
15
|
+
$health | Select-Object ok, version, pid, status, upstreamOk, upstreamReachable, upstreamStatus
|
|
16
|
+
$health.events | Select-Object mux, host
|
|
17
|
+
Get-NetTCPConnection -LocalPort 8787 -State Listen
|
|
18
|
+
~~~
|
|
19
|
+
|
|
20
|
+
~~~sh
|
|
21
|
+
curl -sS --max-time 3 http://127.0.0.1:8787/health
|
|
22
|
+
~~~
|
|
23
|
+
|
|
24
|
+
保留 health 给本地分析,公开反馈前再脱敏地址、路径和错误文本。不要追加读取令牌文件、Cookie 或全部环境变量。没有事件字段的旧版本标为未知。
|
|
25
|
+
|
|
26
|
+
## KB-CONN-01:网关待启动、拒绝连接或端口占用
|
|
27
|
+
|
|
28
|
+
**先看:** 运行账户/profile、端口是否监听、监听者身份、插件网关日志最后约 120 行;同时核对启停意图。
|
|
29
|
+
|
|
30
|
+
**判断:** 无监听通常在启动链路;有其他监听者是占用;有 Remote health 但面板认为未启动,还需检查管理认证与运行版本。不能只凭 PID 存在判定它是 supervisor。
|
|
31
|
+
|
|
32
|
+
**下一步:** 优先由用户在插件面板启动或调整端口;变更环境变量通常需要重启相关进程。重启/结束进程必须有明确授权和实例归属。
|
|
33
|
+
|
|
34
|
+
**验收:** 端口由正确实例监听,health 版本吻合,上游与双事件通道恢复;再从原客户端连接。`SUPERVISOR_*` 诊断见 [错误索引](errors.md)。
|
|
35
|
+
|
|
36
|
+
## KB-CONN-02:ok:true 但 degraded、upstream 不通
|
|
37
|
+
|
|
38
|
+
**先看:** `upstreamReachable/upstreamOk/upstreamStatus`、实际 DSH 地址、登录状态、DSH 进程,以及 mux/host 各自状态。默认探测 DSH 根路径 `/`。
|
|
39
|
+
|
|
40
|
+
**判断:** `ok:true` 只说明网关响应。401 可能说明 HTTP 可达但认证未就绪;Desktop 重启换端口、登录 Cookie 尚未兑换、DSH 本身阻塞需要分别查证。上游临时不可达不应触发网关重启风暴。
|
|
41
|
+
|
|
42
|
+
**下一步:** 在主机确认 DSH 正常响应,再核对插件记录的 upstream;不要自行把不存在的 `/healthz` 当作重启条件。
|
|
43
|
+
|
|
44
|
+
**验收:** 正确上游可响应且认证满足当前接口,目标会话可读取,mux/host 恢复或明确使用轮询。
|
|
45
|
+
|
|
46
|
+
## KB-CONN-03:主机正常,手机打不开或切网后断线
|
|
47
|
+
|
|
48
|
+
**先看:** 手机实际使用的地址、同一部手机在 Wi-Fi/蜂窝及 VPN 开/关下的对照,DNS 与实际网络路径。手机的 localhost 指向手机自己。
|
|
49
|
+
|
|
50
|
+
**判断:** 仅某一网络失败优先查网络、VPN、AP 隔离、防火墙和地址族;不能直接归因于云端。纯 IPv6 DDNS 还需确认网关监听 IPv6。
|
|
51
|
+
|
|
52
|
+
**下一步:** 由用户在已知地址上做最小对照。插件支持 `DSH_REMOTE_GATEWAY_HOST` → `HOST` → `.dsh-remote/gateway-host` → `0.0.0.0`;需要 IPv6 可配置 `::`,但改监听、防火墙与公网暴露属于配置变更。
|
|
53
|
+
|
|
54
|
+
**验收:** 原失败网络下可进入同一主机、读取同一会话;网络恢复后历史/事件继续,不重复发送消息。
|
|
55
|
+
|
|
56
|
+
## KB-CONN-04:401、反复登录或实时更新失败
|
|
57
|
+
|
|
58
|
+
**先看:** 分清 DSH/反向代理登录、Remote 主令牌与独立设备密钥;只确认当前设备配对状态,不读取凭据内容。检查 mux、host、WS ticket 和反向代理 Upgrade。
|
|
59
|
+
|
|
60
|
+
**判断:** 登录 HTML、代理超时、设备撤销与 token 失效不是同一种错误。单通道降级轮询是设计行为;不能靠“WS connected”断言历史完整。
|
|
61
|
+
|
|
62
|
+
**下一步:** 需要时由用户重新配对或在原 DSH 登录入口恢复登录;不把公开 health 当作强杀/轮换凭据依据。客户端不发送应用层心跳,网关使用 WebSocket Ping/Pong。
|
|
63
|
+
|
|
64
|
+
**验收:** 对应认证入口成功,目标接口返回预期数据;检查两条事件流或轮询的实际增量。
|
|
65
|
+
|
|
66
|
+
## KB-CONN-05:中转 HOST_OFFLINE
|
|
67
|
+
|
|
68
|
+
**先看:** 当前中转配置、主机网关是否已连接正确中转、设备身份与主机归属;再做 KB-CONN-03 的同手机网络对照。
|
|
69
|
+
|
|
70
|
+
**判断:** 云端入口可打开,只证明入口响应;`HOST_OFFLINE` 不能唯一定位为防火墙、主机关闭或 DNS 故障。
|
|
71
|
+
|
|
72
|
+
**下一步:** 对照网关、中转与手机三侧同一时间的有限状态。不要因一端报错就重装云服务或更换凭据。
|
|
73
|
+
|
|
74
|
+
**验收:** 相同主机通过原网络可访问且可读会话;长连接与中转在线状态分别核对。自建部署的详细环境准备在仓库 `docs/self-hosted-relay.md`。
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# 错误码与状态索引
|
|
2
|
+
|
|
3
|
+
[首页](README.md)
|
|
4
|
+
|
|
5
|
+
相同 HTTP 状态可以来自不同层。先记下发生阶段、端点类别和组件版本,再查本表;表内不是完整错误枚举。
|
|
6
|
+
|
|
7
|
+
| 原文/状态/检索词 | 解释边界 | 下一篇 |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| `ok:true`、`ready`、`degraded` | 网关响应与就绪程度;上游、事件通道分别核对 | [连接](connection.md) KB-CONN-02 |
|
|
10
|
+
| `EADDRINUSE`、`PORT_IN_USE` | 监听冲突,需要确认占用者身份 | [连接](connection.md) KB-CONN-01 |
|
|
11
|
+
| `SUPERVISOR_ALREADY_RUNNING`、`supervisor already running` | 当前互斥/兼容旧租约的判断;PID 存活本身不够 | [连接](connection.md) KB-CONN-01 |
|
|
12
|
+
| `SUPERVISOR_IDENTITY_UNAVAILABLE` | 无法核实旧 supervisor 身份,保守拒绝接管;可能是进程查询权限 | [连接](connection.md) KB-CONN-01 |
|
|
13
|
+
| `SUPERVISOR_ENDPOINT_TOO_LONG`、`EINVAL`、`ENAMETOOLONG` | macOS 等文件 socket 的路径/监听诊断;不等于端口占用 | [连接](connection.md) KB-CONN-01 |
|
|
14
|
+
| 401、登录 HTML、Unauthorized | 先区分 DSH/代理登录与 Remote 设备认证 | [连接](connection.md) KB-CONN-04 |
|
|
15
|
+
| `HOST_OFFLINE` | 中转视角的主机离线状态;不能唯一定位根因 | [连接](connection.md) KB-CONN-05 |
|
|
16
|
+
| mux/host 重连、WS 失败、轮询中 | 一条/两条事件通道退化;HTTP 可用不证明实时可用 | [连接](connection.md) KB-CONN-04 |
|
|
17
|
+
| `session/migration-required`、`cannot safely transform unclassified message source` | 上游旧会话迁移限制,Remote 侧隔离与提示 | [会话](sessions.md) KB-SESSION-02 |
|
|
18
|
+
| `permission: cannot restore preset "auto" without its active integration` | DSH 恢复 Auto 权限事实时缺当前有效集成;核对错误所属会话 | [会话](sessions.md) KB-SESSION-04 |
|
|
19
|
+
| accepted / rejected / pending / unknown | 分别核对操作阶段;未知不等于未执行 | [会话](sessions.md) KB-SESSION-03 |
|
|
20
|
+
| `ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION` | 发布时间策略可能被锁文件中其他依赖触发 | [插件](plugins.md) KB-PLUGIN-03 |
|
|
21
|
+
| `EPERM`、快照路径越界、任务锁 | 要结合任务阶段,不能统称网络失败或随意删锁 | [插件](plugins.md) KB-PLUGIN-03 |
|
|
22
|
+
| 文件 403、路径不在允许范围 | 授权根、账户、真实路径和保护目录 | [文件](files.md) KB-FILE-01 |
|
|
23
|
+
| 上传 409/422、offset、SHA-256 | 冲突、续传或校验等,具体以响应固定错误为准 | [文件](files.md) KB-FILE-02 |
|
|
24
|
+
| 通知 unknown、规则不可用/过期 | 先区分规则来源和 Android 投递 | [通知](notifications.md) |
|
|
25
|
+
|
|
26
|
+
历史 issue #19 对应旧租约/PID 复用,#20 对应 macOS socket 过长,#21 对应大量会话主动观察,#18 仍包含上游迁移限制。这里是检索线索;关闭 issue 不代表当前机器已验证恢复。版本、实际安装与运行证据要求见 [AI 指引](ai-guide.md)。
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# 证据采集与反馈模板
|
|
2
|
+
|
|
3
|
+
[首页](README.md) · [AI 指引](ai-guide.md)
|
|
4
|
+
|
|
5
|
+
## 最小证据包
|
|
6
|
+
|
|
7
|
+
| 项目 | 建议记录 | 不应分享 |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| 版本 | DSH、已安装插件、运行网关、App/WebUI 与 buildId | 不用源码版本替代运行版本 |
|
|
10
|
+
| 目标 | 系统、使用端、profile 名称、安装方式 | 完整个人路径、账号或公网地址 |
|
|
11
|
+
| 时间 | 问题发生时间和时区、最近升级/切网动作 | 整段历史轨迹 |
|
|
12
|
+
| 状态 | health 关键字段、双事件通道、HTTP 状态与固定错误码 | token、Cookie、认证头、二维码 |
|
|
13
|
+
| 操作 | 目标类型、失败阶段、回执/任务的脱敏关联信息 | 消息正文、工具输入、上传文件 |
|
|
14
|
+
| 对照 | 同手机不同网络、正常/坏会话、重启前后 | 未经授权创建任务或调用模型的结果 |
|
|
15
|
+
| 日志 | 相关日志末尾约 120 行内的必要片段,先脱敏 | 整个会话日志、配置文件、环境变量 |
|
|
16
|
+
|
|
17
|
+
“更多 → 关于与维护 → 本地操作日志”记录有限的操作阶段与匿名关联信息,可复制/导出。Android 使用系统文件选择器。它不包含所有后端错误;历史日志没保存的细节无法事后还原。即使应用已经过滤字段,分享前仍需用户审阅。
|
|
18
|
+
|
|
19
|
+
## 诊断记录模板
|
|
20
|
+
|
|
21
|
+
~~~text
|
|
22
|
+
标题:[Bug/使用问题] 现象
|
|
23
|
+
相关条目:KB-...
|
|
24
|
+
发生时间与时区:
|
|
25
|
+
DSH / 已安装插件 / 运行网关 / 客户端版本与 buildId:
|
|
26
|
+
系统、使用端、安装方式、profile 名称:
|
|
27
|
+
最近变更:
|
|
28
|
+
|
|
29
|
+
最小复现步骤:
|
|
30
|
+
1.
|
|
31
|
+
2.
|
|
32
|
+
|
|
33
|
+
预期:
|
|
34
|
+
实际:
|
|
35
|
+
是否每次发生、影响一个还是全部会话/主机:
|
|
36
|
+
|
|
37
|
+
已确认事实(每项标明截图/状态字段/有限日志/源码):
|
|
38
|
+
可能原因:
|
|
39
|
+
尚未执行或无法取得的检查:
|
|
40
|
+
已经尝试的动作及结果:
|
|
41
|
+
下一步最小检查、影响与验收条件:
|
|
42
|
+
~~~
|
|
43
|
+
|
|
44
|
+
AI 可以整理这份草稿,但不自动上传日志或提交 Issue。用户确认公开内容后再自行提交;先排除已知限制、配置问题与上游错误,避免把所有失败都归为 Remote 缺陷。
|