dsh-chief 0.0.0-stage → 1.0.0

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 ADDED
@@ -0,0 +1,161 @@
1
+ <div align="center">
2
+
3
+ <img src="assets/hero-banner.png" alt="DSH Chief (dsh-chief) — Multi-Agent Command & Cold Archive Vault" width="100%" />
4
+
5
+ <br />
6
+
7
+ # ✦ DSH Chief (`dsh-chief` · DSH 参谋长)
8
+ ### Multi-Agent Command Cockpit · SuperAgent Cross-Session Synergy · 4-Tier Cold Archive Vault for DeepSeek Harness
9
+
10
+ [![DSH Compatibility](https://img.shields.io/badge/DSH-%3E%3D%200.2.0-38bdf8?style=flat-square)](https://dsh.deepseek.com)
11
+ [![SuperAgent Ready](https://img.shields.io/badge/SuperAgent-Router--Worker%20Synergy-a855f7?style=flat-square)](https://github.com/deepseek-ai/dsh-superagent-prototype)
12
+ [![Node.js](https://img.shields.io/badge/Node.js-%3E%3D%2022.13-30d158?style=flat-square)](https://nodejs.org)
13
+ [![Zero Dependencies](https://img.shields.io/badge/Dependencies-0%20External-ffe033?style=flat-square)](#)
14
+ [![Cold Vault](https://img.shields.io/badge/Cold%20Archive-0%20Token%20Idle-34d399?style=flat-square)](#03--4-tier-cold-engineering-archive-cabinet-档案-tab)
15
+ [![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-f87171?style=flat-square)](LICENSE)
16
+
17
+ > **Turn scattered chat tabs into a unified Chief of Staff command center**: inspired by DeepSeek's official **[SuperAgent (`dsh-superagent-prototype`)](https://github.com/deepseek-ai/dsh-superagent-prototype)** *Router + Isolated Workers* architecture to eliminate the human attention bottleneck and context pollution—natively integrated with **DeepSeek Harness (DSH)** split-pane subagent streams, `/goal` supervision, live `steer` injection, and workspace session switching.
18
+
19
+ [简体中文 (`README.md`)](README.md) · **English** · [Changelog (`CHANGELOG.md`)](CHANGELOG.md)
20
+
21
+ </div>
22
+
23
+ ---
24
+
25
+ ## 🔗 Deep Synergy with Official DeepSeek SuperAgent & Native DSH Runtime
26
+
27
+ DeepSeek's official **[`dsh-superagent-prototype`](https://github.com/deepseek-ai/dsh-superagent-prototype)** highlights two core bottlenecks in multi-agent engineering: the **Human Attention Bottleneck** across concurrent sessions and **Context Pollution** from accumulated history—solving them via a persistent **Router** coordinating isolated **Worker** sessions.
28
+
29
+ **`dsh-chief` brings that exact Router–Worker command paradigm into an interactive right-sidebar cockpit natively wired into DSH:**
30
+
31
+ 1. **Visual Router–Worker Orchestration**: Supervise your Root Coordinator, spawned Subagents, and linked independent DSH Worker windows from one **Full-Spread Pyramid DAG** and unified **Collaboration Directory**.
32
+ 2. **Native DSH Split-Pane Subagent Stream (`subagentchat`)**: Click `分屏对话` on any pyramid node or directory row to invoke DSH's native `sidebarRight.openResource('dsh-resource://subagentchat/...')` split-pane live viewer.
33
+ 3. **Native DSH `/goal` Long-Horizon Supervision**: Dedicated dual-tier `/goal` objective + step board paired with `idle-guard` to prevent premature agent stops before tasks are verified.
34
+ 4. **Native DSH `steer` / `followup` Injection & Exact Provider Alignment**: Dispatches live `steer`, `followup`, or `silent` mailbox messages straight through DSH's `agents` runtime while matching the exact `provider/model` channel of your active session.
35
+ 5. **Native Workspace Navigation & Zero-Leak Context Preservation**: Spawns clean worker/handoff sessions and switches the active viewport via `uiWorkspace.openSession`, while keeping long-term engineering postmortems sealed at **0 prompt bytes** inside the 4-Tier Cold Archive Cabinet until explicitly taken out.
36
+
37
+ ---
38
+
39
+ ## 💡 Why `dsh-chief` Is Fundamentally Different
40
+
41
+ Ordinary Todo lists and always-injected memory plugins break down on complex, multi-subagent engineering sessions:
42
+ 1. **Silent Background Token Drain & Wrong Provider Routing**: Auto-summarizing after every turn burns quota in the background and often matches bare model names onto expensive metered channels instead of your active subscription provider.
43
+ 2. **Context Bloat from Long Notes**: Dumping dozens of debugging notes straight into the system prompt wastes thousands of tokens per turn and degrades model focus.
44
+ 3. **Cramped Drag-Scroll Canvas**: Subagent graphs trapped inside tiny scroll boxes force constant panning just to see what is blocked.
45
+ 4. **Forgotten Guardrails & Context Loss Across Windows**: Safety rules buried in chat vanish after compaction, and independent DSH windows cannot coordinate.
46
+
47
+ **`dsh-chief` («DSH 参谋长») replaces ad-hoc scratchpads with a full right-docked Chief of Staff cockpit:**
48
+
49
+ | Capability | Typical Todo / Always-On Memory Plugins | ✦ DSH Chief (`dsh-chief`) |
50
+ | :--- | :--- | :--- |
51
+ | **Briefing Pace & Channel Alignment** | Blind per-turn background LLM calls; bare-name provider mismatches | **3-Gear Human-Paced Control** (`⏸ On-Demand` **0 background calls by default**, `⚡ Smart`, `🤖 Auto`) + exact `provider/model` channel matching |
52
+ | **Subagent Task Topology** | Flat lists or cramped drag-scroll viewports | **Full-Spread Pyramid DAG**: Root Coordinator at the apex, subagent lanes laid out cleanly with inline status, explain, dispatch & split-stream buttons |
53
+ | **Long-Term Engineering Memory** | Stuffed into every system prompt or flat unindexed notes | **4-Tier Cold Archive Cabinet**: `Drawers → Gold/Silver/Dark-Copper Paperclipped Dossiers → Memory Points → Unfoldable Sub-points` (**0 prompt tokens while sealed**) |
54
+ | **Plan Readability & Step Q&A** | Static technical checklists | **Dual-Tier `/goal` + Interactive Step Board**: click any step to ask *"What does this step mean / why is it needed?"* or get an instant Chief explanation without interrupting the main agent |
55
+ | **Cross-Session & Subagent Relay** | Isolated to a single window | **Cross-Window Peer Linking + 3-Mode Relay Bus** (`steer`, `followup`, `silent`) across root coordinators and subagents |
56
+ | **Redline Governance & Handoff** | Verbal rules lost on compaction; manual copy-paste handoffs | **`📌` Global Thumbtack Redlines** (global vs. task-scoped) + human approval banner + **1-click self-contained Session Handoff** + `idle-guard` |
57
+
58
+ ---
59
+
60
+ ## 📸 Visual Tour (7 High-DPI Views)
61
+
62
+ ### 01 · Right-Docked Executive Chief Cockpit (`参谋` Tab)
63
+ Docked alongside your live conversation: displays exact `Provider · Model` channel alignment, the `⏸ On-Demand` human-paced toggle, structured status briefings, pending boundary approvals, and natural-language `@target` dispatch chips.
64
+
65
+ ![01 - Executive Chief Cockpit Overview](assets/screenshots/01-chief-cockpit-overview.png)
66
+
67
+ ---
68
+
69
+ ### 02 · Full-Spread Pyramid Subagent DAG (`任务` Tab)
70
+ No cramped mini-viewports: the Root Coordinator sits at the top while subagent squads spread out across structured columns with direct inline controls for status transitions, plain-language explanation, task dispatch, and split-screen subagent chat inspection.
71
+
72
+ <div align="center">
73
+ <img src="assets/screenshots/02-full-spread-pyramid-dag.png" alt="02 - Full-Spread Pyramid Task Topology" width="76%" />
74
+ </div>
75
+
76
+ ---
77
+
78
+ ### 03 · 4-Tier Cold Engineering Archive Cabinet (`档案` Tab)
79
+ Store hundreds of long-term engineering postmortems and coordinates with **zero idle prompt overhead**:
80
+ - **4-Tier Hierarchy**: **Filing Drawers** → **Color-Coded Paperclipped Dossiers** (high-contrast **Luminous Gold `#ffe033`**, **Brushed Silver `#cbd5e1`**, and **Dark Antique Copper `#7c4329`**) → **Structured Memory Points** → **Click-to-Unfold Sub-point Details**.
81
+ - **3-Stage Lazy Loading**: `Stage-0` (`/snapshot`) carries `< 80B` of counts; sealed dossiers inject **0 bytes** into system prompts until explicitly taken out (`取出备查`) or queried via `archive.search`.
82
+ - **Lossless Chief Curation**: One-click curation refines points and summaries while preserving 100% of raw markdown text.
83
+
84
+ <div align="center">
85
+ <img src="assets/screenshots/03-cold-archive-cabinet.png" alt="03 - 4-Tier Cold Engineering Archive Cabinet" width="68%" />
86
+ </div>
87
+
88
+ ---
89
+
90
+ ### 04 · Dual-Tier `/goal` Supervisor & Click-to-Ask Step Board (`规划` Tab)
91
+ Pairs a dedicated `/goal` long-running objective box with an interactive step checklist. Click any step to open the glass popover menu and ask what a step means or request an immediate inline explanation from DSH Chief without interrupting the lead agent.
92
+
93
+ <div align="center">
94
+ <img src="assets/screenshots/04-dual-tier-goal-and-step-qa.png" alt="04 - Dual-Tier Goal and Step Q&A" width="68%" />
95
+ </div>
96
+
97
+ ---
98
+
99
+ ### 05 · Cross-Window Session Linking & Relay Network (`协同` Tab)
100
+ Link multiple independent DSH root sessions (e.g., UI workspace + benchmark workspace) with one toggle to share a live agent directory and cross-session collaboration mailbox.
101
+
102
+ <div align="center">
103
+ <img src="assets/screenshots/05-cross-session-collab-bus.png" alt="05 - Cross-Session Collaboration Bus" width="68%" />
104
+ </div>
105
+
106
+ ---
107
+
108
+ ### 06 · `📌` Global Thumbtack Redlines & Rule Consolidation (`边界` Tab)
109
+ Pin critical safety rules with `📌` so they enforce globally across all sessions, keep task-specific rules scoped locally, approve or refine subagent boundary proposals in one click, and consolidate scattered rules via DSH Chief.
110
+
111
+ <div align="center">
112
+ <img src="assets/screenshots/06-pinned-bounds-and-handoff.png" alt="06 - Pinned Global Redlines and Governance" width="68%" />
113
+ </div>
114
+
115
+ ---
116
+
117
+ ### 07 · One-Click Self-Contained Session Handoff & Idle Guard (`边界` → `会话交接 & 守护`)
118
+ Generate a self-contained Markdown handoff packet (goal, hierarchical task tree, active cursor, blockers, and pinned boundaries), spawn a fresh session, and switch the frontend view automatically—backed by `idle-guard` to prevent premature turn termination.
119
+
120
+ <div align="center">
121
+ <img src="assets/screenshots/07-session-handoff-and-guard.png" alt="07 - Self-Contained Session Handoff and Idle Guard" width="68%" />
122
+ </div>
123
+
124
+ ---
125
+
126
+ ## ⚡ Quick Installation (Zero External Dependencies)
127
+
128
+ ```bash
129
+ # Fast install from prebuilt GitHub Release tarball (~240 KB, zero build scripts)
130
+ dsh plugin --profile desktop add https://github.com/gluztm/dsh-chief/releases/download/v1.0.0/dsh-chief-1.0.0.tgz
131
+
132
+ # Or install directly via GitHub shorthand (replace `desktop` with `web` if using web profile)
133
+ dsh plugin --profile desktop add github:gluztm/dsh-chief
134
+ ```
135
+
136
+ Refresh the DSH Web UI and click the **✦ `DSH 参谋长`** icon in the right-hand sidebar header.
137
+
138
+ ---
139
+
140
+ ## 🛠️ Model Tool Suite (4 Tools)
141
+
142
+ | Tool Name | Purpose | Key Actions |
143
+ | :--- | :--- | :--- |
144
+ | **`chief_board`** | Task DAG orchestration, step checklists, cold archive queries, and inter-agent mail | `graph.plan`, `task.add`, `task.update`, `plan.set`, `cursor.set`, `mail.send`, `archive.save`, `archive.search`, `bounds.propose` |
145
+ | **`chief_memory`** | Session-scoped hot digest entries (progress, decisions, verification, risks) | `list`, `get`, `add`, `update`, `remove` |
146
+ | **`chief_boundaries`** | Global pinned redlines (`📌`) and task-scoped working boundaries | `get`, `set`, `add`, `pin`, `remove` |
147
+ | **`chief_handoff`** | Self-contained Markdown handoff packet generation across sessions | `preview` / structured session relay |
148
+
149
+ ---
150
+
151
+ ## 🛡️ Security & Local-Only Privacy
152
+
153
+ - **Loopback + Same-Origin Guard**: Every `/api/dsh-chief/*` endpoint enforces loopback client verification and same-origin `Origin`/`Host` validation.
154
+ - **Automatic Secret Blocking**: Rejects accidental persistence of `sk-*`, `ghp_*`, Bearer tokens, and OpenSSH private keys across boards, facts, and archives.
155
+ - **100% Local Storage**: All state lives exclusively on disk under `~/.dsh/chief/` (`board.json`, `boards/`, `archives.json`, `chief-state.json`) with zero external runtime dependencies and zero telemetry.
156
+
157
+ ---
158
+
159
+ ## 📄 License
160
+
161
+ Licensed under the **[GNU Affero General Public License v3.0 (`AGPL-3.0-only`)](LICENSE)**.
package/README.md CHANGED
@@ -1,3 +1,214 @@
1
- # Temporary Holding Version
1
+ <div align="center">
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ <img src="assets/hero-banner.png" alt="DSH 参谋长 (dsh-chief) — 多智能体指挥与四层冷存储记忆中枢" width="100%" />
4
+
5
+ <br />
6
+
7
+ # ✦ DSH 参谋长 (`dsh-chief`)
8
+ ### DeepSeek Harness 多智能体参谋指挥舱 · SuperAgent 跨窗统筹 · 四层冷存储工程档案柜
9
+
10
+ [![DSH Compatibility](https://img.shields.io/badge/DSH-%3E%3D%200.2.0-38bdf8?style=flat-square)](https://dsh.deepseek.com)
11
+ [![SuperAgent Ready](https://img.shields.io/badge/SuperAgent-Router--Worker%20Synergy-a855f7?style=flat-square)](https://github.com/deepseek-ai/dsh-superagent-prototype)
12
+ [![Node.js](https://img.shields.io/badge/Node.js-%3E%3D%2022.13-30d158?style=flat-square)](https://nodejs.org)
13
+ [![Zero Dependencies](https://img.shields.io/badge/Dependencies-0%20External-ffe033?style=flat-square)](#)
14
+ [![Cold Vault](https://img.shields.io/badge/Cold%20Archive-0%20Token%20Idle-34d399?style=flat-square)](#03--四层冷存储工程档案柜档案页签)
15
+ [![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-f87171?style=flat-square)](LICENSE)
16
+
17
+ > **把散装聊天窗升级为智能体总司令部**:深度呼应 DeepSeek 官方 **[SuperAgent (`dsh-superagent-prototype`)](https://github.com/deepseek-ai/dsh-superagent-prototype)** 的「Router 统筹 + Workers 隔离执行」注意力减负范式,并与 **DeepSeek Harness (DSH)** 原生子代理分屏、`/goal` 长程目标、实时 `steer` 切入及跨会话导航无缝联动。
18
+
19
+ **简体中文** · [English (`README.en.md`)](README.en.md) · [更新日志 (`CHANGELOG.md`)](CHANGELOG.md)
20
+
21
+ </div>
22
+
23
+ ---
24
+
25
+ ## 🔗 与 DeepSeek 官方 SuperAgent 范式及 DSH 原生能力深度联动
26
+
27
+ DeepSeek 官方开源的 **[`dsh-superagent-prototype`](https://github.com/deepseek-ai/dsh-superagent-prototype)** 指出了多智能体研发中最核心的两大难题:**人类注意力瓶颈(Human Attention Bottleneck)**与**长上下文污染(Context Pollution)**,并提出了「常驻统筹层(Router)+ 隔离执行层(Workers)」的双层解耦架构。
28
+
29
+ **`dsh-chief`(DSH 参谋长)正是将这一理念直接搬进 DSH 右侧边栏的可视化指挥中枢,并与 DSH 宿主底层能力全链路打通:**
30
+
31
+ 1. **SuperAgent「统筹 + 工人」可视化落地**:无需在十几个并发会话与子代理黑盒间来回切换——参谋长常驻右侧栏充当你的全局统筹台(Router Cockpit),将当前主代理、下辖各路子代理(Subagents)以及跨窗口独立 Worker 会话收拢进同一张**全铺开金字塔拓扑图**与**协同通讯录**中。
32
+ 2. **原生联动 DSH 子代理分屏实时流(`subagentchat`)**:在金字塔节点或协同列表上点击「`分屏对话`」,直接调用 DSH 原生 `sidebarRight.openResource('dsh-resource://subagentchat/...')`,在右侧分屏即时拉开对应子代理的实时推理流。
33
+ 3. **原生联动 DSH `/goal` 长程持续督导**:规划页独立承载 `/goal` 总纲并与底部步骤板双层联动,配合 `idle-guard` 空转完结守护,防止模型在多步长任务中途「口头交差」提前停机。
34
+ 4. **原生联动 DSH Agent 运行时三态注入与多渠道对齐**:跨会话信使总线直连宿主 `agents` 服务,支持 `插话 (steer,下一步立即切入)` / `递话 (followup,排队唤醒)` / `备忘 (silent,静默投递信箱)`,并精确读取当前会话的完整 `provider/model` 标识(如区分 `CommandCode` 与官方按量渠道),杜绝同名模型串渠道误扣费。
35
+ 5. **原生联动 DSH 工作区导航与冷热上下文隔离**:一键交接通过宿主 `uiWorkspace.openSession` 创建干净的隔离接力会话并自动切走前端画面;四层「工程档案柜」平时对提示词保持 **0 字节注入**,彻底守住干净上下文边界。
36
+
37
+ ---
38
+
39
+ ## 💡 为什么需要「DSH 参谋长」?(它与普通看板/记忆插件有何本质不同)
40
+
41
+ 在真实的大型工程与多子代理(Subagents)协作中,普通「待办小本本」或「全量注入式记忆插件」往往会撞上四大痛点:
42
+ 1. **后台偷跑 Token、跨渠道乱选模型**:每轮对话结束都在后台偷偷调用大模型做全量总结,甚至把免费/订阅渠道的同名模型误匹配到高价按量渠道。
43
+ 2. **记忆越存越慢、污染上下文**:把几十篇排障笔记一股脑塞进 System Prompt,每轮白烧数千 Token,还会严重干扰模型对当前任务的注意力。
44
+ 3. **小画布拖拽迷宫**:子代理一多,任务图缩在巴掌大的滚动视口里来回拖拉,根本看不清谁卡住了、谁做完了。
45
+ 4. **口头立规矩转头就忘、换窗口就失忆**:聊天里交代的安全红线一压缩就丢;不同窗口的主对话各自为战,切新会话还得手写长篇背景。
46
+
47
+ **`dsh-chief`(DSH 参谋长)不是一个简单的“记事本”,而是一套完整的右侧栏多智能体指挥部:**
48
+
49
+ | 核心维度 | 普通 Todo / 常驻记忆插件 | ✦ DSH 参谋长 (`dsh-chief`) |
50
+ | :--- | :--- | :--- |
51
+ | **参谋节奏与渠道对齐** | 后台每轮盲目触发总结,同名模型易串渠道扣费 | **人类三档控速**(默认 `⏸ 按需` **0 自动调用**,可选 `⚡ 巡检` / `🤖 托管`),严格对齐完整 `provider/model` 渠道 |
52
+ | **多代理拓扑可视性** | 扁平列表或狭窄视口,频繁横向/纵向拖动 | **全铺开金字塔 DAG 指挥图**:主代理居中统帅、子代理分列纵队,状态切换/解释/派发/分屏看流全部原地铺开 |
53
+ | **长期工程记忆架构** | 常驻塞入提示词(费 Token)或纯扁平长文难翻阅 | **四层冷存储「工程档案柜」**:`抽屉 → 金/银/暗铜曲别针卷宗 → 记忆点 → 可展开小点记忆`;平时 **0 字节注入提示词**,仅在「取出备查」时挂载 |
54
+ | **规划可读性与互动** | 冰冷的技术步骤列表,非底层开发者难看懂意图 | **上 `/goal` 总纲 + 下步骤板**:点击任意步骤即可一键追问「**这条是什么意思 / 为什么有这步**」或请参谋长当场白话解读 |
55
+ | **跨会话与子代理协同** | 仅限单会话内部,窗口之间完全割裂 | **跨窗口独立会话串联 + 三态信使总线**:支持 `插话 (steer)` / `递话 (followup)` / `备忘 (silent)` 直达任意子代理或联动窗口 |
56
+ | **红线治理与长程接力** | 规则混在聊天记录里,换会话靠人工复制粘贴 | **`📌` 图钉全局红线盖章**(跨任务永久生效 vs 仅本任务生效)+ **一键生成自包含交接单并自动切入新会话** + **空转完结守护** |
57
+
58
+ ---
59
+
60
+ ## 📸 全景实机导览(7 大核心视窗)
61
+
62
+ ### 01 · 常驻右侧栏参谋指挥舱(`参谋` 页签)
63
+ 与宿主对话区并排常驻:顶部实时呈现当前跟随的 `Provider · 模型` 渠道、人类三档控速开关(默认 `⏸ 按需` 零后台损耗)与子代理/联动窗口徽标;中部展示结构化战场简报与待盖章的边界请示;底部一句话即可向 `@主对话`、`@子代理` 或 `@跨窗会话` 拆话调度。
64
+
65
+ ![01 - 参谋长全景指挥舱](assets/screenshots/01-chief-cockpit-overview.png)
66
+
67
+ ---
68
+
69
+ ### 02 · 全铺开金字塔子代理拓扑(`任务` 页签)
70
+ 彻底告别局促的小窗拖拽:`👑 主代理·总指挥` 坐镇顶端,下辖各路子代理横向铺开为清晰纵队;每张任务卡原地集成 **状态一键流转、白话解释、指派执行、子代理分屏实时盯流**,谁在推进、谁被卡住一眼洞穿。
71
+
72
+ <div align="center">
73
+ <img src="assets/screenshots/02-full-spread-pyramid-dag.png" alt="02 - 全铺开金字塔任务拓扑" width="76%" />
74
+ </div>
75
+
76
+ ---
77
+
78
+ ### 03 · 四层冷存储「工程档案柜」(`档案` 页签)
79
+ 像真正的工程档案室一样分层保管长期技术资产,彻底根治「长记忆烧光上下文」顽疾:
80
+ - **四层收纳结构**:**分类抽屉**(拉开抽屉)→ **三色曲别针卷宗**(高对比度 **璀璨金针 `#ffe033` 核心必读** / **标准银针 `#cbd5e1` 常规实录** / **暗古铜针 `#7c4329` 历史归档**)→ **分条记忆点** → **点击逐条展开小点记忆**。
81
+ - **三级懒加载 · 默认 0 Token 空耗**:`Stage-0` 快照仅传输 `< 80B` 计数元信息,封存状态下对系统提示词保持 **100% 零注入**;只有当你主动点击「**取出备查**」或模型点名调用 `archive.search` 时才精准调取,用完点「**放回封存**」立即归零。
82
+ - **参谋长无损整理**:支持一键「请参谋长整理收纳 / 重拆此卷」,自动提炼结构化记忆点并 **100% 无损保留原始 Markdown 正文**。
83
+
84
+ <div align="center">
85
+ <img src="assets/screenshots/03-cold-archive-cabinet.png" alt="03 - 四层冷存储工程档案柜与金银暗铜曲别针" width="68%" />
86
+ </div>
87
+
88
+ ---
89
+
90
+ ### 04 · 双层 `/goal` 长期目标与可追问小任务板(`规划` 页签)
91
+ 上方独立承载 `/goal` 长期督导总纲,下方实时同步细粒度执行步骤。对模型写下的某一步技术操作有疑问?**直接左键/右键点击该步骤**,即可呼出交互菜单:一键询问主代理「**这条是什么意思 / 为什么有这步**」,或让 **DSH 参谋长当场白话解读(不打断主对话当前推理流)**。
92
+
93
+ <div align="center">
94
+ <img src="assets/screenshots/04-dual-tier-goal-and-step-qa.png" alt="04 - 双层 Goal 目标与步骤点击追问解读" width="68%" />
95
+ </div>
96
+
97
+ ---
98
+
99
+ ### 05 · 跨窗口独立会话串联与三态信使网络(`协同` 页签)
100
+ 打破单窗口孤岛:一键拨动开关即可将多个独立 DSH 主窗口(例如「前端交互窗口」与「后端压测窗口」)接入同一协同集群,共享统一通讯录与协同信箱,随时发起 `插话`、`递话`、`备忘` 或一键打开子代理右侧分屏。
101
+
102
+ <div align="center">
103
+ <img src="assets/screenshots/05-cross-session-collab-bus.png" alt="05 - 跨窗口独立会话串联与协同网络" width="68%" />
104
+ </div>
105
+
106
+ ---
107
+
108
+ ### 06 · `📌` 图钉全局红线盖章与智能浓缩(`边界` 页签 · 红线边界)
109
+ - **双层作用域精准隔离**:点击规则左侧的 **`📌` 小图钉** 即可将其升格为跨所有任务生效的「**全局共享铁律**」;未钉住的规则仅在当前会话树生效,绝不污染其他无关项目。
110
+ - **撞墙请示与一键浓缩**:子代理实战踩坑后可通过 `bounds.propose` 提交新边界草案,由你在面板上一键选择「`📌 定住全局` / `仅本任务` / `微调` / `驳回`」;零散规则过多时还可勾选并点击「**✨ 零散总结成一条**」交由参谋长精炼合并。
111
+
112
+ <div align="center">
113
+ <img src="assets/screenshots/06-pinned-bounds-and-handoff.png" alt="06 - 图钉全局红线与参谋长边界请示盖章" width="68%" />
114
+ </div>
115
+
116
+ ---
117
+
118
+ ### 07 · 一键自包含会话交接与空转守护(`边界` 页签 · 会话交接 & 守护)
119
+ 长对话上下文逼近上限时,点击「**新建会话并交接**」即可将当前目标、父子任务树、当前游标、阻塞卡点与有效红线打包为一份**自包含 Markdown 交接单**,自动创建新对话并将前端视口无缝切换过去继续接力;内置 `idle-guard` 空转完结守护,防止模型在任务未闭环时提前停机交差。
120
+
121
+ <div align="center">
122
+ <img src="assets/screenshots/07-session-handoff-and-guard.png" alt="07 - 自包含一键会话交接与空转守护" width="68%" />
123
+ </div>
124
+
125
+ ---
126
+
127
+ ## 🏗️ 冷热记忆分舱与多代理协同架构
128
+
129
+ ```mermaid
130
+ flowchart TB
131
+ subgraph UI["DSH 右侧常驻参谋舱 (client.js)"]
132
+ T1["参谋台 (三档人类控速)"]
133
+ T2["全铺开金字塔任务图"]
134
+ T3["跨窗与子代理协同网"]
135
+ T4["/goal + 可追问步骤板"]
136
+ T5["四层冷存储工程档案柜"]
137
+ T6["📌 全局红线 & 一键交接"]
138
+ end
139
+
140
+ subgraph Core["宿主协调与存储内核 (Zero External Deps)"]
141
+ Hot["热工作板 & 精炼热摘要 (< 1.5KB)\nboard.json / boards/session-*.json"]
142
+ Cold["四层懒加载冷档案库 (平时 0B 注入)\narchives.json (金/银/暗铜曲别针)"]
143
+ Bus["三态跨会话信使 & 参谋状态机\nchief-state.json + idle-guard.js"]
144
+ end
145
+
146
+ subgraph Agents["多智能体执行集群"]
147
+ Lead["当前主代理 (Root Coordinator)"]
148
+ Subs["子代理纵队 (@arch / @dev / @bench)"]
149
+ Peers["已串联的跨窗口主会话"]
150
+ end
151
+
152
+ UI <-->|"同源环回守卫 API (/api/dsh-chief/*)"| Core
153
+ Hot -->|"紧凑态势注入"| Lead
154
+ Hot -->|"紧凑态势注入"| Subs
155
+ Cold -.->|"仅「取出备查」或点名检索时按需调取"| Lead
156
+ Bus <-->|"chief_board / chief_memory\nchief_boundaries / chief_handoff"| Agents
157
+ ```
158
+
159
+ ---
160
+
161
+ ## ⚡ 快速安装(零外部依赖)
162
+
163
+ ### 方式一:通过 DSH 插件市场或 CLI 一键安装(推荐)
164
+
165
+ 在已安装 [dshmarket](https://github.com/dsh-market/dsh-market) 或官方「发现」页中搜索 **`dsh-chief`**(或 **DSH 参谋长**)一键安装;或直接使用命令行安装:
166
+
167
+ ```bash
168
+ # 直接从 GitHub Release 预构建包极速安装(约 240 KB,零编译步骤)
169
+ dsh plugin --profile desktop add https://github.com/gluztm/dsh-chief/releases/download/v1.0.0/dsh-chief-1.0.0.tgz
170
+
171
+ # 或通过 GitHub 仓库标识安装(若使用 web profile,将 desktop 替换为 web)
172
+ dsh plugin --profile desktop add github:gluztm/dsh-chief
173
+ ```
174
+
175
+ 安装完成后刷新 DSH Web 页面,点击工作区右侧边栏顶部的 **✦ `DSH 参谋长`** 图标即可展开面板。
176
+
177
+ ### 方式二:源码克隆与本地联接调试(适合二次开发)
178
+
179
+ ```bash
180
+ git clone https://github.com/gluztm/dsh-chief.git
181
+ ```
182
+
183
+ 本插件采用**零外部运行时依赖(Zero Runtime Dependencies)**纯原生 ES Module 架构,无需 `npm build` 即可直接挂载调试。
184
+
185
+ ---
186
+
187
+ ## 🛠️ 模型工具矩阵(4 Tools)
188
+
189
+ 装入后自动向模型暴露 4 个结构化协同工具(动作层均做类型宽容解析,兼容原生 JSON 数组与扁平文本传参):
190
+
191
+ | 工具名 | 核心职责 | 典型高频动作 (`action`) |
192
+ | :--- | :--- | :--- |
193
+ | **`chief_board`** | 驱动任务拓扑、规划步骤、冷档案检索与跨代理信箱 | `graph.plan`、`task.add`、`task.update`、`plan.set`、`cursor.set`、`mail.send`、`archive.save`、`archive.search`、`bounds.propose` |
194
+ | **`chief_memory`** | 读写会话级高密度热记忆条目(决策/进展/验证/风险) | `list`、`get`、`add`、`update`、`remove` |
195
+ | **`chief_boundaries`** | 读取与维护全局图钉红线(`📌`)及当前任务工作边界 | `get`、`set`、`add`、`pin`、`remove` |
196
+ | **`chief_handoff`** | 导出当前多代理全局态势与自包含 Markdown 交接单 | `preview` / 直接生成新会话接力包 |
197
+
198
+ ---
199
+
200
+ ## 📊 实测工程指标与纯本地安全承诺
201
+
202
+ - **高并发写锁防撕裂**:`board.json` 与 `archives.json` 均受基于 `wx` 原子排他文件锁 + 陈旧锁自动剥离机制保护;实测 **80 路并发混合写锁争用 + 60 轮高频 UI 页签切页压测** **0 丢单、0 JSON 损坏、0 残留锁**。
203
+ - **冷库零泄漏与亚毫秒响应**:实测挂载 **500 卷(4.0 MB)** 工程档案压测下,`Stage-0` 快照元信息仅 **`75 Bytes`(耗时 `0.10ms`)**,全文检索 **`< 4ms`**,未取出卷宗对模型提示词 **0 字符泄漏**。
204
+ - **严格同源环回与防泄密门禁**:
205
+ - 所有 `/api/dsh-chief/*` 接口均强制执行 **Loopback 环回地址 + 同源 `Origin/Host` 双重校验**,拒绝任何跨站诱导调用。
206
+ - 内置敏感凭据正则硬拦截器,自动拒绝将 `sk-*`、`ghp_*`、Bearer Token 或 OpenSSH 私钥写入工作板、参谋记忆或冷档案库。
207
+ - **100% 纯本地存储**:所有数据仅保存在本机 `~/.dsh/chief/` 目录下,零遥测、零第三方云上报。
208
+
209
+ ---
210
+
211
+ ## 📄 开源许可 (License)
212
+
213
+ 本项目基于 **[GNU Affero General Public License v3.0 (`AGPL-3.0-only`)](LICENSE)** 开源发布。
214
+ 在遵循相同开源协议并保留版权与修改声明的前提下,欢迎自由使用、审计、分支改进与提交社区 PR!