<?php
$logPath = 'C:/Users/HP/.gemini/antigravity-ide/brain/dabec389-a1dd-4fd5-add9-97761faf96ae/.system_generated/logs/transcript.jsonl';
if (!file_exists($logPath)) {
    die("Log not found\n");
}
$handle = fopen($logPath, "r");
$idx = 0;
while (($line = fgets($handle)) !== false) {
    $idx++;
    if (strpos($line, 'applyFutureTSFilter') !== false) {
        $data = json_decode($line, true);
        if (!$data) continue;
        
        // Let's print replacement content or view file content that contains applyFutureTSFilter
        if (isset($data['tool_calls'])) {
            foreach ($data['tool_calls'] as $tc) {
                $str = json_encode($tc['args'], JSON_PRETTY_PRINT);
                if (strpos($str, 'applyFutureTSFilter') !== false) {
                    echo "=== Step $idx ($tc[name]) ===\n";
                    echo $str . "\n\n";
                }
            }
        }
        
        if (isset($data['content']) && strpos($data['content'], 'applyFutureTSFilter') !== false) {
            echo "=== Step $idx (content) ===\n";
            echo substr($data['content'], 0, 2000) . "\n\n";
        }
    }
}
fclose($handle);
