<?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 ($idx > 50) break;
    $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'] . "\n";
            $args = json_encode($tc['args']);
            if (strlen($args) > 500) {
                echo "  Args (length " . strlen($args) . "): " . substr($args, 0, 500) . "...\n";
            } else {
                echo "  Args: " . $args . "\n";
            }
        }
    }
    if (isset($data['content'])) {
        echo "Content: " . substr($data['content'], 0, 500) . "...\n";
    }
}
fclose($handle);
