feat: add markdown composer backend foundation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Kaya
2026-03-25 19:19:58 +01:00
co-authored by Copilot
parent a8c6ba94f5
commit d07bf30e81
16 changed files with 539 additions and 121 deletions
+2 -3
View File
@@ -4,6 +4,7 @@ import type {
SessionRunRecord,
SessionRunStatus,
} from '@shared/domain/runTimeline';
import { buildMarkdownExcerpt } from '@shared/utils/markdownText';
export function formatRunTimestamp(isoDate: string): string {
try {
@@ -156,9 +157,7 @@ export function eventSortKey(event: RunTimelineEventRecord): number {
export function truncateContent(content: string | undefined, maxLength = 80): string | undefined {
if (!content) return undefined;
const singleLine = content.replace(/\n/g, ' ').trim();
if (singleLine.length <= maxLength) return singleLine;
return `${singleLine.slice(0, maxLength)}`;
return buildMarkdownExcerpt(content, maxLength);
}
export function findLatestRun(runs: readonly SessionRunRecord[]): SessionRunRecord | undefined {