checkpoint: dsh-worktable v2 稳定版(PRD §10 全部定案并实现)

This commit is contained in:
Aisland
2026-08-16 23:34:22 +08:00
commit d58cbc583b
20 changed files with 2073 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import { Context } from '@deepseek-ai/cordis'
export const name = 'dsh-worktable'
/** 依赖 webServer 服务(web profile 由 dsh-web-app 挂载) */
export const inject = ['webServer']
export const HEALTH_PATH = '/api/worktable/health'
export function apply(ctx: Context) {
const webServer = (ctx as any).webServer
if (!webServer) {
ctx.logger?.warn('[dsh-worktable] ctx.webServer 不可用(headless profile?),跳过健康路由')
return
}
webServer.register({
kind: 'exact',
path: HEALTH_PATH,
handler: (_req: any, res: any) => {
const body = JSON.stringify({ plugin: 'dsh-worktable', version: '0.1.0', ok: true })
res.writeHead(200, { 'content-type': 'application/json; charset=utf-8', 'cache-control': 'no-store' })
res.end(body)
},
})
}