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

Function downloadTraceLog

apps/kimi-web/src/debug/trace.ts:401–412  ·  view source on GitHub ↗
(list: readonly TraceEntry[] = entries)

Source from the content-addressed store, hash-verified

399/** Download the captured trace as a JSONL file. Reusable so the debug panel and
400 any "Export log" UI action share one implementation. */
401export function downloadTraceLog(list: readonly TraceEntry[] = entries): void {
402 if (typeof document === 'undefined') return;
403 const blob = new Blob([traceToJsonl(list)], { type: 'application/x-ndjson' });
404 const url = URL.createObjectURL(blob);
405 const a = document.createElement('a');
406 a.href = url;
407 a.download = `kimi-web-log-${new Date().toISOString().replace(/[:.]/g, '-')}.jsonl`;
408 document.body.appendChild(a);
409 a.click();
410 a.remove();
411 URL.revokeObjectURL(url);
412}
413
414/** Serialize the given entries (default: all) as JSONL for download. */
415export function traceToJsonl(list: readonly TraceEntry[] = entries): string {

Callers

nothing calls this directly

Calls 2

traceToJsonlFunction · 0.85
removeMethod · 0.65

Tested by

no test coverage detected