dsh-lark-bot 0.7.0 → 0.8.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.md CHANGED
@@ -153,6 +153,47 @@ runtime profiles): after a task finishes it can push messages to other groups/to
153
153
  members. The bridge listens on 127.0.0.1 with a random per-boot token — nothing is exposed to the
154
154
  public network.
155
155
 
156
+ **安全网守护(Safe-mode guardian)**:可选安装一个独立于 dsh 进程、系统级常驻的最小守护进程
157
+ (Linux systemd user unit / macOS LaunchAgent / Windows 启动项)。dsh 正常运行时守护保持静默;
158
+ 一旦 dsh 进程下线或无法 boot(例如某个第三方插件破坏了整个 profile 组合),守护自动接管飞书
159
+ 通道,用户无需接触命令行即可发送控制信号自救:
160
+
161
+ - `/safemode`:进入**仅核心安全模式**——守护创建 `~/.dsh/profiles/<profile>-safe`(仅
162
+ `dsh-base` + `dsh-headless` 两个官方核心 bundle,**不加载任何第三方插件**),后续消息经
163
+ 守护转发给该核心 dsh 逐条对话,配合代码执行能力定位 / 修复 / 禁用损坏插件;
164
+ - `/safemode plugins`:列出故障 profile 已安装的插件清单(自愈诊断);
165
+ - `/safemode status`:查看守护 / dsh / 安全模式状态;
166
+ - `/safemode exit`:退出安全模式,守护重启完整 profile 并把飞书通道交还给正常形态;
167
+
168
+ 全程不需要命令行;dsh 恢复后守护自动断开并回归静默。安装:
169
+
170
+ ```bash
171
+ npx dsh-lark-bot@latest setup --profile dsh-lark --guardian
172
+ # 或已安装后单独安装:dsh-lark-bot guardian install
173
+ ```
174
+
175
+ **Safety-net guardian**: optionally install a minimal system-level resident process that is
176
+ independent of the dsh process. While dsh runs, the guardian stays silent; once dsh goes down or
177
+ fails to boot (e.g. a third-party plugin breaks the whole profile composition), the guardian
178
+ takes over the Feishu channel so you can self-heal without touching the command line:
179
+
180
+ - `/safemode`: enter **core-only safe mode** — the guardian provisions
181
+ `~/.dsh/profiles/<profile>-safe` with only the two official core bundles (`dsh-base` +
182
+ `dsh-headless`, **no third-party plugins**) and proxies a restricted conversation to that core
183
+ dsh so you can locate / fix / disable the offending plugin;
184
+ - `/safemode plugins`: list the plugins installed into the broken profile;
185
+ - `/safemode status`: show guardian / dsh / safe-mode state;
186
+ - `/safemode exit`: leave safe mode — the guardian relaunches the full profile and hands the
187
+ Feishu channel back;
188
+
189
+ No command line is needed for the whole rescue flow; once dsh is back, the guardian releases the
190
+ channel automatically. Install:
191
+
192
+ ```bash
193
+ npx dsh-lark-bot@latest setup --profile dsh-lark --guardian
194
+ # or later: dsh-lark-bot guardian install
195
+ ```
196
+
156
197
  ### 模型 / Provider / 凭据管理 | Models / Providers / Credentials
157
198
 
158
199
  模型与 provider 的配置以 dsh 官方方式持久化(与 dsh Web **Settings → Models** 页面完全相同的
@@ -187,14 +228,56 @@ Security note: typing a key in a Feishu conversation exposes it to everyone who
187
228
  chat; prefer private chats, `--api-key-env` references to existing environment variables, or the
188
229
  dsh Web UI. The bot never echoes key values in any reply.
189
230
 
190
- ### 5. 卸载 | Uninstall
231
+ ## 安装与卸载 | Install & Uninstall
232
+
233
+ ### 安装 | Install
234
+
235
+ 唯一安装方式(标准 dsh profile bundle):
236
+
237
+ The only install path (a standard dsh profile bundle):
238
+
239
+ ```bash
240
+ npx dsh-lark-bot@latest setup --profile dsh-lark
241
+ ```
242
+
243
+ `setup` 自动完成:定位本机 dsh → 预批准 pnpm 构建策略(protobufjs)→ 执行标准
244
+ `dsh plugin --profile dsh-lark add dsh-lark-bot`。加 `--guardian` 会同时安装「安全网守护」
245
+ (见「安全网守护」一节)。已安装时重复执行即升级到最新版。
246
+
247
+ `setup` locates your dsh, pre-approves pnpm's build policy (protobufjs) and runs the standard
248
+ `dsh plugin --profile dsh-lark add dsh-lark-bot`. Adding `--guardian` also installs the
249
+ safety-net guardian (see "Safety-net guardian" above). Re-running it upgrades to the latest version.
250
+
251
+ ### 升级 | Upgrade
252
+
253
+ - 插件本体:重跑 `setup`(或 `dsh plugin --profile <name> add dsh-lark-bot`)拉取 npm 最新版。
254
+ - CLI 工具(可选):`npm i -g dsh-lark-bot@latest`;使用 `npx` 时无需全局安装。
255
+ - 升级后重启 profile:`dsh --profile dsh-lark`。
256
+
257
+ - Plugin: re-run `setup` (or `dsh plugin --profile <name> add dsh-lark-bot`) to pull the latest
258
+ npm release.
259
+ - CLI tool (optional): `npm i -g dsh-lark-bot@latest`; not needed when using `npx`.
260
+ - Restart the profile after upgrading: `dsh --profile dsh-lark`.
261
+
262
+ ### 禁用 | Disable
263
+
264
+ 保持插件加载但停止桥接引擎:启动 profile 前导出 `DSH_LARK_DISABLED=1`。彻底移除见下节。
265
+
266
+ Keep the plugin loaded but stop the bridge engine: export `DSH_LARK_DISABLED=1` before booting
267
+ the profile. For full removal see the next subsection.
268
+
269
+ ### 卸载 | Uninstall
191
270
 
192
271
  ```bash
193
- dsh-lark-bot stop
194
- npm uninstall -g dsh-lark-bot
195
- rm -rf ~/.dsh-lark
272
+ dsh plugin --profile dsh-lark remove dsh-lark-bot
196
273
  ```
197
274
 
275
+ 卸载后 profile 不再加载本插件。本地状态(配置 / 会话 / 归档 / 角色)保留在 `~/.dsh-lark`;
276
+ 如需清除,先备份再删除该目录。
277
+
278
+ Removal unloads the plugin from the profile. Local state (config / sessions / archives / roles)
279
+ stays in `~/.dsh-lark`; back it up before deleting it.
280
+
198
281
  更详细的安装、状态目录、日志和排障说明见 [`docs/QUICK_START.md`](docs/QUICK_START.md)。
199
282
 
200
283
  See [`docs/QUICK_START.md`](docs/QUICK_START.md) for installation details, state directories,
@@ -212,6 +295,13 @@ logs and troubleshooting.
212
295
 
213
296
  **dsh-lark-bot** is a lightweight bridge that connects your local DeepSeek Harness (`dsh`) into Feishu / Lark, recreating the beloved OpenCode / MiMoCode Telegram-bot experience — chat with your coding agent, receive streaming cards, review diffs — and adds **full project workspace management** on top.
214
297
 
298
+ **适合谁 / Who it is for**:在飞书 / Lark(私聊、群聊、话题)里指挥本机 dsh coding agent 的
299
+ 开发者与团队,尤其是需要多项目隔离、角色分工、并行任务与会话归档的协作场景。
300
+
301
+ Developers and teams who drive a local dsh coding agent from Feishu / Lark (DMs, groups,
302
+ topics) — especially those needing multi-project isolation, role-based collaboration, parallel
303
+ tasks and session archival.
304
+
215
305
  ## 目标 | Goals
216
306
 
217
307
  - **一条命令安装部署**:`npx dsh-lark-bot@latest setup --profile dsh-lark` 装进 dsh profile,
@@ -227,7 +317,7 @@ logs and troubleshooting.
227
317
 
228
318
  ## 兼容性 | Compatibility
229
319
 
230
- - **DeepSeek Harness(`dsh`)**:已验证 **dsh 0.1.0-rc.6**(2026-08-14:SDK JSON-RPC / ACP runtime 握手 +
320
+ - **DeepSeek Harness(`dsh`)**:已验证 **dsh 0.1.0-rc.6**(最后验证 2026-08-15:SDK JSON-RPC / ACP runtime 握手 +
231
321
  真实任务流式验证),通过官方 `@deepseek-ai/dsh-sdk-client` / `@deepseek-ai/dsh-acp` 接入;
232
322
  具体锁定版本、升级政策与自动化探测见 [`docs/COMPATIBILITY.md`](docs/COMPATIBILITY.md),
233
323
  adapter 接入细节见 [`docs/adapter-notes.md`](docs/adapter-notes.md)。
@@ -237,7 +327,7 @@ logs and troubleshooting.
237
327
  token 级流式事件);`DSH_LARK_ADAPTER=acp` 切到官方 **ACP server**(审批卡);`headless` 保留旧版
238
328
  子进程 fallback。首次启动自动在 `~/.dsh/profiles/dsh-lark`(或 `dsh-lark-acp`)创建 runtime profile。
239
329
 
240
- - **DeepSeek Harness (`dsh`)**: verified against **dsh 0.1.0-rc.6** (2026-08-14: SDK JSON-RPC / ACP
330
+ - **DeepSeek Harness (`dsh`)**: verified against **dsh 0.1.0-rc.6** (last verified 2026-08-15: SDK JSON-RPC / ACP
241
331
  runtime handshake + real streaming task verification), connected through the official
242
332
  `@deepseek-ai/dsh-sdk-client` / `@deepseek-ai/dsh-acp`; see
243
333
  [`docs/COMPATIBILITY.md`](docs/COMPATIBILITY.md) for pinned versions, the upgrade policy and
@@ -251,17 +341,46 @@ logs and troubleshooting.
251
341
  fallback. On first start the bot creates the runtime profile at
252
342
  `~/.dsh/profiles/dsh-lark` (or `dsh-lark-acp`).
253
343
 
344
+ ## 已知限制 | Known limitations
345
+
346
+ - ACP 模式会话每次全新(上游限制,无续跑);SDK 协议暂无 mid-turn cancel,`/stop` 会关闭
347
+ 对应 runtime 并自动重建。
348
+ - 桥接引擎作为 dsh 插件在 dsh 进程内运行,agent 执行使用官方 dsh SDK runtime 子进程
349
+ (嵌套 runtime 是有意取舍,用于按工作区隔离的 runtime 池与 scope 内并行 run)。
350
+ 唯一的进程级例外是可选安装的「安全网守护」——它独立于 dsh / Cordis 常驻,仅在 dsh
351
+ 下线后接管飞书通道,正常运行时保持静默。
352
+ - 飞书文档评论、富文本回复为规划中能力,尚未实现。
353
+ - pnpm ≥ 10 的构建脚本策略由 `setup` 自动处理;手动 `dsh plugin add` 时若报
354
+ `ERR_PNPM_IGNORED_BUILDS`,按官方指引在 profile 的 `pnpm-workspace.yaml` 加
355
+ `allowBuilds: { protobufjs: true }` 后重试。
356
+
357
+ - ACP sessions are always fresh (an upstream limit); the SDK protocol has no mid-turn cancel,
358
+ so `/stop` closes and recreates the runtime.
359
+ - The engine runs in-process as a dsh plugin; agent execution uses the official dsh SDK runtime
360
+ subprocess — a deliberate nested-runtime design for per-workspace runtime pools and parallel
361
+ runs. The one process-level exception is the optional safety-net guardian — a minimal
362
+ resident process independent of dsh / Cordis that only takes over the Feishu channel after
363
+ dsh goes down and stays silent otherwise.
364
+ - Feishu doc comments and rich-text replies are planned, not yet implemented.
365
+ - pnpm ≥ 10 build policy is handled by `setup`; when installing manually and
366
+ `ERR_PNPM_IGNORED_BUILDS` appears, add `allowBuilds: { protobufjs: true }` to the profile's
367
+ `pnpm-workspace.yaml` and retry.
368
+
254
369
  ## 配置 | Configuration
255
370
 
256
371
  - 本地配置:`~/.dsh-lark/config.json`
257
372
  - 状态根目录可用 `DSH_LARK_HOME` 覆盖
258
373
  - 环境变量统一使用 `DSH_LARK_*` 前缀
259
374
  - 模板见 [`.env.example`](.env.example)
375
+ - 敏感项:`DSH_LARK_APP_SECRET`、`DEEPSEEK_API_KEY` 等凭据只保存在本机配置 / 环境中,日志与
376
+ 卡片自动脱敏,仓库只提交 `.env.example` 模板。
260
377
 
261
378
  - Local config: `~/.dsh-lark/config.json`
262
379
  - The state root can be overridden with `DSH_LARK_HOME`
263
380
  - Environment variables use the `DSH_LARK_*` prefix
264
381
  - Template: [`.env.example`](.env.example)
382
+ - Sensitive values: credentials (`DSH_LARK_APP_SECRET`, `DEEPSEEK_API_KEY`, …) stay in local
383
+ config/env only; logs and cards are redacted; only `.env.example` is committed.
265
384
 
266
385
  会话运行在 Git 仓库中时,会自动在 `~/.dsh-lark/profiles/<profile>/worktrees/<scope>/` 创建隔离 worktree,并复制项目级 `AGENTS.md`。
267
386
 
@@ -302,6 +421,13 @@ Core environment variables:
302
421
  | `DSH_LARK_RETENTION_MSGS` | `40` | 每个 scope 保留的消息条数(0=全部保留)<br>Messages kept per scope (0 keeps everything) |
303
422
  | `DSH_LARK_ARCHIVE_MAX` | `50` | 每个 scope 最多保留的归档数(0=不清理)<br>Max archives kept per scope (0 disables pruning) |
304
423
  | `DSH_LARK_ARCHIVE_MAX_AGE_DAYS` | `90` | 归档最大保留天数(0=不清理)<br>Max archive age in days (0 disables pruning) |
424
+ | `DSH_LARK_HEARTBEAT_MS` | `5000` | 桥接引擎心跳写入间隔(守护存活信号)<br>Bridge heartbeat write interval (guardian liveness signal) |
425
+ | `DSH_LARK_GUARDIAN_DISABLED` | `false` | `1` 时安全网守护进程保持停止<br>`1` keeps the safety-net guardian stopped |
426
+ | `DSH_LARK_GUARDIAN_PROFILE` | `dsh-lark` | 守护监视 / 重启的 dsh profile(首次安装时写入状态)<br>dsh profile the guardian watches / relaunches (persisted on install) |
427
+ | `DSH_LARK_GUARDIAN_BRIDGE_PROFILE` | `default` | 提供飞书凭据与白名单的桥接状态 profile<br>Bridge state profile providing Feishu credentials / allowlist |
428
+ | `DSH_LARK_GUARDIAN_POLL_MS` | `2000` | 守护看门狗轮询间隔<br>Guardian watchdog poll interval |
429
+ | `DSH_LARK_GUARDIAN_STALE_MS` | `15000` | 心跳超时阈值,超过且无 dsh 进程则接管飞书通道<br>Heartbeat staleness threshold before channel takeover |
430
+ | `DSH_LARK_GUARDIAN_ENGINE_DEAD_MS` | `120000` | dsh 进程存活但心跳持续超时该时长,判定桥接引擎已死并接管<br>Live dsh process with heartbeat stale this long is treated as engine-dead (takeover) |
305
431
 
306
432
  启动时会自动查找本机常见的 `@deepseek-ai/dsh` 安装位置。只有自动发现失败或需要指定特殊 profile 时,才需要设置这两个变量。
307
433
 
@@ -323,6 +449,10 @@ This tool runs **locally**; before installing, be aware that it accesses:
323
449
  - **dsh 配置**:`/model` `/providers` `/provider` `/key` 命令按 dsh 官方存储协议读写
324
450
  `~/.dsh/settings.yaml` 与 `~/.dsh/.credentials.yaml`(仅管理员可写;settings 只存 `apiKeyEnv`
325
451
  引用,凭据文件权限 0600、目录 0700,字面密钥不进入 settings 或聊天记录)。
452
+ - **安全网守护(可选)**:安装后为系统级常驻进程,读取 `~/.dsh-lark/config.json` 中的飞书
453
+ 凭据;dsh 下线时接管同一 bot 的飞书长连接并扫描本机进程(仅 `ps` 命令行,不读内存);
454
+ `/safemode` 时在 `~/.dsh/profiles/<profile>-safe` 创建仅核心的 dsh profile 并逐条执行
455
+ `dsh --profile <safe> "<prompt>"` 子进程。
326
456
 
327
457
  - **Feishu credentials**: the PersonalAgent app `app_id` / `app_secret`, stored in plaintext at
328
458
  `~/.dsh-lark/config.json` (file mode 600).
@@ -338,6 +468,11 @@ This tool runs **locally**; before installing, be aware that it accesses:
338
468
  `~/.dsh/settings.yaml` and `~/.dsh/.credentials.yaml` using the official dsh storage protocol
339
469
  (admin-only writes; settings keep only `apiKeyEnv` references; credentials file mode 0600,
340
470
  directory 0700; literal keys never enter settings or chat history).
471
+ - **Safety-net guardian (optional)**: when installed, a system-level resident process reads the
472
+ Feishu credentials from `~/.dsh-lark/config.json`; it takes over the same bot's Feishu long
473
+ connection only after dsh goes down and scans local processes (command lines via `ps` only, no
474
+ memory access). On `/safemode` it provisions a core-only dsh profile at
475
+ `~/.dsh/profiles/<profile>-safe` and runs `dsh --profile <safe> "<prompt>"` per message.
341
476
 
342
477
  所有数据仅在本机与飞书、DeepSeek 之间流转,不收集、不上传任何遥测。密钥不会提交进仓库(见 `.gitignore`)。
343
478
 
@@ -375,6 +510,14 @@ dsh 自己的日志体系。
375
510
  The bridge engine logs to `~/.dsh-lark/profiles/<profile>/logs/bot.log` (JSON Lines); the dsh
376
511
  host uses its own logging.
377
512
 
513
+ **回滚 / Rollback**:`dsh plugin --profile dsh-lark remove dsh-lark-bot` 后重装固定版本即可
514
+ (如 `dsh plugin --profile dsh-lark add dsh-lark-bot@0.6.0`);`~/.dsh-lark` 状态独立于插件
515
+ 本体,升级 / 回滚不会丢失配置与会话。
516
+
517
+ To roll back: remove the plugin and reinstall a pinned version (e.g.
518
+ `dsh plugin --profile dsh-lark add dsh-lark-bot@0.6.0`); `~/.dsh-lark` state is independent of
519
+ the package, so config and sessions survive upgrades / rollbacks.
520
+
378
521
  ## 开发 | Development
379
522
 
380
523
  ```bash
@@ -396,6 +539,13 @@ module contracts, and [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) for the arc
396
539
  [`docs/COMPATIBILITY.md`](docs/COMPATIBILITY.md) for the compatibility matrix, upgrade policy
397
540
  and automation.
398
541
 
542
+ **贡献 / Contributing**:欢迎 Issue 与 PR。开发流程见 [`AGENTS.md`](AGENTS.md)(必读文档、
543
+ 提交规范与推送边界),生态交付标准见 [`docs/ECOSYSTEM.md`](docs/ECOSYSTEM.md)。
544
+
545
+ Contributions are welcome via Issues and PRs; see [`AGENTS.md`](AGENTS.md) for the workflow
546
+ (required reading, commit conventions, push policy) and [`docs/ECOSYSTEM.md`](docs/ECOSYSTEM.md)
547
+ for ecosystem delivery standards.
548
+
399
549
  发布双包(`dsh-lark-bot` 与 `dsh-feishu-bot` 共享同一份 dist / 版本 / 依赖):
400
550
 
401
551
  Publishing both packages (`dsh-lark-bot` and `dsh-feishu-bot` share the same dist / version /
@@ -418,14 +568,31 @@ create a Release automatically.
418
568
  The same dist is also published to GitHub Packages as `@plutokeating/dsh-lark-bot` and
419
569
  `@plutokeating/dsh-feishu-bot`, viewable on the GitHub Packages page.
420
570
 
571
+ ## 维护与支持 | Maintenance
572
+
573
+ - 状态:**活跃维护(Active)**。主维护者:**PlutoKeating**。
574
+ - 问题 / 建议:优先在 GitHub Issues 提交;安全漏洞请走 [`SECURITY.md`](SECURITY.md) 的私下报告渠道。
575
+
576
+ - Status: **active**. Primary maintainer: **PlutoKeating**.
577
+ - Bugs / feature requests: GitHub Issues; security issues via the private channel in
578
+ [`SECURITY.md`](SECURITY.md).
579
+
580
+ 社区收录情况见下节「社区收录情况 | Community Listings」。
581
+
582
+ See "Community Listings" in the next section for ecosystem registration status.
583
+
421
584
  ## 许可与安全 | License & Security
422
585
 
423
586
  - **许可证**:GNU Affero General Public License v3.0(见 `LICENSE`)。
587
+ - **版权归属**:源码版权归项目维护者所有,按 AGPL-3.0 授权;「DeepSeek」「飞书 / Lark」等
588
+ 商标归各自权利人所有。
424
589
  - **安全报告**:如发现安全漏洞,请通过 GitHub Security Advisory 私下报告,勿公开 issue。
425
590
  - **安全模型**:默认拒绝、密钥脱敏、路径 containment、SSRF 防护、过期事件拒绝与交互工具
426
591
  默认禁用——详见 [`SECURITY.md`](SECURITY.md)。
427
592
 
428
593
  - **License**: GNU Affero General Public License v3.0 (see `LICENSE`).
594
+ - **Copyright**: source is owned by the maintainers and licensed under AGPL-3.0; "DeepSeek" and
595
+ "Feishu / Lark" trademarks belong to their respective owners.
429
596
  - **Security reports**: report vulnerabilities privately via GitHub Security Advisory; do not
430
597
  open a public issue.
431
598
  - **Security model**: default-deny, secret redaction, path containment, SSRF protection, stale
@@ -462,8 +629,17 @@ The same dist is also published to GitHub Packages as `@plutokeating/dsh-lark-bo
462
629
 
463
630
  核心思路:**飞书通道与 agent 后端解耦**。桥接层复刻 `lark-channel-bridge` 的成熟做法(WebSocket 长连接 + 流式卡片 + 会话路由),agent 后端通过 adapter 抽象,默认挂接官方 DeepSeek Harness SDK(`DSH_LARK_ADAPTER=sdk`),可选 ACP 审批模式与 legacy headless。
464
631
 
632
+ 可选「安全网守护」(`src/guardian/`)独立于 dsh 进程常驻:dsh 在线时静默,下线时接管飞书
633
+ 通道接收 `/safemode` 控制信号,以仅核心 profile(`dsh-base` + `dsh-headless`)拉起受限对话
634
+ 用于自愈,`/safemode exit` 重启完整 profile 并交还通道。
635
+
465
636
  The core idea: **decouple the Feishu channel from the agent backend**. The bridge layer follows the battle-tested `lark-channel-bridge` approach (WebSocket long-connection + streaming cards + session routing); the agent backend is abstracted behind an adapter, defaulting to the official DeepSeek Harness SDK (`DSH_LARK_ADAPTER=sdk`), with an optional ACP approval mode and the legacy headless fallback.
466
637
 
638
+ The optional safety-net guardian (`src/guardian/`) runs as a separate resident process: silent
639
+ while dsh is up, it takes over the Feishu channel when dsh goes down, accepts `/safemode` control
640
+ signals, runs a restricted core-only conversation (`dsh-base` + `dsh-headless`) for self-healing,
641
+ and relaunches the full profile on `/safemode exit`.
642
+
467
643
  ## 目录结构 | Directory Structure
468
644
 
469
645
  | 目录 Dir | 职责 Responsibility |
@@ -477,6 +653,7 @@ The core idea: **decouple the Feishu channel from the agent backend**. The bridg
477
653
  | `src/bot/` | 运行注册、消息排队、审批/问答注册表<br>Run registry, queueing, approval/question registries |
478
654
  | `src/commands/` | 斜杠命令(/cd /ws /new …)<br>Slash commands |
479
655
  | `src/cli/` | CLI 入口:`setup`(唯一安装命令)/ `doctor`(诊断)/ 隐藏 `run`<br>CLI entry: setup / doctor / hidden run |
656
+ | `src/guardian/` | 安全网守护:心跳、进程观察、仅核心安全 profile、接管状态机、系统服务安装<br>Safety-net guardian: heartbeat, process watch, core-only safe profile, takeover state machine, service install |
480
657
  | `src/config/` | profile / 配置 / 访问白名单 / dsh 配置管理<br>Profile, config, access & dsh config management |
481
658
  | `src/core/` | 结构化日志<br>Structured logging |
482
659
  | `src/media/` | 附件下载与文本注入<br>Attachment download & text injection |
@@ -496,6 +673,29 @@ The core idea: **decouple the Feishu channel from the agent backend**. The bridg
496
673
  | [`deepseek-ai/deepseek-harness`](https://github.com/deepseek-ai/deepseek-harness) | DeepSeek Harness(`dsh`),agent 后端<br>DeepSeek Harness (`dsh`), the agent backend |
497
674
  | [`grinev/opencode-telegram-bot`](https://github.com/grinev/opencode-telegram-bot) | OpenCode 的 Telegram 手机端,另一参照<br>Telegram mobile client for OpenCode; another reference |
498
675
 
676
+ ## 社区收录情况 | Community Listings
677
+
678
+ > 本项目的社区收录 / 推荐状态,随提交的更新请求持续维护。截至 v0.8.0:
679
+ > Community listing & recommendation status, kept current as update requests land. As of v0.8.0:
680
+
681
+ | 平台 Platform | 状态 Status | 说明 Notes |
682
+ | :--- | :--- | :--- |
683
+ | [awesome-dsh-plugins](https://github.com/AdamPlatin123/awesome-dsh-plugins) | ✅ 已收录 · 运行级可用<br>Listed · runtime-verified | 社区榜单标注 `✅ 运行级可用`,2026-08-14 agent 实测通过;v0.8.0 更新已提交(见下文链接)<br>Shown as `✅ 运行级可用` in the community leaderboard; agent-tested on 2026-08-14; v0.8.0 update submitted (see below) |
684
+ | [dshfind](https://github.com/hikariming/dshfind) | ✅ 已收录(自动聚合)<br>Listed (auto-aggregated) | 插件市场从 GitHub `dsh-plugin` topic 自动聚合;本仓库已带该 topic,刷新后展示最新版本与数据<br>Marketplace auto-aggregates from the GitHub `dsh-plugin` topic; this repo carries the topic, so the latest version shows after the next refresh |
685
+ | [omdsh-dev/community](https://github.com/orgs/omdsh-dev/discussions/12) | ✅ 已提交收录申请<br>Submission submitted | `[Plugin]` 收录申请(Discussion #12)已通过;v0.8.0 更新说明已发布在该讨论<br>`[Plugin]` submission (Discussion #12) accepted; v0.8.0 update posted there |
686
+
687
+ **更新请求 / Update requests**:
688
+
689
+ - awesome-dsh-plugins 收录条目更新:`https://github.com/AdamPlatin123/awesome-dsh-plugins/pull/<PR>`(v0.8.0 描述同步)
690
+ - dshfind 数据刷新请求(含快照条目名称异常修正):`https://github.com/hikariming/dshfind/issues/<ISSUE>`
691
+ - omdsh-dev/community 收录讨论更新:https://github.com/orgs/omdsh-dev/discussions/12
692
+
693
+ **Update requests**:
694
+
695
+ - awesome-dsh-plugins entry refresh: `https://github.com/AdamPlatin123/awesome-dsh-plugins/pull/<PR>` (v0.8.0 description)
696
+ - dshfind data-refresh request (incl. fixing the snapshot entry name): `https://github.com/hikariming/dshfind/issues/<ISSUE>`
697
+ - omdsh-dev/community listing update: https://github.com/orgs/omdsh-dev/discussions/12
698
+
499
699
  ## 免责声明 | Disclaimer
500
700
 
501
701
  > [!NOTE]
package/SECURITY.md CHANGED
@@ -11,6 +11,8 @@
11
11
  - **SSRF**:agent 或桥接层被诱导访问内网 / 环回地址。
12
12
  - **消息重放 / 过期事件**:旧消息或重复事件被当作新指令处理。
13
13
  - **交互工具不可达**:`ask_user_question`、终端类工具在 IM 场景下无法回达,应默认禁用。
14
+ - **救援通道被滥用**:dsh 下线后由守护接管飞书通道,若控制信号无鉴权,任何能私聊 bot 的人
15
+ 都能触发安全模式或重启完整 profile。
14
16
 
15
17
  ## 安全姿态 · Security posture
16
18
 
@@ -35,6 +37,16 @@
35
37
  `/invite admin <open_id>` 定义);查看类命令(`/model`、`/providers`、`/key list`)开放。
36
38
  10. **本地回调隔离**:`lark_notify` 工具的回调服务只绑定 `127.0.0.1`,每次启动生成随机
37
39
  token 鉴权(不落盘、不进日志),请求体限 1MB;`/notify` 与角色 / 配置写命令同为管理员操作。
40
+ 11. **安全网守护(可选安装)**:
41
+ - 守护是独立于 dsh / Cordis 的最小进程,只读取本地状态与进程命令行(`ps`,不读内存),
42
+ 不导入任何 dsh 代码、不监听公网端口;
43
+ - dsh 在线时守护**不连接飞书**(同 app 长连接仅允许单连接,避免抢占正常通道);仅在
44
+ 「曾观察 dsh 在线 且 心跳过期 + 无 dsh 进程」时接管通道;
45
+ - 控制信号默认拒绝:仅管理员(`access.admins`,无管理员时回退 `allowedUsers`)可触发
46
+ `/safemode` 系列命令,未授权消息静默丢弃;
47
+ - 过期事件复用 `DSH_LARK_EVENT_FRESHNESS_MS` 窗口拒绝;
48
+ - 心跳 / 守护状态文件以 `0600` 写入;安全模式仅挂载官方核心 bundle(`dsh-base` +
49
+ `dsh-headless`),不加载任何第三方插件,避免把故障面带进救援通道。
38
50
 
39
51
  ## 数据与凭据 · Data & credentials
40
52
 
@@ -47,6 +59,9 @@
47
59
  引用,不落字面密钥)与 `~/.dsh/.credentials.yaml`(目录 0700、文件 0600)。bot 永不回显
48
60
  密钥值;群聊中粘贴密钥会对群成员可见,建议私聊使用或改用环境变量 / dsh Web 页面录入。
49
61
  - 所有数据仅在本机、飞书开放平台与 DeepSeek API 之间流转;无遥测。
62
+ - 安全网守护相关文件:`~/.dsh-lark/guardian.json` 与
63
+ `~/.dsh-lark/profiles/<profile>/guardian/heartbeat.json`(均 `0600`);守护读取的飞书凭据
64
+ 来自 `~/.dsh-lark/config.json`(`0600`),日志按既有规则脱敏。
50
65
 
51
66
  ## 报告渠道 · Reporting
52
67