<?php
$logPath = 'C:/Users/HP/.gemini/antigravity-ide/brain/d31b1fe2-ad06-4c7a-9ab1-c82bd4c8dd20/.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 ($idx >= 500 && $idx <= 560) {
        $data = json_decode($line, true);
        if (!$data) continue;
        echo "=== Step $idx ===\n";
        if (isset($data['type'])) {
            echo "Type: " . $data['type'] . "\n";
        }
        if (isset($data['tool_calls'])) {
            foreach ($data['tool_calls'] as $tc) {
                echo "Tool: " . $tc['name'] . " -> " . json_encode($tc['args']) . "\n";
            }
        }
        if (isset($data['content'])) {
            echo "Content: " . substr($data['content'], 0, 500) . "\n";
        }
    }
}
fclose($handle);
