mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 13:03:42 +00:00
feat(hooks): add text_delta event for streaming text monitoring
- New text_delta hook event fires for each chunk of streaming text - Enables real-time monitoring of agent output - Plan-mode hook now updates todo progress as [DONE:id] tags stream in - Each todo item has unique ID for reliable tracking
This commit is contained in:
parent
7a03f57fbe
commit
d1eea3ac4e
5 changed files with 57 additions and 5 deletions
|
|
@ -306,6 +306,21 @@ pi.on("turn_end", async (event, ctx) => {
|
|||
});
|
||||
```
|
||||
|
||||
#### text_delta
|
||||
|
||||
Fired for each chunk of streaming text from the assistant. Useful for real-time monitoring of agent output.
|
||||
|
||||
```typescript
|
||||
pi.on("text_delta", async (event, ctx) => {
|
||||
// event.text - the new text chunk
|
||||
|
||||
// Example: watch for specific patterns in streaming output
|
||||
if (event.text.includes("[DONE:")) {
|
||||
// Handle completion marker
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
#### context
|
||||
|
||||
Fired before each LLM call. Modify messages non-destructively (session unchanged).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue