notify on certain tool calls
This commit is contained in:
@@ -74,12 +74,21 @@ function sendNotification(): void {
|
||||
notifyLocal();
|
||||
}
|
||||
|
||||
const ACTION_NOTIFY_TOOLS = new Set(["question", "questionnaire"]);
|
||||
|
||||
export default function (pi: ExtensionAPI) {
|
||||
pi.on("agent_end", async (_event, ctx) => {
|
||||
if (!ctx.hasUI) return;
|
||||
sendNotification();
|
||||
});
|
||||
|
||||
// Notify when interactive tools are called so the user notices prompts immediately
|
||||
pi.on("tool_call", async (event, ctx) => {
|
||||
if (!ctx.hasUI) return;
|
||||
if (!ACTION_NOTIFY_TOOLS.has(event.toolName)) return;
|
||||
sendNotification();
|
||||
});
|
||||
|
||||
// Simple test command
|
||||
pi.registerCommand("notify", {
|
||||
description: "Test notification",
|
||||
|
||||
Reference in New Issue
Block a user