feat: 会话下拉按用户面板工作区分组(optgroup分隔)+排除子代理/archived会话(新增只读workspaces路由)

This commit is contained in:
Aisland
2026-08-18 11:11:36 +08:00
parent 2e54d38080
commit a84cb12c5f
5 changed files with 89 additions and 31 deletions
+15
View File
@@ -284,6 +284,21 @@ export function apply(ctx: Context) {
},
})
// 工作区列表(自定义窗口会话分组用):读宿主 ~/.dsh/storages/workspace.json(只读)
webServer.register({
kind: 'exact',
path: '/api/worktable/workspaces',
handler: async (_req: any, res: any) => {
try {
const file = pathResolve(homedir(), '.dsh', 'storages', 'workspace.json')
const raw = await readFile(file, 'utf8')
json(res, 200, JSON.parse(raw))
} catch (err) {
json(res, 404, { error: String(err) })
}
},
})
// 本地文件写入(MD 编辑模式保存回磁盘)
webServer.register({
kind: 'exact',