dsh-remote-plugin 0.7.3 → 0.7.5
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 +29 -48
- package/README.md +29 -48
- package/apk/dsh-remote.apk +0 -0
- package/gateway.cjs +147 -77
- package/index.mjs +52 -9
- package/package.json +4 -2
- package/plugin-center.mjs +126 -26
- package/public/admin.js +15 -2
- package/public/app.js +249 -96
- package/public/chat-files.js +17 -0
- package/public/desktop/desktop.css +5 -0
- package/public/desktop/desktop.html +17 -2
- package/public/desktop/desktop.js +269 -100
- package/public/extensions.css +1 -0
- package/public/extensions.js +103 -0
- package/public/history.js +42 -14
- package/public/index.html +11 -1
- package/public/insights.css +2 -0
- package/public/insights.js +50 -23
- package/public/md.js +13 -12
- package/public/network.js +56 -0
- package/public/plugin-center.css +7 -3
- package/public/plugin-center.js +76 -18
- package/public/plugin.js +8 -1
- package/public/skills.css +81 -0
- package/public/skills.js +191 -0
- package/public/styles.css +7 -0
- package/public/theme-vars.css +5 -0
- package/public/update.json +12 -12
- package/public/version.json +1 -1
- package/session-file.mjs +34 -0
- package/skills.mjs +53 -0
package/public/update.json
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.7.
|
|
2
|
+
"version": "0.7.5",
|
|
3
3
|
"apkUrl": "dsh-remote.apk",
|
|
4
|
-
"sha256": "
|
|
5
|
-
"releasedAt": "2026-10-
|
|
6
|
-
"notes": "
|
|
4
|
+
"sha256": "01e83d17828fbcbabf265c19b93ab104b1aa7ddba597c5936f0e42aa0522b618",
|
|
5
|
+
"releasedAt": "2026-10-14T09:21:57.815Z",
|
|
6
|
+
"notes": "新增技能中心适配,按已安装且运行的插件显示技能、费用和上下文入口;优化插件中心与技能页移动布局,修复展开详情和任务更新抢占历史阅读位置;增强插件任务锁恢复及进度反馈;支持 Remote 本体远程更新与聊天附件下载到手机;修复 Android 系统栏重复避让、旧压缩完成提示重复弹出及结束后状态残留;整理使用、配置、排障和发布文档。",
|
|
7
7
|
"history": [
|
|
8
|
+
{
|
|
9
|
+
"version": "0.7.5",
|
|
10
|
+
"notes": "新增技能中心适配,按已安装且运行的插件显示技能、费用和上下文入口;优化插件中心与技能页移动布局,修复展开详情和任务更新抢占历史阅读位置;增强插件任务锁恢复及进度反馈;支持 Remote 本体远程更新与聊天附件下载到手机;修复 Android 系统栏重复避让、旧压缩完成提示重复弹出及结束后状态残留;整理使用、配置、排障和发布文档。"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"version": "0.7.4",
|
|
14
|
+
"notes": "修复 Windows Desktop 进程核验拖慢健康检查和管理页的问题:后台缓存并合并探测,测速与首页检测使用存活检查,控制操作仍实时核验身份。修复管理代理超时误报认证失败、操作进度参数丢失、状态轮询竞态及禁用后仍探测 Desktop 崩溃日志。修复桌面对话切换时消息发错会话、压缩状态串会话、归档关闭新会话、服务器切换串用 WS 票据、同源会话导出认证、Desktop 管理页网关地址以及不同本地 IP 同号端口误判。同步修复手机端共享的票据、命令与导出逻辑。继续修复连接切换后旧模型、审批、队列和压缩状态残留,测速覆盖手动选择,新建会话跳错服务器,目标编辑串会话,以及工作台绑定和模型密钥保存串服务器。桌面发送失败保留草稿并避免重复提交。优化实时历史插入、事件列表刷新和子代理查询,修复桌面实时消息被误判无变化;连接切换可立即开始新轮询,旧结果不会覆盖新状态。加强弱网传输:历史与前端资源按需 gzip 压缩、ETag 缓存验证,双通道独立长轮询避免互相阻塞,弱网模式减少历史分页并延长只读等待;Android 后台支持 gzip。修复桌面首次连接依赖系统 prompt 的问题。Android 已完成构建,尚未手机真机验收;本次不提供 HarmonyOS HAP。"
|
|
15
|
+
},
|
|
8
16
|
{
|
|
9
17
|
"version": "0.7.3",
|
|
10
18
|
"notes": "修复手机对话页输入栏下方空白,标题与工作区独立显示,操作集中到更多菜单。主页系统链路自动检测和重试,新增分段仪表、拖尾扫描与平滑状态切换。对话历史先显示本地缓存,再后台核对云端内容;一致时保留消息与阅读位置,修复持续上翻导致的卡顿,隐藏无意义的标题事件。插件详情原地展开,清理重复入口,完善 DSH Desktop 插件管理。新增 Windows Desktop 远程启动与重启(实验性),以及网关、受控 DSH 与 Desktop 的限次崩溃恢复;本机轮转记录诊断日志,用户可预览并自行选择通过现有反馈通道上传摘要。加强敏感目录访问、设备权限、配对与系统备份保护,新增离线贡献者致谢,更新现有 Capacitor 至 8.5.3。Android 已完成构建与浏览器验收,尚未手机真机验收;本次不提供 HarmonyOS HAP,新增 WebUI 功能尚未同步鸿蒙。"
|
|
@@ -36,14 +44,6 @@
|
|
|
36
44
|
{
|
|
37
45
|
"version": "0.6.23",
|
|
38
46
|
"notes": "0.6.23:加强 DSH 版本兼容。旧版点号 RPC 与新版 slash Remote API 可自动协商和回退,修复部分新版 DSH 中 host.describe、创建会话等请求返回 404 的问题;DSH 重启或升级后会重新识别协议并恢复实时通道。反馈时可由用户选择附带脱敏兼容性诊断,便于定位接口问题;诊断不包含令牌、Cookie、对话内容或文件路径。"
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"version": "0.6.22",
|
|
42
|
-
"notes": "0.6.22:斜杠命令统一后台受理并显示运行状态与耗时,/compact 不再受两分钟请求等待限制;/export 可在手机保存到系统下载目录、在浏览器按下载设置保存会话 ZIP;修复命令桥接超时后被误作为普通消息发送的问题。首次有多条未读公告时改为单一分页窗口,可左右切换,确认一次即可全部标为已读。"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"version": "0.6.21",
|
|
46
|
-
"notes": "0.6.21:左上角 DSH Remote 名称可展开服务器组快捷切换抽屉,当前组、组内服务器数量和管理入口一目了然,手机与桌面端均可一键切换;修复部分新版 DSH 命令执行成功返回 void 时被误判为未执行、继而把 /命令作为普通文本发送的问题,同时兼容旧版三参数、新版四参数及默认参数签名。"
|
|
47
47
|
}
|
|
48
48
|
]
|
|
49
49
|
}
|
package/public/version.json
CHANGED
package/session-file.mjs
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { once } from 'node:events'
|
|
2
|
+
export async function serveSessionFile(ctx, req, res, url) {
|
|
3
|
+
const send = (status, code) => { res.writeHead(status, { 'content-type':'application/json', 'cache-control':'no-store' }); res.end(JSON.stringify({ok:false,code})) }
|
|
4
|
+
if (!['GET','HEAD'].includes(req.method)) return send(405,'read-only')
|
|
5
|
+
const sessionId=url.searchParams.get('sessionId'),id=url.searchParams.get('attachmentId')
|
|
6
|
+
if (!sessionId || sessionId.length>200 || !/^[a-f0-9]{64}$/.test(id||'') || [...url.searchParams.keys()].some(k=>!['sessionId','attachmentId','token'].includes(k)) || url.searchParams.getAll('attachmentId').length!==1 || url.searchParams.getAll('sessionId').length!==1) return send(400,'invalid-reference')
|
|
7
|
+
let controller,store
|
|
8
|
+
try {controller=ctx.get?.('sessionController');store=ctx.get?.('attachments')}catch{return send(503,'files-unsupported')}
|
|
9
|
+
const abort=new AbortController()
|
|
10
|
+
if (!controller?.inspect || !store?.readFileStream) return send(503,'files-unsupported')
|
|
11
|
+
const cancel=()=>abort.abort();res.once('close',cancel)
|
|
12
|
+
try {
|
|
13
|
+
const inspection=await controller.inspect(sessionId,abort.signal)
|
|
14
|
+
let ref
|
|
15
|
+
for (const event of inspection?.events||[]) {
|
|
16
|
+
if (!['user/message','assistant/message','tool/result'].includes(event.type)) continue
|
|
17
|
+
const blocks=event.data?.message?.content||event.data?.content||[]
|
|
18
|
+
if (!Array.isArray(blocks)) continue
|
|
19
|
+
ref=blocks.find(b=>b?.type==='file'&&b.attachment?.attachmentId===id)?.attachment
|
|
20
|
+
if(ref)break
|
|
21
|
+
}
|
|
22
|
+
if (!ref) return send(404,'file-not-in-session')
|
|
23
|
+
if (!Number.isSafeInteger(ref.bytes)||ref.bytes<0||typeof ref.name!=='string') return send(502,'invalid-host-reference')
|
|
24
|
+
const name=ref.name.replace(/[\\/\r\n"\x00-\x1f]/g,'_').slice(0,200)||'download'
|
|
25
|
+
const headers={'content-type':'application/octet-stream','content-length':String(ref.bytes),'content-disposition':"attachment; filename*=UTF-8''"+encodeURIComponent(name),'cache-control':'private, no-store','x-content-type-options':'nosniff'}
|
|
26
|
+
if(req.method==='HEAD'){res.writeHead(200,headers);return res.end()}
|
|
27
|
+
const stream=store.readFileStream(ref,abort.signal)[Symbol.asyncIterator](),first=await stream.next()
|
|
28
|
+
res.writeHead(200,headers)
|
|
29
|
+
let bytes=0,next=first
|
|
30
|
+
try { while(!next.done){abort.signal.throwIfAborted();const chunk=Buffer.from(next.value);bytes+=chunk.length;if(bytes>ref.bytes)throw Error('size');if(!res.write(chunk))await once(res,'drain',{signal:abort.signal});next=await stream.next()}if(bytes!==ref.bytes)throw Error('size');res.end() }
|
|
31
|
+
finally{await stream.return?.()}
|
|
32
|
+
} catch { if(res.headersSent)res.destroy();else if(!res.destroyed)send(502,'file-unavailable') }
|
|
33
|
+
finally {res.off('close',cancel)}
|
|
34
|
+
}
|
package/skills.mjs
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Read-only adapter for dsh-skill-explorer 0.4.x. Paths never come from clients.
|
|
2
|
+
import { createHash } from 'node:crypto'
|
|
3
|
+
const text = (value, max) => typeof value === 'string' ? value.slice(0, max) : ''
|
|
4
|
+
const idOf = (name, path, source) => createHash('sha256').update(JSON.stringify([name, path, source])).digest('hex')
|
|
5
|
+
const unavailable = code => ({ status: 200, body: { ok: true, available: false, code } })
|
|
6
|
+
export function createSkillsAdapter(requestNative) {
|
|
7
|
+
async function list() {
|
|
8
|
+
const raw = await requestNative('/api/dsh-skill-explorer/list')
|
|
9
|
+
if (!raw || !Array.isArray(raw.groups) || typeof raw.complete !== 'boolean') throw new Error('unsupported')
|
|
10
|
+
const items = [], identities = new Map()
|
|
11
|
+
let truncated = raw.groups.length > 50
|
|
12
|
+
for (const group of raw.groups.slice(0, 50)) {
|
|
13
|
+
if (!Array.isArray(group?.skills)) throw new Error('unsupported')
|
|
14
|
+
for (const row of group.skills) {
|
|
15
|
+
if (items.length >= 500) { truncated = true; break }
|
|
16
|
+
if (!row || typeof row.name !== 'string' || !/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(row.name) || row.name.length > 200) continue
|
|
17
|
+
const source = text(group.key, 100), path = text(row.path, 4096), id = idOf(row.name, path, source)
|
|
18
|
+
const item = { id, name: row.name, description: text(row.description, 3000), whenToUse: text(row.whenToUse, 3000), source,
|
|
19
|
+
modelInvocable: typeof row.modelInvocable === 'boolean' ? row.modelInvocable : null,
|
|
20
|
+
userInvocable: typeof row.userInvocable === 'boolean' ? row.userInvocable : null,
|
|
21
|
+
readable: !!path, workspace: text(row.workspaceName, 200) }
|
|
22
|
+
identities.set(id, { name: row.name, path, item }); items.push(item)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return { body: { ok: true, schema: 1, available: true, source: 'dsh-skill-explorer', complete: raw.complete, truncated,
|
|
26
|
+
generatedAt: Date.now(), items }, identities }
|
|
27
|
+
}
|
|
28
|
+
return { async handle(method, endpoint, query = new URLSearchParams()) {
|
|
29
|
+
if (method !== 'GET') return { status: 405, body: { ok: false, code: 'read-only' } }
|
|
30
|
+
if (!['/list', '/read'].includes(endpoint)) return { status: 404, body: { ok: false, code: 'unknown-route' } }
|
|
31
|
+
const keys = [...query.keys()]
|
|
32
|
+
if (endpoint === '/list' ? keys.length : keys.length !== 1 || keys[0] !== 'id' || !/^[a-f0-9]{64}$/.test(query.get('id') || '')) {
|
|
33
|
+
return { status: 400, body: { ok: false, code: 'invalid-query' } }
|
|
34
|
+
}
|
|
35
|
+
try {
|
|
36
|
+
const state = await list()
|
|
37
|
+
if (endpoint === '/list') return { status: 200, body: state.body }
|
|
38
|
+
const found = state.identities.get(query.get('id'))
|
|
39
|
+
if (!found) return { status: 409, body: { ok: false, code: 'skill-changed' } }
|
|
40
|
+
if (!found.path) return { status: 200, body: { ok: true, available: true, item: found.item, content: null } }
|
|
41
|
+
const params = new URLSearchParams({ name: found.name, path: found.path })
|
|
42
|
+
const detail = await requestNative('/api/dsh-skill-explorer/read?' + params)
|
|
43
|
+
if (!detail || detail.name !== found.name || detail.path !== found.path || typeof detail.content !== 'string') throw new Error('unsupported')
|
|
44
|
+
return { status: 200, body: { ok: true, available: true, item: found.item,
|
|
45
|
+
content: detail.content.slice(0, 100000), truncated: detail.content.length > 100000 } }
|
|
46
|
+
} catch (error) {
|
|
47
|
+
if (error.status === 404) return unavailable('not-installed')
|
|
48
|
+
if (error.status === 401 || error.status === 403) return { status: 502, body: { ok: false, code: 'host-denied' } }
|
|
49
|
+
if (error.status === 409) return { status: 409, body: { ok: false, code: 'skill-changed' } }
|
|
50
|
+
return { status: 502, body: { ok: false, code: error.message === 'unsupported' ? 'unsupported' : 'skills-unavailable' } }
|
|
51
|
+
}
|
|
52
|
+
} }
|
|
53
|
+
}
|