<?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 1 not found\n");
}
$handle = fopen($logPath, "r");
$idx = 0;
while (($line = fgets($handle)) !== false) {
    $idx++;
    if (strpos($line, 'futureVariableTS') !== false || strpos($line, 'futureLocationTS') !== false || strpos($line, 'futurePeriodTS') !== false) {
        $data = json_decode($line, true);
        if (isset($data['tool_calls'])) {
            foreach ($data['tool_calls'] as $tc) {
                $args = $tc['args'] ?? [];
                echo "=== Step $idx ($tc[name]) ===\n";
                echo "TargetFile: " . ($args['TargetFile'] ?? '') . "\n";
                echo "Instruction: " . ($args['Instruction'] ?? '') . "\n";
                echo "ReplacementContent:\n" . ($args['ReplacementContent'] ?? $args['CodeContent'] ?? '') . "\n\n";
            }
        }
    }
}
fclose($handle);
