+
    lHàj.  ã                   ó   € R t R R ltR# )zEIncremental sandbox log reads for ProcessRegistry's non-local poller.c                ó<   € V ^8„  d   QhR\         R\        R\         /# )é   Úquoted_log_pathÚoffsetÚreturn)ÚstrÚint)Úformats   "ÚC/home/ubuntu/.hermes/hermes-agent/tools/process_registry_env_log.pyÚ__annotate__r      s!   € ÷ ñ ¤sð ´Cð ¼Cñ ó    c                ó&   € RV RV  RV  RV  RV  R2# )aà  Shell command that reads only the log bytes written since ``offset``
(``cat``-ing the whole file every poll re-sends all output over docker/SSH).

Prints one header line ``"<size> <offset>"`` then the bytes in [offset, size).
The size is read first and the tail cut at that same size, so a growing file
never sends a byte twice; a file that shrank was rotated/truncated, so the
offset drops to 0 and the reader starts over. The window end is pulled back
to a UTF-8 character boundary (the backend decodes each ``execute()`` result
on its own, so a straddling multibyte char would become U+FFFD and break watch
patterns at the seam): up to 3 trailing continuation bytes are held for the
next poll and the header reports the trimmed size.zO=z; S=$({ wc -c < z™; } 2>/dev/null | tr -dc '0-9'); S=${S:-0}; if [ "$S" -lt "$O" ]; then O=0; fi; N=0; P=$S; while [ "$P" -gt "$O" ] && [ "$N" -lt 3 ]; do B=$(tail -c +$P z¿ 2>/dev/null | head -c 1 | od -An -to1 | tr -dc '0-9'); case "$B" in 2[0-7][0-7]) P=$((P-1)); N=$((N+1));; *) break;; esac; done; if [ "$N" -gt 0 ] || [ "$P" -eq "$S" ]; then B=$(tail -c +$P zû 2>/dev/null | head -c 1 | od -An -to1 | tr -dc '0-9'); case "$B" in 3[0-3][0-7]) L=2;; 3[4-5][0-7]) L=3;; 3[6-7][0-7]) L=4;; *) L=1;; esac; if [ "$L" -gt $((N+1)) ]; then S=$((P-1)); fi; fi; echo "$S $O"; if [ "$S" -gt "$O" ]; then tail -c +$((O+1)) z# 2>/dev/null | head -c $((S-O)); fi© )r   r   s   &&r
   Úlog_delta_commandr      sK   € ð ˆVˆHð Ø)Ð*ð +ð +Ð+ð ,ð +Ð+ð ,ð
 -Ð-Ð-Pð!	Rðr   N)Ú__doc__r   r   r   r
   Ú<module>r      s   ðÙ K÷r   