Hook commands: remove string return, use sendMessage() for prompting

- Command handler now returns Promise<void> instead of Promise<string | undefined>
- To trigger LLM response, use sendMessage() with triggerTurn: true
- Simplify _tryExecuteHookCommand to return boolean

Added example hook and slash command in .pi/:
- .pi/hooks/test-command.ts - /greet command using sendMessage
- .pi/commands/review.md - file-based /review command
This commit is contained in:
Mario Zechner 2025-12-27 01:21:18 +01:00
parent c8d9382aaa
commit 30cd723411
5 changed files with 50 additions and 23 deletions

View file

@ -426,7 +426,7 @@ export interface CommandContext {
export interface RegisteredCommand {
name: string;
description?: string;
handler: (ctx: CommandContext) => Promise<string | undefined>;
handler: (ctx: CommandContext) => Promise<void>;
}
/**