MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / buildExportMarkdown

Function buildExportMarkdown

apps/kimi-code/src/tui/utils/export-markdown.ts:222–247  ·  view source on GitHub ↗
(input: BuildExportMarkdownInput)

Source from the content-addressed store, hash-verified

220}
221
222export function buildExportMarkdown(input: BuildExportMarkdownInput): string {
223 const { sessionId, workDir, history, tokenCount, now } = input;
224
225 const lines: string[] = [
226 '---',
227 `session_id: ${sessionId}`,
228 `exported_at: ${now.toISOString()}`,
229 `work_dir: ${workDir}`,
230 `message_count: ${String(history.length)}`,
231 `token_count: ${String(tokenCount)}`,
232 '---',
233 '',
234 '# Kimi Session Export',
235 '',
236 ];
237
238 const turns = groupIntoTurns(history);
239 lines.push(buildOverview(history, turns));
240 lines.push('');
241
242 for (let i = 0; i < turns.length; i++) {
243 lines.push(formatTurnMd(turns[i]!, i + 1));
244 }
245
246 return lines.join('\n');
247}

Callers 2

handleExportMdCommandFunction · 0.90

Calls 4

groupIntoTurnsFunction · 0.85
buildOverviewFunction · 0.85
formatTurnMdFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected