mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-18 16:02:24 +00:00
- addMessageToChat: exhaustive switch for all AgentMessage roles - renderSessionContext: delegates to addMessageToChat, special handling for assistant tool calls and tool results - export-html formatMessage: exhaustive switch for all AgentMessage roles - Removed isHookMessage, isBashExecutionMessage type guards in favor of role checks - Fixed imports and removed unused getLatestCompactionEntry
18 lines
517 B
TypeScript
18 lines
517 B
TypeScript
import { Container, Markdown, Spacer } from "@mariozechner/pi-tui";
|
|
import { getMarkdownTheme, theme } from "../theme/theme.js";
|
|
|
|
/**
|
|
* Component that renders a user message
|
|
*/
|
|
export class UserMessageComponent extends Container {
|
|
constructor(text: string) {
|
|
super();
|
|
this.addChild(new Spacer(1));
|
|
this.addChild(
|
|
new Markdown(text, 1, 1, getMarkdownTheme(), {
|
|
bgColor: (text: string) => theme.bg("userMessageBg", text),
|
|
color: (text: string) => theme.fg("userMessageText", text),
|
|
}),
|
|
);
|
|
}
|
|
}
|