File size: 1,566 Bytes
771f178
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import json

transcript_path = "/home/nabil/.gemini/antigravity/brain/13b11a65-32bc-4771-9531-ecadb88830c8/.system_generated/logs/transcript.jsonl"

for line in open(transcript_path):
    try:
        step = json.loads(line)
        if "tool_calls" in step:
            for tc in step["tool_calls"]:
                if tc["name"] in ["multi_replace_file_content", "replace_file_content"]:
                    args = tc["args"]
                    target_file = args.get("TargetFile", "")
                    if "index.html" in target_file:
                        target_lines = 0
                        replacement_lines = 0
                        
                        if tc["name"] == "multi_replace_file_content":
                            chunks = json.loads(args.get("ReplacementChunks", "[]"))
                            for chunk in chunks:
                                target_lines += len(chunk.get("TargetContent", "").split("\n"))
                                replacement_lines += len(chunk.get("ReplacementContent", "").split("\n"))
                        else:
                            target_lines = len(args.get("TargetContent", "").split("\n"))
                            replacement_lines = len(args.get("ReplacementContent", "").split("\n"))
                            
                        print(f"Step {step['step_index']}: {tc['name']} -> Target: {target_lines}, Replacement: {replacement_lines}")
                        print(f"   Description: {args.get('Description', 'N/A')}")
    except Exception as e:
        pass