dsh-lark-bot 0.15.7 → 0.15.9
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 +8 -3
- package/README_EN.md +6 -3
- package/dist/cli.js +717 -305
- package/dist/cli.js.map +1 -1
- package/dist/plugin.d.ts +45 -1
- package/dist/plugin.js +437 -80
- package/dist/plugin.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -77,7 +77,7 @@ npx dsh-lark-bot@latest setup --profile dsh-lark
|
|
|
77
77
|
dsh --profile dsh-lark
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
③ 首次启动终端打印二维码 → 飞书 / Lark App 扫码创建或选择 PersonalAgent 应用 →
|
|
80
|
+
③ 首次启动终端打印二维码 → 飞书 / Lark App 扫码创建或选择 PersonalAgent 应用 → 绑定后私聊直接发消息;群聊 / 话题默认 `@bot`,也可显式开启受白名单保护的无 @ 模式。
|
|
81
81
|
|
|
82
82
|
`setup` 自动完成:定位本机 dsh → 预批准 pnpm 构建策略 → 标准 `dsh plugin add` → 默认安装「安全网守护」系统服务,一条命令完成全部安装。
|
|
83
83
|
|
|
@@ -136,6 +136,8 @@ dsh --profile dsh-lark
|
|
|
136
136
|
|
|
137
137
|
**任务中向你提问(问答卡)**:agent 需要你拍板、确认或补充信息时,通过 `lark_ask_user` 工具弹**问答卡**(单选 / 多选 / 自由文本),回答后任务自动继续,等待期间运行超时看门狗暂停。(与 `/ask` 的“你主动提问”方向相反。)
|
|
138
138
|
|
|
139
|
+
审批卡与问答卡提交后会立即显示成功提示、发送一条终态确认并撤回原卡,避免按钮仍停留在聊天中造成“未生效”的误解;确认或撤回失败不会影响已经提交给 agent 的审批结果或答案。
|
|
140
|
+
|
|
139
141
|
**安全网守护**:独立于 dsh 进程、系统级常驻的最小守护进程(systemd / LaunchAgent / Windows 启动项),默认随 `setup` 安装。dsh 正常时静默;dsh 下线或无法 boot(如第三方插件破坏 profile 组合)时自动接管飞书通道,无需命令行即可自救:
|
|
140
142
|
|
|
141
143
|
- `/safemode`:进入**仅核心安全模式**(仅 `dsh-base` + `dsh-headless` 官方核心,**不加载第三方插件**),优先 SDK 流式引擎、失败回退 headless,直接在聊天里定位 / 修复 / 禁用损坏插件;
|
|
@@ -240,7 +242,7 @@ dsh plugin --profile dsh-lark remove dsh-lark-bot
|
|
|
240
242
|
|
|
241
243
|
**Q: DeepSeek Harness 怎么接入飞书?**
|
|
242
244
|
|
|
243
|
-
**A:** 安装 Node.js ≥ 22 与 DeepSeek Harness(已配置 `DEEPSEEK_API_KEY`),执行 `npx dsh-lark-bot@latest setup --profile dsh-lark`,再 `dsh --profile dsh-lark`
|
|
245
|
+
**A:** 安装 Node.js ≥ 22 与 DeepSeek Harness(已配置 `DEEPSEEK_API_KEY`),执行 `npx dsh-lark-bot@latest setup --profile dsh-lark`,再 `dsh --profile dsh-lark` 扫码绑定即可。私聊直接发消息;群聊 / 话题默认 `@bot`,也可按下文的权限与白名单要求开启无 @ 模式。
|
|
244
246
|
|
|
245
247
|
**Q: 需要公网 IP、域名或服务器吗?**
|
|
246
248
|
|
|
@@ -322,6 +324,8 @@ SDK 模式下 dsh 原生 session 续跑,headless 模式则把历史注入下
|
|
|
322
324
|
| `DSH_LARK_WEB_PUSH` | `true` | `web` 适配器:网页端回合完成时推送到飞书并自动切换会话映射(`0` 关闭)|
|
|
323
325
|
| `DSH_LARK_ACCESS_DEFAULT_DENY` | `false` | 无白名单时拒绝私聊|
|
|
324
326
|
| `DSH_LARK_EVENT_FRESHNESS_MS` | `600000` | 过期消息拒绝窗口(0 关闭)|
|
|
327
|
+
| `DSH_LARK_GROUP_NO_AT` | `false` | 开启已登记群聊的无 @ 历史轮询;要求 `im:message.group_msg` 权限和非空 `allowed_users` |
|
|
328
|
+
| `DSH_LARK_GROUP_POLL_MS` | `3000` | 无 @ 群消息轮询间隔(毫秒,最小 1000)|
|
|
325
329
|
| `DSH_LARK_RUN_TIMEOUT_MS` | `300000` | 单次运行空闲超时:持续无活动事件才终止(活跃任务不会被误杀)|
|
|
326
330
|
| `DSH_LARK_STOP_GRACE_MS` | `5000` | SIGTERM 后等待优雅退出再 SIGKILL 的宽限期|
|
|
327
331
|
| `DSH_LARK_SCOPE_CONCURRENCY` | `2` | 每个 scope 的并行任务数(1=严格串行)|
|
|
@@ -353,6 +357,7 @@ SDK 模式下 dsh 原生 session 续跑,headless 模式则把历史注入下
|
|
|
353
357
|
- **飞书凭据**:PersonalAgent 应用的 `app_id` / `app_secret`,明文写入本机 `~/.dsh-lark/config.json`(文件权限 600)。
|
|
354
358
|
- **文件系统**:读取 / 写入你通过 `/cd`、`/ws` 指定的工作目录(含执行 shell 命令、修改文件)。
|
|
355
359
|
- **网络**:向飞书开放平台建立 WebSocket 出站长连接收发消息;向 DeepSeek API 发送任务上下文。
|
|
360
|
+
- **可选群消息历史**:仅当 `DSH_LARK_GROUP_NO_AT=true` 时,轮询曾经通过事件登记的群聊 / 话题;只处理启动后的、未删除的白名单真人消息,并与实时事件按 message ID 去重。该模式会让 bot 读取群内未 @ 它的消息,需管理员授予 `im:message.group_msg` 权限并确认符合团队隐私政策。
|
|
356
361
|
- **本地回调**:运行 `lark_notify` 工具时,dsh runtime 子进程通过 `127.0.0.1` 随机端口 +
|
|
357
362
|
每启动随机 token 回调 bridge 进程(仅本机回环,不监听公网)。
|
|
358
363
|
- **进程**:spawn 本机 `dsh` runtime 子进程(`dsh-sdk-jsonrpc-server` / `dsh-acp` profile)执行 agent 任务。
|
|
@@ -369,7 +374,7 @@ SDK 模式下 dsh 原生 session 续跑,headless 模式则把历史注入下
|
|
|
369
374
|
## 排障
|
|
370
375
|
|
|
371
376
|
先运行 `dsh-lark-bot doctor`,它会检查 profile、工作目录,并对当前 adapter 做真实可用性探测
|
|
372
|
-
(`sdk` / `acp` / `headless` 对应 runtime
|
|
377
|
+
(`sdk` / `acp` / `headless` 对应 runtime 的初始化握手);启用无 @ 群消息后,还会使用一个已登记群聊探测历史消息权限。
|
|
373
378
|
|
|
374
379
|
常见问题:
|
|
375
380
|
|
package/README_EN.md
CHANGED
|
@@ -77,7 +77,7 @@ npx dsh-lark-bot@latest setup --profile dsh-lark
|
|
|
77
77
|
dsh --profile dsh-lark
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
③ On first boot the terminal prints a QR code → scan it with the Feishu / Lark app to create or choose a PersonalAgent app → after binding, DM the bot directly
|
|
80
|
+
③ On first boot the terminal prints a QR code → scan it with the Feishu / Lark app to create or choose a PersonalAgent app → after binding, DM the bot directly; groups/topics use `@bot` by default, with an explicitly enabled allowlist-protected no-@ mode available.
|
|
81
81
|
|
|
82
82
|
`setup` automatically: locates your local dsh → pre-approves pnpm's build policy (protobufjs) → runs the standard `dsh plugin --profile dsh-lark add dsh-lark-bot@<version>` (pinned to the running package) → installs the safety-net guardian system service. One command installs everything.
|
|
83
83
|
|
|
@@ -231,7 +231,7 @@ See [`docs/QUICK_START.md`](docs/QUICK_START.md) for installation details, state
|
|
|
231
231
|
|
|
232
232
|
**Q: How do I connect DeepSeek Harness to Feishu?**
|
|
233
233
|
|
|
234
|
-
**A:** Install Node.js ≥ 22 and DeepSeek Harness (with `DEEPSEEK_API_KEY` configured), run `npx dsh-lark-bot@latest setup --profile dsh-lark`, then `dsh --profile dsh-lark` and scan to bind. DM the bot directly
|
|
234
|
+
**A:** Install Node.js ≥ 22 and DeepSeek Harness (with `DEEPSEEK_API_KEY` configured), run `npx dsh-lark-bot@latest setup --profile dsh-lark`, then `dsh --profile dsh-lark` and scan to bind. DM the bot directly; groups/topics use `@bot` by default, or can use the opt-in no-@ mode described below.
|
|
235
235
|
|
|
236
236
|
**Q: Do I need a public IP, domain or server?**
|
|
237
237
|
|
|
@@ -296,6 +296,8 @@ Core environment variables:
|
|
|
296
296
|
| `DSH_LARK_WEB_PUSH` | `true` | `web` adapter: push web-GUI turn completions to Feishu and auto-switch the chat mapping (`0` disables) |
|
|
297
297
|
| `DSH_LARK_ACCESS_DEFAULT_DENY` | `false` | Reject private chats when no allowlist is configured |
|
|
298
298
|
| `DSH_LARK_EVENT_FRESHNESS_MS` | `600000` | Stale-message rejection window (0 disables) |
|
|
299
|
+
| `DSH_LARK_GROUP_NO_AT` | `false` | Poll registered groups for messages without @; requires `im:message.group_msg` and a non-empty `allowed_users` list |
|
|
300
|
+
| `DSH_LARK_GROUP_POLL_MS` | `3000` | No-@ group polling interval in milliseconds (minimum 1000) |
|
|
299
301
|
| `DSH_LARK_RUN_TIMEOUT_MS` | `300000` | Idle timeout for a single run: stops only after the run has been silent for this long |
|
|
300
302
|
| `DSH_LARK_STOP_GRACE_MS` | `5000` | Grace period after SIGTERM before SIGKILL |
|
|
301
303
|
| `DSH_LARK_SCOPE_CONCURRENCY` | `2` | Concurrent runs per scope (1 = strictly serial) |
|
|
@@ -327,6 +329,7 @@ This tool runs **locally**; before installing, be aware that it accesses:
|
|
|
327
329
|
- **Feishu credentials**: the PersonalAgent app `app_id` / `app_secret`, stored in plaintext at `~/.dsh-lark/config.json` (file mode 600).
|
|
328
330
|
- **File system**: reads / writes the working directories you choose with `/cd` and `/ws` (including running shell commands and modifying files).
|
|
329
331
|
- **Network**: an outbound WebSocket long connection to the Feishu open platform for messages, and task context sent to the DeepSeek API.
|
|
332
|
+
- **Optional group history**: only with `DSH_LARK_GROUP_NO_AT=true`, the bridge polls groups/topics previously registered by an event. It accepts only post-start, non-deleted messages from explicitly allowlisted human users and deduplicates them against live events. This lets the bot read group messages that do not mention it; grant `im:message.group_msg` only after confirming that this matches your team's privacy policy.
|
|
330
333
|
- **Local callback**: when the `lark_notify` tool runs, the dsh runtime subprocess calls the bridge process back over a random 127.0.0.1 port with a per-boot token (loopback only).
|
|
331
334
|
- **Processes**: spawns local `dsh` runtime subprocesses (`dsh-sdk-jsonrpc-server` / `dsh-acp` profiles) to run agent tasks.
|
|
332
335
|
- **dsh configuration**: `/model` `/providers` `/provider` `/key` read / write `~/.dsh/settings.yaml` and `~/.dsh/.credentials.yaml` using the official dsh storage protocol (admin-only writes; settings keep only `apiKeyEnv` references; credentials file mode 0600, directory 0700; literal keys never enter settings or chat history).
|
|
@@ -336,7 +339,7 @@ All data flows only between this machine, Feishu and DeepSeek; nothing is collec
|
|
|
336
339
|
|
|
337
340
|
## Troubleshooting
|
|
338
341
|
|
|
339
|
-
Run `dsh-lark-bot doctor` first; it checks the profile and working directory and performs a real availability probe for the current adapter (`sdk` / `acp` / `headless` runtime handshake).
|
|
342
|
+
Run `dsh-lark-bot doctor` first; it checks the profile and working directory and performs a real availability probe for the current adapter (`sdk` / `acp` / `headless` runtime handshake). When no-@ group polling is enabled, it also probes the history API against one registered group.
|
|
340
343
|
|
|
341
344
|
Common issues:
|
|
342
345
|
|