MCPcopy Create free account
hub / github.com/fastrepl/anarlog / extractTranscriptText

Function extractTranscriptText

apps/desktop/src/chat/tools/note-files.ts:90–106  ·  view source on GitHub ↗
(
  transcript: SessionContentData["transcript"],
)

Source from the content-addressed store, hash-verified

88}
89
90function extractTranscriptText(
91 transcript: SessionContentData["transcript"],
92): string | null {
93 const transcripts = transcript?.transcripts ?? [];
94 const chunks = transcripts.flatMap((item) => {
95 const memo = typeof item.memo_md === "string" ? item.memo_md.trim() : "";
96 if (memo) {
97 return [memo];
98 }
99
100 const words = item.words ?? [];
101 const text = normalizeWhitespace(words.map((word) => word.text).join(" "));
102 return text ? [text] : [];
103 });
104
105 return chunks.length > 0 ? chunks.join("\n\n") : null;
106}
107
108function buildNoteSections(payload: SessionContentData): NoteSection[] {
109 const sections: NoteSection[] = [];

Callers 1

buildNoteSectionsFunction · 0.85

Calls 1

normalizeWhitespaceFunction · 0.85

Tested by

no test coverage detected