Something went wrong. Try again.
fork of prime agent with changes i want but are not upstreamable probqbly (and some fixes)
Something went wrong. Try again.
1.3 kB · 36 lines
TypeScript
at main
12345678910111213141516171819202122232425262728293031323334353637import { Markdown, type MarkdownTheme, Text } from "@earendil-works/pi-tui";import type { ParsedSkillBlock } from "../../../core/skill-blocks.js";import { getMarkdownTheme, theme } from "../theme/theme.js";import { customMessageLabel, ExpandableCustomMessageBox } from "./expandable-custom-message.js";import { expandCollapseHint } from "./keybinding-hints.js";
/** Skill invocation card; the user message is rendered separately. */export class SkillInvocationMessageComponent extends ExpandableCustomMessageBox { constructor( private readonly skillBlock: ParsedSkillBlock, private readonly markdownTheme: MarkdownTheme = getMarkdownTheme(), ) { super(); this.updateDisplay(); }
protected updateDisplay(): void { this.clear();
if (this.expanded) { this.addChild(new Text(customMessageLabel("skill"), 0, 0)); const header = `**${this.skillBlock.name}**\n\n`; this.addChild( new Markdown(header + this.skillBlock.content, 0, 0, this.markdownTheme, { color: (text: string) => theme.fg("customMessageText", text), }), ); } else { const line = `${customMessageLabel("skill")} ` + theme.fg("customMessageText", this.skillBlock.name) + ` ${expandCollapseHint("app.tools.expand", false)}`; this.addChild(new Text(line, 0, 0)); } }}