9b90dabaa9
- Added session compaction auto-continue feature that automatically sends a synthetic continuation prompt after compaction completes when enabled in settings. - Added tool output pruning system that intelligently removes verbose tool outputs from session history during compaction to reduce token usage while preserving critical information. - Added short summary generation for compaction results, providing concise PR-style summaries of conversation changes alongside full summaries. - Added session.compacting extension hook that allows extensions to customize compaction prompts, add context, and preserve metadata during summarization. - Added synthetic message support to mark system-injected messages (like auto-continue prompts) and prevent them from being persisted to editor history.
23 lines
638 B
TypeScript
23 lines
638 B
TypeScript
import { Container, Markdown, Spacer } from "@oh-my-pi/pi-tui";
|
|
import { getMarkdownTheme, theme } from "../../modes/theme/theme";
|
|
|
|
/**
|
|
* Component that renders a user message
|
|
*/
|
|
export class UserMessageComponent extends Container {
|
|
constructor(text: string, synthetic = false) {
|
|
super();
|
|
const bgColor = (value: string) => theme.bg("userMessageBg", value);
|
|
const color = synthetic
|
|
? (value: string) => theme.fg("dim", value)
|
|
: (value: string) => theme.fg("userMessageText", value);
|
|
this.addChild(new Spacer(1));
|
|
this.addChild(
|
|
new Markdown(text, 1, 1, getMarkdownTheme(), {
|
|
bgColor,
|
|
color,
|
|
}),
|
|
);
|
|
}
|
|
}
|