<?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++;
    $data = json_decode($line, true);
    if (!$data) continue;
    if (isset($data['tool_calls'])) {
        foreach ($data['tool_calls'] as $tc) {
            $name = $tc['name'] ?? '';
            $args = $tc['args'] ?? [];
            if ($name === 'run_command' || $name === 'default_api:run_command') {
                $cmd = $args['CommandLine'] ?? '';
                if (stripos($cmd, 'index.php') !== false || stripos($cmd, 'copy') !== false || stripos($cmd, 'move') !== false || stripos($cmd, 'rename') !== false) {
                    echo "Step $idx ($name): $cmd\n";
                }
            }
            if ($name === 'write_to_file' || $name === 'default_api:write_to_file') {
                $tf = $args['TargetFile'] ?? '';
                echo "Step $idx ($name) writes to: $tf\n";
            }
        }
    }
}
fclose($handle);
