dsh-global-supervisor 0.5.1 → 0.5.2
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.md +30 -30
- package/README.zh-CN.md +55 -0
- package/dist/probe.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
# dsh-global-supervisor
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> [简体中文](README.zh-CN.md) | **English**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Global supervisor plugin for DSH (DeepSeek Harness): cross-workspace project management, task dispatch, status monitoring, scheduled inspections, and event response — without modifying DSH core.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
A single Router session manages many project workspaces: identify projects, dispatch tasks, resume sessions, receive structured worker reports, run periodic patrols. All state persists in SQLite and survives host restarts.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
- **任务状态机**:`pending → queued → running → completed` 及 `blocked / need_human / failed / canceled`,严格转换表 + 审计留痕;Task 与 TaskRun 分离,重试不覆盖历史。
|
|
11
|
-
- **SQLite 持久化**:十三张表(八表基线 + plugin_settings / routing_rules / event_routing_rules / thread_subscriptions 等),基于 Node 内建 `node:sqlite`,零原生依赖。
|
|
12
|
-
- **事件驱动**:Webhook 接入外部事件 + 五种 cordis 内部事件订阅,统一流水去重;observe/auto 双模式规则路由(转述/静音/直投 Worker),多条事件自动合批为一条 Router 通知。
|
|
13
|
-
- **Thread 直通**:从事件创建的任务自动订阅来源 Thread,同 Thread 后续事件直投该任务 Worker,不经 Router。
|
|
14
|
-
- **上下文召回**:`supervisor_recall` 按事件/任务 ID 一跳召回关联上下文(同 Thread 事件、订阅任务、Worker 汇报、执行历史)。
|
|
15
|
-
- **看门狗四分类**:启动超时重试 / 执行超时重试 / 需人工超时升级 / Worker 空闲失联检测,每 5 分钟自动扫描。
|
|
16
|
-
- **IM 推送(可选)**:经 dsh-im 把需人工提醒与完成摘要推到飞书/Telegram 等手机 IM,不可用自动降级 Router 会话。
|
|
17
|
-
- **串行派发**:ModelQueue 默认并发 1,优先级插队不抢占运行中任务,适配本地推理资源。
|
|
18
|
-
- **定时巡检**:复用 DSH 原生 Host-wide Schedule(0.2.2-rc.x),不自研 Cron。
|
|
9
|
+
## Highlights
|
|
19
10
|
|
|
20
|
-
|
|
11
|
+
- **Router/Worker split** — the Router session holds 24 `supervisor_*` tools; worker sessions report via `worker_report` with server-side permission checks (not prompt constraints).
|
|
12
|
+
- **Task state machine** — `pending → queued → running → completed` plus `blocked / need_human / failed / canceled`; strict transition table with audit trail; Task/TaskRun separation keeps retry history intact.
|
|
13
|
+
- **SQLite persistence** — 13 tables on built-in `node:sqlite`, zero native dependencies.
|
|
14
|
+
- **Event-driven** — webhook intake + 5 cordis event subscriptions with a unified dedup pipeline; observe/auto rule routing; multiple events batched into one Router notification.
|
|
15
|
+
- **Thread passthrough** — tasks created from an event auto-subscribe to its thread; follow-up events on the same thread go straight to the assigned worker, bypassing the Router.
|
|
16
|
+
- **Context recall** — `supervisor_recall` pulls related context (thread events, subscriptions, worker reports, run history) in one hop.
|
|
17
|
+
- **Watchdog, 4 classes** — startup-timeout retry, run-timeout retry, need-human escalation, idle/lost worker detection; 5-minute scans.
|
|
18
|
+
- **IM push (optional)** — need-human alerts and completion summaries to Feishu/Telegram etc. via dsh-im, with automatic fallback to the Router session.
|
|
19
|
+
- **Model control** — per-task / per-project model selection and switching; `steer` to inject instructions into a running task.
|
|
20
|
+
- **Serial dispatch** — ModelQueue defaults to concurrency 1 with priority queue-jumping that never preempts a running task, tuned for local inference.
|
|
21
|
+
- **Scheduled inspections** — reuses the DSH native host-wide Schedule service (0.2.2-rc.x); no custom cron.
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
- Node ≥ 22.19(内建 `node:sqlite`)
|
|
23
|
+
## Requirements
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
- DSH Desktop **0.2.2-rc.x** (host-wide Schedule requires 0.2.x; 0.1.x is incompatible)
|
|
26
|
+
- Node ≥ 22.19 (built-in `node:sqlite`; shipped with the DSH runtime)
|
|
27
|
+
|
|
28
|
+
## Install
|
|
26
29
|
|
|
27
30
|
```powershell
|
|
28
|
-
# DSH Desktop
|
|
31
|
+
# Run in the DSH Desktop built-in terminal (replace "desktop" with your profile name)
|
|
29
32
|
dsh plugin --profile desktop add dsh-global-supervisor
|
|
30
33
|
```
|
|
31
34
|
|
|
32
|
-
|
|
35
|
+
Restart DSH Desktop. **Installing is not enough**: open the settings panel ("Global Supervisor") and assign a Router session first. IM push is optional (configure a dsh-im bot). Patch-level configuration options: see `cordis.patch.yml`.
|
|
33
36
|
|
|
34
|
-
|
|
37
|
+
For development, link mode works too: in the profile directory run `pnpm add "dsh-global-supervisor@link:<repo path>"` and add the package name to `dsh.profile.bundles`.
|
|
35
38
|
|
|
36
|
-
##
|
|
39
|
+
## Documentation
|
|
37
40
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
node24 scripts\build-client.mjs # client 侧构建(设置面板 bundle)
|
|
42
|
-
node24 node_modules\vitest\vitest.mjs run # 全部测试
|
|
43
|
-
```
|
|
41
|
+
Full documentation ships inside the npm package (in Chinese) at `node_modules/dsh-global-supervisor/docs/`: USER_GUIDE (usage), DEVELOPMENT_PLAN, API_COMPATIBILITY (API contract + host sandbox contract), ITERATION_PLAN, TEST_PLAN, DEPLOYMENT, TROUBLESHOOTING, INTEGRATIONS. Engineering discipline: [AGENTS.md](AGENTS.md).
|
|
42
|
+
|
|
43
|
+
## Development
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Build and tests must run on the DSH runtime node (≥ 22.19; PATH node is often too old). All release gates (tsc, client bundle, vitest, bundle smoke) run via `node scripts/prepublish-check.mjs`, wired to `prepublishOnly` — `npm publish` enforces them automatically.
|
|
46
46
|
|
|
47
|
-
##
|
|
47
|
+
## Status
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
Version 0.5.2 — the full planned feature set is complete: 25 tools (24 Router + `worker_report`), 190 unit tests, and every major flow verified end-to-end against a real DSH Desktop 0.2.2-rc.x host.
|
|
50
50
|
|
|
51
51
|
## License
|
|
52
52
|
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# dsh-global-supervisor
|
|
2
|
+
|
|
3
|
+
> **简体中文** | [English](README.md)
|
|
4
|
+
|
|
5
|
+
DSH(DeepSeek Harness)全局监督插件:跨 Workspace 的项目管理、任务分派、状态监控、定时巡检与事件响应。
|
|
6
|
+
|
|
7
|
+
在不修改 DSH 核心源码的前提下,以一个 Router 会话统一管理多个项目 Workspace——识别项目、分派任务、恢复 Session、接收结构化汇报、定时巡检,全局状态 SQLite 持久化,Host 重启后可恢复。
|
|
8
|
+
|
|
9
|
+
## 核心特性
|
|
10
|
+
|
|
11
|
+
- **Router/Worker 分工**:Router 会话持有 `supervisor_*` 工具集(24 个)统一调度;Worker 会话经 `worker_report` 结构化汇报(权限服务端校验,非 Prompt 约束)。
|
|
12
|
+
- **任务状态机**:`pending → queued → running → completed` 及 `blocked / need_human / failed / canceled`,严格转换表 + 审计留痕;Task 与 TaskRun 分离,重试不覆盖历史。
|
|
13
|
+
- **SQLite 持久化**:十三张表(八表基线 + plugin_settings / routing_rules / event_routing_rules / thread_subscriptions 等),基于 Node 内建 `node:sqlite`,零原生依赖。
|
|
14
|
+
- **事件驱动**:Webhook 接入外部事件 + 五种 cordis 内部事件订阅,统一流水去重;observe/auto 双模式规则路由(转述/静音/直投 Worker),多条事件自动合批为一条 Router 通知。
|
|
15
|
+
- **Thread 直通**:从事件创建的任务自动订阅来源 Thread,同 Thread 后续事件直投该任务 Worker,不经 Router。
|
|
16
|
+
- **上下文召回**:`supervisor_recall` 按事件/任务 ID 一跳召回关联上下文(同 Thread 事件、订阅任务、Worker 汇报、执行历史)。
|
|
17
|
+
- **看门狗四分类**:启动超时重试 / 执行超时重试 / 需人工超时升级 / Worker 空闲失联检测,每 5 分钟自动扫描。
|
|
18
|
+
- **IM 推送(可选)**:经 dsh-im 把需人工提醒与完成摘要推到飞书/Telegram 等手机 IM,不可用自动降级 Router 会话。
|
|
19
|
+
- **串行派发**:ModelQueue 默认并发 1,优先级插队不抢占运行中任务,适配本地推理资源。
|
|
20
|
+
- **定时巡检**:复用 DSH 原生 Host-wide Schedule(0.2.2-rc.x),不自研 Cron。
|
|
21
|
+
|
|
22
|
+
## 环境要求
|
|
23
|
+
|
|
24
|
+
- DSH Desktop **0.2.2-rc.x**(Host-wide Schedule 依赖 0.2.x;0.1.x 不兼容)
|
|
25
|
+
- Node ≥ 22.19(内建 `node:sqlite`)
|
|
26
|
+
|
|
27
|
+
## 安装
|
|
28
|
+
|
|
29
|
+
```powershell
|
|
30
|
+
# DSH Desktop 内置终端执行(--profile 后换成你自己的 profile 名)
|
|
31
|
+
dsh plugin --profile desktop add dsh-global-supervisor
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
安装后重启 DSH Desktop。**装完 ≠ 可用**:首次使用需在设置面板(全局监督)指派 Router 会话,IM 推送为可选项(配置 dsh-im bot 后生效);patch 级配置项见包内 `cordis.patch.yml` 示例。
|
|
35
|
+
|
|
36
|
+
开发期调试可用 link 模式:profile 目录 `pnpm add "dsh-global-supervisor@link:<仓库路径>"` 并把包名加入 profile 的 `dsh.profile.bundles`。
|
|
37
|
+
|
|
38
|
+
## 开发
|
|
39
|
+
|
|
40
|
+
```powershell
|
|
41
|
+
# 构建与测试须用 DSH runtime node(本机 PATH node 过旧)
|
|
42
|
+
node24 node_modules\typescript\bin\tsc -p tsconfig.json # host 侧构建(含类型检查)
|
|
43
|
+
node24 scripts\build-client.mjs # client 侧构建(设置面板 bundle)
|
|
44
|
+
node24 node_modules\vitest\vitest.mjs run # 全部测试
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
完整文档随 npm 包发行(安装后位于 `node_modules/dsh-global-supervisor/docs/`):USER_GUIDE(使用说明)、DEVELOPMENT_PLAN(开发方案)、API_COMPATIBILITY(API 使用契约与宿主沙箱契约)、ITERATION_PLAN(迭代方案)、TEST_PLAN(测试与验收映射)、DEPLOYMENT(部署运维)、TROUBLESHOOTING(排障)、INTEGRATIONS(外部集成样例)、ASSESSMENT_SWOT(生态定位评估)。工程纪律见 [AGENTS.md](AGENTS.md)。
|
|
48
|
+
|
|
49
|
+
## 状态
|
|
50
|
+
|
|
51
|
+
当前版本 0.5.2:规划功能全部完成——跨 Workspace 任务管理、事件路由与合批、Thread 直通、上下文召回、看门狗四分类、IM 通知、steer 与模型切换。25 个工具、190 个单测,主要流程均在真实 DSH Desktop 0.2.2-rc.x Host 实测通过(细节见包内 API_COMPATIBILITY 变更记录)。
|
|
52
|
+
|
|
53
|
+
## License
|
|
54
|
+
|
|
55
|
+
MIT
|
package/dist/probe.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-global-supervisor",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"description": "DSH
|
|
3
|
+
"version": "0.5.2",
|
|
4
|
+
"description": "DSH global supervisor plugin: cross-workspace project management, task dispatch, status monitoring, scheduled inspections and event response. SQLite-backed state, structured worker reports, no DSH core modification.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"exports": {
|