• Trim a JSONL session file: strip bloat, keep conversation.

    Rules:

    1. Pre-compaction content → skip entirely (dead weight)
    2. file-history-snapshot entries → skip entirely
    3. queue-operation entries → skip entirely
    4. Image blocks in tool results → strip always
    5. tool_result content > threshold → stub with summary
    6. tool_use input for write ops (+ broad fallback) → stub large fields
    7. thinking blocks → remove entirely (signature is required by API)
    8. API usage metadata → strip
    9. Everything else → preserved verbatim

    Parameters

    • sourcePath: string
    • destPath: string
    • options: TrimOptions = {}

    Returns Promise<TrimMetrics>