mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-21 09:01:20 +00:00
Wire up hook custom message renderers to TUI
- CustomMessageComponent accepts optional CustomMessageRenderer - If hook provides a renderer, call it and use returned Component inside Box - Falls back to default rendering (label + Markdown) if no renderer or null returned - renderSessionContext gets renderer from hookRunner and passes to component
This commit is contained in:
parent
7b94ddf36b
commit
ba11622d0c
2 changed files with 3 additions and 1 deletions
|
|
@ -89,3 +89,4 @@ Location: `packages/coding-agent/CHANGELOG.md`, `packages/ai/CHANGELOG.md`, `pac
|
||||||
|
|
||||||
5. **Add new [Unreleased] section** at top of CHANGELOG.md for next cycle, commit it
|
5. **Add new [Unreleased] section** at top of CHANGELOG.md for next cycle, commit it
|
||||||
|
|
||||||
|
**CTRICIAL**: NEVER use sed/cat to read a file or a range of a file. Always use the read tool (use offset + limit for ranged reads).
|
||||||
|
|
@ -1054,7 +1054,8 @@ export class InteractiveMode {
|
||||||
// Check if this is a custom_message entry
|
// Check if this is a custom_message entry
|
||||||
if (entry?.type === "custom_message") {
|
if (entry?.type === "custom_message") {
|
||||||
if (entry.display) {
|
if (entry.display) {
|
||||||
this.chatContainer.addChild(new CustomMessageComponent(entry));
|
const renderer = this.session.hookRunner?.getCustomMessageRenderer(entry.customType);
|
||||||
|
this.chatContainer.addChild(new CustomMessageComponent(entry, renderer));
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue