159075cad7
- Show tool execution components immediately when tool calls appear in streaming - Update components with streaming arguments as they come in - Handle incomplete/partial arguments gracefully with optional chaining - Fix error handling: tools now throw exceptions instead of returning error messages - Fix bash abort handling to properly reject on abort/timeout - Clean up error display
22 lines
539 B
TypeScript
22 lines
539 B
TypeScript
import { Container, Markdown, Spacer } from "@mariozechner/pi-tui";
|
|
|
|
/**
|
|
* Component that renders a user message
|
|
*/
|
|
export class UserMessageComponent extends Container {
|
|
private markdown: Markdown;
|
|
|
|
constructor(text: string, isFirst: boolean) {
|
|
super();
|
|
|
|
// Add spacer before user message (except first one)
|
|
if (!isFirst) {
|
|
this.addChild(new Spacer(1));
|
|
}
|
|
|
|
// User messages with dark gray background
|
|
this.markdown = new Markdown(text, undefined, undefined, { r: 52, g: 53, b: 65 });
|
|
this.addChild(this.markdown);
|
|
}
|
|
}
|