mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 17:00:59 +00:00
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:
parent
c8d9382aaa
commit
30cd723411
5 changed files with 50 additions and 23 deletions
|
|
@ -183,8 +183,7 @@ registerCommand(name: string, options: {
|
|||
```
|
||||
|
||||
Handler return:
|
||||
- `undefined` - command completed
|
||||
- `string` - text to send as prompt (like file-based slash commands)
|
||||
- `void` - command completed (use `sendMessage()` with `triggerTurn: true` to prompt LLM)
|
||||
|
||||
Wiring (all in AgentSession.prompt()):
|
||||
- [x] Add hook commands to autocomplete in interactive-mode
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue