dsh-feishu-notifier 0.1.2 → 0.1.3
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/lib/index.js +5 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -50,7 +50,7 @@ pnpm dsh --profile web
|
|
|
50
50
|
建议使用 release tag 或 commit SHA,确保安装内容可复现:
|
|
51
51
|
|
|
52
52
|
```sh
|
|
53
|
-
pnpm dsh plugin --profile demo add github:blooming-fang/dsh-feishu-notifier
|
|
53
|
+
pnpm dsh plugin --profile demo add github:blooming-fang/dsh-feishu-notifier
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
从 GitHub 安装时会执行 `prepare` 构建插件。只应安装可信仓库中的代码;pnpm 可能要求在 Profile 的 workspace 配置中加入 `allowBuilds` 授权。
|
package/lib/index.js
CHANGED
|
@@ -163,8 +163,11 @@ function apply(ctx, config) {
|
|
|
163
163
|
notify(current, "approval", request.reason ?? `工具 ${request.toolName} 正在等待批准。`);
|
|
164
164
|
return next();
|
|
165
165
|
});
|
|
166
|
-
ctx.on("session/event", (
|
|
167
|
-
if (event.type === "turn/end")
|
|
166
|
+
ctx.on("session/event", (session, event) => {
|
|
167
|
+
if (event.type === "turn/end") {
|
|
168
|
+
if (session.header.origin === "subagent") return;
|
|
169
|
+
notify(current, "turn-end", `第 ${String(event.data.turn)} 轮:${turnReasonText(event.data.reason)}`);
|
|
170
|
+
}
|
|
168
171
|
if (event.type === "tool/call" && (event.data.name === "ask_user_question" || event.data.name === "exit_plan_mode")) notify(current, "approval", event.data.name === "exit_plan_mode" ? "智能体正在等待你确认计划。" : "智能体正在等待你回答问题。");
|
|
169
172
|
});
|
|
170
173
|
ctx.effect(() => ctx.webServer.register({
|