dsh-lark-bot 0.11.0 → 0.13.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
@@ -136,6 +136,7 @@ Just send a normal message to the bot in Feishu to get started. Common commands:
136
136
  | 命令 Command | 作用 Description |
137
137
  | --- | --- |
138
138
  | `/new` `/reset` | 开始新会话<br>Start a new session |
139
+ | `/newg <群名>` | 自动新建群聊(拉你入群)并开新会话,当前会话保留<br>Auto-create a group chat (with you invited) and start a fresh session there; the current session is untouched |
139
140
  | `/cd <path>` | 切换工作目录并重置会话<br>Change working directory and reset the session |
140
141
  | `/ws list` | 查看命名工作空间<br>List named workspaces |
141
142
  | `/ws save <name>` | 保存当前工作空间<br>Save the current workspace |
@@ -170,6 +171,10 @@ Just send a normal message to the bot in Feishu to get started. Common commands:
170
171
 
171
172
  Images in Feishu messages are downloaded to the local media directory and passed to dsh; text files are read and their content is injected into the task context.
172
173
 
174
+ **`/newg <群名>`**:通过飞书 API 自动新建一个私密群、把发送者拉入群,并回复群链接——在新群里发消息即为新 scope / 新会话,当前会话不受影响。需要应用具备 `im:chat` 与 `im:chat.members:write_only` 权限(在开发者后台「权限管理」申请)。
175
+
176
+ **`/newg <group name>`**: auto-creates a private group via the Feishu API, invites the sender, and replies with a group link — chatting in the new group starts a fresh scope/session while the current session is untouched. Requires the `im:chat` and `im:chat.members:write_only` scopes (apply in the developer console).
177
+
173
178
  同一 scope(私聊 / 群聊 / 话题)默认允许 **2 个任务并行**(`DSH_LARK_SCOPE_CONCURRENCY` 或
174
179
  `/concurrency` 调整):连续发来的多条消息会以独立 run 并行推进,每个 run 使用独立的 dsh
175
180
  session 与独立 runId,`/status` 展示全部运行中的 run,`/stop` 一次性终止全部任务。
@@ -328,17 +333,61 @@ to the latest version.
328
333
 
329
334
  ### 升级 | Upgrade
330
335
 
336
+ **推荐:一行命令彻底升级(v0.12.0+ 新增,issue #10)**
337
+
338
+ ```bash
339
+ npx dsh-lark-bot@latest upgrade --profile dsh-lark --yes
340
+ ```
341
+
342
+ `upgrade` 自动完成:检测当前已装版本 / 运行中 CLI / npm 最新版 → 升级**包本体**
343
+ (`dsh plugin add <name>@<latest>`)→ **幂等重装并重启 guardian 服务** → 升级后运行
344
+ `doctor` 验证。覆盖运行中实例的安全处理:
345
+
346
+ - 默认不打断运行中的 dsh profile,只提示重启命令(升级不影响配置 / 会话 / 凭据);
347
+ - `--restart`:升级后自动重启 guardian 服务与(受管/后台的)dsh profile 进程;
348
+ - `--check`:只报告版本与运行状态,零改动;
349
+ - `--rollback`:回滚到上一次升级前的版本(记录在 `~/.dsh-lark/upgrade-state.json`);
350
+ - `--force`:无法访问 npm(离线)时按当前运行版本重装;
351
+ - `--no-guardian`:跳过守护升级;
352
+ - **runtime profile 一致性修复**:升级后自动把 `dsh-lark-sdk` / `dsh-lark-acp` 的
353
+ own-package 链接重指到新版本(避免下次启动重新预置)。
354
+
355
+ 无需交互确认时加 `--yes`(非交互环境不带 `--yes` 会安全中止)。其余方式:
356
+
331
357
  - 插件本体:重跑 `setup`(或 `dsh plugin --profile <name> add dsh-lark-bot`)拉取 npm 最新版。
332
- - 安全网守护:随 `setup` 一起安装 / 升级(幂等重装),也可单独 `dsh-lark-bot guardian install`。
358
+ - 安全网守护:随 `upgrade` / `setup` 一起安装 / 升级(幂等重装),也可单独
359
+ `dsh-lark-bot guardian install`。
333
360
  - CLI 工具(可选):`npm i -g dsh-lark-bot@latest`;使用 `npx` 时无需全局安装。
334
- - 升级后重启 profile:`dsh --profile dsh-lark`。
361
+ - 升级后重启 profile(未用 `--restart` 时):`dsh --profile dsh-lark`。
362
+
363
+ - **Recommended: one-command full upgrade (new in v0.12.0, issue #10)**
364
+
365
+ ```bash
366
+ npx dsh-lark-bot@latest upgrade --profile dsh-lark --yes
367
+ ```
368
+
369
+ `upgrade` detects the installed / running / npm-latest versions, upgrades the **package**
370
+ (`dsh plugin add <name>@<latest>`), **idempotently reinstalls and restarts the guardian
371
+ service**, then runs `doctor` verification. Running instances are handled safely:
372
+
373
+ - By default the running dsh profile is never interrupted — you only get the restart command
374
+ (config / sessions / credentials are untouched);
375
+ - `--restart`: also restarts the guardian service and (managed/detached) dsh profile processes;
376
+ - `--check`: report versions and running state only, no changes;
377
+ - `--rollback`: reinstall the version recorded before the last upgrade
378
+ (`~/.dsh-lark/upgrade-state.json`);
379
+ - `--force`: reinstall the running version when npm is unreachable (offline);
380
+ - `--no-guardian`: skip the guardian upgrade.
381
+
382
+ Pass `--yes` to skip the interactive confirmation (non-interactive runs fail closed without it).
383
+ Alternatives:
335
384
 
336
385
  - Plugin: re-run `setup` (or `dsh plugin --profile <name> add dsh-lark-bot`) to pull the latest
337
386
  npm release.
338
- - Safety-net guardian: installed / upgraded together with `setup` (idempotent), or standalone via
339
- `dsh-lark-bot guardian install`.
387
+ - Safety-net guardian: installed / upgraded together with `upgrade` / `setup` (idempotent), or
388
+ standalone via `dsh-lark-bot guardian install`.
340
389
  - CLI tool (optional): `npm i -g dsh-lark-bot@latest`; not needed when using `npx`.
341
- - Restart the profile after upgrading: `dsh --profile dsh-lark`.
390
+ - Restart the profile after upgrading (when not using `--restart`): `dsh --profile dsh-lark`.
342
391
 
343
392
  ### 禁用 | Disable
344
393
 
@@ -518,6 +567,7 @@ Core environment variables:
518
567
  | `DSH_LARK_GUARDIAN_SAFE_ADAPTER` | `auto` | 安全模式引擎:`auto` 优先 SDK 流式、失败回退 headless;`sdk` 强制 SDK;`headless` 跳过预置<br>Safe-mode engine: `auto` tries the SDK streaming runtime then falls back to headless; `sdk` requires it; `headless` skips provisioning |
519
568
  | `DSH_LARK_GUARDIAN_SAFE_TIMEOUT_MS` | `600000` | 安全模式单任务空闲超时(持续无活动事件才停止并出超时卡)<br>Safe-mode per-task idle timeout (stops the run after it has been silent this long and renders a timeout card) |
520
569
  | `DSH_LARK_GUARDIAN_CARD_DENSITY` | `detailed` | 安全模式任务卡片密度(compact / standard / detailed)<br>Card density for safe-mode run cards |
570
+ | `DSH_LARK_UPGRADE_REGISTRY` | `https://registry.npmjs.org` | `upgrade` 探测最新版本的 npm registry(可指向镜像)<br>npm registry used by `upgrade` to discover the latest version (mirrors supported) |
521
571
 
522
572
  启动时会自动查找本机常见的 `@deepseek-ai/dsh` 安装位置。只有自动发现失败或需要指定特殊 profile 时,才需要设置这两个变量。
523
573
 
@@ -673,6 +723,40 @@ The same dist is also published to GitHub Packages as `@plutokeating/dsh-lark-bo
673
723
 
674
724
  See "Community Listings" in the next section for ecosystem registration status.
675
725
 
726
+ ## 作者 | Author
727
+
728
+ 本项目由 **PlutoKeating** 开发并维护。作者专注于自动化与开发者工具,习惯从真实使用场景出发
729
+ 做软件:本项目正是从“用飞书 / Lark 群聊驱动 DeepSeek Agent”的日常需求长出来的,逐步演进为
730
+ 一套带守护、自愈与一键升级能力的完整桥接方案。更多信息见个人主页:
731
+ [PlutoKeating](https://github.com/PlutoKeating)。
732
+
733
+ This project is developed and maintained by **PlutoKeating**, who focuses on automation and
734
+ developer tooling and prefers building software from real usage. It grew out of the daily need
735
+ to drive DeepSeek agents from Feishu/Lark group chats, evolving into a complete bridge with
736
+ guardian, self-healing, and one-command upgrade capabilities. See the author's profile:
737
+ [PlutoKeating](https://github.com/PlutoKeating).
738
+
739
+ ## 贡献者 | Contributors
740
+
741
+ 感谢以下贡献者(按合入 / 提交时间):
742
+
743
+ Thanks to the following contributors (by merge / submission time):
744
+
745
+ | 贡献者 Contributor | 贡献 Contribution | 状态 Status |
746
+ | :--- | :--- | :--- |
747
+ | [koprivnikarurnaa-oss](https://github.com/koprivnikarurnaa-oss) | [PR #9](https://github.com/PlutoKeating/dsh-lark-bot/pull/9):web 单写者适配器 + self-heal v2 + 守护自动重启<br>Web single-writer adapter + self-heal v2 + guardian auto-relaunch | ✅ 已合入<br>Merged |
748
+ | [Normanyin](https://github.com/Normanyin) | [PR #11](https://github.com/PlutoKeating/dsh-lark-bot/pull/11):`/newg` 自动建群命令<br>`/newg` auto-create group chat command | ✅ 已合入(cherry-pick)<br>Merged (cherry-pick) |
749
+
750
+ > 说明:GitHub 贡献者图按 commit 作者邮箱归因。PR #9 合入时的提交使用了本地通用身份
751
+ > `dsh-user <dsh-user@local>`(未绑定 GitHub 账号),因此未自动计入贡献者图;本表为仓库侧
752
+ > 的明确署名,PR #11 的提交身份已绑定其账号,合入后会自动计入。
753
+ >
754
+ > Note: GitHub's contributor graph attributes commits by author email. The commits merged via
755
+ > PR #9 carried a local generic identity (`dsh-user <dsh-user@local>`, not linked to a GitHub
756
+ > account), so they are not auto-counted in the graph; this table is the repository's explicit
757
+ > acknowledgment. PR #11's commits are authored under the contributor's linked account and will
758
+ > be credited automatically once merged.
759
+
676
760
  ## 许可与安全 | License & Security
677
761
 
678
762
  - **许可证**:GNU Affero General Public License v3.0(见 `LICENSE`)。
@@ -740,11 +824,12 @@ and relaunches the full profile on `/safemode exit`.
740
824
  | `src/onboard/` | 首次扫码创建 / 绑定 PersonalAgent 应用<br>First-run QR onboarding |
741
825
  | `src/session/` | 会话路由、排队、访问控制<br>Session routing, queueing, access control |
742
826
  | `src/workspace/` | 项目工作区、git worktree 隔离与规则注入<br>Project workspace, git worktree isolation & rule injection |
743
- | `src/adapters/` | agent 后端适配器(sdk 默认 / acp 审批 / headless legacy)<br>Agent backend adapters (sdk / acp / headless) |
827
+ | `src/adapters/` | agent 后端适配器(sdk 默认 / acp 审批 / headless legacy / web 单写者)<br>Agent backend adapters (sdk / acp / headless / web single-writer) |
744
828
  | `src/card/` | 流式卡片状态与渲染<br>Streaming card state & rendering |
745
829
  | `src/bot/` | 运行注册、消息排队、审批/问答注册表<br>Run registry, queueing, approval/question registries |
746
830
  | `src/commands/` | 斜杠命令(/cd /ws /new …)<br>Slash commands |
747
- | `src/cli/` | CLI 入口:`setup`(唯一安装命令)/ `doctor`(诊断)/ 隐藏 `run`<br>CLI entry: setup / doctor / hidden run |
831
+ | `src/cli/` | CLI 入口:`setup`(唯一安装命令)/ `doctor`(诊断)/ `upgrade`(一键升级)/ 隐藏 `run`<br>CLI entry: setup / doctor / upgrade / hidden run |
832
+ | `src/upgrade/` | 一键升级(issue #10):版本探测、升级状态、运行检测、guardian/profile 重启助手、runtime 链接修复<br>One-command upgrade (issue #10): version probe, upgrade state, running-state detection, restart helpers, runtime link repair |
748
833
  | `src/guardian/` | 安全网守护:心跳、进程观察、仅核心安全 profile、接管状态机、系统服务安装<br>Safety-net guardian: heartbeat, process watch, core-only safe profile, takeover state machine, service install |
749
834
  | `src/config/` | profile / 配置 / 访问白名单 / dsh 配置管理<br>Profile, config, access & dsh config management |
750
835
  | `src/core/` | 结构化日志<br>Structured logging |
@@ -774,39 +859,39 @@ and relaunches the full profile on `/safemode exit`.
774
859
  | :--- | :--- | :--- |
775
860
  | [awesome-dsh-plugins](https://github.com/AdamPlatin123/awesome-dsh-plugins) | ✅ 已收录 · 运行级可用<br>Listed · runtime-verified | 社区榜单标注 `✅ 运行级可用`,2026-08-14 agent 实测通过;收录条目更新至 v0.8.0([PR #127](https://github.com/AdamPlatin123/awesome-dsh-plugins/pull/127) 已合并),v0.10.2 同步已跟进([#139](https://github.com/AdamPlatin123/awesome-dsh-plugins/issues/139) 最新评论)<br>Shown as `✅ 运行级可用` in the community leaderboard; agent-tested on 2026-08-14; v0.8.0 entry merged via [PR #127](https://github.com/AdamPlatin123/awesome-dsh-plugins/pull/127); v0.10.2 sync requested in [#139](https://github.com/AdamPlatin123/awesome-dsh-plugins/issues/139) |
776
861
  | [dshfind](https://dshfind.com/zh/plugins/PlutoKeating/dsh-lark-bot) | ✅ 已收录 · 详情页已上线<br>Listed · detail page live | 中英日韩四语详情页已上线(含安装命令与亮点),条目名称正常([issue #2](https://github.com/hikariming/dshfind/issues/2) 已关闭);v0.10.2 数据刷新已提交([issue #6](https://github.com/hikariming/dshfind/issues/6));顶部徽章 / 展示卡来自 dshfind<br>Four-language detail page is live (install command & highlights), entry name fixed ([issue #2](https://github.com/hikariming/dshfind/issues/2) closed); v0.10.2 data refresh requested in [issue #6](https://github.com/hikariming/dshfind/issues/6); the header badge / card comes from dshfind |
777
- | [omdsh-dev/community](https://github.com/orgs/omdsh-dev/discussions/12) | ✅ 已提交收录申请<br>Submission submitted | `[Plugin]` 收录申请(Discussion #12)已通过;v0.8.0 更新、六项独家亮点与 v0.10.1 / v0.10.2 稳定性修复说明均已发布在该讨论<br>`[Plugin]` submission (Discussion #12) accepted; v0.8.0 update, the six-exclusive-highlights summary and the v0.10.1 / v0.10.2 stability-fix notes are all posted there |
862
+ | [omdsh-dev/community](https://github.com/orgs/omdsh-dev/discussions/11) | ✅ 已提交收录申请<br>Submission submitted | `[Plugin]` 收录申请(Discussion #11)已通过;v0.8.0 更新、六项独家亮点与 v0.10.1 / v0.10.2 稳定性修复说明均已发布在该讨论<br>`[Plugin]` submission (Discussion #11) accepted; v0.8.0 update, the six-exclusive-highlights summary and the v0.10.1 / v0.10.2 stability-fix notes are all posted there |
778
863
 
779
864
  **更新请求进度 / Update request status**:
780
865
 
781
866
  - awesome-dsh-plugins 收录条目更新:[#127](https://github.com/AdamPlatin123/awesome-dsh-plugins/pull/127) — ✅ 已合并
782
867
  - dshfind 数据刷新请求(含条目名称异常修正):[#2](https://github.com/hikariming/dshfind/issues/2) — ✅ 已关闭,详情页已更新
783
- - omdsh-dev/community 收录讨论更新:[Discussion #12 更新评论](https://github.com/orgs/omdsh-dev/discussions/12#discussioncomment-18021998) — ✅ 已发布
868
+ - omdsh-dev/community 收录讨论更新:[Discussion #11 更新评论](https://github.com/orgs/omdsh-dev/discussions/11#discussioncomment-18021998) — ✅ 已发布
784
869
  - awesome-dsh-plugins 榜单行同步至 v0.10.2:[#139 最新评论](https://github.com/AdamPlatin123/awesome-dsh-plugins/issues/139#issuecomment-5304382615) — 📨 已提交
785
870
  - dshfind 数据刷新至 v0.10.2:[#6 跟进评论](https://github.com/hikariming/dshfind/issues/6#issuecomment-5304382647) — 📨 已提交
786
- - omdsh-dev/community v0.10.1 更新说明:[Discussion #12 评论](https://github.com/omdsh-dev/community/discussions/12#discussioncomment-18034706) — ✅ 已发布
787
- - omdsh-dev/community v0.10.2 更新说明:[Discussion #12 评论](https://github.com/omdsh-dev/community/discussions/12#discussioncomment-18034903) — ✅ 已发布
871
+ - omdsh-dev/community v0.10.1 更新说明:[Discussion #11 评论](https://github.com/orgs/omdsh-dev/discussions/11#discussioncomment-18034706) — ✅ 已发布
872
+ - omdsh-dev/community v0.10.2 更新说明:[Discussion #11 评论](https://github.com/orgs/omdsh-dev/discussions/11#discussioncomment-18034903) — ✅ 已发布
788
873
 
789
874
  **Update requests**:
790
875
 
791
876
  - awesome-dsh-plugins entry refresh: [#127](https://github.com/AdamPlatin123/awesome-dsh-plugins/pull/127) — ✅ merged
792
877
  - dshfind data-refresh request (incl. fixing the entry name): [#2](https://github.com/hikariming/dshfind/issues/2) — ✅ closed, detail page updated
793
- - omdsh-dev/community listing update: [Discussion #12 update comment](https://github.com/orgs/omdsh-dev/discussions/12#discussioncomment-18021998) — ✅ posted
878
+ - omdsh-dev/community listing update: [Discussion #11 update comment](https://github.com/orgs/omdsh-dev/discussions/11#discussioncomment-18021998) — ✅ posted
794
879
  - awesome-dsh-plugins leaderboard sync to v0.10.2: [#139 comment](https://github.com/AdamPlatin123/awesome-dsh-plugins/issues/139#issuecomment-5304382615) — 📨 submitted
795
880
  - dshfind data refresh to v0.10.2: [#6 follow-up](https://github.com/hikariming/dshfind/issues/6#issuecomment-5304382647) — 📨 submitted
796
- - omdsh-dev/community v0.10.1 update: [Discussion #12 comment](https://github.com/omdsh-dev/community/discussions/12#discussioncomment-18034706) — ✅ posted
797
- - omdsh-dev/community v0.10.2 update: [Discussion #12 comment](https://github.com/omdsh-dev/community/discussions/12#discussioncomment-18034903) — ✅ posted
881
+ - omdsh-dev/community v0.10.1 update: [Discussion #11 comment](https://github.com/orgs/omdsh-dev/discussions/11#discussioncomment-18034706) — ✅ posted
882
+ - omdsh-dev/community v0.10.2 update: [Discussion #11 comment](https://github.com/orgs/omdsh-dev/discussions/11#discussioncomment-18034903) — ✅ posted
798
883
 
799
884
  **亮点跟进 / Highlights follow-ups**(六项独家能力与 issue #6 设计实现):
800
885
 
801
886
  - awesome-dsh-plugins 榜单行同步(仓库描述 → 最新)与 agent-test 报告名称异常:[#139](https://github.com/AdamPlatin123/awesome-dsh-plugins/issues/139) — 📨 已提交(维护方已确认,等待渲染周期同步)
802
887
  - dshfind 详情页补「对话内管理模型和密钥」亮点:[#2 跟进评论](https://github.com/hikariming/dshfind/issues/2#issuecomment-5301019067) — 📨 已提交
803
- - omdsh 六项独家亮点补充(含 Guardian 设计实现):[Discussion #12 亮点评论](https://github.com/orgs/omdsh-dev/discussions/12#discussioncomment-18026370) — 📨 已提交
888
+ - omdsh 六项独家亮点补充(含 Guardian 设计实现):[Discussion #11 亮点评论](https://github.com/orgs/omdsh-dev/discussions/11#discussioncomment-18026370) — 📨 已提交
804
889
 
805
890
  **Highlights follow-ups** (six exclusive capabilities & the issue #6 design):
806
891
 
807
892
  - awesome-dsh-plugins leaderboard row sync (repo description → latest) & agent-test name anomaly: [#139](https://github.com/AdamPlatin123/awesome-dsh-plugins/issues/139) — 📨 submitted (maintainer confirmed; awaiting the snapshot/render cycle)
808
893
  - dshfind detail page: add the in-chat model/key management highlight: [#2 follow-up](https://github.com/hikariming/dshfind/issues/2#issuecomment-5301019067) — 📨 submitted
809
- - omdsh six-exclusive-highlights summary (incl. the Guardian design): [Discussion #12 highlights comment](https://github.com/orgs/omdsh-dev/discussions/12#discussioncomment-18026370) — 📨 submitted
894
+ - omdsh six-exclusive-highlights summary (incl. the Guardian design): [Discussion #11 highlights comment](https://github.com/orgs/omdsh-dev/discussions/11#discussioncomment-18026370) — 📨 submitted
810
895
 
811
896
  ## 免责声明 | Disclaimer
812
897