dsh-lark-bot 0.15.3 → 0.15.4
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 +1 -1
- package/README_EN.md +1 -1
- package/SECURITY.md +5 -3
- package/dist/cli.js +8 -0
- package/dist/cli.js.map +1 -1
- package/dist/plugin.js +8 -0
- package/dist/plugin.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -122,7 +122,7 @@ dsh --profile dsh-lark
|
|
|
122
122
|
| `/provider add\|update\|remove <id>` | 管理 provider(管理员;deepseek-official 与自定义 pi-ai)|
|
|
123
123
|
| `/key set\|remove\|list <引用名>` | 管理 dsh 凭据(set / remove 需管理员)|
|
|
124
124
|
| `/ask <问题>` | 发送问答卡,回答写入会话上下文|
|
|
125
|
-
| `/invite user\|admin\|group <id>`、`/invite list`、`/invite remove user\|group <id>` |
|
|
125
|
+
| `/invite user\|admin\|group <id>`、`/invite list`、`/invite remove user\|group <id>` | 管理访问白名单(写操作需管理员)|
|
|
126
126
|
| `/help` | 查看帮助|
|
|
127
127
|
|
|
128
128
|
飞书消息中的图片会下载到本地 media 目录并传给 dsh;文本类文件会读取内容并注入任务上下文。
|
package/README_EN.md
CHANGED
|
@@ -122,7 +122,7 @@ Send a normal message to the bot in Feishu to get started. Common commands:
|
|
|
122
122
|
| `/provider add\|update\|remove <id>` | Manage providers (admin; deepseek-official and custom pi-ai) |
|
|
123
123
|
| `/key set\|remove\|list <ref>` | Manage dsh credentials (set / remove require admin) |
|
|
124
124
|
| `/ask <question>` | Send a Q&A card; the answer is written back to session context |
|
|
125
|
-
| `/invite user\|admin\|group <id>`、`/invite list`、`/invite remove user\|group <id>` | Manage the access allowlist |
|
|
125
|
+
| `/invite user\|admin\|group <id>`、`/invite list`、`/invite remove user\|group <id>` | Manage the access allowlist (mutating commands require admin) |
|
|
126
126
|
| `/help` | Show help |
|
|
127
127
|
|
|
128
128
|
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.
|
package/SECURITY.md
CHANGED
|
@@ -47,9 +47,11 @@
|
|
|
47
47
|
`DEFAULT_DENIED_INTERACTIVE_TOOLS` 提供工具级黑名单。
|
|
48
48
|
8. **审批**:ACP 模式下敏感操作通过 `session/request_permission` 以飞书审批卡一问一答;
|
|
49
49
|
run 结束 / dispose 时所有挂起审批卡结算为拒绝(`src/bot/approvals.ts`)。
|
|
50
|
-
9. **管理操作鉴权**:飞书会话内对 dsh
|
|
51
|
-
`/provider add|update|remove`、`/key set|remove
|
|
52
|
-
`/invite
|
|
50
|
+
9. **管理操作鉴权**:飞书会话内对 dsh 配置与访问白名单的写操作(`/model default`、
|
|
51
|
+
`/model add|remove`、`/provider add|update|remove`、`/key set|remove`、`/invite user|admin|group`
|
|
52
|
+
与 `/invite remove …`)仅管理员可执行;首个扫码绑定的 operator 自动成为管理员,之后由现有
|
|
53
|
+
管理员经 `/invite admin <open_id>` 添加(`/invite list` 为只读、开放)。查看类命令
|
|
54
|
+
(`/model`、`/providers`、`/key list`)开放。
|
|
53
55
|
10. **本地回调隔离**:`lark_notify` 工具的回调服务只绑定 `127.0.0.1`,每次启动生成随机
|
|
54
56
|
token 鉴权(不落盘、不进日志),请求体限 1MB;`/notify` 与角色 / 配置写命令同为管理员操作。
|
|
55
57
|
11. **安全网守护(默认随 `setup` 安装)**:
|
package/dist/cli.js
CHANGED
|
@@ -5687,6 +5687,7 @@ async function handleAsk(args, ctx) {
|
|
|
5687
5687
|
async function handleInvite(args, ctx) {
|
|
5688
5688
|
const [kind, ...rest] = args.trim().split(/\s+/);
|
|
5689
5689
|
const id = rest.join(" ").trim();
|
|
5690
|
+
if (kind !== "list" && !requireAdmin3(ctx)) return;
|
|
5690
5691
|
if (kind === "list") {
|
|
5691
5692
|
const snapshot = ctx.accessManager.snapshot();
|
|
5692
5693
|
await reply5(
|
|
@@ -5739,6 +5740,13 @@ async function handleInvite(args, ctx) {
|
|
|
5739
5740
|
}
|
|
5740
5741
|
await reply5(ctx, "\u672A\u77E5 `/invite` \u7C7B\u578B\uFF0C\u8BF7\u4F7F\u7528 user / admin / group / list / remove\u3002");
|
|
5741
5742
|
}
|
|
5743
|
+
function requireAdmin3(ctx) {
|
|
5744
|
+
if (!ctx.accessManager.isAdmin(ctx.senderId)) {
|
|
5745
|
+
void reply5(ctx, "\u4EC5\u7BA1\u7406\u5458\u53EF\u6267\u884C\u8BE5\u64CD\u4F5C\u3002");
|
|
5746
|
+
return false;
|
|
5747
|
+
}
|
|
5748
|
+
return true;
|
|
5749
|
+
}
|
|
5742
5750
|
async function handleHelp(_args, ctx) {
|
|
5743
5751
|
await reply5(ctx, HELP);
|
|
5744
5752
|
}
|