Previous response had warnings:
WARNINGS: - Extra text detected before JSON object
- Extra text detected after JSON object

New Terminal Output:

root@d7299c7f5982:/app# python3 -c "
> import struct
> with open('/app/frames.tza', 'rb') as f:
>     magic = f.read(4)
>     width, height = struct.unpack('<HH', f.read(4))
>     n_frames, max_bytes = struct.unpack('<II', f.read(8))
>     frames = [f.read(width * height) for _ in range(n_frames)]
>
> # Find runs in frame 0
> prev = b' ' * (width * height)
> frame = frames[0]
> runs = []
> i = 0
> while i < width * height:
>     if prev[i] != frame[i]:
>         start = i
>         while i < width * height and prev[i] != frame[i]:
>             i += 1
>         runs.append((start, i - start))
>     else:
>         i += 1
>
> print(f'Frame 0: {len(runs)} runs')
> print('First 20 runs:')
> for j, (start, length) in enumerate(runs[:20]):
>     row, col = start // width, start % width
>     print(f'  Run {j}: row={row}, col={col}, len={length}')
>
> # Calculate cursor position after frame 0
> total_chars = sum(length for _, length in runs)
> print(f'\nTotal chars in frame 0: {total_chars}')
> end_row = (total_chars - 1) // width
> end_col = (total_chars - 1) % width
> print(f'Cursor ends at: row={end_row}, col={end_col}')
> "
Frame 0: 140 runs
First 20 runs:
  Run 0: row=0, col=0, len=12
  Run 1: row=0, col=13, len=1
  Run 2: row=0, col=15, len=9
  Run 3: row=0, col=25, len=6
  Run 4: row=0, col=32, len=5
  Run 5: row=0, col=38, len=5
  Run 6: row=1, col=0, len=6
  Run 7: row=1, col=7, len=6
  Run 8: row=1, col=14, len=6
  Run 9: row=1, col=21, len=34
  Run 10: row=1, col=56, len=1
  Run 11: row=2, col=0, len=1
  Run 12: row=2, col=2, len=6
  Run 13: row=2, col=9, len=5
  Run 14: row=2, col=15, len=3
  Run 15: row=2, col=19, len=10
  Run 16: row=2, col=30, len=11
  Run 17: row=3, col=0, len=1
  Run 18: row=3, col=2, len=6
  Run 19: row=3, col=9, len=5

Total chars in frame 0: 901
Cursor ends at: row=11, col=20
root@d7299c7f5982:/app#
