@reserendipity/dsh-superagent 0.0.0-stage → 0.1.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.
Files changed (57) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +50 -0
  3. package/README.md +206 -2
  4. package/cordis.patch.yml +214 -0
  5. package/examples/profile.cordis.patch.yml +31 -0
  6. package/lib/client.js +7695 -0
  7. package/lib/feishu-Dvj-1eJf.js +1325 -0
  8. package/lib/feishu-watch.d.ts +125 -0
  9. package/lib/feishu-watch.js +2 -0
  10. package/lib/github-pull-DRiuuSs8.js +597 -0
  11. package/lib/github-watch.d.ts +2 -0
  12. package/lib/github-watch.js +836 -0
  13. package/lib/host-BIWKSB5j.js +124 -0
  14. package/lib/inbox-watch.d.ts +43 -0
  15. package/lib/inbox-watch.js +343 -0
  16. package/lib/index.d.ts +369 -0
  17. package/lib/index.js +13654 -0
  18. package/lib/instance-status-Cqaju-dw.js +87 -0
  19. package/lib/instances-view.d.ts +164 -0
  20. package/lib/instances-view.js +258 -0
  21. package/lib/intake-TNIkqilh.d.ts +735 -0
  22. package/lib/kind--8woUEex.d.ts +1019 -0
  23. package/lib/poll-Bm5EYA2c.js +819 -0
  24. package/lib/schemas-MhNERx8d.js +4484 -0
  25. package/lib/schemas-lx-F2nnt.d.ts +2134 -0
  26. package/locale/en.json +6 -0
  27. package/locale/zh.json +6 -0
  28. package/package.json +159 -4
  29. package/prompts/admission.md +68 -0
  30. package/prompts/cli.md +17 -0
  31. package/prompts/dispatch.md +59 -0
  32. package/prompts/handoff-orchestrator.md +4 -0
  33. package/prompts/handoff-worker.md +7 -0
  34. package/prompts/handoff.md +6 -0
  35. package/prompts/orchestrator.md +16 -0
  36. package/prompts/presets/brief/communication.md +4 -0
  37. package/prompts/presets/brief/delivery.md +3 -0
  38. package/prompts/presets/brief/scope.md +4 -0
  39. package/prompts/presets/evidence/communication.md +6 -0
  40. package/prompts/presets/evidence/delivery.md +4 -0
  41. package/prompts/presets/evidence/scope.md +5 -0
  42. package/prompts/presets/result/communication.md +4 -0
  43. package/prompts/presets/result/delivery.md +3 -0
  44. package/prompts/presets/result/scope.md +5 -0
  45. package/prompts/replies.md +35 -0
  46. package/prompts/shared.md +9 -0
  47. package/prompts/subscriptions.md +13 -0
  48. package/prompts/team/communication.md +101 -0
  49. package/prompts/team/delivery.md +35 -0
  50. package/prompts/team/scope.md +26 -0
  51. package/prompts/work.md +49 -0
  52. package/prompts/worker.md +10 -0
  53. package/schema/declarative-settings.example.json +26 -0
  54. package/schema/declarative-settings.schema.json +348 -0
  55. package/skills/README.md +14 -0
  56. package/skills/dsh-superagent-feishu/SKILL.md +12 -0
  57. package/skills/dsh-superagent-github/SKILL.md +14 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DeepSeek Harness Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/NOTICE ADDED
@@ -0,0 +1,50 @@
1
+ dsh-superagent — Windows adaptation
2
+ ====================================
3
+
4
+ This repository is an adaptation built on the official DeepSeek project:
5
+
6
+ dsh-superagent-prototype
7
+ https://github.com/deepseek-ai/dsh-superagent-prototype
8
+ Copyright (c) 2026 DeepSeek Harness Team
9
+ Licensed under the MIT License (see LICENSE)
10
+
11
+ The upstream project is a research prototype, published with the disclaimer quoted in README.md:
12
+ it is not an official DeepSeek product, and the design discussed in the article
13
+ "Exploring Super-agent Design: Towards a More Autonomous Agent System" is partly future work.
14
+
15
+ What this repository adds on top of upstream (all MIT, all opt-in or documented):
16
+
17
+ * a native Windows desktop application (Electron shell, portable layout, bundled git/gh/pwsh,
18
+ installer and shortcuts), under windows-app/ — removed from this repository on 2026-11-07;
19
+ the credit below is retained as provenance for the removed material
20
+ * multi-instance support: one context boundary per instance, separate state directories and
21
+ per-instance credentials (the desktop management window belonged to the removed shell)
22
+ * the external control loop ("Watchdog") deepened beyond upstream: cross-tick diffing, stall
23
+ detection, silence when nothing changed, and a standing instruction channel
24
+ * Router sharding (article §2.1), off by default: stable Thread placement, shard Sessions created
25
+ on first delivery, visible in health
26
+ * documentation for both the Windows port and the conformance review (docs/011–docs/015、017)
27
+
28
+ Upstream files keep their copyright and MIT license. Where this adaptation changes upstream behaviour it
29
+ is listed in docs/WINDOWS-DELTA.md; when upstream implements the same mechanism, this adaptation deletes its
30
+ own version and returns to the upstream implementation.
31
+
32
+ Provenance of the Windows work
33
+ ------------------------------
34
+
35
+ This repository is maintained independently and is not a downstream of anyone else's fork. It builds on
36
+ three separate sources, and the split is honest about which parts came from where:
37
+
38
+ * the official prototype above — the domain model, engine, sources, prompts and panel;
39
+ * Check-mj's Windows port (https://github.com/Check-mj/dsh-superagent-windows) — portions of the Windows
40
+ layer were first written there: `windows-app/` (the Electron shell, installer, bundled tools, instance
41
+ manager; removed from this repository on 2026-11-07) and docs/011–docs/015、017. That author's work is MIT, like this repository; it is credited here
42
+ and was the origin of that material, but this repository keeps an independent history and its own
43
+ direction, so it is not a fork of that project and no commit history was carried over into the public baseline;
44
+ * the external-agent-orchestration discipline — the operator-side rules injected into the team prompt
45
+ sections (secret redaction, "empty output means unproven", verifiable completion criteria, directory
46
+ boundaries, commit identity), plus Mode A (the local inbox Source) and the outer watchdog/guard layer,
47
+ both designed here.
48
+
49
+ Maintainer of this adaptation: ReSerendipity (https://github.com/ReSerendipity)
50
+ Prior Windows adaptation, and the origin of windows-app/ (removed 2026-11-07) and docs/011–docs/015、017: Check-mj (https://github.com/Check-mj)
package/README.md CHANGED
@@ -1,3 +1,207 @@
1
- # Temporary Holding Version
1
+ # DSH-Superagent
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
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
4
+ [![Upstream](https://img.shields.io/badge/upstream-dsh--superagent--prototype-0969da)](https://github.com/deepseek-ai/dsh-superagent-prototype)
5
+ [![Platform](https://img.shields.io/badge/platform-Windows%2010%2F11-lightgrey)](#安装)
6
+ [![Node](https://img.shields.io/badge/node-%5E22.19.0%20%7C%7C%20%3E%3D24-3fb950)](#安装)
7
+
8
+ > **DSH-Superagent 是 DeepSeek Harness 的一个非官方插件**:把 GitHub 仓库(issue / PR / 评论 / CI)、本地收件目录或飞书群聊里的事件,变成一条条可执行的工单——每条工单在上下文隔离的 DSH 会话里完成,再把结果回贴到原处。
9
+ >
10
+ > **非官方产品**:上游代码与设计由 DeepSeek Harness Team 以 MIT 授权,本仓新增部分同样以 MIT 发布;归属与分工见 [NOTICE](NOTICE)。
11
+
12
+ ## 安装
13
+
14
+ **在 DeepSeek Harness 应用里**:插件 → 添加插件,粘贴本仓库地址;等价的命令行是:
15
+
16
+ ```powershell
17
+ dsh plugin --profile superagent add "git+https://github.com/ReSerendipity/dsh-superagent.git"
18
+ ```
19
+
20
+ 装的是 `main` 当前最新提交;`dsh plugin add` 把 spec 原样交给 pnpm,锁文件会记下解析到的具体 commit。
21
+
22
+ **可选:锁定某个提交。** 团队统一版本、复现问题或 CI 需要固定构建时,在地址末尾加 `#<40 位 commit>`:`dsh plugin --profile superagent add "git+https://github.com/ReSerendipity/dsh-superagent.git#<40 位 commit>"`。代价是升级要手动换 sha,否则会一直停在旧版。
23
+
24
+ 仓库自带 `lib/` 构建产物,安装时不需要再构建。要求 Node `^22.19.0 || >=24`、DeepSeek Harness `>=0.2.1-alpha.2 <0.3.0`;一个 `stateDir` 只允许一个后端(锁保护)。
25
+
26
+ **装完还要做一步:给 profile 配 `stateDir`。** 插件配置里的 `stateDir` 是必填项,**故意没有默认值**:一个 `stateDir` 只允许一个后端(`<stateDir>.lock`),若给共享默认值,两个 profile 会抢同一把锁。没有配置时主页件会报 `ValidationError: invalid config: - $.stateDir missing required value (at stateDir)`。编辑 `%USERPROFILE%\.dsh\profiles\<profile>\cordis.patch.yml`:
27
+
28
+ ```yaml
29
+ - id: dsh-superagent
30
+ config:
31
+ stateDir: C:/Users/<you>/.dsh/state/superagent
32
+ ```
33
+
34
+ 每个 profile 用各自的目录(例如 `.../state/superagent-team-b`)。可直接复制的完整示例见 [`examples/profile.cordis.patch.yml`](examples/profile.cordis.patch.yml),它随包发出。
35
+
36
+ **只用本地收件目录(`mode: local`,不配 GitHub)** 还要三件套:`mode: local`、关掉 GitHub Source、启用 inbox Source:
37
+
38
+ ```yaml
39
+ - id: dsh-superagent
40
+ config:
41
+ stateDir: C:/Users/<you>/.dsh/state/superagent
42
+ mode: local
43
+ - id: dsh-superagent-github
44
+ disabled: true
45
+ - id: dsh-superagent-inbox
46
+ disabled: false
47
+ ```
48
+
49
+ 收件准入名单也必须非空(面板 设置 → 评估 → 谁可以派活,加一行 `local`),否则投单会被判 `not_a_member` 并静默归档,不写回信。
50
+
51
+ tarball、本地目录、独立 profile 与常驻服务见 [WINDOWS-SETUP.md](docs/WINDOWS-SETUP.md)。发布状态:本仓以 `v0.1.0` 为公开基线;npm 尚未发布(计划包名 `@reserendipity/dsh-superagent`);离线跑 `pnpm release:check -SkipOnline`(被跳过的在线检查会标成 `NOT VERIFIED`)。
52
+
53
+ ![插件管理器「已安装插件」:DSH-Superagent 开关为启用](https://gcore.jsdelivr.net/gh/ReSerendipity/dsh-superagent@main/docs/assets/readme-plugin-installed-20261108.png)
54
+
55
+ > **图**:插件管理器「已安装插件」列表中 DSH-Superagent 的开关为启用状态,模式 `mode: local`。
56
+ > **Figure**: in the plugin manager's installed-plugins list the DSH-Superagent switch is enabled; mode `mode: local`.
57
+
58
+ ## 它是什么
59
+
60
+ 单个 Coding Agent 已经能干活,但工作单位仍是「一次会话」:并行推进多项工作时,人得手动切换、记住上下文。DSH-Superagent 把这类工作变成**可排队、可观察、可回贴的工单**:一个仓库或一个收件目录连续产出事件,程序层准入与语义层评估决定哪些变成工单,每条工单在独立目录、上下文隔离的 DSH 会话里执行,完成后回贴评论或开 Pull Request。
61
+
62
+ 它遵循官方文章里的设计:Router 只分派不干活、Worker 隔离执行、程序与模型两级过滤、订阅直通、链式召回、外部控制回路。上游已实现的机制直接复用(例如异步子任务用 Harness 自带的 `subagent`);与上游的逐项差异和跟随方法见 [WINDOWS-DELTA.md](docs/WINDOWS-DELTA.md)。
63
+
64
+ ![执行页「进行中」:2 张执行中、2 张排队](https://gcore.jsdelivr.net/gh/ReSerendipity/dsh-superagent@main/docs/assets/readme-tickets-20261108.png)
65
+
66
+ > **图**:执行页「进行中」显示 2 张执行中、2 张排队,执行器运行中(2/2),模式 `mode: local`。
67
+ > **Figure**: the Execution tab shows two tickets executing and two queued with the executor running (2/2); mode `mode: local`.
68
+
69
+ ## 它能做什么
70
+
71
+ | 能力 | 说明 |
72
+ |---|---|
73
+ | **事件源** | GitHub 的 issue / PR / 评论 / CI 结果;本地收件目录(丢 `.md` 即工单,无需 GitHub 账号);可选飞书群聊 |
74
+ | **判断** | 程序层准入(谁能触发、什么算请求)+ 语义层评估(含糊的消息交给模型,必要时来问你) |
75
+ | **执行** | 每个工单一个**上下文隔离**的 DSH 会话,在独立目录里干活;完成后回贴评论或开 Pull Request |
76
+ | **运营** | 面板实时看触发/评估/执行/健康;一行运行判读对应 CLI 退出码;Watchdog 与 Router 分片按需开启 |
77
+ | **边界** | 插件运行期不依赖 WSL/tmux/Python;执行器按设计有完整 OS 权限——这是操作者信任模型,不是沙箱 |
78
+
79
+ ![概览页:运行判读「正常」,过去 24 小时到达 6 / 接单 6,执行器 2/2](https://gcore.jsdelivr.net/gh/ReSerendipity/dsh-superagent@main/docs/assets/readme-overview-20261108.png)
80
+
81
+ > **图**:概览页的运行判读为「正常(对应 CLI 退出码 0)」,过去 24 小时到达 6、已评估 6、接单或续做 6,待处理工单 0,执行器 2/2、排队 2;模式 `mode: local`。
82
+ > **Figure**: the Overview tab reports a normal run (CLI exit code 0): 6 delivered, 6 evaluated and 6 accepted or continued in the last 24 hours, 0 pending tickets, executors 2/2 with 2 queued; mode `mode: local`.
83
+
84
+ ## 第一次使用
85
+
86
+ 1. **接上事件源**:设置 → 来源,填仓库与 GitHub CLI(或指定本地收件目录),确认状态变成「就绪」
87
+ 2. **决定谁能触发**:设置 → 评估,把团队成员加入允许名单(名单外的人不会唤起它)
88
+ 3. **确认判断策略**:明确请求直接接单;含糊的消息走语义评估,必要时来问你
89
+ 4. **看执行与结果**:执行页看待处理工单,原 Thread 看回贴结果;需要介入时停止/继续
90
+
91
+ 接好来源后,设置 → 来源会逐条显示每个事件源的状态:本机收件目录显示「运行中」并给出 24 小时内的到达数,未装插件的 GitHub 源显示「插件未安装」。
92
+
93
+ 面板第一个标签是**介绍**;第一次打开概览还会给一张三步卡(接来源 → 派一张单 → 看回信)。Watchdog 间隔与 Router 分片在 设置 → 执行 里,默认按需开启,设计与取舍见 [`docs/012`](docs/012-watchdog.md)、[`docs/017`](docs/017-independent-layer.md)。
94
+
95
+ ![设置 → 执行:Watchdog 间隔 30 分钟、停滞判定 45 分钟、Router 分片 2](https://gcore.jsdelivr.net/gh/ReSerendipity/dsh-superagent@main/docs/assets/readme-watchdog-20261108.png)
96
+
97
+ > **图**:设置 → 执行中执行器模型为 DSH 默认(`modelscope / Qwen/Qwen3.8-Flash-Next`),并行工单数 2、Watchdog 间隔 30 分钟、停滞判定 45 分钟、Router 分片数 2,以上设置已保存并生效;模式 `mode: local`。
98
+ > **Figure**: under Settings → Execution the executor model is the DSH default (`modelscope / Qwen/Qwen3.8-Flash-Next`), with two parallel tickets, a 30-minute Watchdog interval, a 45-minute stall threshold and two Router shards saved and in effect; mode `mode: local`.
99
+
100
+ ### 一条工单的样子
101
+
102
+ ![工单详情:已完成,授权详情、订阅的线程,执行环境与标识为收起状态](https://gcore.jsdelivr.net/gh/ReSerendipity/dsh-superagent@main/docs/assets/readme-ticket-detail-20261108-r1.png)
103
+
104
+ > **图**:一条已完成工单的详情——授权详情(触发原文、决定「接单」、范围、点名方式、策略版本(当时))、订阅的线程;执行环境、渠道与标识三栏保持收起,画面里不出现本机路径;模式 `mode: local`。
105
+ > **Figure**: the detail of one completed ticket — mandate details (original trigger, decision "accept", scope, addressing, policy version (at the time)) and its subscribed thread; the execution environment, channel and identifier rows stay collapsed, so no machine path appears; mode `mode: local`.
106
+
107
+ ![执行器会话最终回报:分支 agent/glossary-notes-b36e816a648e、该轮执行的提交](https://gcore.jsdelivr.net/gh/ReSerendipity/dsh-superagent@main/docs/assets/readme-ticket-run-20261108.png)
108
+
109
+ > **图**:一条工单的执行器会话已完成(用时 1 分 46 秒)并回报:新增 `docs/notes/glossary.md`、分支 `agent/glossary-notes-b36e816a648e`、该轮执行的提交(提交信息带 Signed-off-by)、工作树干净,本地交付未推送、未开 PR;模式 `mode: local`。
110
+ > **Figure**: the executor session of one ticket completed (1 min 46 s) and reported back — it added `docs/notes/glossary.md`, committed on branch `agent/glossary-notes-b36e816a648e` with a Signed-off-by trailer, left a clean worktree, and delivered locally without pushing or opening a PR; mode `mode: local`.
111
+
112
+ ## 多实例
113
+
114
+ 一个后端只服务一个 `stateDir`(锁保护)。需要多个上下文边界时开多个 profile / 多个 `stateDir`,各自独立重启。详见 [`docs/015`](docs/015-multi-instance.md)。
115
+
116
+ ## English
117
+
118
+ **DSH-Superagent is an unofficial plugin for DeepSeek Harness.** It turns GitHub events (issues, pull requests, comments, CI results), a local inbox directory, or an optional Feishu group chat into tickets; each ticket runs in a context-isolated DSH session inside its own working directory and posts its result back.
119
+
120
+ It is built on the [deepseek-ai/dsh-superagent-prototype](https://github.com/deepseek-ai/dsh-superagent-prototype) and is **not an official DeepSeek product**; additions in this repository are MIT as well — the upstream license and copyright notice are in [NOTICE](NOTICE), the repository license in [LICENSE](LICENSE).
121
+
122
+ **Install.** *Plugins → Add plugin* in the app and paste this repository's GitHub URL, or run `dsh plugin --profile <name> add "git+https://github.com/ReSerendipity/dsh-superagent.git"`. This installs the latest commit on `main`; `dsh plugin add` hands the spec to pnpm verbatim, and the lockfile records the commit it resolved.
123
+
124
+ **One step after installing:** add `stateDir` to `%USERPROFILE%\.dsh\profiles\<profile>\cordis.patch.yml` — it is required and deliberately has no default, because one `stateDir` allows one backend at a time and a shared default would make two profiles fight over the same lock. Without it the home plugin reports `$.stateDir missing required value`. A copyable example is in [`examples/profile.cordis.patch.yml`](examples/profile.cordis.patch.yml), which ships in the package.
125
+
126
+ **Optional — pin a build.** For a team-wide version, reproducing an issue or CI, append `#<full 40-character commit>` to the URL (`...git#<commit>`); the cost is that upgrading means editing the sha, otherwise the install stays on that old build. The repo ships built artifacts in `lib/`, so no build step is needed at install time. Requirements: Node `^22.19.0 || >=24`, DeepSeek Harness `>=0.2.1-alpha.2 <0.3.0`; one backend per state directory (lock-protected).
127
+
128
+ **Honest limits.** Windows only, no macOS/Linux support; executors run with full OS access by design (an operator-trust model, not a sandbox); the public baseline is v0.1.0 and npm publication is pending (planned package name `@reserendipity/dsh-superagent`); the project is maintained by one person. Differences from upstream are enumerated in [docs/WINDOWS-DELTA.md](docs/WINDOWS-DELTA.md).
129
+
130
+ ## 文档索引
131
+
132
+ | 文档 | 内容 |
133
+ |---|---|
134
+ | [`SETUP.md`](docs/SETUP.md) | 给 Agent 读的安装向导(一次一个问题,最后统一执行) |
135
+ | [`WINDOWS-SETUP.md`](docs/WINDOWS-SETUP.md) | Windows 上的完整部署与排错 |
136
+ | [`WINDOWS-DELTA.md`](docs/WINDOWS-DELTA.md) | 与上游的逐项差异、上游跟随方法 |
137
+ | [`CHANGELOG.md`](CHANGELOG.md) | 本仓的版本历史 |
138
+ | [`NOTICE`](NOTICE) | 归属与新增部分声明 |
139
+ | [`ARCHITECTURE.md`](ARCHITECTURE.md) | 本仓内部结构:组件与依赖方向、数据流、外部依赖、边界与非目标、变更影响面 |
140
+ | [`docs/000`](docs/000-philosophy.md) | 设计哲学:尽可能少占用人的注意力 |
141
+ | [`docs/001`](docs/001-domain.md) | 领域模型:Trigger / Thread / Ticket / Assignment |
142
+ | [`docs/002`](docs/002-authorization.md) | 授权:谁能唤起 Agent、准入与两级过滤 |
143
+ | [`docs/003`](docs/003-execution.md) | 执行:执行器、会话、报告 |
144
+ | [`docs/004`](docs/004-prompts.md) | 提示词:段落组织与团队提示词 |
145
+ | [`docs/005`](docs/005-panel.md) | 面板:路由与视图 |
146
+ | [`docs/006`](docs/006-deployment.md) | 部署:profile、状态目录、契约 |
147
+ | [`docs/007`](docs/007-architecture.md) | 架构:模块与测试清单 |
148
+ | [`docs/008`](docs/008-cookbook.md) | 操作手册:常见任务的做法 |
149
+ | [`docs/009`](docs/009-declarative-settings.md) | 声明式设置文件 |
150
+ | [`docs/010`](docs/010-multi-source.md) | 多来源调研(未采纳的路线与原因) |
151
+ | [`docs/011`](docs/011-official-design-conformance.md) | 与官方设计的一致性审查 |
152
+ | [`docs/012`](docs/012-watchdog.md) | Watchdog 控制回路 |
153
+ | [`docs/013`](docs/013-full-duplex.md) | 全双工交互(§4.1)对照 |
154
+ | [`docs/014`](docs/014-chain-of-recall.md) | 链式召回(§3.3)对照 |
155
+ | [`docs/015`](docs/015-multi-instance.md) | 多实例:一边界一实例 |
156
+ | [`docs/017`](docs/017-independent-layer.md) | 独立实现层:补上游未做的机制 |
157
+ | [`docs/019`](docs/019-video-script.md) | 发布视频脚本(分镜 + 旁白) |
158
+ | [`docs/020`](docs/020-release-checklist.md) | 发布检查清单:发布前逐项验证与回滚 |
159
+ | [`docs/026`](docs/026-local-delivery.md) | `mode: local` 交付形态:选入路径(内置本地工作区)与默认值决策备忘、影响面与回滚 |
160
+
161
+ ## 常见问题
162
+
163
+ **它会自己改我的仓库吗?** 只在你或名单里的人请求、或团队写下的规则允许时行动;它写出的内容都在它自己的账号名下,
164
+ 并出现在原 Thread 里。自动合并默认关闭。
165
+
166
+ **必须有自己的 GitHub 账号吗?** 分两条路线,见 [`WINDOWS-SETUP.md`](docs/WINDOWS-SETUP.md) §6.0。走 **Mode B**(GitHub 派单、团队语义)需要专用智能体账号——它做的事都记在那个账号名下,不要用你自己的主账号。走 **Mode A**(本地收件目录派单)不需要第二个账号:丢文件即请求,结果写回信文件。两条路线都遵守「派单账号 ≠ 执行账号」。
167
+
168
+ **需要常开一台机器吗?** 是。它是常驻进程;进程停了就不工作。外部可以挂一个定时检查(见 [`WINDOWS-SETUP.md`](docs/WINDOWS-SETUP.md))
169
+ 作为最外层兜底。
170
+
171
+ **数据存在哪里?** 每个实例一个状态目录,由 profile 的 `cordis.patch.yml` **显式指定** `stateDir`(没有默认值):数据库、锁、工单目录、凭据目录。
172
+ 卸载插件不会删它。
173
+
174
+ **仓库里有没有绑定开发机的地方?** 没有。所有路径运行时推导,文档只用 `<install>`、`%LOCALAPPDATA%`、`<checkout>`
175
+ 这类占位符;`tests/portability.spec.ts` 会扫描仓库内的文本文件(含 `lib/` 构建产物、`.css` 与无扩展名文件),
176
+ 用户名与 home 目录在运行时从 `os.userInfo()` / `os.homedir()` 推导,出现开发机的绝对路径或用户名就让测试失败。
177
+
178
+ **安装时报 `UNABLE_TO_VERIFY_LEAF_SIGNATURE`?** 这台机器或网络边界有 TLS 中间盒(公司代理、杀毒软件的 HTTPS 扫描),git 不认它的根证书。这与插件无关,克隆任何 GitHub 仓库都一样。把代理根证书导入系统信任区,或 `git config --global http.sslCAInfo <ca-bundle.pem>` 指向它的 CA 包;Node 侧需要时设 `NODE_EXTRA_CA_CERTS`。不要用 `http.sslVerify false` 绕过。详见 [`WINDOWS-DELTA.md`](docs/WINDOWS-DELTA.md) §8.5。
179
+
180
+ **为什么显示名和包名不一样?** 显示名是 DSH-Superagent;npm 包名带 scope,是 `@reserendipity/dsh-superagent`——裸名 `dsh-superagent` 与 npm 上已有的 `dsh-super-agent` 相似,被注册表按近似名拦截,因此挂在本人 scope 下。包名是安装契约(插件 id、profile 依赖、内部路径),改动会破坏已安装实例;显示名只是给人看的。
181
+
182
+ ## 目录结构
183
+
184
+ ```
185
+ src/ 插件本体(TypeScript):来源、核心、执行器、面板服务
186
+ locale/ 面板与插件页的显示名、描述(中英)
187
+ prompts/ 提示词段落
188
+ docs/ 编号设计文档(当前保留 000–015、017、019、020、026)与 Windows 操作说明
189
+ scripts/ 启动/停止/状态脚本
190
+ tests/ 单元与面板测试(文档与代码一致性也在其中)
191
+ ```
192
+
193
+ ## 开发与发布
194
+
195
+ - 开发与提交约定见 [CONTRIBUTING.md](CONTRIBUTING.md);本地跑 `pnpm typecheck` 与 `pnpm vitest run`。
196
+ - 发布前跑 `pnpm release:check`(逐项 PASS/FAIL,失败退出码非 0);在线两项核对 `releases/tags/v<版本>` 的资产与本地打出的 `.tgz` digest——改过打包内容(`package.json`、`files`)之后对已发布版本必然不一致,这是预期的「不要用旧资产冒充新构建」,新版本要等新 tag 与新资产。细则见 [`docs/020`](docs/020-release-checklist.md),视频脚本见 [`docs/019`](docs/019-video-script.md)。
197
+ - 变更历史见 [CHANGELOG](CHANGELOG.md)。
198
+
199
+ ## 致谢与归属
200
+
201
+ - **设计思想来源**:官方文章《Super-agent 设计探索:迈向更自主的 Agent 系统》。
202
+ - 上游与第三方来源的许可与版权声明统一写在 [`NOTICE`](NOTICE);本仓许可见 [`LICENSE`](LICENSE)。
203
+ - `NOTICE` 与 `examples/` 都在发布包的 `files` 白名单里,所以安装副本内 `README` 指向 `NOTICE` 的相对链接同样有效。
204
+
205
+ ## 许可
206
+
207
+ MIT,见 [`LICENSE`](LICENSE)。
@@ -0,0 +1,214 @@
1
+ # dsh-superagent bundle layer: inserts the plugins without configuration, and the agent presets its Sessions run under. The
2
+ # profile supplies the `dsh-superagent` entry's stateDir (see docs/006-deployment.md and examples/profile.cordis.patch.yml); the plugin
3
+ # refuses to start without stateDir.
4
+ - insert:
5
+ - id: dsh-superagent
6
+ name: '@reserendipity/dsh-superagent'
7
+ - id: dsh-superagent-github
8
+ name: '@reserendipity/dsh-superagent/github-watch'
9
+ # Optional Feishu Source; requires configuring a bot CLI after enabling.
10
+ - id: dsh-superagent-feishu
11
+ name: '@reserendipity/dsh-superagent/feishu-watch'
12
+ disabled: true
13
+ # Mode A Source: a local inbox directory whose files become tickets, so one GitHub account suffices. Enable it in a profile.
14
+ - id: dsh-superagent-inbox
15
+ name: '@reserendipity/dsh-superagent/inbox-watch'
16
+ disabled: true
17
+ # The agent preset of every Executor Session (WORKER_PRESET in src/app/sessions.ts); the main Session has its own, below.
18
+ # It is DSH's `standard` preset with only what a worker needs, and a shell whose foreground command moves to a background job
19
+ # after 5 seconds, so a long command does not hold back a person's message, which the Session takes at its next step. Left
20
+ # out: questions to a person, presenting, plan mode, the plugin manager and market, scheduling, goals, workflows, web fetch,
21
+ # and forked subagents, which would run under this preset; spawned subagents run under `standard`, whose shell moves a
22
+ # command to a background job only after 60 seconds, as a subagent's jobs are killed when it ends. A preset row has no
23
+ # setting that hides it from the preset picker, so its name and description say whom it is for.
24
+ - id: dsh-superagent-worker-preset
25
+ name: '@deepseek-ai/dsh-agent-preset'
26
+ config:
27
+ id: dsh-superagent-worker
28
+ name: '[内部] dsh-superagent 执行器'
29
+ description: 仅供插件为工单开启的执行器 Session 使用,普通对话请选「标准模式」。前台命令超 5 秒转入后台,只含执行工作所需的工具。
30
+ order: 90
31
+ plugins:
32
+ - id: persona
33
+ name: '@deepseek-ai/dsh-persona'
34
+ config:
35
+ prefix: You are a coding agent powered by the {{model}} model.
36
+ - id: agent-instructions
37
+ name: '@deepseek-ai/dsh-agent-instructions'
38
+ config:
39
+ maxBytes: 65536
40
+ - id: time-context
41
+ name: '@deepseek-ai/dsh-time-context'
42
+ # A foreground command waits at most 5 s, then the shell tool moves it to a background job.
43
+ - id: shell
44
+ name: cordis:group
45
+ group: true
46
+ isolate:
47
+ shell: true
48
+ config:
49
+ - id: bash-sandbox
50
+ name: '@deepseek-ai/dsh-bash-sandbox'
51
+ disabled: !!js process.platform === 'win32'
52
+ config:
53
+ timeoutMs: 5000
54
+ maxTimeoutMs: 5000
55
+ - id: pwsh-sandbox
56
+ name: '@deepseek-ai/dsh-pwsh-sandbox'
57
+ disabled: !!js process.platform !== 'win32'
58
+ config:
59
+ timeoutMs: 5000
60
+ maxTimeoutMs: 5000
61
+ - id: tool-bash
62
+ name: '@deepseek-ai/dsh-tool-bash'
63
+ disabled: !!js process.platform === 'win32'
64
+ - id: tool-pwsh
65
+ name: '@deepseek-ai/dsh-tool-pwsh'
66
+ disabled: !!js process.platform !== 'win32'
67
+ - id: tool-fs
68
+ name: '@deepseek-ai/dsh-tool-fs'
69
+ - id: tool-fs-search
70
+ name: '@deepseek-ai/dsh-tool-fs-search'
71
+ config:
72
+ sampleOverCapGlobResults: false
73
+ # A wait for a job ends after 5 s too; the job's end wakes the worker with its result.
74
+ - id: tool-jobs
75
+ name: '@deepseek-ai/dsh-tool-jobs'
76
+ config:
77
+ waitTimeoutMs: 5000
78
+ maxWaitTimeoutMs: 5000
79
+ - id: skill-filesystem
80
+ name: '@deepseek-ai/dsh-skill-filesystem'
81
+ - id: tool-skill
82
+ name: '@deepseek-ai/dsh-tool-skill'
83
+ - id: compaction
84
+ name: cordis:group
85
+ group: true
86
+ isolate:
87
+ compaction: true
88
+ toolResultPruner: true
89
+ config:
90
+ - id: compaction-basic
91
+ name: '@deepseek-ai/dsh-compaction-basic'
92
+ - id: command-compact
93
+ name: '@deepseek-ai/dsh-command-compact'
94
+ - id: tool-result-pruner
95
+ name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
96
+ config:
97
+ thresholdChars: 8192
98
+ headChars: 4096
99
+ tailChars: 1024
100
+ - id: delegation
101
+ name: cordis:group
102
+ group: true
103
+ isolate:
104
+ workflowEngine: true
105
+ config:
106
+ - id: tool-subagent-control
107
+ name: '@deepseek-ai/dsh-tool-subagent-control'
108
+ - id: tool-subagent
109
+ name: '@deepseek-ai/dsh-tool-subagent'
110
+ config:
111
+ provider: spawn
112
+ toolName: subagent
113
+ modelSelection: true
114
+ modelDiscovery: true
115
+ agentPreset: standard
116
+ - id: tool-todo
117
+ name: '@deepseek-ai/dsh-tool-todo'
118
+ config:
119
+ allowParallelInProgress: true
120
+ - id: tool-web
121
+ name: '@deepseek-ai/dsh-tool-web'
122
+ config:
123
+ fetch: false
124
+ searchTimeoutMs: 60000
125
+ # The agent preset of the main Session (ROUTER_PRESET in src/app/sessions.ts). The worker's 5-second shell and job waits, so a command or a wait does not hold back the next candidates, and
126
+ # only what the main Session uses: no subagents, web, file search or writes, todo list, questions to a person, presenting,
127
+ # plan mode, plugin manager, scheduling, goals or workflows. No persona: the main Session's prompt is complete, so it has
128
+ # no other section.
129
+ - id: dsh-superagent-router-preset
130
+ name: '@deepseek-ai/dsh-agent-preset'
131
+ config:
132
+ id: dsh-superagent-router
133
+ name: '[内部] dsh-superagent 主 Session'
134
+ description: 仅供插件自己的主 Session 使用,普通对话请选「标准模式」。这里只有路由工具(文件只读、命令限 5 秒、不许等待)。
135
+ order: 91
136
+ plugins:
137
+ - id: agent-instructions
138
+ name: '@deepseek-ai/dsh-agent-instructions'
139
+ config:
140
+ maxBytes: 65536
141
+ - id: time-context
142
+ name: '@deepseek-ai/dsh-time-context'
143
+ - id: shell
144
+ name: cordis:group
145
+ group: true
146
+ isolate:
147
+ shell: true
148
+ config:
149
+ - id: bash-sandbox
150
+ name: '@deepseek-ai/dsh-bash-sandbox'
151
+ disabled: !!js process.platform === 'win32'
152
+ config:
153
+ timeoutMs: 5000
154
+ maxTimeoutMs: 5000
155
+ - id: pwsh-sandbox
156
+ name: '@deepseek-ai/dsh-pwsh-sandbox'
157
+ disabled: !!js process.platform !== 'win32'
158
+ config:
159
+ timeoutMs: 5000
160
+ maxTimeoutMs: 5000
161
+ - id: tool-bash
162
+ name: '@deepseek-ai/dsh-tool-bash'
163
+ disabled: !!js process.platform === 'win32'
164
+ - id: tool-pwsh
165
+ name: '@deepseek-ai/dsh-tool-pwsh'
166
+ disabled: !!js process.platform !== 'win32'
167
+ - id: tool-fs
168
+ name: '@deepseek-ai/dsh-tool-fs'
169
+ config:
170
+ write: false
171
+ edit: false
172
+ - id: tool-jobs
173
+ name: '@deepseek-ai/dsh-tool-jobs'
174
+ config:
175
+ waitTimeoutMs: 5000
176
+ maxWaitTimeoutMs: 5000
177
+ - id: skill-filesystem
178
+ name: '@deepseek-ai/dsh-skill-filesystem'
179
+ - id: tool-skill
180
+ name: '@deepseek-ai/dsh-tool-skill'
181
+ - id: compaction
182
+ name: cordis:group
183
+ group: true
184
+ isolate:
185
+ compaction: true
186
+ toolResultPruner: true
187
+ config:
188
+ - id: compaction-basic
189
+ name: '@deepseek-ai/dsh-compaction-basic'
190
+ - id: command-compact
191
+ name: '@deepseek-ai/dsh-command-compact'
192
+ - id: tool-result-pruner
193
+ name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
194
+ config:
195
+ thresholdChars: 8192
196
+ headChars: 4096
197
+ tailChars: 1024
198
+
199
+ # A second instance must not list the workspaces the default instance created (docs/015 §5). The composition cannot
200
+ # read the plugin's `stateDir`, so these roots mirror `src/app/instance-roots.ts` through an environment variable:
201
+ # unset, each expression is exactly the base bundle's `dshHomePath('storages')` / `dshHomePath('sessions')`, so the
202
+ # single instance is unchanged; a second instance sets `SUPERAGENT_DATA_HOME` to its state directory.
203
+ - id: storage-json
204
+ config:
205
+ root: !!js |-
206
+ process.env.SUPERAGENT_DATA_HOME
207
+ ? process.env.SUPERAGENT_DATA_HOME + '/storages'
208
+ : dshHomePath('storages')
209
+ - id: session-persistence-jsonl
210
+ config:
211
+ root: !!js |-
212
+ process.env.SUPERAGENT_DATA_HOME
213
+ ? process.env.SUPERAGENT_DATA_HOME + '/sessions'
214
+ : dshHomePath('sessions')
@@ -0,0 +1,31 @@
1
+ # Example profile configuration: %USERPROFILE%\.dsh\profiles\<profile>\cordis.patch.yml
2
+ # Replace <placeholders> before first start; see docs/006-deployment.md.
3
+ #
4
+ # `stateDir` is required and deliberately has no default: one stateDir allows one backend at a
5
+ # time (`<stateDir>.lock`), so every profile needs its own directory. Without it the plugin
6
+ # fails with `$.stateDir missing required value`.
7
+ - id: webserver
8
+ config:
9
+ host: 127.0.0.1
10
+ port: 3082
11
+ - id: dsh-superagent
12
+ config:
13
+ stateDir: C:/Users/<you>/.dsh/state/superagent
14
+ # POSIX form, kept for reference only (the product targets Windows):
15
+ # stateDir: /home/<you>/.dsh/state/superagent
16
+ # mode: local
17
+ # Feishu is optional: uncomment to enable its Source, then set the bot's lark-cli on the Feishu Source.
18
+ # - id: dsh-superagent-feishu
19
+ # disabled: false
20
+
21
+ # Local mode (no GitHub) needs all three pieces below. The inbox admission list must be
22
+ # non-empty as well (Settings -> Eval -> who can dispatch, add `local`); otherwise a dropped
23
+ # ticket is judged `not_a_member` and archived silently, with no reply written.
24
+ # - id: dsh-superagent
25
+ # config:
26
+ # stateDir: C:/Users/<you>/.dsh/state/superagent
27
+ # mode: local
28
+ # - id: dsh-superagent-github
29
+ # disabled: true
30
+ # - id: dsh-superagent-inbox
31
+ # disabled: false