+
    .pÐj	� ã                   ó’  a € R· t¡0 t R t^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RIt^ RIt^ RIt^ RIHtHt ^ RIHtHtHt ^ RIHt ^ RIHtHtHtHtHtHt ^ RIHtHtH t H!t!H"t" ^ RI#H$t$ ^ RI%H&t& ^ R	I'H(t( ^ R
I)H*t* ^ RI+H,t,H-t- ^ RI.H/t/H0t0 ^ RI1H2t3 ^ RI4H5t5H6t6H7t7H8t8H9t9H:t:H;t;H<t< ]Pz                  ! ]>4      t?R R lt@RtAR R ltBRRRRR]ARRRRRRRR R!R"R#R$0tC]]/R%0,
          ,          tD]E! R&04      tFR'R(R)R*R+R,](0tGR- R. ltHR¸tIR/R0.]IO5tJ0 R¹mtKR1R2]$ 23tL0 RºmtM ^ RINtN]NPž                  3tP] ^ k ]P¤                  ]P¦                  ]T.]PO5tU] ^k 0 R¼mtVR3tW ! R4 R5]X4      tY ! R6 R7]X4      tZ]R½R8 R9 ll4       t[]R¾R: R; ll4       t\R< R= lt]R> R? lt^R@ RA lt_RB RC lt`RD RE ltaR¾RF RG lltbRH RI ltcRJ^dRKRL/RM RN lltdROteR¿tfRPRQRRRQRS]f/RT RU lltgRV RW lthRX RY ltiRZ R[ ltjR\ R] ltkR^ R_ ltlR`tmRa Rb ltnRc Rd ltoRe Rf ltpRg Rh ltqRi Rj ltrRk Rl ltsRm Rn lttRo Rp ltuRÀtv^twR¾Rr Rs lltxRt Ru ltyRqtzRÁt{] ^k Rv Rw lt|Rt}Rxt~^tRyt€^t�Rzt‚R{ R| ltƒR} R~ lt„R R€ lt…R]3R� R‚ llt†R]�3Rƒ R„ llt‡RÂR… R† lltˆRÂR‡ Rˆ llt‰RÃR‰ RŠ lltŠR‹ RŒ lt‹R¾R� RŽ lltŒR� R� lt�R¾R‘ R’ lltŽR“ R” lt�R• R– lt�R— R˜ lt‘R¾R™ Rš llt’R¾R› Rœ llt“R� Rž lt”RÄRŸ R  llt•RÁt{] ^k R¡ R¢ lt–R£ R¤ lt—R¥ R¦ lt˜R¾R§ R¨ llt™R¾R© Rª lltšR¾R« R¬ llt›]w3R­ R® lltœ]wR3R¯ R° llt�R± R² ltžR³ R´ ltŸRµ R¶ lt R#   ]Q d    R»tP EL	i ; i)Åz*Backup and import commands for hermes CLI.N)ÚcontextmanagerÚsuppress)ÚdatetimeÚtimezoneÚUTC©ÚPath)ÚAnyÚCallableÚDictÚListÚOptionalÚTuple)ÚLOCAL_RUNTIME_ROOT_DIRSÚ!_get_platform_default_hermes_homeÚget_default_hermes_rootÚget_hermes_homeÚdisplay_hermes_home)ÚRETIRED_GENERATION_DIR_SUFFIX)Úread_only_db_uri)ÚGENERATED_SUBDIR)Únormalize_archive_parts)Ú_close_quietlyÚ_safe_copy_db)ÚPM_RUNTIME_ROOT_DIRSÚprofile_root_entry)Úformat_bytes)Ú_count_session_rowsÚ_default_new_file_modeÚ_detect_prefixÚ_extract_member_atomicallyÚ_import_db_memberÚ_restore_auth_jsonÚ_safe_restore_dbÚ_validate_backup_zipc                ó\   € V ^8„  d   QhR\         R\        \        \        ,          ,          /# )é   Údb_pathÚreturn)r   r   ÚlistÚint)Úformats   "Ú /opt/hermes/hermes_cli/backup.pyÚ__annotate__r-   /   s#   € ÷ ñ ¤Tð ¬h´t¼CµyÕ.Añ ó    c                 ó   € R # ©N© )r'   s   &r,   Ú_foreign_db_holder_pidsr2   /   s   € ñ r.   zstate-snapshotsc                ó$   € V ^8„  d   QhR\         /# ©r&   r(   ©Ústr)r+   s   "r,   r-   r-   <   s   € ÷ 4ñ 4¤ñ 4r.   c                 ó   € R# )u¢   How to restore a state snapshot. There is no `hermes snapshot` subcommand â€” only the /snapshot
slash command inside a `hermes` session (hermes_cli/commands.py).z}To restore a newer snapshot, start `hermes` in a terminal and run `/snapshot list`, then `/snapshot restore <id>` (CLI only).r1   r1   r.   r,   Ú_snapshot_recovery_hintr8   <   s   € ñ3r.   úhermes-agentÚ__pycache__z.gitÚnode_modulesÚbackupsÚcheckpointszbrowser-profileszbrowser-profilez.venvÚvenvzsite-packagesz.cachez.toxz.noxz.pytest_cachez.mypy_cachez.ruff_cacheÚcacheÚbrowser_profilesÚimagesÚaudioÚvideosÚ	documentsÚscreenshotsÚ	citationsc                ó0   € V ^8„  d   QhR\         R\        /# ©r&   Úrel_pathr(   ©r   Úbool)r+   s   "r,   r-   r-   m   s   € ÷ [ñ [¤Dð [¬Tñ [r.   c                ó6  € \        V P                  4      pV\        9   g   V\        9   d   R# V P                  p\	        V4      ^8¼  d   V^ ,          R8X  d
   VR,          p\	        V4      ^8¬  ;'       d%    V^ ,          R8H  ;'       d    V^,          \
        9  # )zITrue when *rel_path* is inside a regenerable tree at a profile-home root.TÚprofiles:r&   NNr?   )r   ÚpartsÚ_EXCLUDED_ROOT_DIRSÚ_EXCLUDED_BACKUP_ROOT_DIRSÚlenÚ_KEPT_CACHE_SUBDIRS)rI   Ú
root_entryrN   s   &  r,   Ú_in_excluded_root_dirrT   m   s}   € ä# H§N¡NÓ3€JØÔ(Ô(¨JÔ:TÔ,TÙØ�N‰N€EÜ
ˆ5ƒz�Q„˜5 �8 zÔ1Ø�b•	ˆÜˆu‹:˜‰?×ZÐZ˜u Q�x¨7Ñ2×ZÐZ°u¸QµxÔGZÑ7ZÐZr.   z.pycz.pyozstate.db.pre-update-emergency-ústate.dbz
_external/c                   ó   € ] tR t^¬tRtRtR# )ÚBackupInProgressErrorz@Raised when another process already owns the Hermes backup slot.r1   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__r1   r.   r,   rW   rW   ¬   s   † ÝJr.   rW   c                   ó   € ] tR t^°tRtR# )Ú_SQLiteSnapshotErrorr1   N)rX   rY   rZ   r[   r]   r1   r.   r,   r_   r_   °   s   † Ûr.   r_   c                ó0   € V ^8„  d   QhR\         R\        /# )r&   Úhermes_homeÚtimeout_seconds)r   Úfloat)r+   s   "r,   r-   r-   µ   s   € ÷ #ñ #¬ð #¼uñ #r.   c           	   #  óZ  aa	a
"  € V R,          pVP                   P                  RRR7       VP                  R4      o	Rp\        P                  ! 4       \        RV4      ,           p \        P                  R8X  dg   ^ RIo
VP                  4       P                  ^ 8X  d"   S	P                  R	4       S	P                  4        R
 V	V
3R llpS
P                  S
P                  rvM6^ RIoR VV	3R llpSP                   SP"                  ,          SP$                  rvV'       g    V! V4       RpK  Rx € V'       d)   \-        \&        4      ;_uu_ 4        V! V4       RRR4       S	P/                  4        R#   \&         d@    \        P                  ! 4       T8¼  d   \)        R4      h\        P*                  ! R4        K¤  i ; i  + '       g   i     Lo; i  T'       d=   \-        \&        4      ;_uu_ 4        X! X4       RRR4       M  + '       g   i     M; iS	P/                  4        i ; i5i)zCAcquire one cross-process backup slot for full and quick snapshots.ú.backup.lockT©ÚparentsÚexist_okza+bFg        ÚntNó    c                ó(   € V ^8„  d   QhR\         RR/# ©r&   Úflagr(   N©r*   )r+   s   "r,   r-   Ú,_backup_operation_lock.<locals>.__annotate__Â   s   € ÷ 9ñ 9œsð 9 tñ 9r.   c                 ól   <€ SP                  ^ 4       SP                  SP                  4       V ^4       R# )é    N)ÚseekÚlockingÚfileno)rm   ÚhandleÚmsvcrts   &€€r,   Ú_lock_opÚ(_backup_operation_lock.<locals>._lock_opÂ   s$   ø€ Ø—‘˜A”Ø—‘˜vŸ}™}›°°aÖ8r.   c                ó(   € V ^8„  d   QhR\         RR/# rl   rn   )r+   s   "r,   r-   ro   È   s   € ÷ 3ñ 3œsð 3 tñ 3r.   c                 óH   <€ SP                  SP                  4       V 4       R # r0   )Úflockrt   )rm   Úfcntlru   s   &€€r,   rw   rx   È   s   ø€ Ø—‘˜FŸM™M›O¨TÖ2r.   z(another Hermes backup is already runninggš™™™™™©?)ÚparentÚmkdirÚopenÚtimeÚ	monotonicÚmaxÚosÚnamerv   ÚstatÚst_sizeÚwriteÚflushÚLK_NBLCKÚLK_UNLCKr|   ÚLOCK_EXÚLOCK_NBÚLOCK_UNÚOSErrorrW   Úsleepr   Úclose)ra   rb   Ú	lock_pathÚacquiredÚdeadlinerw   Ú	lock_flagÚunlock_flagr|   ru   rv   s   &&      @@@r,   Ú_backup_operation_lockr–   ´   s‚  úé € ð ˜nÕ,€IØ×Ñ×Ñ 4°$ÐÔ7Ø�^‰^˜EÓ"€FØ€HÜ�~Š~Ó¤# c¨?Ó";Õ;€HðÜ�7‰7�dŒ?ÛØ�~‰~Ó×'Ñ'¨1Ô,Ø—‘˜TÔ"Ø—‘”÷9ñ 9ð &,§_¡_°f·o±o‘{ã÷3ñ 3à%*§]¡]°U·]±]Õ%BÀEÇMÁM�{ßð!Ù˜Ô#Ø’ó
 	çÜœ'×"Õ"Ù˜Ô%÷ #à�‰Žøô ô !Ü—>’>Ó# xÔ/Ü/Ð0ZÓ[Ð[Ü—
’
˜4× ð!ú÷ #×"û÷ Üœ'×"Õ"Ù˜Ô%÷ #×"×"Ð"úà�‰�üst   …A H+Á&B8G Ä 
E2 Ä*G Ä0H+Å	F?ÅH+Å2AF<Æ8G Æ;F<Æ<G Æ?G	Ç
H+Ç H(Ç2	H	Ç;	H(ÈHÈH(È(H+c                óv   € V ^8„  d   QhR\         R\        \        . \        \         ,          3,          ,          /# )r&   Ú
final_pathÚpublish_path)r   r   r
   )r+   s   "r,   r-   r-   Ü   s.   € ÷ ñ ¤Dð ¼ÄÈ"ÌhÔW[ÍnÐJ\ÕA]Õ8^ñ r.   c           	   #  ó”  "  € V P                  RV P                   R\        P                  ! 4        R\        P
                  ! 4        R24      pVP                  RR7        Vx € V'       d   V! 4       MT pVf   VP                  RR7       R# \        P                  ! W#4       R#   \         d    TP                  RR7       h i ; i5i)a5  Yield a hidden sibling path and publish it only after a clean close.

``publish_path`` picks the destination at publish time (default ``final_path``) so a caller
can divert an incomplete archive elsewhere without ever touching ``final_path``; returning
``None`` discards the partial instead of publishing it.
Ú.Ú-ú.partialT©Ú
missing_okN)	Ú	with_namer„   rƒ   ÚgetpidÚ	threadingÚ	get_identÚunlinkÚreplaceÚBaseException)r˜   r™   Úpartial_pathÚdestinations   &&  r,   Ú_atomic_output_pathr©   Û   s®   é € ð ×'Ñ'¨!¨J¯O©OÐ+<¸A¼b¿iºi»k¸]È!ÌI×L_ÒL_ÓLaÐKbÐbjÐ(kÓl€LØ×Ñ 4ÐÔ(ð	ØÒß(4‘l”n¸*ˆØÒØ×Ñ¨4ÐÖ0ä�JŠJ�|Ö1øÜô Ø×Ñ tÐÔ,Øðüs*   ‚ACÁ!+B& ÂCÂB& Â$CÂ&CÃCc                ó:   € V ^8„  d   QhR\         \        ,          /# r4   )r)   r   )r+   s   "r,   r-   r-   ñ   s   € ÷ ñ ´´dµñ r.   c                 óR  €  ^ RI Hp Hp V ! 4       pV'       d	   V! V4      MRpTf   . #  TP	                  4       ;'       g    . p/ pT FW  p \        T4      P                  4       pTP                  4       '       g   K5   TP                  4       p	TP                  Y˜4       KY  	  \        TP                  4       4      #   \         d    . u # i ; i  \         d#   p\
        P                  RY%4       . u Rp?# Rp?ii ; i  \         d     KÅ  i ; i  \        \        3 d     KÝ  i ; i)z�Existing paths the active memory provider declares via ``backup_paths()``; ``[]`` on any
provider failure (backup must never fail because of a flaky plugin).)Ú_get_active_memory_providerÚload_memory_providerNz0backup_paths() failed for memory provider %r: %s)Úplugins.memoryr¬   r­   Ú	ExceptionÚbackup_pathsÚloggerÚwarningr   Ú
expanduserÚexistsÚresolverŽ   Ú
ValueErrorÚ
setdefaultr)   Úvalues)
r¬   r­   ÚactiveÚproviderÚdeclaredÚexcÚoutÚrawÚpÚresolveds
             r,   Ú'_collect_memory_provider_external_pathsrÁ   ñ   s  € ðßTÙ,Ó.ˆß39Ñ'¨Ô/¸tˆð ÒØˆ	ðØ×(Ñ(Ó*×0Ð0¨bˆð €CÛˆð	Ü�S“	×$Ñ$Ó&ˆAð �x‰x�zŠzÙð	Ø—y‘y“{ˆHð 	�‰�xÖ#ñ ô �—
‘
“ÓÐøô- ô ØŠ	ðûô ô Ü�‰ÐIÈ6ÔWØ�	ûðûô ô 	Úð	ûô œÐ$ô 	Úð	ús]   ‚B< ™
B< ªC ÁC ÁC?Á>DÂ<CÃCÃC<ÃC7Ã1C<Ã7C<Ã?DÄDÄD&Ä%D&c                óF   € V ^8„  d   QhR\         R\        \         ,          /# )r&   Úbaser(   ©r   r)   )r+   s   "r,   r-   r-     s   € ÷ ñ œtð ¬¬T­
ñ r.   c                ón  a€ V P                  4       '       d   V P                  4       '       g   V .# V P                  4       '       g   . # . p\        P                  ! V RR7       FI  w  or#V Uu. uF  qD\
        9  g   K  VNK  	  upVR&   VP                  R V3R lV 4        4       4       KK  	  V# u upi )zWRegular files under *base* (a file or a directory), skipping symlinks, caches, and pyc.F©ÚfollowlinksºNNNc              3   óÈ   "  € T FX  p\        V4      '       d   K  VP                  \        9   d   K-  VP                  P                  \        4      '       d   KT  Vx € KZ  	  R # 5ir0   )Ú_is_non_regular_pathr„   Ú_EXCLUDED_NAMESÚendswithÚ_EXCLUDED_SUFFIXES)Ú.0Úfps   & r,   Ú	<genexpr>Ú'_iter_external_files.<locals>.<genexpr>  sK   é € ð GÑ"H˜BÜ1°"×5ô Ø9;¿¹ÄOÑ9Sô à "§¡× 0Ñ 0Ô1C× D÷ ’RÓ"Hùs   ‚A"šA"±"A"Á
A"c              3   óH   <"  € T F  p\        S4      V,          x € K  	  R # 5ir0   r   )rÎ   ÚfÚdirpaths   & €r,   rÐ   rÑ     s   øé € Ð"H¹i¸¤4¨£=°1×#4Ò#4»iùó   ƒ")Úis_fileÚ
is_symlinkÚis_dirrƒ   ÚwalkÚ_EXCLUDED_DIRSÚextend)rÃ   ÚfilesÚdirnamesÚ	filenamesÚdrÔ   s   &    @r,   Ú_iter_external_filesrà     sž   ø€ à‡|�|‡~‚~˜dŸo™o×/Ò/ØˆvˆØ�;‰;�=Š=Øˆ	Ø€EÜ(*¯ª°À%×(HÑ$ˆ�Ù"*ÓF¡(˜Q´~Ñ.E—q�q¡(ÑFˆ�‰Ø�‰ñ GÔ"H¹iÔ"Hó Gö 	Gñ )Ið
 €Lùò	 Gs   Á-B2Á>B2c                ó0   € V ^8„  d   QhR\         R\        /# ©r&   Úpathr(   rJ   )r+   s   "r,   r-   r-      s   € ÷ 	ñ 	œtð 	¬ñ 	r.   c                óŽ   €  \         P                  ! V P                  4       P                  4      '       * #   \         d     R# i ; i)zôTrue for symlinks, sockets, devices, and other non-regular filesystem entries.

A failed ``lstat`` is not treated as an exclusion: the archive writer must see the path and
report the read failure instead of silently claiming a complete backup.
F)r…   ÚS_ISREGÚlstatÚst_moderŽ   )rã   s   &r,   rÊ   rÊ      s7   € ðÜ—<’< §
¡
£× 4Ñ 4Ó5Ô5Ð5øÜô Úðús   ‚25 µAÁAc                ó0   € V ^8„  d   QhR\         R\        /# râ   rJ   )r+   s   "r,   r-   r-   ,  s   € ÷ 
pñ 
pœð 
p¤ñ 
pr.   c                ó$  €  V P                  4       p\        P                  ! TP                  4      '       d   R# \
        P                  R8H  ;'       d,    \        \        TR^ 4      \        P                  ,          4      #   \         d     R# i ; i)uÒ   True for symlinks and Windows junctions/reparse points â€” the only
directory entries a strict walk must never descend (os.walk already
refuses POSIX dir symlinks; this also covers junctions, which it follows).FTri   Úst_file_attributes)
ræ   rŽ   r…   ÚS_ISLNKrç   rƒ   r„   rK   ÚgetattrÚFILE_ATTRIBUTE_REPARSE_POINT)rã   Úinfos   & r,   Ú_is_link_pathrï   ,  sn   € ðØ�z‰z‹|ˆô ‡|‚|�D—L‘L×!Ò!ÙÜ�7‰7�d‰?×oÐoœt¤G¨DÐ2FÈÓ$JÌT×MnÑMnÕ$nÓoÐoøô	 ô Úðús   ‚B  Â BÂBc                ó0   € V ^8„  d   QhR\         R\        /# rH   rJ   )r+   s   "r,   r-   r-   9  s   € ÷ 	oñ 	oœdð 	o¤tñ 	or.   c                ód  a€ V P                   o\        V 4      '       d   R# \        ;QJ d    V3R lS 4       F  '       g   K   RM	  RM! V3R lS 4       4      '       d   R# V P                  pV\        9   ;'       g3    VP                  \        4      ;'       g    VP                  \        4      # )zFReturn True if *rel_path* (relative to hermes root) should be skipped.Tc              3   óv   <"  € T F.  q\         9   ;'       d    VR 8g  ;'       g    VS^ ,          8H  x € K0  	  R# 5i)r9   N)rÚ   )rÎ   r¿   rN   s   & €r,   rÐ   Ú"_should_exclude.<locals>.<genexpr>?  s6   øé € Ð
YÑSXÈa”Ñ×IÐI A¨Ñ$7×$HÐ$H¸1ÀÀaÅ¹=ÔIÓSXùs   ƒ9—9¤9F)	rN   rT   Úanyr„   rË   Ú
startswithÚ_EXCLUDED_PREFIXESrÌ   rÍ   )rI   r„   rN   s   & @r,   Ú_should_excluder÷   9  sx   ø€ à�N‰N€EÜ˜X×&Ò&Ùç
ƒsÔ
YÑSXÓ
Y‡s‡s‚sÔ
YÑSXÓ
Y×YÒYÙØ�=‰=€DØ”?Ñ"×nÐn d§o¡oÔ6HÓ&I×nÐnÈTÏ]É]Ô[mÓMnÐnr.   c                óR   € V ^8„  d   QhR\         R\         R\        \        ,          /# )r&   Úhermes_rootÚout_pathÚskipped_dirs)r   r   Úset)r+   s   "r,   r-   r-   E  s&   € ÷ ñ ¤Dð ´Dð ÌÔQTÍñ r.   c           	   #  ó†  a"  € \         P                  ! V RR7       EF�  w  r4p\        V4      P                  V 4      oS\        R4      8H  pV Uu. uF=  pV\        9  g   VR8X  g   K  V'       d   K!  \        SV,          4      '       d   K;  VNK?  	  ppVe5   VP                  V3R l\        V4      \        V4      ,
           4       4       V U	u. uF(  p	\        \        V4      V	,          4      '       d   K&  V	NK*  	  up	VR&   V F“  p
SV
,          pW,          p\        V4      '       d   K'  \        V4      '       d   K:  \        \        \        4      ;_uu_ 4        VP                  4       VP                  4       8X  d    RRR4       K…   RRR4       WË3x € K•  	  EK„  	  R# u upi u up	i   + '       g   i     L*; i5i)aN  Yield ``(abs_path, rel_path)`` for every file a full backup should hold.

The one owner of the walk policy (directory pruning so os.walk never descends a multi-GB
excluded tree, the root-only ``hermes-agent`` carve-out, root runtime trees, per-file rules),
shared by ``hermes backup`` and the pre-update path so they can never drift.
FrÆ   r›   r9   Nc              3   óH   <"  € T F  p\        SV,          4      x € K  	  R # 5ir0   r5   )rÎ   rß   Úrel_dirs   & €r,   rÐ   Ú%_iter_backup_files.<locals>.<genexpr>T  s   øé € ÐTÑ:S°Q¤ G¨a¥K× 0Ð 0Ó:SùrÕ   rÈ   )rƒ   rÙ   r   Úrelative_torÚ   rT   Úupdaterü   rï   r÷   rÊ   r   rŽ   r¶   rµ   )rù   rú   rû   rÔ   rÝ   rÞ   Úis_rootrß   Úkeptr„   ÚfnameÚrelÚfpathrÿ   s   &&&          @r,   Ú_iter_backup_filesr  E  sr  øé € ô )+¯ª°È×(OÐ(OÑ$ˆ˜9Ü�w“-×+Ñ+¨KÓ8ˆØœT #›YÑ&ˆáó8Ù�!ØœÔ'¨A°Ñ,?ô ÜHOô ä)¨'°A­+×6÷ ˆA‘xð 	ð 8ð Ò#Ø×ÑÔT¼#¸h»-Ì#ÈdË)Ö:SÓTÔTá(,ÓX© ´MÄ$ÀwÃ-ÐRVÕBV×4W—t�t©ÑXˆ�‰ÛˆEØ˜E•/ˆCØÕ%ˆEô ˜s×#Ò#ÙÜ# E×*Ò*ÙÜœ'¤:×.Õ.Ø—=‘=“? h×&6Ñ&6Ó&8Ô8Ø÷ /Ñ.Ø8÷ /ð �*Ôô ó )Pùò8ùò Y÷ /×.üsU   ƒAGÁF$Á(F$Á2F$ÂF$Â>GÃ#F)Ã8F)Ã>AGÅ%F.	Æ
GÆ"GÆ.F>Æ9Gc                ó$   € V ^8„  d   QhR\         /# )r&   rã   r   )r+   s   "r,   r-   r-   h  s   € ÷ 	ñ 	œ4ñ 	r.   c                óä   € Rp \         P                  ! \        V 4      RRR7      pV! V4      R3\        V4       #   \         d   pRT3u Rp?\        T4       # Rp?ii ; i  \        T4       i ; i)zbRun ``fn(conn)`` on a read-only connection to *path*; return ``(value, None)`` or ``(None, exc)``.NTg      ð?)ÚuriÚtimeout)Úsqlite3Úconnectr   r   r¯   )rã   ÚfnÚconnr¼   s   &&  r,   Ú_query_ro_sqliter  h  sh   € à€DðÜ�ŠÔ/°Ó5¸4ÈÔMˆÙ�$‹x˜ˆ~ô 	�tÕøô ô Ø�SˆyÔä�tÕûðûô 	�tÕús-   „+; »AÁAÁ	AÁ
A" ÁAÁA" Á"A/Úprobe_bytesÚforceFc                óH   € V ^8„  d   QhR\         R\        R\        R\        /# )r&   rã   r  r  r(   )r   r*   rK   )r+   s   "r,   r-   r-   t  s/   € ÷ Zñ Z¤ð Z´cð ZÌð ZÔY]ñ Zr.   c               ó8  €  V P                  4       '       g   R#  ^ RIHpHp T'       g   T! T 4      '       d   R# T! T \        ^T4      TR7      pTRJ;'       d/    TP                  R4      '       * ;'       d    \        T4      '       * #   \         d     R# i ; i)u©  True when *path* looks like the #68474 zeroed-state.db signature.

Only regular files qualify: probing a FIFO/device/socket could block indefinitely.

Signature: no ``SQLite format 3`` header and no data â€” either empty (size 0, the total-loss case,
#97568) or first *probe_bytes* all NUL. Used at SessionDB open and for snapshot diagnostics so a silent
all-zero file becomes a guided recovery instead of a generic failure.
F)Úhas_live_connectionÚread_header_bytes_preopen)Úlengthr  Ns   SQLite format 3)rÖ   rŽ   Úhermes_cli.sqlite_safe_readr  r  r‚   rõ   rô   )rã   r  r  r  r  Úheads   &$$   r,   Úis_zeroed_sqlite_filer  t  s‹   € ðØ�|‰|�~Š~Ùð ÷ [ßÑ(¨×.Ò.Ùá$ T´#°b¸+Ó2FÈeÔT€Dà�tÐ×YÐY D§O¡OÐ4FÓ$GÔ G×YÐYÔPSÐTXÓPYÌMÐYøô ô Úðús   ‚B
 Â
BÂBs   SQLite format 3 Úcheck_headerTÚ
run_pragmaÚ	max_bytesc          
      óT   € V ^8„  d   QhR\         R\        R\        R\        R\        /# )r&   rã   r  r  r  r(   )r   rK   r*   Údict)r+   s   "r,   r-   r-   —  s4   € ÷ /?ñ /?Ü
ð/?Ü!%ð/?Ü:>ð/?äð/?ä;?ñ/?r.   c               óœ  € R#R R llp V P                  4       pTP                  pT^d8  d   T! RT R2TR7      # T'       d[   ^ R	IHp T! T \        \        4      R
7      p	T	f   T! RTR7      # T	\        8w  d%   T! RT	R,          P                  4       : R2TR7      # T^ 8”  db   Ys8”  d\   \        T R 4      w  r¦Te5   \        T\        P                  4      '       d   RMRpT! RT RT 2TR7      # T! RTR RTR R2RTR7      # T'       d}   \        T R 4      w  rÆTe4   \        T\        P                  4      '       d   RMRpT! T RT 2TR7      # TR.8X  d   T! RRTR7      # T! RR P                  TR!,          4       2TR7      # T! R"RTR7      #   \         d    T! RT  24      u # \         d   pT! RT 24      u Rp?# Rp?ii ; i)$z Verify a SQLite database: existence + minimum size, header magic, then a read-only
``PRAGMA integrity_check`` (or a cheap structural probe above ``max_bytes``).Nc                ó^   € V ^8„  d   QhR\         R\        R\        \        ,          R\        /# )r&   ÚmessageÚvalidÚsizer(   )r6   rK   r   r*   r   )r+   s   "r,   r-   Ú-verify_sqlite_integrity.<locals>.__annotate__œ  s3   € ÷ Bñ B”sð B¤4ð B´xÄµ}ð BÔPTñ Br.   c                 ó   € R VRV RV/# )r$  r#  r%  r1   )r#  r$  r%  s   &&&r,   Ú_doneÚ&verify_sqlite_integrity.<locals>._doneœ  s   € Ø˜ 	¨7°F¸DÐAÐAr.   znot found: zcannot stat: ztoo small (z% bytes) to be a valid SQLite database)r%  )r  )r  zcannot read headerz!missing SQLite header magic (got :Né   NÚ)c                 ó~   € V P                  R 4      P                  4       V P                  R4      P                  4       3# )zPRAGMA schema_versionz"SELECT count(*) FROM sqlite_master)ÚexecuteÚfetchone)Úcs   &r,   Ú<lambda>Ú)verify_sqlite_integrity.<locals>.<lambda>³  s4   € Ø�I‰IÐ-Ó.×7Ñ7Ó9Ø�I‰IÐ:Ó;×DÑDÓFñ3Hr.   ÚfailedÚerrorzschema probe ú: zsize Ú,z bytes exceeds max_bytes z?; skipped PRAGMA integrity_check (header + schema probe passed)T)r$  r%  c                 ón   € V P                  R 4       Uu. uF  p\        V^ ,          4      NK  	  up# u upi )zPRAGMA integrity_check)r-  r6   )r/  Úrs   & r,   r0  r1  ¿  s*   € °·	±	Ð:RÔ0SÓTÑ0S¨1œS  1¥žYÑ0SÒTùÒTs   ”2zcannot open databasezintegrity check errorÚokzintegrity check passedzintegrity check failed: ú; :Né   Nzheader check passed)FN)r…   ÚFileNotFoundErrorrŽ   r†   r  r  rQ   Ú_SQLITE_HEADERÚhexr  Ú
isinstancer  ÚDatabaseErrorÚjoin)rã   r  r  r  r(  Ústr¼   r%  r  r  Ú_ÚkindÚrowss   &$$$         r,   Úverify_sqlite_integrityrE  —  s  € ÷
Bð,Ø�Y‰Y‹[ˆð
 �:‰:€DØˆc„zÙ�{ 4 &Ð(MÐNÐUYÔZÐZßõ 	JÙ(¨´c¼.Ó6IÔJˆØŠ<ÙÐ-°DÔ9Ð9Ø”>Ô!ÙÐ<¸TÀ#½Y¿]¹]»_Ñ<OÈqÐQÐX\Ô]Ð]Ø�1„}˜Ô)ô " $ñ )Hó I‰ˆð Š?Ü)¨#¬w×/DÑ/D×EÒE‘8È7ˆDÙ˜=¨¨¨b°°Ð6¸TÔBÐBÙØ�D˜�8Ð4°Y¸q°Mð BLð Là˜Tô#ð 	#÷ Ü$ØÑTóV‰	ˆàŠ?Ü-7¸¼W×=RÑ=R×-SÒ-SÑ)ÐYpˆDÙ˜D˜6  C 5Ð)°Ô5Ð5Ø�D�6Œ>ÙÐ1¸ÀDÔIÐIÙÐ/°·	±	¸$¸r½(Ó0CÐ/DÐEÈDÔQÐQÙÐ&¨d¸Ô>Ð>øôM ô +Ù�{ 4 &Ð)Ó*Ò*Üô ,Ù�} S EÐ*Ó+Õ+ûð,ús)   ŠF ÆGÆ,GÆ5GÆ6
GÇ GÇGc                óH   € V ^8„  d   QhR\         P                  R\        RR/# )r&   ÚzfÚfilelist_lenr(   N)ÚzipfileÚZipFiler*   )r+   s   "r,   r-   r-   É  s*   € ÷ Hñ H¤G§O¡Oð HÄ3ð HÈ4ñ Hr.   c                ó˜  € \        V P                  4      V8:  d   R# V P                  V,          P                  pV P                  P	                  V4       V P                  P                  4        W n        V P                  VR1 V P                  P                  4        V P                  P                  R V P                   4       4       R# )aŽ  Drop the member(s) created by a failed write, both from the central directory and the file.

ZipFile.write finalizes its destination member while unwinding a source-read
failure, so the partial bytes can otherwise become a CRC-valid archive member.
This runs immediately after that failed write, so the dropped bytes are the tail
of the file: truncate at the first dropped local header and rewind start_dir so
later members overwrite it. Leaving the bytes (with a valid local header) would
still expose a ghost member to streaming readers. Rebuilding NameToInfo from the
surviving file list also restores the previous entry when a duplicate name failed.
Nc              3   ó<   "  € T F  qP                   V3x € K  	  R # 5ir0   )Úfilename)rÎ   rî   s   & r,   rÐ   Ú._discard_failed_zip_members.<locals>.<genexpr>Ü  s   é € ÐG¹;°4Ÿ-™-¨Õ.»;ùs   ‚)
rQ   ÚfilelistÚheader_offsetrÏ   rr   ÚtruncateÚ	start_dirÚ
NameToInfoÚclearr  )rG  rH  Úoffsets   && r,   Ú_discard_failed_zip_membersrV  É  s‰   € ô ˆ2�;‰;Ó˜<Ô'ÙØ�[‰[˜Õ&×4Ñ4€FØ‡E�E‡J�JˆvÔØ‡E�E‡N�NÔØ„LØ
�‰�L‘MÐ"Ø‡M�M×ÑÔØ‡M�M×ÑÑG¸2¿;º;ÓGÖGr.   c                óT   € V ^8„  d   QhR\         P                  R\        R\        RR/# )r&   rG  rã   Úarcnamer(   N)rI  rJ  r   r6   )r+   s   "r,   r-   r-   ß  s,   € ÷ ñ œŸ™ð ¬tð ¼cð Àdñ r.   c                óŒ   € \        V P                  4      p V P                  WR7       R#   \         d    \	        Y4       h i ; i)zSWrite one member while keeping a failed partial write out of the central directory.)rX  N)rQ   rO  r‡   r¯   rV  )rG  rã   rX  rH  s   &&& r,   Ú_write_zip_filerZ  ß  s=   € ä�r—{‘{Ó#€LðØ
�‰�ˆÖ'øÜô Ü# BÔ5Øðús	   —+ «Ac                ó~   € V ^8„  d   QhR\         P                  R\        R\        R\        R\        \        ,          /# )r&   rG  Úabs_pathrI   rú   r(   )rI  rJ  r   r   r*   )r+   s   "r,   r-   r-   é  s;   € ÷ 'ñ 'œWŸ_™_ð '¼ð 'Ìð 'ÔX\ð 'ÔaiÔjmÕanñ 'r.   c                óÌ  € \         P                  ! RR\        VP                  4      R7      ;_uu_ 4       p\	        VP
                  4      pRRR4        \        VX4      '       g    VP                  RR7       R# \        W\        V4      4       VP                  4       P                  VP                  RR7       #   + '       g   i     Ly; i  XP                  RR7       i ; i)z´Add a WAL-safe snapshot of *abs_path* to *zf*; return its byte size, or None on failure.

Staged beside the output zip: /tmp may be a small tmpfs that cannot hold large databases.
ú.dbF)ÚsuffixÚdeleteÚdirNTrž   )ÚtempfileÚNamedTemporaryFiler6   r}   r   r„   r   r¤   rZ  r…   r†   )rG  r\  rI   rú   ÚtmpÚtmp_dbs   &&&&  r,   Ú_zip_sqlite_snapshotrf  é  s¥   € ô
 
×	$Ò	$¨E¸%ÄSÈÏÉÓEY×	ZÕ	ZÐ^aÜ�c—h‘h“ˆ÷ 
[ð'Ü˜X v×.Ò.Øð 	�‰ ˆÖ&ô 	˜¤C¨£MÔ2Ø�{‰{‹}×$Ñ$à�‰ ˆÕ&÷ 
[×	Zûð 	�‰ ˆÕ&ús   µB<ÁC Á;.C Â<C	ÃC#c          
      ó    € V ^8„  d   QhR\         P                  R\        \        \        \        3,          ,          R\        R\
        R\        /# )r&   rG  Úfiles_to_addrú   Útrack_bytesr(   )rI  rJ  r)   Útupler   rK   r*   )r+   s   "r,   r-   r-   ù  sF   € ÷ ñ Ü�‰ðÜ'+¬E´$¼°*Õ,=Õ'>ðÜJNðä:>ðäCFñr.   c               ó¦  € ^ p\        V^4       F’  w  pw  rš V	P                  R8X  d$   \        W	W¢4      pVf   V! V
4       K4  W{,          pM=\        W	\	        V
4      4       V'       d!   WyP                  4       P                  ,          pVR,          ^ 8X  g   KŠ  V! V4       K”  	  V#   \        \        \        3 d   pT! Y¬4        Rp?K¼  Rp?ii ; i)aC  Add every ``(abs_path, rel_path)`` to *zf*, WAL-safe for ``*.db``; return bytes archived.

``on_db_failure(rel_path)`` runs when a SQLite snapshot fails (may raise to abort);
``on_error(rel_path, exc)`` records a read failure; ``on_progress(i)`` fires every 500 files;
``track_bytes`` stats plain files for the size total.
r^  Néô  )
Ú	enumerater_  rf  rZ  r6   r…   r†   ÚPermissionErrorrŽ   r¶   )rG  rh  rú   Úon_db_failureÚon_errorÚon_progressri  Útotal_bytesÚir\  rI   r%  r¼   s   &&&$$$$      r,   Ú_write_zip_entriesrt  ù  s¼   € ð €KÜ#,¨\¸1Ö#=ÑˆÑˆHð	Ø�‰ %Ô'Ü+¨B¸(ÓM�Ø’<Ù! (Ô+ÙØÕ#‘ä ¬c°(«mÔ<ßØ§=¡=£?×#:Ñ#:Õ:�Kð ˆs�7�aŽ<Ù˜ŽNñ! $>ð" Ðøô  ¤¬*Ð5ô 	Ù�XÔ#Ýûð	ús#   ˜)B'ÁB'Á=B'Â'CÂ=CÃCc                óV   € V ^8„  d   QhR\         R\        \         ,          R\         RR/# )r&   ÚheaderÚlinesÚindentr(   N)r6   r)   )r+   s   "r,   r-   r-     s,   € ÷ 9ñ 9œ#ð 9¤d¬3¥ið 9¼ð 9Àñ 9r.   c                óÀ   € \        V 4       VR,           F  p\        V V 24       K  	  \        V4      ^
8”  d$   \        V R\        V4      ^
,
           R24       R# R# )zcPrint *header*, then at most 10 of *lines* (each prefixed by *indent*) and a "... and N more" tail.ºNé
   Nz... and ú moreN)ÚprintrQ   )rv  rw  rx  Úlines   &&& r,   Ú_print_cappedr    sX   € ä	ˆ&„MØ�c—
�
ˆÜ��˜˜ÐÖ ñ ä
ˆ5ƒz�B„Ü��˜¤ U£¨b¥Ð 1°Ð7Ö8ñ r.   zhermes-backup-c                óF   € V ^8„  d   QhR\         \        ,          R\        /# )r&   Úoutputr(   )r   r6   r   )r+   s   "r,   r-   r-   %  s   € ÷ ñ ¬´­ð ¼$ñ r.   c                ój  € Rp\          \        P                  ! 4       P                  R4       R2p V '       dG   \	        V 4      P                  4       P                  4       pVP                  4       '       d	   W,          pM\        P                  ! 4       V,          pVP                  P                  4       R8w  d#   VP                  VP                  R,           4      pVP                  P                  RRR7       V#   \         d-   p\        RT ;'       g    T RT 24       \!        ^4      ThRp?ii ; i)z—Turn ``--output`` (file, directory, or None) into a ``.zip`` path whose parent exists;
an unwritable path exits with a one-line error, not a traceback.Nú%Y-%m-%d-%H%M%Sú.zipTrf   zError: cannot write backup to r4  )Ú_RUN_BACKUP_PREFIXr   ÚnowÚstrftimer   r³   rµ   rØ   Úhomer_  ÚlowerÚwith_suffixr}   r~   rŽ   r}  Ú
SystemExit)r�  rú   Údefault_namer¼   s   &   r,   Ú_resolve_backup_output_pathr�  %  s   € ð €HÜ(Ð)¬(¯,ª,«.×*AÑ*AÐBSÓ*TÐ)UÐUYÐZ€Lð%ßÜ˜F“|×.Ñ.Ó0×8Ñ8Ó:ˆHØ�‰× Ò Ø#Õ2�øä—y’y“{ \Õ1ˆHØ�?‰?× Ñ Ó" fÔ,Ø×+Ñ+¨H¯O©O¸fÕ,DÓEˆHØ�‰×Ñ d°TÐÔ:ð €Oøô ô %ÜÐ.¨v×/AÐ/A¸Ð.BÀ"ÀSÀEÐJÔKÜ˜‹m Ð$ûð%ús   ±C; ¹C C; Ã;D2Ä'D-Ä-D2c                ó”   € V ^8„  d   QhR\         \        \         \        \        3,          ,          \        \        ,          3,          /# r4   )rj  r)   r   r6   )r+   s   "r,   r-   r-   :  s/   € ÷ -ñ -¤5¬¬e´D¼#°IÕ.>Õ)?ÄÄcÅÐ)JÕ#Kñ -r.   c            
     óH  € \         P                  ! 4       P                  4       p . p. p\        4        F¥  p VP                  4       P	                  V 4       \        T4       Fs  p\        \
        \        4      ;_uu_ 4        TP                  4       P	                  T 4      pTP                  T\        TP                  4       ,           34       RRR4       Ku  	  K§  	  W3#   \
        \        3 d    TP                  \        T4      4        KÚ  i ; i  + '       g   i     KÁ  ; i)z²``([(abs_path, arcname)], [skipped])`` for the memory provider's external state, arc-named
``_external/<home-relative>``; paths outside home are skipped (security + portability).N)r   rˆ  rµ   rÁ   r  r¶   rŽ   Úappendr6   rà   r   Ú_EXTERNAL_PREFIXÚas_posix)Úhome_dirÚexternal_to_addÚskipped_externalrÃ   r  Úrel_to_homes         r,   Ú_collect_external_entriesr—  :  sé   € ô �yŠy‹{×"Ñ"Ó$€HØ.0€OØ"$ÐÜ7Ö9ˆð	Ø�L‰L‹N×&Ñ& xÔ0ô *¨$Ö/ˆEÜœ*¤g×.Õ.Ø#Ÿm™m›o×9Ñ9¸(ÓC�Ø×&Ñ&¨Ô/?À+×BVÑBVÓBXÕ/XÐ'YÔZ÷ /Ñ.ó 0ñ :ð Ð,Ð,øô œGÐ$ô 	Ø×#Ñ#¤C¨£IÔ.Úð	ú÷ /×.Ð.ús   ¶CÁ?AD	Ã+DÄDÄD!c                ó$   € V ^8„  d   QhR\         /# r4   )rK   )r+   s   "r,   r-   r-   M  s   € ÷ %ñ %œñ %r.   c                ó`  € \        4       pVP                  4       '       g%   \        RV 24       \        P                  ! ^4        \        V4      ;_uu_ 4        \        W4      uuRRR4       #   + '       g   i     R# ; i  \         d    p\        RT 24       \        ^4      ThRp?ii ; i)uŸ  Create a zip backup of the Hermes home directory.

True when every selected file landed in the archive (or there was nothing to back up); False
when the zip was written but is incomplete â€” it is kept so the rest can still be restored, and
the caller turns False into exit status 1 so a cron/systemd timer never publishes a "successful"
archive that is missing state.db. Hard failures keep raising ``SystemExit``.
z*Error: Hermes home directory not found at NúError: )	r   rØ   r}  ÚsysÚexitr–   Ú_run_backup_lockedrW   r‹  )Úargsrù   r¼   s   &  r,   Ú
run_backuprŸ  M  s†   € ô *Ó+€Kà×Ñ×ÒÜÐ:¸;¸-ÐHÔIÜ�Š�Œð%Ü# K×0Õ0Ü% dÓ8÷ 1×0×0Ó0ûä ô %Ü�˜�uˆoÔÜ˜‹m Ð$ûð%ús6   ÁB ÁA/Á$
B Á/B 	Á:B Â B ÂB-ÂB(Â(B-c                ó0   € V ^8„  d   QhR\         R\        /# )r&   rù   r(   rJ   )r+   s   "r,   r-   r-   c  s   € ÷ Cñ C¬$ð C´4ñ Cr.   c                ó	  aa€ \        V P                  4      p\        P                  ! 4       p\        P                  R4       \        R\        4        R24       \        4       p\        \        WV4      4      p\        4       w  rgV'       gM   V'       gE   \        P                  R\        P                  ! 4       V,
          R,          4       \        R4       R# \        V4      \        V4      ,           o\        P                  R\        P                  ! 4       V,
          R,          S4       \        P                  R	S4       \        R
S R24       . o\        P                  ! 4       pR V3R llp	\        V4      ;_uu_ 4       p
\        P                  ! V
R\        P                   ^R7      ;_uu_ 4       p\#        WµW)RV3R lV3R lR7      pV F2  w  rÞ \%        W½V4       WÍP'                  4       P(                  ,          pK4  	  RRR4       RRR4       \        P                  ! 4       V,
          pVP'                  4       P(                  p\        P                  RVR,          S\        S4      V4       \        RS'       d   RMR RV RS R\3        X4       R\3        V4       RVR R24       V'       d$   \        R\        V4       R \        4        R!24       V'       dF   \        R"\        V4       R#2R$P5                  R% \7        V4      R&,           4       4      ,           4       V'       d2   \        R'R$P5                  R( \7        V4       4       4      ,           4       S'       d   \9        R)\        S4       R*2SR+4       M\        R,VP:                   24       \=        V R-^ 4      pV'       dk   S'       gc   VP:                  P?                  \@        4      '       d>   \C        VPD                  \@        VR.4      pV'       d   \        R/V R0\@         R1V R224       S'       * #   \*        \,        \.        3 d#   pSP1                  T RT 24        Rp?EK…  Rp?ii ; i  + '       g   i     EL`; i  + '       g   i     ELl; i)3z@Write a full backup while the cross-process backup slot is held.z backup phase=scan status=startedz	Scanning z ...z/backup phase=scan status=empty duration_ms=%.1féè  zNo files to back up.Tz;backup phase=scan status=complete duration_ms=%.1f files=%dz,backup phase=archive status=started files=%dzBacking up ú
 files ...c                ó(   € V ^8„  d   QhR\         RR/# )r&   rs  r(   Nrn   )r+   s   "r,   r-   Ú(_run_backup_locked.<locals>.__annotate__y  s   € ÷ añ a”Sð a˜Tñ ar.   c                 óZ   <€ \        R V  RS R24       \        P                  RV S4       R# )ú  Ú/r£  z:backup phase=archive status=progress completed=%d total=%dN)r}  r±   rî   )rs  Ú
file_counts   &€r,   Ú	_progressÚ%_run_backup_locked.<locals>._progressy  s-   ø€ Ü��1�#�Q�z�l *Ð-Ô.Ü�‰ÐPÐRSÐU_Ö`r.   Úw©Úcompresslevelc                 ó,   <€ SP                  V  R 24      # )z: SQLite safe copy failed©r�  )r  Úerrorss   &€r,   r0  Ú$_run_backup_locked.<locals>.<lambda>�  s   ø€  f§m¡m°s°eÐ;TÐ4UÔ&Vr.   c                 ó0   <€ SP                  V  R V 24      # ©r4  r°  ©r  r¼   r±  s   &&€r,   r0  r²  ‚  s   ø€  f§m¡m°s°e¸2¸c¸U°OÔ&Dr.   )rq  ri  ro  rp  r4  NzQbackup phase=archive status=complete duration_ms=%.1f files=%d errors=%d bytes=%dz
Backup Ú
incompleteÚcompletez
  Files:       z
  Original:    z
  Compressed:  z
  Time:        ú.1fÚsz
  Included z( memory-provider file(s) stored outside r›   z
  Skipped zE memory-provider path(s) outside your home directory (not portable):
Ú
c              3   ó,   "  € T F
  pR V 2x € K  	  R# 5i)ú    Nr1   )rÎ   r¿   s   & r,   rÐ   Ú%_run_backup_locked.<locals>.<genexpr>˜  s   é € Ð-`ÑB_¸Q°°Q°C­jÓB_ùs   ‚rz  z
  Excluded directories:
c              3   ó.   "  € T F  pR V R2x € K  	  R# 5i)r¼  r¨  Nr1   ©rÎ   rß   s   & r,   rÐ   r½  š  s   é € Ð7bÑMaÈ¸$¸q¸cÀ½ÓMaùs   ‚z
  Archive kept, but z file(s) could not be added:r§  z
Restore with: hermes import ÚkeepÚbackupz	  Pruned z older z*.zip (keeping z).)#r�  r�  r€   r�   r±   rî   r}  r   rü   r)   r  r—  rQ   r©   rI  rJ  ÚZIP_DEFLATEDrt  rZ  r…   r†   rn  rŽ   r¶   r�  Ú_format_sizer@  Úsortedr  r„   rì   rõ   r…  Ú_prune_prefixed_zipsr}   )rž  rù   rú   Úscan_startedrû   rh  r”  r•  Út0rª  Úarchive_pathrG  rr  r\  rX  r¼   ÚelapsedÚzip_sizerÀ  Úprunedr±  r©  s   &&                  @@r,   r�  r�  c  s·  ù€ ä*¨4¯;©;Ó7€HÜ—>’>Ó#€LÜ
‡K�KÐ2Ô3Ü	ˆIÔ)Ó+Ð,¨DÐ
1Ô2Ü›€LÜ,0Ô1CÀKÐ[gÓ1hÓ,i€LÜ(AÓ(CÑ%€Oß§Ü�‰ÐEÌÏÊÓHXÐ[gÕHgÐkoÕGoÔpÜÐ$Ô%Ùä�\Ó"¤S¨Ó%9Õ9€JÜ
‡K�KÐMÜ—’Ó! LÕ0°DÕ8¸*ôFä
‡K�KÐ>À
ÔKÜ	ˆK˜
�| :Ð
.Ô/Ø€FÜ	�ŠÓ	€B÷að aô 
˜X×	&Ô	&¨,¼¿ºØ˜#œw×3Ñ3À1÷9Fõ 9FØIKÜ(Ø˜hÈ4ÜVÜDôFˆó "1ÑˆHð3Ü ¨gÔ6ØŸ}™}›×6Ñ6Õ6’ñ "1÷9F×	&ô �nŠnÓ Õ#€GØ�}‰}‹×&Ñ&€HÜ
‡K�KÐcØ˜$• 
¬C°«K¸ôCä	ˆI§f‘l°*Ð=¸RÀ¸zð JØ&˜<ð (Ü(¨Ó5Ð6ð 7Ü(¨Ó2Ð3ð 4Ø# C˜=¨ð	+ô ,÷
 Ü�œc /Ó2Ð3Ð3[Ô\oÓ\qÐ[rÐrsÐtÔußÜ�œSÐ!1Ó2Ð3ð 4"ð "Ø$(§I¡IÑ-`Ä&ÐIYÓBZÐ[^ÖB_Ó-`Ó$`õaô 	bçÜÐ+¨d¯i©iÑ7bÌVÐT`ÔMaÓ7bÓ.bÕbÔcßÜÐ.¬s°6«{¨mÐ;WÐXÐZ`ÐbfÕgäÐ.¨x¯}©}¨oÐ>Ô?ô �4˜ Ó#€Dß—F˜xŸ}™}×7Ñ7Ô8J×KÒKÜ% h§o¡oÔ7IÈ4ÐQYÓZˆßÜ�I˜f˜X WÔ-?Ð,@ÀÐPTÈvÐUWÐXÔYØŒ:Ðøô; $¤W¬jÐ9ô 3Ø—‘  	¨¨C¨5Ð1×2Ó2ûð3ú÷9F÷ 9Fð 9Fú×	&×	&Ð	&úsN   Æ1Q0Æ4 Q	Ç,P!
ÈQ	ÈQ0Ð!QÐ7QÑQ	ÑQÑQ	ÑQ-Ñ'	Q0Ñ0R	c                ó|   € V ^8„  d   QhR\         P                  R\        \        ,          R\        \        ,          /# )r&   rG  Úmembersr(   )rI  rJ  r)   r6   )r+   s   "r,   r-   r-   «  s-   € ÷ ñ œgŸo™oð ¼¼S½	ð ÄdÌ3Åiñ r.   c                ó,  € . pV F@  p V P                  V4      ;_uu_ 4       pVP                  R4      '       d   K   RRR4       KB  	  V#   + '       g   i     KW  ; i  \        .\        O5 d"   pTP	                  T RT 24        Rp?K‰  Rp?ii ; i)a  Return ``"<member>: <error>"`` for every member whose data does not decompress or
fails its CRC, streaming each one in 1 MiB chunks so a multi-GB ``state.db`` is never
held in memory.

``is_zipfile()``/``namelist()`` only read the central directory, so an archive with a
rotten member passes them and the damage surfaces as ``zlib.error``/``BadZipFile`` in
the middle of the restore, after earlier members already replaced the user's files
(#121258). Not ``zf.testzip()``: it lets ``zlib.error`` escape and names at most the
first bad member.
Nr4  i   )r   ÚreadrŽ   Ú_ZIP_MEMBER_READ_ERRORSr�  )rG  rÍ  ÚbadÚmemberÚsrcr¼   s   &&    r,   Ú_find_corrupt_membersrÔ  «  sŠ   € ð €CÛˆð	+Ø—‘˜—” CØ—h‘h˜w×'Ò'Ùð (÷ !‘ñ ð €J÷ !—�ûô Ð2Ô1Ñ2ô 	+Ø�J‰J˜&˜  C 5Ð)×*Ò*ûð	+ús3   ‰A¢A½AÁAÁAÁAÁBÁ2BÂBc                ó0   € V ^8„  d   QhR\         R\        /# )r&   r  r(   )r6   rK   )r+   s   "r,   r-   r-   Á  s   € ÷ 4ñ 4œð 4¤ñ 4r.   c                óÞ   €  \        \        V 4      4      pTR,          \        9   ;'       g0    \	        T4      \
        9   ;'       g    T P                  \        4      #   \         d     R# i ; i)aj  True for a HERMES_HOME-relative member the import deliberately does not restore: runtime
state (``_IMPORT_SKIP_NAMES``), PM-local interpreter/dependency roots, or an archived SQLite
WAL/SHM/journal. A ``.db`` member is page-restored into the live file, and a sidecar from a
different image would replay a foreign WAL on next open (older archives may ship these).Féÿÿÿÿ)rj  r   r¶   Ú_IMPORT_SKIP_NAMESr   r   rÌ   Ú_SQLITE_SIDECAR_SUFFIXES)r  rN   s   & r,   Ú_import_skippedrÚ  Á  sn   € ð
ÜÔ-¨cÓ2Ó3ˆð �"�IÔ+Ñ+÷ 3ð 3Ü˜uÓ%Ô)=Ñ=÷3ð 3à�L‰LÔ1Ó2ð4øô ô Úðús   ‚A ÁA,Á+A,c                ó^   € V ^8„  d   QhR\         R\         R\        \         \        3,          /# )r&   rÒ  Úprefixr(   )r6   rj  rK   )r+   s   "r,   r-   r-   Ï  s*   € ÷ 	%ñ 	%œsð 	%¬Cð 	%´E¼#¼t¸)Õ4Dñ 	%r.   c                óØ   € V P                  \        4      '       d   V \        \        4      R R3# V'       d&   V P                  V4      '       d   V \        V4      R MT pV\        V4      3# )aO  Classify an archive member exactly as the restore does: return ``(rel, skipped)``.

``_external/`` members are home-relative and never skipped; every other member is
HERMES_HOME-relative after stripping the archive ``prefix``. Shared by the integrity
pre-flight and ``_import_members`` so the two cannot disagree on what gets restored.NF)rõ   r‘  rQ   rÚ  )rÒ  rÜ  r  s   && r,   Ú_import_member_relrÞ  Ï  sc   € ð ×ÑÔ)×*Ò*Ø”cÔ*Ó+Ð,Ð-¨uÐ4Ð4ß"(¨V×->Ñ->¸v×-FÒ-Fˆ&”�V“�Ñ
ÈF€CØ” Ó$Ð$Ð$r.   c                ó:   € V ^8„  d   QhR\         \        ,          /# r4   )r   r*   )r+   s   "r,   r-   r-   Û  s   € ÷ @Dñ @Dœ¤�ñ @Dr.   c                óì  a3€ \        V P                  4      P                  4       P                  4       pVP	                  4       '       g%   \        RV 24       \        P                  ! ^4       \        P                  ! V4      '       g%   \        RV 24       \        P                  ! ^4       \        4       p\        P                  ! VR4      ;_uu_ 4       p\        V4      w  rEV'       g%   \        RV 24       \        P                  ! ^4       \        V4      pVP                  4        Uu. uF  qwP                  R4      '       d   K  VNK  	  pp\        V4      p	\        RV	 R24       \        R\!        4        24       V'       d   \        R	V: R
24       VR,          P#                  4       p
VR,          P#                  4       pV
'       g	   V'       d‚   V P$                  '       gp   \        4        \        R4       \        R4       \        4         \'        R4      P)                  4       P+                  4       pXRW9  d   \        R4        RRR4       R# \        R4       \1        Y8 Uu. uF  p\3        WÖ4      ^,          '       d   K  VNK!  	  up4      pV'       d&   \5        R\        V4       R2VR4        RRR4       ^# \        RV	 R24       VP7                  RRR7       . p^ p^ p. p. p\         P8                  ! 4       P                  4       p\;        4       p\<        P>                  ! 4       pV EF  pVPA                  \B        4      '       då   V\        \B        4      R pV'       g   K;  VV,          p VP                  4       PE                  V4        TPJ                  P7                  RRR7       \M        TTTT4       TPN                  RX9   g   TPP                  \R        9   d    \T        PV                  ! TR4       T^,          pT^,          pTR,          ^ 8X  d   \        RT RT	 R24       EK  V'       d'   VPA                  V4      '       d   V\        V4      R pMTpV'       g   EK>   \]        \_        V4      4      pTRY,          \`        9   d   TPI                  T4       EKy  \c        T4      \d        9   d   TPI                  T4       EK¡  TP                  \f        4      '       d   TPI                  T4       EKÐ  TPh                  ! T!  p TP                  4       PE                  TP                  4       4        TPJ                  P7                  RRR7       TPN                  R8X  d_   \k        T4      p\m        TTTT4       \k        T4      pT'       d2   T'       d*   T^,          T^,          8  d   TPI                  TTT34       M\M        TTTT4       TPP                  \R        9   d   \T        PV                  ! TR4       T^,          pTR,          ^ 8X  g   EKï  \        RT RT	 R24       EK  	  \<        P>                  ! 4       V,
          p\        4        \        R V'       d   R!MR" RV R#VR$ R%24       \        R&\!        4        24       V'       d   \        R'V R(\!        4        R)24       V'       dc   \        R*\        V4       R+24       VR,,           F  p \        V 4       K  	  \        V4      ^
8”  d    \        R-\        V4      ^
,
           R.24       V'       de   \        R/4       V F=  w  ppp\        R0V RV^ ,           R1V^,           R2V^ ,           R3V^,           2
4       K?  	  \        R4\o        4        24       V'       do   \        R5\        V4       R624       \q        V4      R,,           F  p\        R0V 24       K  	  \        V4      ^
8”  d    \        R7\        V4      ^
,
           R.24       VR8,          p!. p"V!Ps                  4       '       Ed¨    ^ R9I:H;p#H<p$H=p%H>p& \q        V!P                  4       4       F¶  p'V'Ps                  4       '       g   K  V'PP                  p(V'R,          P#                  4       '       g    V'R,          P#                  4       '       g   Kc  V$! V(4      p)V)'       d'   \        R:V( R;V) 24       V"PI                  V(R<34       K™  V#! V(4      p*V"PI                  V(V*RJ34       K¸  	  V"'       dÀ   V" UUu. uF  w  rtV'       g   K  VNK  	  p+ppV" UUu. uF  w  rtV'       d   K  VNK  	  p,ppV+'       d   \        R=R>P�                  V+4       24       V,'       d   \        R?R>P�                  V,4       24       V%! 4       '       g+   \        R@V&! 4        RA24       \        RB4       \        RC4       \        4        VRF,          Ps                  4       '       g   \        RG4       \        RH4       V"'       d:   V" UU-u. uF  w  pp-VNK
  	  p.pp-\        RI4       V. F  p/\        RJV/ RK24       K  	  \‡        4       o3\„        ;QJ d    V33RL lRZ 4       F  '       g   K   RM	  R<M! V33RL lRZ 4       4      p0VS38w  d$   V0'       d   \        RMS3 R)24       \        RN4       M) ^ ROIDHEp1HFp2 V2! 4       '       g   \        4        V1! RPRQ7       V'       d$   \        RT\        V4       RU24        RRR4       ^# \        RV4       RRR4       R# u upi   \,        \.        3 d&    \        R4       \        P                  ! ^4        E	L"i ; iu upi   \F         d    TPI                  RT R24        EKU  i ; i  \X         d     EL™i ; i  \X        .\Z        O5 d#   pTPI                  RT RT 24        Rp?EL»Rp?ii ; i  \F         d    TPI                  RT R24        EKÇ  i ; i  \F         d    TPI                  RT R24        EKï  i ; i  \X        .\Z        O5 d#   pTPI                  RT RT 24        Rp?ELERp?ii ; iu uppi u uppi   \‚         d:    \…        T!P                  4       4      '       d   \        RD4       \        RE4        ELái ; iu up-pi   \Ž         d    \        RR4       \        RS4        ELúi ; i  + '       g   i     R# ; i)[zMRestore a Hermes backup; return 1 on damaged archives or incomplete restores.zError: File not found: zError: Not a valid zip file: r7  rš  r¨  zBackup contains z fileszTarget: zDetected archive prefix: z (will be stripped)úconfig.yamlú.envz;Warning: Target directory already has Hermes configuration.z=Importing will overwrite existing files with backup contents.zContinue? [y/N] z	
Aborted.zAborted.Nz
Checking archive integrity ...z"Error: backup archive is damaged (zG member(s) fail to decompress or fail their CRC); nothing was restored:r§  z
Importing r£  Trf   z: path traversal blockedé€  r4  rl  r^  zImport r¶  r·  z files restored in r¸  r¹  z
  Target: z
  Restored z? memory-provider file(s) to their original location(s) outside r›   z
  Warnings (z files skipped):rz  z
  ... and r|  u6   
  âš  Session data replaced by older backup contents:r¼  z session(s) / z message(s) -> z / z?    Anything recorded after the backup was taken is not in it. z
  Preserved z? runtime state file(s) (kept this machine's, not the backup's):z    ... and rM   )Úcreate_wrapper_scriptÚcheck_alias_collisionÚ_is_wrapper_dir_in_pathÚ_get_wrapper_dirz  Skipped alias 'z': Fz
  Profile aliases restored: ú, z  Profile aliases skipped:  z	
  Note: z is not in your PATH.z3  Add to your shell config (~/.bashrc or ~/.zshrc):z(    export PATH="$HOME/.local/bin:$PATH"z6
  Profiles detected but aliases could not be created.z5  Run: hermes profile list  (after installing hermes)r9   z?Note: The hermes-agent codebase was not included in the backup.z0  If this is a fresh install, run: hermes updatez,
To re-enable gateway services for profiles:z  hermes -p z gateway installc              3   óR   <"  € T F  pSV,          P                  4       x € K  	  R # 5ir0   )r´   )rÎ   ÚmarkerÚnative_defaults   & €r,   rÐ   Úrun_import.<locals>.<genexpr>ü  s)   øé € ð "
á=�ð ˜fÕ$×,Ñ,×.Ð.Û=ùs   ƒ$'zk
Restored into a non-default home; leaving the gateway service alone to avoid clashing with the install at z>To start a gateway for this home, run:  hermes gateway install)Úensure_gateway_serviceÚ_is_service_runningÚimport)Úcontextz7
Start the gateway to activate cron jobs and messaging:z  hermes gateway installzImport incomplete: zU file(s) were not restored (see Warnings above). Fix the cause and re-run the import.z2Done. Your Hermes configuration has been restored.>   ÚyÚyes>   râ  ú.confú.jsonr×  )rá  râ  rU   )Hr   rI  r³   rµ   rÖ   r}  r›  rœ  Ú
is_zipfiler   rJ  r$   r   ÚnamelistrÌ   rQ   r   r´   r  ÚinputÚstripr‰  ÚEOFErrorÚKeyboardInterruptrÔ  rÞ  r  r~   rˆ  r   r€   r�   rõ   r‘  r  r¶   r�  r}   r    r_  r„   Ú_SECRET_FILE_NAMESrƒ   ÚchmodrŽ   rÐ  rj  r   rØ  r   r   rÙ  Újoinpathr   r!   r8   rÄ  rØ   Úhermes_cli.profilesrä  rå  ræ  rç  Úiterdirr@  ÚImportErrorrô   r   Úhermes_cli.gatewayrí  rî  r¯   )4rž  Úzip_pathrù   rG  r8  ÚreasonrÜ  ÚnrÍ  r©  Ú
has_configÚhas_envÚanswerÚmÚcorruptr±  ÚrestoredÚrestored_externalÚskipped_runtimeÚ	db_shrunkr“  Únew_file_moderÇ  rÒ  Úext_relÚtargetr¼   r  rN   ÚbeforeÚafterrÉ  ÚeÚprofiles_dirÚrestored_profilesrä  rå  ræ  rç  ÚentryÚprofile_nameÚ	collisionÚwrapperÚcreatedÚskippedrB  Úgw_profilesÚpnameÚdefault_has_installrí  rî  rë  s4   &                                                  @r,   Ú
run_importr  Û  sw  ø€ ä�D—L‘LÓ!×,Ñ,Ó.×6Ñ6Ó8€Hà×Ñ×ÒÜÐ'¨ zÐ2Ô3Ü�Š�Œä×Ò˜h×'Ò'ÜÐ-¨h¨ZÐ8Ô9Ü�Š�Œô "Ó#€Kä	�Š˜ 3×	'Ô	'¨2ä)¨"Ó-‰
ˆßÜ�G˜F˜8Ð$Ô%Ü�HŠH�QŒKä Ó#ˆØ Ÿk™kœmÓC™m˜·:±:¸c·?—1�1™mˆÐCÜ˜“\ˆ
äÐ   ¨FÐ3Ô4Ü�Ô,Ó.Ð/Ð0Ô1çÜÐ-¨f©ZÐ7JÐKÔLð " MÕ1×9Ñ9Ó;ˆ
Ø Õ'×/Ñ/Ó1ˆçŸ'¨4¯:¯:¨:ÜŒGÜÐOÔPÜÐQÔRÜŒGðÜÐ1Ó2×8Ñ8Ó:×@Ñ@ÓB�ð ˜\Ô)Ü�jÔ!Ø÷C 
(Ñ	'ôJ 	Ð0Ô1Ü'¨¸Ó,h¹°1ÔGYÐZ[ÓGdÐef×GgÑGg¯Q¨Q¹Ñ,hÓiˆßÜÐ>¼sÀ7»|¸nð MQð RØSZÐ\`ôbà÷U 
(Ñ	'ôZ 	�˜Z˜L¨
Ð3Ô4Ø×Ñ $°ÐÔ6àˆØˆØÐØ%'ˆð IKˆ	Ü—9’9“;×&Ñ&Ó(ˆô /Ó0ˆÜ�^Š^ÓˆäˆFð × Ñ Ô!1×2Ò2Ø ¤Ô%5Ó!6Ð!7Ð8�ßÙØ! GÕ+�ðØ—N‘NÓ$×0Ñ0°Ô:ð8Ø—M‘M×'Ñ'°¸tÐ'ÔDÜ.¨r°6¸6À=ÔQà—}‘}Ð(BÔBÀfÇkÁkÔUgÔFgð!ÜŸHšH V¨UÔ3ð  •M�HØ%¨Õ*Ð%ð ˜c•> QÔ&Ü˜B˜x˜j¨¨*¨°ZÐ@ÔAÚ÷ ˜&×+Ñ+¨F×3Ò3ØœS ›[˜\Ð*‘à�çÚðÜÔ5°cÓ:Ó;�ð �R�yÔ.Ô.Ø×&Ñ& sÔ+Úô " %Ó(Ô,@Ô@Ø×&Ñ& sÔ+Úð �|‰|Ô4×5Ò5Ø×&Ñ& sÔ+Úà ×)Ò)¨5Ñ1ˆFðØ—‘Ó ×,Ñ,¨[×-@Ñ-@Ó-BÔCð
1Ø—‘×#Ñ#¨D¸4Ð#Ô@Ø—=‘= EÔ)ô 1°Ó8�FÜ% b¨&°&¸-ÔHÜ/°Ó7�Eß§%¨E°!­H°v¸aµyÔ,@Ø!×(Ñ(¨#¨v°uÐ)=Ô>øä.¨r°6¸6À=ÔQØ—;‘;Ô"4Ô4Ü—H’H˜V UÔ+Ø˜A•�ð ˜#�~ ×"Ü˜˜8˜* A j \°Ð<×=ñK ôN —.’.Ó" RÕ'ˆô 	ŒÜ�¯™°JÐ?¸rÀ(ÀÐK^Ð_fÐgjÐ^kÐklÐmÔnÜ�
Ô.Ó0Ð1Ð2Ô3çÜØÐ 1Ð2ð 36Ü6IÓ6KÐ5LÈAðOô÷
 Ü�N¤3 v£; -Ð/?Ð@ÔAØ˜C—[�[�Ü�a–ñ !ä�6‹{˜RÔÜ˜
¤3 v£;°Õ#3Ð"4°EÐ:Ô;çô ÐKÔLÛ&/Ñ"��V˜UÜØ˜3˜%˜r &¨¥) ¨N¸6À!½9¸+ð FØ  �8˜* C¨¨a­ zð3öñ '0ô
 ØQÜ*Ó,Ð-ð/ô÷
 ÜØ ¤ _Ó!5Ð 6ð 7Cð Dôô ˜oÓ.¨s×3Ð3�Ü˜˜S˜E�lÖ#ñ 4ä�?Ó# bÔ(Ü˜¤S¨Ó%9¸BÕ%>Ð$?¸uÐEÔFð # ZÕ/ˆØÐØ×Ñ× Ó ð#S÷ó ô $ L×$8Ñ$8Ó$:Ö;�EØ Ÿ<™<Ÿ>š>Ù Ø#(§:¡:�Là! MÕ1×9Ñ9×;Ò;ÀUÈVÅ^×D[ÑD[×D]ÒD]Ù Ù 5°lÓ C�Iß ÜÐ 1°,°¸sÀ9À+ÐNÔOØ)×0Ñ0°,ÀÐ1FÖGá"7¸Ó"E˜Ø)×0Ñ0°,ÀÈtÐ@SÐ1TÖUñ <÷ %Ù.?ÔFÑ.?¡U QÄ2Ÿq˜qÑ.?�GÑFÙ.?ÔJÑ.?¡U QÄrŸq˜qÑ.?�GÑJßÜÐ >¸t¿y¹yÈÓ?QÐ>RÐSÔTßÜÐ <¸T¿Y¹YÀwÓ=OÐ<PÐQÔRÙ2×4Ò4Ü 
Ñ+;Ó+=Ð*>Ð>SÐTÔUÜÐSÔTÜÐHÔIô 	ŒØ˜nÕ,×4Ñ4×6Ò6ÜÐSÔTÜÐDÔEçÙ):Ô;Ñ):¡  A›1Ñ):ˆKÑ;ÜÐAÔBÛ$�Ü˜ U GÐ+;Ð<Ö=ñ %ô ;Ó<ˆß!›cô "
á=ó"
ŸcŸcšcô "
á=ó"
ó 
Ðð ˜.Ô(×-@Üð?à!Ð" !ð%ôô
 ÐRÕSð2ßZá*×,Ò,Ü”GÙ*°8Õ<÷
 ÜÐ'¬¨F« }ð 59ð 9ô :à÷Y	 
(Ñ	'ôZ	 	ÐBÔC÷[	 
(Ñ	'ùò Døô( Ô/Ð0ô Ü�lÔ#Ü—’˜—ðüò -iøôH "ô Ø—M‘M B v hÐ.FÐ"GÔHÛðûô  'ô !Ú ð!ûô  Ð:Ô"9Ñ:ô 8Ø—M‘M B v h¨b°°Ð"6×7Ò7ûð8ûô" ô Ø—‘  3 %Ð'?Ð@ÔAÛðûôF ô Ø—‘  3 %Ð'?Ð@ÔAÛðûô& Ð6Ô5Ñ6ô 1Ø—‘  3 % r¨#¨Ð/×0Ò0ûð1üóX GùÛJøô ô Sä�|×+Ñ+Ó-×.Ò.ÜÐSÔTÜÐQÔRúð	Süó <øôF ô 2ÜÐPÔQÜÐ0×1ð2ú÷K	 
(×	'Ð	'úsb  ÃAs"Ä-l$Å
l$ÅA?s"Çs"Çs"Ç**s"È'l)È<s"És"É-m"Êm"Ês"Ê!s"ËB4s"Í;m'ÎAn!Ï-nÐn!Ð*s"Ñs"Ñs"Ñ1s"Ñ5oÒ	A(s"Ó2$s"Ô-pÕA!p)Ö'A-p)Øs"Ø%Bs"ÛA)s"Ü,A+s"ÞBs"à)A(q-âq-â/q-ãAq-äq-äq!
ä&q!
ä,q-ä4q'
åq'
å/q-å;)q-æ%*q-çAs"ès"èr4
è'As"é9&s"ê s"ê<r:ër:ë$s"ë,s"ìs"ì$s"ì)2mís"ímís"í' n	îs"în	îs"în	în!în	în!î!o	î4o	ïs"ïo	ïs"ï o>	ï9s"ï=o>	ï>s"ð p&	ð!s"ð%p&	ð&s"ð)q	ð<q	ñs"ñq	ñs"ñ!q-ñ-A r1ò-s"ò0r1ò1	s"ò:!sós"ósós"ó"s3	úcron/jobs.jsonc                óF   € V ^8„  d   QhR\         \        ,          R\        /# )r&   ra   r(   ©r   r   )r+   s   "r,   r-   r-   :  s   € ÷ 'ñ '¤h¬t¥nð 'Äñ 'r.   c                 óD   € T ;'       g    \        4       pV\        ,          # r0   )r   Ú_QUICK_SNAPSHOTS_DIR)ra   rˆ  s   & r,   Ú_quick_snapshot_rootr%  :  s   € Ø×+Ð+œ/Ó+€DØÔ&Õ&Ð&r.   c                óF   € V ^8„  d   QhR\         R\        \         ,          /# )r&   Úrootr(   rÄ   )r+   s   "r,   r-   r-   ?  s"   € ÷ Zñ Zœð Z¬T´$­Zñ Zr.   c                ó~   € V P                  4       '       g   . # \        \        WP                  4       4      R RR7      # )z^Entries of *root* passing ``keep_entry``, newest (by name) first; ``[]`` if *root* is missing.c                 ó   € V P                   # r0   ©r„   )r¿   s   &r,   r0  Ú_newest_first.<locals>.<lambda>C  s   € ÀAÇFÂFr.   T©ÚkeyÚreverse)r´   rÄ  Úfilterrÿ  )r'  Ú
keep_entrys   &&r,   Ú_newest_firstr1  ?  s.   € à�;‰;�=Š=Øˆ	Ü”&˜§\¡\£^Ó4Ñ:JÐTXÔYÐYr.   c                ó^   € V ^8„  d   QhR\         \        ,          R\        R\        R\        /# )r&   Únewest_firstrÀ  Úwhatr(   )r)   r   r*   r6   )r+   s   "r,   r-   r-   R  s,   € ÷ 	ñ 	¤¤T¥
ð 	´#ð 	ÄSð 	ÌSñ 	r.   c                ó¸   € ^ pWR  F  p V! V4       V^,          pK  	  V#   \          d-   p\        P                  RY5P                  T4        Rp?KM  Rp?ii ; i)zN``remove(path)`` every entry past the first *keep*; return how many succeeded.NzFailed to prune %s %s: %s)rŽ   r±   r²   r„   )r3  rÀ  Úremover4  Údeletedr¿   r¼   s   &&&&   r,   Ú_prune_oldestr8  R  s_   € à€GØ˜%Ó ˆð	KÙ�1ŒIØ�q�LŠGñ !ð €Nøô ô 	KÜ�N‰NÐ6¸¿f¹fÀc×JÒJûð	Kús   ‹"¢A­!AÁAzpre-update-zpre-migration-z.incomplete.zipc          
      óT   € V ^8„  d   QhR\         R\        R\        R\        R\        /# )r&   Ú
backup_dirrÜ  rÀ  r4  r(   ©r   r6   r*   )r+   s   "r,   r-   r-   h  s0   € ÷ ;ñ ;¤Tð ;´3ð ;¼cð ;Ìð ;ÔQTñ ;r.   c                óZ   a€ \        V V3R l4      p\        WB\        P                  V4      # )z®Remove oldest ``<prefix>*.zip`` in *backup_dir* beyond *keep*; return count deleted.

Only prefix-matched files are touched, so hand-made zips or other backup kinds survive.
c                 ó(  <€ V P                  4       ;'       d{    V P                  P                  S4      ;'       dX    V P                  P	                  4       R 8H  ;'       d3    V P                  P	                  4       P                  \        4      '       * # )r„  )rÖ   r„   rõ   r_  r‰  rÌ   Ú_INCOMPLETE_ZIP_SUFFIX©r¿   rÜ  s   &€r,   r0  Ú&_prune_prefixed_zips.<locals>.<lambda>m  sv   ø€ °!·)±)³+÷ 3Tð 3TÀ!Ç&Á&×BSÑBSÐTZÓB[÷ 3Tð 3TØ !§¡§¡Ó 0°FÑ :÷3Tð 3Tà$%§F¡F§L¡L£N×$;Ñ$;Ô<RÓ$SÔ Sð3Tr.   ©r1  r8  r   r¤   )r:  rÜ  rÀ  r4  r<   s   &f&& r,   rÅ  rÅ  h  s-   ø€ ô
 ˜Jô )Tó U€Gô ˜¬¯©°TÓ:Ð:r.   c                óH   € V ^8„  d   QhR\         R\        R\        R\        /# )r&   r:  rÜ  r4  r(   r;  )r+   s   "r,   r-   r-   s  s.   € ÷ Hñ H¤tð H´Sð HÄð HÌñ Hr.   c                ób   a€ \        V V3R l4      p\        V^\        P                  RV 24      # )zÐKeep only the newest ``<prefix>*.incomplete.zip`` salvage archive; return count deleted.

Salvage archives never count toward normal retention, so repeated failing runs would
otherwise pile up without bound.
c                 óÔ   <€ V P                  4       ;'       dQ    V P                  P                  S4      ;'       d.    V P                  P                  4       P	                  \
        4      # r0   )rÖ   r„   rõ   r‰  rÌ   r>  r?  s   &€r,   r0  Ú(_prune_incomplete_zips.<locals>.<lambda>y  sT   ø€ °!·)±)³+÷ 3Pð 3PÀ!Ç&Á&×BSÑBSÐTZÓB[÷ 3Pð 3PØ !§¡§¡£× 7Ñ 7Ô8NÓ Oð3Pr.   zincomplete rA  )r:  rÜ  r4  Úsalvages   &f& r,   Ú_prune_incomplete_zipsrG  s  s4   ø€ ô ˜Jô )Pó Q€Gä˜ !¤T§[¡[°KÀ¸vÐ2FÓGÐGr.   c                óŒ   € V ^8„  d   QhR\         \        ,          R\        R\        R\        R\        R\         \        ,          /# )r&   ra   rÜ  rÀ  r4  Ú
prune_whatr(   )r   r   r6   r*   )r+   s   "r,   r-   r-   ~  sF   € ÷ ñ Üœ$•ðÜ),ðÜ47ðÜ?BðÜPSðÜX`ÔaeÕXfñr.   c                ó¬  € T ;'       g    \        4       pVP                  4       '       g   R# V\        ,          p VP                  RRR7       Ya \        P                  ! 4       P                  R4       R2,          p\        Y…4      f   \        YaT4       R# \        YaY$4       T#   \         d#   p\
        P                  RY6T4        Rp?R# Rp?ii ; i)a  Write ``<HERMES_HOME>/backups/<prefix><timestamp>.zip`` and prune older same-prefix zips.
Returns the path, or ``None`` if nothing to back up, the write failed, or the archive is
incomplete (kept as ``<prefix><timestamp>.incomplete.zip``, excluded from retention).
Never raises.NTrf   z%Could not create %s backup dir %s: %srƒ  r„  )r   rØ   Ú_PRE_UPDATE_BACKUPS_DIRr~   rŽ   r±   r²   r   r†  r‡  Ú_write_full_zip_backuprG  rÅ  )	ra   rÜ  rÀ  r4  rI  rù   r:  r¼   rú   s	   &&&&&    r,   Ú_create_prefixed_full_backuprM  ~  sÃ   € ð ×:Ð:Ô!8Ó!:€KØ×Ñ×ÒÙØÔ6Õ6€JðØ×Ñ °ÐÔ5ð ˜h¤x§|¢|£~×'>Ñ'>Ð?PÓ'QÐ&RÐRVÐWÕW€HÜ˜hÓ4Ò<ô 	˜z°:Ô>ÙÜ˜¨TÔ>Ø€Oøô ô Ü�‰Ð>ÀÐRUÔVÝûðús   »B& Â&CÂ1CÃCc                óh   € V ^8„  d   QhR\         \        ,          R\        R\         \        ,          /# ©r&   ra   rÀ  r(   ©r   r   r*   )r+   s   "r,   r-   r-   —  s3   € ÷ oñ oÜœ$•ðoÜ.1ðoÜQYÔZ^ÕQ_ñor.   c                ó<   € \        V \        \        V^4      RR4      # )uë   Full zip backup to ``backups/pre-update-<timestamp>.zip``, auto-pruned; ``None`` if nothing
was found, the backup failed, or it was incomplete (salvage kept as ``*.incomplete.zip``).
Never raises â€” ``hermes update`` continues anyway.ú
pre-updaterÁ  )rM  Ú_PRE_UPDATE_PREFIXr‚   ©ra   rÀ  s   &&r,   Úcreate_pre_update_backuprU  —  s!   € ô
 (¨Ô5GÌÈTÐSTËÐWcÐemÓnÐnr.   c                óh   € V ^8„  d   QhR\         \        ,          R\        R\         \        ,          /# rO  rP  )r+   s   "r,   r-   r-   Ÿ  s3   € ÷ cñ cÜœ$•ðcÜ.1ðcÜT\Ô]aÕTbñcr.   c                ó<   € \        V \        \        V^ 4      RR4      # )a  Full zip backup to ``backups/pre-migration-<timestamp>.zip`` before ``hermes claw migrate``
(same dir as update backups so listings/``hermes import`` find it); ``None`` if nothing was
found, the write failed, or it was incomplete (salvage kept as ``*.incomplete.zip``). Never
raises.zpre-migrationzpre-migration backup)rM  Ú_PRE_MIGRATION_PREFIXr‚   rT  s   &&r,   Úcreate_pre_migration_backuprY  Ÿ  s&   € ô (ØÔ*¬C°°a«L¸/ÐKaócð cr.   c                óÂ   € V ^8„  d   QhR\         \        ,          R\         \        ,          R\         \        ,          R\         \        ,          R\         \        ,          /# ©r&   Úlabelra   rÀ  Úmax_file_sizer(   ©r   r6   r   r*   )r+   s   "r,   r-   r-   ­  sN   € ÷ 
ñ 
Ü”C�=ð
äœ$•ð
ô ”3�-ð
ô œC•=ð	
ô
 Œc…]ñ
r.   c           	     ó¬   € T;'       g    \        4       p\        V4      ;_uu_ 4        \        V VVVR7      uuRRR4       #   + '       g   i     R# ; i)zFCreate one atomic quick snapshot while holding the shared backup slot.©r\  ra   rÀ  r]  N)r   r–   Ú_create_quick_snapshot_locked)r\  ra   rÀ  r]  rˆ  s   &&&& r,   Úcreate_quick_snapshotrb  ­  sB   € ð ×+Ð+œ/Ó+€DÜ	 ×	%Õ	%Ü,ØØØØ'ô	
÷ 
&×	%×	%Ó	%ús   ¨AÁA	c                óÂ   € V ^8„  d   QhR\         \        ,          R\         \        ,          R\         \        ,          R\         \        ,          R\         \        ,          /# r[  r^  )r+   s   "r,   r-   r-   ¾  sU   € ÷ pñ pÜ”C�=ðpäœ$•ðpô ”3�-ðpô œC•=ð	pô
 Œc…]ñpr.   c                ó  a€ T;'       g    \        4       p\        V4      pR V3R llp\        P                  ! \        4      P                  R4      pV '       d   V RV  2MTpTp	^p
WY,          P                  4       '       d   V RV
 2p	V
^,          p
K.  WY,          pVRV	 R\        P                  ! 4        R2,          p\        P                  ! VRR7       VP                  RRR	R
7       \        P                  R8w  d   \        P                  ! VR	4       VP                  R	RR7       \        P                  RV	4       / p. p. p\          EFâ  pVV,          pVP                  4       '       g   K%  VP#                  4       '       Ed}   VP%                  R4       EFc  pVP'                  4       '       g   K  VP)                  V4      P+                  4       pRRV R29   g   RRV R29   d   KS  V! VV4      '       d%   VP,                  R8X  d   VP/                  V4       K†  VV,          pVP0                  P                  RRR7        VP,                  R8X  dr   \3        VV4      '       g_   VP/                  V4       \5        RV R24       \7        V4      '       d+   \5        RV RVP9                  4       P:                   R24       EK.  M\        P<                  ! VV4       VP9                  4       P:                  VV&   EKf  	  EK¸  VP'                  4       '       g   EKÑ  V! VV4      '       d&   VP,                  R8X  d   VP/                  V4       EK  VV,          pVP0                  P                  RRR7        VP,                  R8X  dr   \3        VV4      '       g_   VP/                  V4       \5        RV R24       \7        V4      '       d+   \5        RV RVP9                  4       P:                   R24       EK­  M\        P<                  ! VV4       VP9                  4       P:                  VV&   EKå  	  V'       d`   \5        RRPE                  V4      ,           4       \5        RV R \G        4        24       \        PI                  R!RPE                  V4      4       V'       gA   \        P                  ! VRR7       V'       d   \5        R"RPE                  V4       R#24       R# R$V	R%VR&V R'\K        V4      R(\M        VPO                  4       4      R)VR*VR+V/p\Q        VR,,          R-R.R/7      ;_uu_ 4       p\R        PT                  ! VV^R07       RRR4       \        P                  R8w  d¥   \        P                  ! VR	4       \        P                  ! VR	4       VP%                  R4       Fa  pVP#                  4       '       d   \        P                  ! VR	4       K2  VP'                  4       '       g   KJ  \        P                  ! VR14       Kc  	  \        PV                  ! WË4       T;'       g    TpV'       g   \Y        YRf   \Z        MTR27       MwV'       dG   \5        R3RPE                  V4      ,           4       \        PC                  R4RPE                  V4      4       \        PC                  R5\K        V4      \K        V4      4       \        P                  R6V	\K        V4      \M        VPO                  4       4      4       V	#   \>        \@        3 d$   p\        PC                  RTT4        Rp?EK”  Rp?ii ; i  \>        \@        3 d$   p\        PC                  RTT4        Rp?EK  Rp?ii ; i  + '       g   i     EL*; i)7uú  Create a quick state snapshot of critical files.

Copies STATE_FILES to a timestamped directory under state-snapshots/.
Auto-prunes old snapshots beyond the keep limit.

Args:
    max_file_size: When set, individual files larger than this many bytes
        are skipped (with a printed warning) instead of copied. Used by
        the pre-update safety snapshot so a multi-GB ``state.db`` can
        never stall ``hermes update`` or silently eat disk â€” the small
        pairing/cron/config files the snapshot exists to protect are
        always captured. ``None`` (default) copies everything, which
        preserves manual ``/snapshot`` and ``hermes backup --quick``
        behavior.

Returns:
    Snapshot ID (timestamp-based), or None if no files found.
c                ó<   € V ^8„  d   QhR\         R\        R\        /# )r&   rã   Úrel_namer(   )r   r6   rK   )r+   s   "r,   r-   Ú3_create_quick_snapshot_locked.<locals>.__annotate__Ù  s!   € ÷ ñ œð ¬ð ´ñ r.   c           
     óþ   <€ Sf   R#  V P                  4       P                  pTS8:  d   R# \        RT R\	        T4       R\	        S4       R24       \
        P                  RTTS4       R#   \         d     R# i ; i)z<True (and warn) when ``path`` exceeds the max_file_size cap.Fu     âš  Snapshot: skipping z (z	 exceeds z limit)z9Quick snapshot skipped %s: %d bytes exceeds %d byte limitT)r…   r†   rŽ   r}  rÃ  r±   r²   )rã   rf  r%  r]  s   && €r,   Ú
_too_largeÚ1_create_quick_snapshot_locked.<locals>._too_largeÙ  s•   ø€ àÒ Ùð	Ø—9‘9“;×&Ñ&ˆDð �=Ô ÙÜØ'¨ zð 2Ü˜TÓ"Ð# 9¬\¸-Ó-HÐ,IÈðRô	
ô 	�‰ØGØØØô		
ñ øô ô 	Úð	ús   ‰A- Á-A<Á;A<z%Y%m%d-%H%M%Srœ   r›   r�   T)Úignore_errorsiÀ  )rg   rh   Úmoderi   F)rl  rh   z.quick snapshot phase=copy status=started id=%sÚ*z/workspaces/r¨  z/attachments/r^  rf   u,     âš  Snapshot: SQLite safe copy FAILED for u$    â€” file may be locked or corruptedu     âš  Snapshot: z! looks ZEROED (no SQLite header; z bytes of NULs?)zCould not snapshot %s: %sNz bytes)u/     âš  CRITICAL: could not snapshot DB file(s): rè  u4     âš  If sessions disappear after the update, check z. z/Quick snapshot failed to capture DB file(s): %su7     âš  Snapshot aborted: no files captured (failed DBs: r+  ÚidÚ	timestampr\  r©  Ú
total_sizerÜ   Ú
failed_dbsÚoversized_skippedúmanifest.jsonr¬  úutf-8©Úencoding©rx  rã  ©rÀ  u<     âš  Skipping snapshot prune: DB file(s) skipped for size: z/Quick snapshot skipped oversized DB file(s): %su…   Skipping snapshot prune because %d DB(s) failed to capture and/or %d were oversized â€” preserving older snapshots as recovery sourcezAquick snapshot phase=copy status=complete id=%s files=%d bytes=%d).r   r%  r   r†  r   r‡  r´   rƒ   r¡   ÚshutilÚrmtreer~   r„   rü  r±   rî   Ú_QUICK_STATE_FILESrØ   ÚrglobrÖ   r  r’  r_  r�  r}   r   r}  r  r…   r†   Úcopy2rŽ   rn  r²   r@  r8   r3  rQ   Úsumr¸   r   ÚjsonÚdumpr¥   Ú_prune_quick_snapshotsÚ_QUICK_DEFAULT_KEEP)r\  ra   rÀ  r]  rˆ  r'  ri  ÚtsÚbase_snap_idÚsnap_idr_  Úsnap_dirÚstaging_dirÚmanifestrq  rr  r  rÓ  ÚsubÚsub_relÚdstr¼   ÚmetarÓ   rã   r¶  s   &&&f                      r,   ra  ra  ¾  sk  ø€ ð0 ×+Ð+œ/Ó+€DÜ Ó%€D÷ð ô, 
�Š”cÓ	×	#Ñ	# OÓ	4€Bß&+�b�T˜˜5˜'‘?°€LØ€GØ€FØ�>×
!Ñ
!×
#Ò
#Ø!�N ! F 8Ð,ˆØ�!�ŠØ�~€HØ˜1˜W˜I Q¤r§y¢y£{ m°8Ð<Õ<€KÜ
‡M‚M�+¨TÕ2Ø‡J�J�t d°€JÔ7Ü	‡w�w�$„Ü
�Š��uÔØ×Ñ˜5¨5ÐÔ1Ü
‡K�KÐ@À'ÔJà!€HØ€Jð
 $&Ðç!Ð!ˆØ�S�jˆØ�z‰z�|Š|Ùà�:‰:�<‹<ð —y‘y —~�Ø—{‘{—}’}ÙØŸ/™/¨$Ó/×8Ñ8Ó:�ð " q¨¨	° ^Ô3°ÈAÈgÈYÐVWÈ.Ô7XÙÙ˜c 7×+Ò+Ø—z‘z UÔ*Ø)×0Ñ0°Ô9ÙØ! GÕ+�Ø—
‘
× Ñ ¨¸Ð Ô=ðNð —z‘z UÔ*Ü,¨S°#×6Ò6Ø&×-Ñ-¨gÔ6Ü!Ø"NÈwÈið XFð !Gôô  5°S×9Ò9Ü %Ø&6°w°ið @:Ø:=¿(¹(»*×:LÑ:LÐ9MÐM]ð%_ô!"ò %ð  7ô Ÿš S¨#Ô.Ø(+¯©«
×(:Ñ(:�H˜WÔ%ñE &òJ à�{‰{�}Š}Úá�c˜3×ÒØ�z‰z˜UÔ"Ø!×(Ñ(¨Ô-Úà˜CÕˆØ�
‰
×Ñ °ÐÔ5ð	BØ�z‰z˜UÔ"Ü$ S¨#×.Ò.Ø×%Ñ% cÔ*ÜØFÀsÀeð L>ð ?ôô -¨S×1Ò1ÜØ.¨s¨eð 42Ø25·(±(³*×2DÑ2DÐ1EÀWðNôò ð /ô —’˜S #Ô&ØŸH™H›J×.Ñ.ˆH�SŒMñW "÷^ ô 	Ø=Ø�i‰i˜
Ó#õ$ô	
ô 	ØBÀ4À&ÈÔKbÓKdÐJeÐfô	
ô 	�‰Ø=Ø�I‰I�jÓ!ô	
÷
 Ü�Š�k°Õ6ßäð Ø $§	¡	¨*Ó 5Ð6°að9ôñ ð 	ˆgØ�RØ�Ø”c˜(“mØ”c˜(Ÿ/™/Ó+Ó,Ø�Ø�jØÐ.ð	€Dô 
ˆk˜OÕ+¨S¸7×	CÕ	CÀqÜ�	Š	�$˜ !Õ$÷ 
Dô 
‡w�w�$„Ü
�Š��uÔÜ
�Š�˜eÔ$Ø×%Ñ% cÖ*ˆDØ�{‰{�}Š}Ü—’˜˜uÖ%Ø—‘—”Ü—’˜˜uÖ%ñ	 +ô ‡J‚Jˆ{Ô%ð ×0Ð0Ð0€JßÜ˜tÂÕ*=ÐSWÖXçÜØNØ—)‘)Ð-Ó.õ/ôô �N‰NØAØ—	‘	Ð+Ó,ôô 	�‰ðô �
‹OœSÐ!2Ó3ô		
ô ‡K�KØKØÜˆH‹ÜˆH�O‰OÓÓô	ð €Nøôw  ¤Ð1ô NÜ—N‘NÐ#>ÀÈ×MÓMûðNûô@ œÐ)ô 	BÜ�N‰NÐ6¸¸S×AÓAûð	Bú÷P 
D×	CÐ	CúsJ   ÉA>\ Ë	5\ Í:A>\7Ï;5\7Ô3].Ü \4Ü\/Ü/\4Ü7]+Ý]&Ý&]+Ý.]?	c          	      óŠ   € V ^8„  d   QhR\         R\        \        ,          R\        \        \
        \        3,          ,          /# )r&   Úlimitra   r(   )r*   r   r   r)   r   r6   r	   )r+   s   "r,   r-   r-   ±  s7   € ÷ ñ Üðäœ$•ðô 
Œ$Œs”Cˆx�.Õñr.   c           
     óÞ  € \        V4      pVP                  4       '       g   . # . p\        VP                  4       RR7       FÓ  pVP	                  4       '       dC   VP
                  P                  R4      '       g"   VP
                  P                  R4      '       d   K]  VR,          pVP                  4       '       dE    \        VRR7      ;_uu_ 4       pVP                  \        P                  ! V4      4       RRR4       \        V4      V 8¼  g   KÒ   V# 	  V#   + '       g   i     L); i  \        P                  \        3 d%    TP                  R	TP
                  R
^ R^ /4        Lji ; i)z7List existing quick state snapshots, most recent first.T)r.  r›   r�   rs  ú	utf-8-sigru  Nrn  r©  rp  )r%  r´   rÄ  rÿ  rØ   r„   rõ   rÌ   r   r�  r  ÚloadÚJSONDecodeErrorrŽ   rQ   )rŽ  ra   r'  Úresultsrß   Úmanifest_pathrÓ   s   &&     r,   Úlist_quick_snapshotsr•  ±  s  € ô
   Ó,€DØ�;‰;�=Š=Øˆ	à€GÜ�D—L‘L“N¨D×1ˆØ�x‰x�zŠz˜QŸV™V×.Ñ.¨s×3Ò3°q·v±v·±Àz×7RÒ7RÙØ˜OÕ+ˆØ×Ñ×!Ò!ðQÜ˜-°+×>Õ>À!Ø—N‘N¤4§9¢9¨Q£<Ô0÷ ?ô ˆw‹<˜5Ö Øà€Nñ 2ð €N÷ ?×>ûä×(Ñ(¬'Ð2ô QØ—‘  a§f¡f¨l¸A¸|ÈQÐOÖPðQús0   Â>D-Ã&DÃ9D-ÄD*Ä%D-Ä*D-Ä-<E,Å+E,c                ó<   € V ^8„  d   QhR\         R\         R\        /# )r&   rã   rˆ  r(   rJ   )r+   s   "r,   r-   r-   Ë  s!   € ÷ ñ ¤dð ´$ð ¼4ñ r.   c                óV  € V P                  4       '       g   R#  \        VR7      P                  RR7      pVP                  RR7      V8X  d   R# VR,          P                  RR7      pVP                  V4       V P                  RR7      V8H  #   \        \
        \        3 d     R# i ; i)zVTrue only for a file symlink resolving to this restore home's default-root auth store.F)rˆ  )Ústrictú	auth.json)r×   r   rµ   r  rŽ   ÚRuntimeErrorr¶   )rã   rˆ  r'  Útrusteds   &&  r,   Ú_is_trusted_root_auth_aliasrœ  Ë  sš   € à�?‰?×ÒÙðÜ&¨DÔ1×9Ñ9ÀÐ9ÓGˆØ�<‰<˜uˆ<Ó%¨Ô-ÙØ˜+Õ%×.Ñ.°eÐ.Ó<ˆØ×Ñ˜DÔ!Ø�|‰| 5ˆ|Ó)¨WÑ4Ð4øÜ”\¤:Ð.ô Úðús   š3B Á>B ÂB(Â'B(c                óR   € V ^8„  d   QhR\         R\        \        ,          R\        /# ©r&   Úsnapshot_idra   r(   )r6   r   r   rK   )r+   s   "r,   r-   r-   Ú  s/   € ÷ e4ñ e4Üðe4äœ$•ðe4ô 
ñe4r.   c                ó"  € T;'       g    \        4       p\        V4      pV '       d   RV 9   g   RV 9   g   V R9   d   \        P                  RV 4       R# W0,          p VP	                  4       P                  VP	                  4       4       TP                  4       '       g   R# TR,          pTP                  4       '       g   R# \        TRR7      ;_uu_ 4       p\        P                  ! T4      pR	R	R	4       ^ pRp	XP                  R
/ 4       EFS  p
YJ,          p TP	                  4       P                  TP	                  4       4       Y*,          p TP	                  4       P                  TP	                  4       4       TP                  4       '       g"   T
R8X  d   \        P                  RT4       Rp	K§  TP                  P                  RRR7        TP                   R8X  d+   \#        Y¼4      '       g   \        P                  RT
4       Kÿ  MJT
R8X  d.   \%        Y¼4      '       g   \        P                  RT
4       Rp	EK3  M\&        P(                  ! Y¼4       T^,          pEKV  	  \        P/                  RY€4       T^ 8„  ;'       d    T	'       * #   \         d    \        P                  RT 4        R# i ; i  + '       g   i     ELÑ; i  \         d%    \        P                  RT
4       T
R8X  d   Rp	 EKì  i ; i  \         d@    T
R8w  g   \        YÂ4      '       g$   \        P                  RT
4       T
R8X  d   Rp	 EK6   ELÉi ; i  \*        \,        3 d3   p\        P                  RY­4       T
R8X  d
   Rp	 R	p?EKt   R	p?EK{  R	p?ii ; i)zÅRestore state from a quick snapshot.

Overwrites current state files with the snapshot's copies.
Returns True if at least one file was restored and the listed auth.json
was not refused or skipped.
r¨  Ú\zInvalid snapshot_id: %sFz*Snapshot path traversal blocked for id: %srs  r�  ru  NrÜ   z#Manifest path traversal blocked: %sr™  Tz4Snapshot auth.json listed in manifest is missing: %srf   r^  zQFailed to restore %s: refused or source integrity check failed (see previous log)zFailed to restore %s safelyzFailed to restore %s: %sz"Restored %d files from snapshot %s)r›   z..)r   r%  r±   r3  rµ   r  r¶   rØ   r´   r   r  r‘  Úgetrœ  r}   r~   r_  r#   r"   ry  r}  rŽ   rn  rî   )rŸ  ra   rˆ  r'  r†  r”  rÓ   rŒ  r
  Úauth_restore_failedr  rÓ  r‹  r¼   s   &&            r,   Úrestore_quick_snapshotr¤  Ú  s  € ð ×+Ð+œ/Ó+€DÜ Ó%€D÷ ˜# Ô,°¸Ô0CÀ{ÐVaÔGaÜ�‰Ð.°Ô<ÙàÕ!€HðØ×ÑÓ×&Ñ& t§|¡|£~Ô6ð
 �?‰?×ÒÙà˜Õ.€MØ×Ñ×!Ò!Ùä	ˆm k×	2Õ	2°aÜ�yŠy˜‹|ˆ÷ 
3ð €HØÐØ�x‰x˜ ×$ˆà�nˆð	Ø�K‰K‹M×%Ñ% h×&6Ñ&6Ó&8Ô9ð �jˆð
	Ø�K‰K‹M×%Ñ% d§l¡l£nÔ5ð �z‰z�|Š|Ø�kÔ!Ü—‘ÐSÐUXÔYØ&*Ð#Ùà�
‰
×Ñ °ÐÔ5ð	+Ø�z‰z˜UÔ"ô
 (¨×1Ò1ô —L‘LÐ!tÐvyÔzÙð	 2ð
 ˜Ô#ô
 *¨#×3Ò3Ü—L‘LÐ!>ÀÔDØ*.Ð'Úð 4ô
 —’˜SÔ&Ø˜�M‹Hñm %ôx ‡K�KÐ4°hÔLØ�a‰<×3Ð3Ð 3Ô3Ð3øô[ ô Ü�‰ÐAÀ;ÔOÚðú÷ 
3×	2Ð	2ûô ô 	Ü�L‰LÐ>ÀÔDØ�kÔ!Ø&*Ð#Ûð		ûô ô 	ð �kÔ!Ô)DÀS×)OÒ)OÜ—‘ÐBÀCÔHØ˜+Ô%Ø*.Ð'Ûò	 *Pð		ûôR œÐ)ô 	+Ü�L‰LÐ3°SÔ>Ø�kÔ!Ø&*×#ö "ûð	+úsg   Á-J ÃJ8Ä-KÅ-K>Ç8MÈ1MÉ MÊ!J5Ê4J5Ê8K		Ë*K;Ë:K;Ë>AMÍMÍNÍN	Î	Nc                óF   € V ^8„  d   QhR\         R\        \        ,          /# râ   )r   r   r*   )r+   s   "r,   r-   r-   B  s   € ÷ ñ œ4ð ¤H¬S¥Mñ r.   c                óä  € V P                  4       '       g   R#  \        V RRR7      ;_uu_ 4       p\        P                  ! V4      pRRR4       \        X\        4      '       d6   TP                  R. 4      p\        T\        4      '       d   \        T4      # R# \        T\        4      '       d   \        T4      # R#   + '       g   i     L~; i  \        \        P
                  3 d     R# i ; i)uß  Return the number of cron jobs stored in ``path``.

The canonical on-disk shape is ``{"jobs": [...]}`` (see ``cron/jobs.py``).
A legacy bare-list shape (``[...]``) is also honoured.

Returns:
    The job count for any *valid, readable* JSON document, or ``None`` if
    the file is missing or cannot be parsed. ``None`` means "unknown" â€”
    callers must not treat it as "zero jobs", because acting on an
    unreadable file could mask a real corruption the user needs to see.
Nr7  r�  ru  Újobs)rÖ   r   r  r‘  rŽ   r’  r>  r   r¢  r)   rQ   ©rã   rÓ   Údatar§  s   &   r,   Ú_count_cron_jobsrª  B  sµ   € ð �<‰<�>Š>Ùðô
 �$˜ k×2Õ2°aÜ—9’9˜Q“<ˆD÷ 3ô �$œ×ÒØ�x‰x˜ Ó#ˆÜ& t¬T×2Ò2Œs�4‹yÐ<¸Ð<Ü�$œ×ÒÜ�4‹yÐÙ÷ 3×2ûä”T×)Ñ)Ð*ô Úðús.   šC °B=ÁC Â=C	ÃC ÃC ÃC/Ã.C/c          	      óŠ   € V ^8„  d   QhR\         R\        \        ,          R\        \        \         \        3,          ,          /# rž  ©r6   r   r   r   r	   )r+   s   "r,   r-   r-   a  sA   € ÷ ISñ ISÜðISäœ$•ðISô Œd”3œ�8�nÕñISr.   c                ó  € V '       g   R# T;'       g    \        4       pV\        ,          p\        V4      pVf   R# \        V4      V ,          \        ,          p\        V4      pV'       g   R# WF8¼  d   R#  VP                  P                  RRR7       \        P                  ! WS4       \        P                  RTT TT4       RRRTRT /#   \        \        3 d"   p\        P                  RT4        Rp?R# Rp?ii ; i)	uñ  Safety net for silent cron-job loss across ``hermes update``.

Config-version migrations have been observed to leave ``cron/jobs.json``
valid-but-empty after an update, silently dropping every scheduled job
(issue #34600). The desktop scheduler can also overwrite the file with its
own small set of internally-tracked crons, causing partial loss (issue
#52144).

This compares the *current* job count against the pre-update snapshot. If
the live file now has **fewer** jobs than the snapshot, the snapshot copy
of ``cron/jobs.json`` is restored in place.

The check is deliberately conservative â€” it only ever restores when there
is unambiguous evidence of loss (snapshot had more jobs than live file),
so a user who genuinely deleted jobs during/after the update is never
second-guessed, and an unreadable live file (count ``None``) is left
untouched so real corruption still surfaces.

Args:
    snapshot_id: The pre-update quick-snapshot id (from
        :func:`create_quick_snapshot`).
    hermes_home: Override for the Hermes home directory (tests).

Returns:
    ``None`` when no action was taken (the common, healthy path). On a
    successful restore, a dict ``{"restored": True, "job_count": N,
    "snapshot_id": ...}`` so the caller can warn the user.
NTrf   z@Cron jobs were emptied during update but auto-restore failed: %su‚   Restored %d cron job(s) from pre-update snapshot %s (live file had %d job(s), snapshot had %d â€” jobs were lost during migration)r
  Ú	job_countrŸ  )r   Ú_CRON_JOBS_RELrª  r%  r}   r~   ry  r}  rŽ   rn  r±   r3  r²   )rŸ  ra   rˆ  Ú	live_pathÚ
live_countÚ	snap_pathÚ
snap_countr¼   s   &&      r,   Úrestore_cron_jobs_if_emptiedr´  a  sö   € ÷@ Ùà×+Ð+œ/Ó+€DØ”~Õ%€Iä! )Ó,€Jð ÒÙä$ TÓ*¨[Õ8¼>ÕI€IÜ! )Ó,€JßÙð ÔÙðØ×Ñ×Ñ t°dÐÔ;Ü�Š�YÔ*ô ‡N�Nð	YàØØØôð ˜˜k¨:°}ÀkÐRÐRøô ”_Ð%ô Ü�‰ØNÐPSô	
õ ûð	ús   Á83C ÃC>ÃC9Ã9C>c                óF   € V ^8„  d   QhR\         R\        \        ,          /# râ   )r   r   r	   )r+   s   "r,   r-   r-   ­  s   € ÷ ñ œdð ¤x´¥}ñ r.   c                óÀ  € V P                  4       '       g   R#  \        V RRR7      ;_uu_ 4       p\        P                  ! V4      pRRR4       \        X\        4      '       d-   TP                  R. 4      p\        T\        4      '       d   T# R# \        T\        4      '       d   T# R#   + '       g   i     Ll; i  \        \        P
                  3 d     R# i ; i)uæ   Parse ``path`` as the canonical ``{"jobs": [...]}`` doc (legacy bare list honoured).

``None`` = missing/unreadable/non-dict-with-list â€” same dialect rules as
:func:`_count_cron_jobs` (utf-8-sig for Windows BOMs). Never raises.
Nr7  r�  ru  r§  )
rÖ   r   r  r‘  rŽ   r’  r>  r   r¢  r)   r¨  s   &   r,   Ú_load_cron_jobs_docr·  ­  sª   € ð �<‰<�>Š>ÙðÜ�$˜ k×2Õ2°aÜ—9’9˜Q“<ˆD÷ 3ô �$œ×ÒØ�x‰x˜ Ó#ˆÜ! $¬×-Ò-ˆtÐ7°4Ð7Ü�$œ×ÒØˆÙ÷ 3×2ûä”T×)Ñ)Ð*ô Úðús.   šB> °B+ÁB> Â+B;	Â6B> Â;B> Â>CÃCc                óF   € V ^8„  d   QhR\         R\        \         ,          /# )r&   Údocr(   )r	   r)   )r+   s   "r,   r-   r-   Â  s   € ÷ ñ œð ¤¤c¥ñ r.   c                óº   € \        V \        4      '       d   V # \        V \        4      '       d-   V P                  R. 4      p\        V\        4      '       d   V# . # . # )z@The job list out of either document shape. Empty when malformed.r§  )r>  r)   r   r¢  )r¹  r§  s   & r,   Ú_cron_jobs_listr»  Â  sM   € ä�#”t×ÒØˆ
Ü�#”t×ÒØ�w‰w�v˜rÓ"ˆÜ! $¬×-Ò-ˆtÐ5°2Ð5Ø€Ir.   c                óR   € V ^8„  d   QhR\         \        \        3,          R\        /# )r&   Újobr(   )r   r6   r	   rK   )r+   s   "r,   r-   r-   Ì  s"   € ÷ >ñ >œ$œs¤C˜x�.ð >¬Tñ >r.   c                ó&  € V P                  R4      '       d   R# V P                  R4      p\        V\        4      '       d   VP                  4       '       g   R# VP                  4       \        V P                  RR4      4      P                  4       8H  # )zTrue when an agent job's prompt field is unusable: blank, missing, or
collapsed to the job's own name (a name is not a prompt).Úno_agentFÚpromptTr„   Ú )r¢  r>  r6   rø  )r½  rÀ  s   & r,   Ú_prompt_degradedrÂ  Ì  sh   € ð ‡w�wˆz×ÒÙØ�W‰W�XÓ€FÜ�fœc×"Ò"¨&¯,©,¯.ª.ÙØ�<‰<‹>œS §¡¨°Ó!4Ó5×;Ñ;Ó=Ñ=Ð=r.   c          	      óŠ   € V ^8„  d   QhR\         R\        \        ,          R\        \        \         \        3,          ,          /# rž  r¬  )r+   s   "r,   r-   r-   ×  s<   € ÷ eñ eÜðeäœ$•ðeô Œd”3œ�8�nÕñer.   c           
     óx  € V '       g   R# T;'       g    \        4       pV\        ,          p\        V4      V ,          \        ,          p\        V4      pVf   R# \        V4      pVf   R# / p\	        V4       F8  p\        V\        4      '       g   K  W‡\        VP                  RR4      4      &   K:  	  . p	\	        V4      p
V
 FË  p\        V\        4      '       g   K  VP                  \        VP                  RR4      4      4      pVf   KK  \        V4      '       g   K^  VP                  R4      p\        V\        4      '       d   VP                  4       '       g   K�  WÈR&   V	P                  \        VP                  RR4      4      4       KÍ  	  V	'       g   R#  VP                  P                  RRR7       \        V4      ;_uu_ 4       p\        VRRR	7      ;_uu_ 4       p\         P"                  ! W^^R
7       VP%                  R4       RRR4       RRR4       \*        P/                  R\1        T	4      T RP3                  T	4      4       RRR\1        T	4      RT	RT /#   + '       g   i     L[; i  + '       g   i     Lf; i  \&        \(        3 d"   p\*        P-                  RT4        Rp?R# Rp?ii ; i)uà  Safety net for field-level cron-job degradation across ``hermes update``.

A writer active during the update's mutation window replaced every
agent-job ``prompt`` with the job's own ``name`` while the job COUNT
stayed identical, so the count-based net
(:func:`restore_cron_jobs_if_emptied`) passed the loss undetected
(issue #82990): 6 jobs before, 6 jobs after, every one of them with an
empty prompt wearing its name.

Mirrors the field-level pattern of
:func:`restore_config_model_settings_if_rewritten`: compare the live
file against the pre-update snapshot taken minutes earlier by this same
update run, and restore ONLY the ``prompt`` field of a live agent job
whose id matches a snapshot job â€” never the whole record, never jobs the
snapshot does not know. Conservative on purpose:

- a live prompt is only restored when it is blank/missing or exactly
  equal to the job's own name â€” a legitimate user edit that merely
  differs from the snapshot is never stomped;
- ``no_agent`` script jobs are never touched (they have no prompt);
- a blank snapshot prompt restores nothing (there is nothing better to
  put back).

Args:
    snapshot_id: The pre-update quick-snapshot id (from
        :func:`create_quick_snapshot`).
    hermes_home: Override for the Hermes home directory (tests/siblings).

Returns:
    ``None`` when no action was taken (the common, healthy path). On a
    successful restore, ``{"restored": True, "prompts": N,
    "snapshot_id": ...}`` so the caller can warn the user.
Nrn  rÁ  rÀ  Trf   r¬  rt  ru  rw  rº  zHCron job prompts were degraded during update but auto-restore failed: %su{   Restored %d cron job prompt(s) from pre-update snapshot %s â€” job(s) %s had their prompt replaced by the job name (#82990)rè  r
  ÚpromptsÚjob_idsrŸ  )r   r¯  r%  r·  r»  r>  r   r6   r¢  rÂ  rø  r�  r}   r~   r©   r   r  r€  r‡   rŽ   rn  r±   r3  r²   rQ   r@  )rŸ  ra   rˆ  r°  r²  Úlive_docÚsnap_docÚ
snap_by_idr½  Úrestored_idsÚ	live_jobsÚsnap_jobÚsnap_promptÚtmp_pathrÓ   r¼   s   &&              r,   Ú&restore_cron_prompt_fields_if_degradedrÏ  ×  sA  € ÷J Ùà×+Ð+œ/Ó+€DØ”~Õ%€IÜ$ TÓ*¨[Õ8¼>ÕI€Iä" 9Ó-€HØÒÙÜ" 9Ó-€HØÒÙà,.€JÜ˜xÖ(ˆÜ�cœ4× Ô Ø14”s˜3Ÿ7™7 4¨Ó,Ó-Ó.ñ )ð !€LÜ Ó)€IÛˆÜ˜#œt×$Ò$ÙØ—>‘>¤# c§g¡g¨d°BÓ&7Ó"8Ó9ˆØÒÙÜ ×$Ò$ÙØ—l‘l 8Ó,ˆÜ˜+¤s×+Ò+°;×3DÑ3D×3FÒ3FÙØ#ˆH‰Ø×ÑœC §¡¨¨bÓ 1Ó2Ö3ñ ÷ ÙðØ×Ñ×Ñ t°dÐÔ;Ü  ×+Ô+¨xÜ�h ¨g×6Õ6¸!Ü—	’	˜(¨aÕ0Ø—‘˜”÷ 7÷ ,ô ‡N�Nð	@äˆLÓØØ�	‰	�,Óôð 	�DØ”3�|Ó$Ø�<Ø�{ð	ð ÷% 7×6ú÷ ,×+ûô ”_Ð%ô Ü�‰ðàô	
õ
 ûðúsN   Æ0J ÇI4Ç$*I!	ÈI4ÈJ É!I1É,I4É4J	É?J ÊJ ÊJ9ÊJ4Ê4J9c          	      ó¬   € V ^8„  d   QhR\         \        \        3,          R\        \        ,          R\        \         \        \
        3,          ,          /# ©r&   Úprofile_snapshotsÚinvoking_homer(   ©r   r6   r   r   r)   r	   )r+   s   "r,   r-   r-   ?  ó?   € ÷ "ñ "ÜœC¤˜H•~ð"äœD•>ð"ô 
Œ$Œs”Cˆx�.Õñ"r.   c                ó†  € . pV '       g   V# T;'       g    \        4       p\        \        V4      4      pV P                  4        FH  w  rVVP	                  V4      pVf   K   \        WgR7      pT'       g   K3  YXR&   TP                  T4       KJ  	  V#   \         d#   p	\        P                  RTT	4        Rp	?	Kv  Rp	?	ii ; i)aA  Run the cron prompt-field safety net for every sibling profile.

Same contract as :func:`restore_cron_jobs_all_profiles`: each profile's
live ``cron/jobs.json`` is compared against ITS OWN same-generation
pre-update snapshot. Returns one result dict per restored profile, each
with a ``profile`` key added. Never raises.
N©ra   z9Cron prompt-field restore check for profile %s failed: %sÚprofile)
r   r   Ú_sibling_profile_homesÚitemsr¢  rÏ  r¯   r±   Údebugr�  ©
rÒ  rÓ  r
  rˆ  Úby_namer„   r…  Úprofile_homeÚresultr¼   s
   &&        r,   Ú'restore_cron_prompt_fields_all_profilesrà  ?  s½   € ð &(€HßØˆØ×-Ð-œOÓ-€DÜÔ)¨$Ó/Ó0€GØ*×0Ñ0Ö2‰ˆØ—{‘{ 4Ó(ˆØÒÙð
	Ü;ØôˆF÷ ‰6Ø $�9ÑØ�O‰O˜FÖ#ñ# 3ð$ €Oøô ô 	Ü�L‰LØKØØôõ
 ûð	úó   Á"BÂC ÂB;Â;C c                óh   € V ^8„  d   QhR\         R\        \        \        \         3,          ,          /# )r&   rÓ  r(   )r   r)   rj  r6   )r+   s   "r,   r-   r-   d  s(   € ÷ ñ ¬$ð ´4¼¼cÄ4¸iÕ8HÕ3Iñ r.   c                ó¦  € . p ^ RI HpHpHp V P	                  4       pV! 4       pVP                  4       '       d)   VP	                  4       V8w  d   VP                  RV34       V! 4       pVP                  4       '       d£   \        VP                  4       4       F…  pVP                  4       '       g   K  VP                  R8w  g   K.  VP                  VP                  4      '       g   KQ  VP	                  4       V8w  g   Kh  VP                  VP                  V34       K‡  	  V#   \         d"   p	\        P                  RT	4        Rp	?	T# Rp	?	ii ; i)u
  (name, home) for every OTHER profile on this install. Never raises.

The update's code swap and gateway fleet restart touch every profile,
so the pre-update snapshot must too (#66140). The invoking profile is
excluded â€” its snapshot is taken by the existing call.
)Ú_get_default_hermes_homeÚ_get_profiles_rootÚ_PROFILE_ID_REÚdefaultz&Sibling profile enumeration failed: %sN)rþ  rä  rå  ræ  rµ   rØ   r�  rÄ  rÿ  r„   Úmatchr¯   r±   rÛ  )
rÓ  Úhomesrä  rå  ræ  ÚinvokingÚdefault_homer'  r  r¼   s
   &         r,   rÙ  rÙ  d  s
  € ð %'€EðD÷	
ñ 	
ð !×(Ñ(Ó*ˆÙ/Ó1ˆØ×Ñ× Ò  \×%9Ñ%9Ó%;¸xÔ%GØ�L‰L˜) \Ð2Ô3Ù!Ó#ˆØ�;‰;�=Š=Ü §¡£Ö/�à—L‘L—N”NØŸ
™
 iÖ/Ø&×,Ñ,¨U¯Z©Z×8Ô8ØŸ™›¨8Ö3à—L‘L %§*¡*¨eÐ!4Ö5ñ 0ð €Løô ô DÜ�‰Ð=¸s×CÐCØ€LûðDús;   „6D$ »AD$ Â /D$ Â4D$ ÃD$ Ã*D$ Ä!D$ Ä$EÄ/EÅEc          
      ó¬   € V ^8„  d   QhR\         \        ,          R\         \        ,          R\         \        ,          R\        \        \        3,          /# )r&   rÓ  rÀ  r]  r(   )r   r   r*   r   r6   )r+   s   "r,   r-   r-   †  sD   € ÷ ñ ÜœD•>ðä
”3�-ðô œC•=ðô 
Œ#Œsˆ(…^ñ	r.   c                óô   € / pT ;'       g    \        4       p\        V4       F#  w  rV \        RVVVR7      pV'       d   WsV&   K#  K%  	  V#   \         d"   p\        P                  RYX4        Rp?KP  Rp?ii ; i)uÍ  Pre-update quick snapshots for every SIBLING profile (#66140).

Same snapshot set, same per-file size cap, same keep policy as the
invoking profile's snapshot â€” identical semantics per profile, no
partial-tier coherence class. Each sibling's snapshot lands under its
OWN ``<home>/state-snapshots/`` so per-profile restore tooling finds
it where it expects. Returns ``{profile_name: snapshot_id}`` for the
siblings that snapshotted successfully. Never raises.
rR  r`  z-Pre-update snapshot for profile %s failed: %sN)r   rÙ  rb  r¯   r±   rÛ  )	rÓ  rÀ  r]  r“  rˆ  r„   rÞ  r…  r¼   s	   &&&      r,   Ú(create_pre_update_snapshots_all_profilesrî  †  s…   € ð !€GØ×-Ð-œOÓ-€DÜ4°TÖ:Ñˆð
	UÜ+Ø"Ø(ØØ+ô	ˆG÷ Ø '˜“ñ ñ ;ð €Nøô ô 	UÜ�L‰LÐHÈ$×TÒTûð	Uús   ¨AÁA7ÁA2Á2A7c                óh   € V ^8„  d   QhR\         R\        \        \        \        3,          ,          /# râ   )r   r   r   r6   r	   )r+   s   "r,   r-   r-   ³  s'   € ÷ 4ñ 4œdð 4¤x´´S¼#°XµÕ'?ñ 4r.   c                ó  € V P                  4       '       g   R#  ^ RIp\        V RRR7      ;_uu_ 4       pVP                  V4      pRRR4       \        X\        4      '       d   T# R#   + '       g   i     L*; i  \         d     R# i ; i)zIParse ``path`` as a YAML mapping. ``None`` = missing/unreadable/non-dict.Nr7  r�  ru  )rÖ   Úhermes_yamlr   Ú	safe_loadr¯   r>  r   )rã   ÚyamlrÓ   r©  s   &   r,   Ú_read_raw_yaml_dictrô  ³  so   € à�<‰<�>Š>ÙðÛ"ä�$˜ k×2Õ2°aØ—>‘> !Ó$ˆD÷ 3ô ˜d¤D×)Ò)ˆ4Ð3¨tÐ3÷	 3×2ûäô Úðús.   šA; ´A(ÁA; Á(A8	Á3A; Á8A; Á;B
Â	B
c                óx   € V ^8„  d   QhR\         \        \        3,          R\        \        R3,          R\        /# )r&   r©  Údotted.r(   ©r   r6   r	   rj  )r+   s   "r,   r-   r-   Á  s1   € ÷ ñ ¤¤c¬3 h¥ð ¼¼sÀC¸x½ð ÌSñ r.   c                 óp   € T pV F-  p\        V\        4      '       g    R # VP                  V4      pK/  	  V# r0   )r>  r   r¢  )r©  rö  Únoder-  s   &&  r,   Ú_get_config_path_valuerú  Á  s5   € Ø€DÛˆÜ˜$¤×%Ò%ÚØ�x‰x˜‹}Šñ ð €Kr.   c                ó|   € V ^8„  d   QhR\         \        \        3,          R\        \        R3,          R\        RR/# )r&   r©  rö  .Úvaluer(   Nr÷  )r+   s   "r,   r-   r-   Ê  s:   € ÷ ñ ¤¤c¬3 h¥ð ¼¼sÀC¸x½ð ÔQTð ÐY]ñ r.   c                 ó–   € T pVR R  F2  pVP                  V4      p\        V\        4      '       g   / pWSV&   TpK4  	  W#VR,          &   R # )Nr×  )r¢  r>  r   )r©  rö  rü  rù  r-  Úchilds   &&&   r,   Ú_set_config_path_valuerÿ  Ê  sP   € Ø€DØ�c�r‹{ˆØ—‘˜“ˆÜ˜%¤×&Ò&ØˆEØ�‰IØŠñ ð ˆ��Ór.   c          	      óŠ   € V ^8„  d   QhR\         R\        \        ,          R\        \        \         \        3,          ,          /# rž  r¬  )r+   s   "r,   r-   r-   Õ  sA   € ÷ NQñ NQÜðNQäœ$•ðNQô Œd”3œ�8�nÕñNQr.   c                ó’  € V '       g   R# T;'       g    \        4       pVR,          p\        V4      V ,          R,          p\        V4      pV'       g   R# \        V4      pVf   R# . p\         FZ  p\	        WX4      p	V	RR/ . 39   d   K  \	        Wh4      p
W©8X  d   K.  \        WhV	4       VP                  RP                  V4      4       K\  	  V'       g   R#  ^ RIH	p V! W64       \        P                  RRP                  T4      T 4       R	R
RTRT /#   \        \        3 d"   p\        P                  RT4        Rp?R# Rp?ii ; i)u½  Safety net for silent config.yaml model/MoA loss across ``hermes update``.

Desktop update/repair cycles have been observed to rewrite user-set
``model.provider``/``model.default`` and drop the ``moa:`` section
entirely (issue #64160; the macOS repair/relaunch variant rewrote a
pinned ``model.default`` to a transient composer pick). These keys are
consumed by the gateway and unattended cron jobs too, so a rewrite
silently changes paid inference behavior machine-wide.

Mirrors :func:`restore_cron_jobs_if_emptied`: compare the *current*
config against the pre-update snapshot taken minutes earlier by this
same update run, and restore only the protected keys â€” never the whole
file â€” when a value the user had set was changed or dropped. Everything
the update legitimately wrote (version stamps, new sections) is left in
place.

Args:
    snapshot_id: The pre-update quick-snapshot id (from
        :func:`create_quick_snapshot`).
    hermes_home: Override for the Hermes home directory (tests/siblings).

Returns:
    ``None`` when no action was taken (the common, healthy path). On a
    successful restore, ``{"restored": True, "keys": [...],
    "snapshot_id": ...}`` so the caller can warn the user.
Nrá  rÁ  r›   )Úatomic_config_writezSconfig.yaml model settings were rewritten during update but auto-restore failed: %suf   Restored user config value(s) %s from pre-update snapshot %s â€” the update flow rewrote them (#64160)rè  r
  TÚkeysrŸ  )r   r%  rô  Ú_PROTECTED_CONFIG_PATHSrú  rÿ  r�  r@  Úhermes_cli.configr  rŽ   rn  r±   r3  r²   )rŸ  ra   rˆ  r°  r²  ÚsnapÚliveÚrestored_keysrö  Úsnap_valÚlive_valr  r¼   s   &&           r,   Ú*restore_config_model_settings_if_rewrittenr  Õ  s<  € ÷< Ùà×+Ð+œ/Ó+€DØ�}Õ$€IÜ$ TÓ*¨[Õ8¸=ÕH€Iä˜yÓ)€DßÙÜ˜yÓ)€DØ‚|ñ à!€Mß)ˆÜ)¨$Ó7ˆØ˜˜b " bÐ)Ô)ÙÜ)¨$Ó7ˆØÔÙÜ˜t¨XÔ6Ø×Ñ˜SŸX™X fÓ-Ö.ñ *÷ Ùð
Ý9á˜IÔ,ô ‡N�Nð	0à�	‰	�-Ó Øô	ð ˜˜f m°]ÀKÐPÐPøô ”_Ð%ô Ü�‰ð&àô	
õ
 ûðús   ÃD ÄEÄ%EÅEc          	      ó¬   € V ^8„  d   QhR\         \        \        3,          R\        \        ,          R\        \         \        \
        3,          ,          /# rÑ  rÔ  )r+   s   "r,   r-   r-   &  rÕ  r.   c                ó†  € . pV '       g   V# T;'       g    \        4       p\        \        V4      4      pV P                  4        FH  w  rVVP	                  V4      pVf   K   \        WgR7      pT'       g   K3  YXR&   TP                  T4       KJ  	  V#   \         d#   p	\        P                  RTT	4        Rp	?	Kv  Rp	?	ii ; i)aB  Run the config model-settings safety net for every sibling profile.

Same contract as :func:`restore_cron_jobs_all_profiles`: each profile's
live ``config.yaml`` is compared against ITS OWN same-generation
pre-update snapshot. Returns one result dict per restored profile, each
with a ``profile`` key added. Never raises.
Nr×  z=Config model-settings restore check for profile %s failed: %srØ  )
r   r   rÙ  rÚ  r¢  r  r¯   r±   rÛ  r�  rÜ  s
   &&        r,   Ú*restore_config_model_settings_all_profilesr  &  s½   € ð &(€HßØˆØ×-Ð-œOÓ-€DÜÔ)¨$Ó/Ó0€GØ*×0Ñ0Ö2‰ˆØ—{‘{ 4Ó(ˆØÒÙð
	Ü?ØôˆF÷ ‰6Ø $�9ÑØ�O‰O˜FÖ#ñ# 3ð$ €Oøô ô 	Ü�L‰LØOØØôõ
 ûð	úrá  c          	      ó¬   € V ^8„  d   QhR\         \        \        3,          R\        \        ,          R\        \         \        \
        3,          ,          /# rÑ  rÔ  )r+   s   "r,   r-   r-   K  s?   € ÷ ñ ÜœC¤˜H•~ðäœD•>ðô 
Œ$Œs”Cˆx�.Õñr.   c                ó„  € . pV '       g   V# T;'       g    \        4       p\        \        V4      4      pV P                  4        FH  w  rVVP	                  V4      pVf   K   \        WgR7      pT'       g   K3  YXR&   TP                  T4       KJ  	  V#   \         d"   p	\        P                  RYY4        Rp	?	Ku  Rp	?	ii ; i)u¶  Run the cron-jobs safety net for every sibling profile (#66140).

``profile_snapshots`` is the map returned by
:func:`create_pre_update_snapshots_all_profiles`. Each profile's live
``cron/jobs.json`` is compared against ITS OWN snapshot â€” restores are
same-generation by construction (the snapshot was taken minutes ago by
this update run). Returns one result dict per restored profile, each
with a ``profile`` key added. Never raises.
Nr×  z,Cron restore check for profile %s failed: %srØ  )
r   r   rÙ  rÚ  r¢  r´  r¯   r±   rÛ  r�  rÜ  s
   &&        r,   Úrestore_cron_jobs_all_profilesr  K  s²   € ð &(€HßØˆØ×-Ð-œOÓ-€DÜÔ)¨$Ó/Ó0€GØ*×0Ñ0Ö2‰ˆØ—{‘{ 4Ó(ˆØÒÙð	Ü1°'ÔTˆF÷ ‰6Ø $�9ÑØ�O‰O˜FÖ#ñ 3ð €Oøô ô 	Ü�L‰LÐGÈÔSÝûð	ús   Á"BÂB?ÂB:Â:B?c                ó<   € V ^8„  d   QhR\         R\        R\        /# )r&   r'  rÀ  r(   )r   r*   )r+   s   "r,   r-   r-   l  s!   € ÷ ñ ¤ð ¬Sð Ì3ñ r.   c                óL  € V P                  4       '       g   ^ # \        R V P                  4        4       R RR7      p^ pW!R  F#  p \        P                  ! V4       V^,          pK%  	  V#   \
         d-   p\        P                  RTP                  T4        Rp?K[  Rp?ii ; i)zKRemove oldest quick snapshots beyond the keep limit. Returns count deleted.c              3   óâ   "  € T Fe  pVP                  4       '       g   K  VP                  P                  R 4      '       d   K>  VP                  P                  R4      '       d   Ka  Vx € Kg  	  R# 5i)r›   r�   N)rØ   r„   rõ   rÌ   r¿  s   & r,   rÐ   Ú)_prune_quick_snapshots.<locals>.<genexpr>r  sO   é € ð 	
á#�Ø�x‰x�zô à"#§&¡&×"3Ñ"3°C×"8ô àABÇÁÇÁÐQ[×A\÷ ŠAÛ#ùs   ‚A/ŸA/ÁA/Á%
A/c                 ó   € V P                   # r0   r*  )rß   s   &r,   r0  Ú(_prune_quick_snapshots.<locals>.<lambda>w  s   € �a—f’fr.   Tr,  NzFailed to prune snapshot %s: %s)	r´   rÄ  rÿ  ry  rz  rŽ   r±   r²   r„   )r'  rÀ  Údirsr7  rß   r¼   s   &&    r,   r�  r�  l  s˜   € à�;‰;�=Š=Ùäñ	
à—\‘\”^ó	
ñ
 Øô€Dð €GØ�%‹[ˆð	KÜ�MŠM˜!ÔØ�q�LŠGñ ð €Nøô ô 	KÜ�N‰NÐ<¸a¿f¹fÀc×JÒJûð	Kús   ÁA,Á,B#Á7!BÂB#c                óR   € V ^8„  d   QhR\         R\        \        ,          R\         /# )r&   rÀ  ra   r(   )r*   r   r   )r+   s   "r,   r-   r-   †  s/   € ÷ Pñ PÜ
ðPäœ$•ðPô 	ñPr.   c                ó.   € \        \        V4      V R7      # )z6Manually prune quick snapshots. Returns count deleted.rx  )r�  r%  )rÀ  ra   s   &&r,   Úprune_quick_snapshotsr  †  s   € ô
 "Ô"6°{Ó"CÈ$ÔOÐOr.   c                ó   € V ^8„  d   QhRR/# )r&   r(   Nr1   )r+   s   "r,   r-   r-   Ž  s   € ÷ 
3ñ 
3˜dñ 
3r.   c                óô   € \        V RR4      p\        VR7      pV'       dL   \        RV 24       \        4       p\        R\	        V4       R\        4        R24       \        RV 24       R# \        R	4       R# )
z*CLI entry point for hermes backup --quick.r\  N)r\  zState snapshot created: r§  z snapshot(s) stored in z/state-snapshots/z"  Restore with: /snapshot restore z!No state files found to snapshot.)rì   rb  r}  r•  rQ   r   )rž  r\  r…  Úsnapss   &   r,   Úrun_quick_backupr  Ž  sp   € ä�D˜' 4Ó(€EÜ#¨%Ô0€GßÜÐ(¨¨	Ð2Ô3Ü$Ó&ˆÜ�”3�u“:�,Ð5Ô6IÓ6KÐ5LÐL]Ð^Ô_ÜÐ2°7°)Ð<Ö=äÐ1Ö2r.   c                óR   € V ^8„  d   QhR\         R\         R\        \         ,          /# ©r&   rú   rù   r(   ©r   r   )r+   s   "r,   r-   r-   Ÿ  s%   € ÷ ñ ¤Tð ¼ð ÄÌ$Åñ r.   c                óÜ   €  \        V4      ;_uu_ 4        \        W4      uuRRR4       #   + '       g   i     R# ; i  \         d"   p\        P	                  RT4        Rp?R# Rp?ii ; i)z5Single-flight wrapper for automatic full zip backups.NzFull-zip backup skipped: %s)r–   Ú_write_full_zip_backup_lockedrW   r±   r²   )rú   rù   r¼   s   && r,   rL  rL  Ÿ  sJ   € ðÜ# K×0Õ0Ü0°ÓG÷ 1×0×0Ó0ûä ô Ü�‰Ð4°cÔ:Ýûðús)   ‚? •+ 
? «<	¶? ¼? ¿A+Á
A&Á&A+c                óR   € V ^8„  d   QhR\         R\         R\        \         ,          /# r!  r"  )r+   s   "r,   r-   r-   ©  s+   € ÷ Eñ E¬Dð E¼tð EÌÔQUÍñ Er.   c                 óˆ  a aaaa€ \         P                  ! 4       p\        P                  R 4        \	        \        VS 4      4      oS'       g   R# \        P                  R\         P                  ! 4       T,
          R,          \        S4      4       R R lp. oR T3R llpS P                  S P                  \        ,           4      oRoR	 TTT TT3R
 llp\         P                  ! 4       p \        S T4      ;_uu_ 4       p\        P                  ! TR\        P                  ^R7      ;_uu_ 4       p	\!        T	SS TRT3R lT3R lR7       RRR4       RRR4       Sf   \        P                  RT! 4       4       R# SP%                  4       P&                  p
SS 8w  dV   \        P                  R\         P                  ! 4       T,
          R,          \        S4      \        S4      T
ST! 4       4       R# \        P                  R\         P                  ! 4       T,
          R,          \        S4      T
4       S #   \         d"   p\        P                  RT4        Rp?R# Rp?ii ; i  + '       g   i     EL#; i  + '       g   i     EL/; i  \        \"        3 d"   p\        P                  RT4        Rp?R# Rp?ii ; i)z*automatic backup phase=scan status=startedz Full-zip backup: walk failed: %sNzEautomatic backup phase=scan status=complete duration_ms=%.1f files=%dr¢  c                ó(   € V ^8„  d   QhR\         RR/# )r&   rI   r(   Nr   )r+   s   "r,   r-   Ú3_write_full_zip_backup_locked.<locals>.__annotate__¶  s   € ÷ 2ñ 2œdð 2 tñ 2r.   c                 óV   € \         P                  R V 4       \        \        V 4      4      h)z6Full-zip backup aborted: SQLite snapshot failed for %s)r±   r²   r_   r6   )rI   s   &r,   Ú_db_failureÚ2_write_full_zip_backup_locked.<locals>._db_failure¶  s!   € Ü�‰ÐOÐQYÔZÜ"¤3 x£=Ó1Ð1r.   c                ó$   € V ^8„  d   QhR\         /# r4   r5   )r+   s   "r,   r-   r(  ¼  s   € ÷ Tñ TœCñ Tr.   c                  óˆ   <€ R P                  SR,          4      p \        S4      ^
8”  d   V  R\        S4      ^
,
           R2# T # )r9  rz  z (+z more))r@  rQ   )Úshownr±  s    €r,   Ú_capped_errorsÚ5_write_full_zip_backup_locked.<locals>._capped_errors¼  sB   ø€ à—	‘	˜& �+Ó&ˆÜ8;¸F»ÀbÔ8H�%�˜œC ›K¨"Õ,Ð-¨VÐ4ÐSÈeÐSr.   c                ó:   € V ^8„  d   QhR\         \        ,          /# r4   r"  )r+   s   "r,   r-   r(  É  s   € ÷ ñ œ8¤D�>ñ r.   c                  óV   <€ S '       g   SoS# \        S 4      \        S4      8  d   SoS# r0   )rQ   )r±  rh  rú   Ú	publishedÚsalvage_paths   €€€€€r,   Ú_publish_pathÚ4_write_full_zip_backup_locked.<locals>._publish_pathÉ  s3   ø€ ÷ Ø ˆIð Ðô �‹[œ3˜|Ó,Ô,Ø$ˆIØÐr.   r¬  r­  Fc                 ó0   <€ SP                  V  R V 24      # r´  r°  rµ  s   &&€r,   r0  Ú/_write_full_zip_backup_locked.<locals>.<lambda>Ø  s   ø€ ¨&¯-©-¸3¸%¸rÀ#À¸Ô*Hr.   c                 óD   <€ \         P                  R V \        S4      4      # )zDautomatic backup phase=archive status=progress completed=%d total=%d)r±   rî   rQ   )rs  rh  s   &€r,   r0  r8  Ù  s   ø€ ¤f§k¡kØZÐ\]Ô_bÐcoÓ_pô'rr.   )ro  ri  rp  rq  z%Full-zip backup: zip write failed: %sz9Full-zip backup: every entry failed, nothing salvaged: %szsautomatic backup phase=archive status=incomplete duration_ms=%.1f files=%d errors=%d bytes=%d salvage=%s skipped=%szQautomatic backup phase=archive status=complete duration_ms=%.1f files=%d bytes=%d)r€   r�   r±   rî   r)   r  rŽ   r²   rQ   r    Ústemr>  r©   rI  rJ  rÂ  rt  r_   r…   r†   )rú   rù   rÆ  r¼   r*  r/  r5  Úarchive_startedrÈ  rG  rÊ  r±  rh  r3  r4  s   f&         @@@@r,   r$  r$  ©  s6  ü€ Ü—>’>Ó#€LÜ
‡K�KÐ<Ô=ðÜÔ.¨{¸HÓEÓFˆ÷ ÙÜ
‡K�KÐWÜ—’Ó! LÕ0°DÕ8¼#¸lÓ:KôMõ2ð €F÷Tð Tð ×%Ñ% h§m¡mÔ6LÕ&LÓM€Là $€I÷ô ô —n’nÓ&€OðÜ  ¨=×9Ô9¸\Ì7Ï?Ê?Ø˜c¤7×#7Ñ#7Àq÷LJõ LJØMOÜØ�L (¸+ÐSXÜHôrõs÷LJ×9ð ÒÜ�‰ÐRÑTbÓTdÔeÙØ�~‰~Ó×'Ñ'€HØ�HÔÜ�‰ð-ä�^Š^Ó Õ/°4Õ7¼¸\Ó9JÌCÐPVËKÐYaØ™.Ó*ô		,ñ
 ä
‡K�KÐcÜ—’Ó! OÕ3°tÕ;¼SÀÓ=NÐPXôZà€OøôA ô Ü�‰Ð9¸3Ô?Ýûðú÷LLJ÷ LJð LJú×9×9Ð9ûô Ô)Ð*ô ä�‰Ð>ÀÔDÝûðúse   ±H8 Ã-J Ä1I;Ä2I'	ÅI;ÅJ È8I$ÉIÉI$É'I8É2	I;É;J	ÊJ ÊJ ÊKÊ J<Ê<Kc                ó€  € V ^8„  d   Qh/ ^ \         9   d"   \        \        \        ,          R3,          ;R&   ^\         9   d"   \        \        \        ,          R3,          ;R&   ^\         9   d$   \        \        \        R3,          R3,          ;R&   ^\         9   d$   \        \        \        R3,          R3,          ;R&   # )r&   .Ú_LZMA_ERRORSrÐ  r  )Ú__conditional_annotations__rj  Útyper¦   r6   )r+   s   "r,   r-   r-      s§   € × 0Ñ 0÷l FÒE”%œœ]Õ+¨SÐ0Õ1ÑEñm 1÷x=ò =œœt¤MÕ2°CÐ7Õ8ñ =ñy 1÷X"ò œœu¤S¨# X�°Ð3Õ4ñ ñY" 1÷R=ò œœu¤S¨# X�°Ð3Õ4ñ òS= 1r.   )z.db-walz.db-shmz.db-journal>   úcron.pidúgateway.pidre   >   r@  rA  úgateway.lockúprocesses.jsonúgateway_state.jsonr1   >   râ  rU   r™  ú	vault.keyúvault.json.enc)g      Ð?r0   l        )rU   rá  râ  r™  r   zcron/executions.dbrD  zchannel_directory.jsonzchannel_aliases.jsonrC  z#gateway/discord_message_recovery.dbzprojects.dbzresponse_store.dbzmemory_store.dbzverification_evidence.dbz	kanban.dbzkanban/boardsÚpairingzplatforms/pairingzfeishu_comment_pairing.json))Úmodelrº   )rH  rç  )rH  Úbase_url)rH  Úapi_key)Úmoa)NNNN)é   N)NNN)¢r>  r\   r  Úloggingrƒ   ry  r  r…   r›  rb  r¢   r€   rI  ÚzlibÚ
contextlibr   r   r   r   r   Úpathlibr   Útypingr	   r
   r   r   r   r   Úhermes_constantsr   r   r   r   r   Úhermes_state_dbfiler   Úhermes_state_holdersr   Úagent.provider_mediar   Úhermes_cli.archive_safer   Úhermes_cli.backup_sqliter   r   Úhermes_cli.home_data_layoutr   r   Úhermes_cli.sizefmtr   rÃ  Úhermes_cli.backup_restorer   r   r   r    r!   r"   r#   r$   Ú	getLoggerrX   r±   r2   r$  r8   rÚ   rO   Ú	frozensetrP   rR   rT   rÙ  rÍ   rË   rö   rØ  ÚlzmaÚ	LZMAErrorr=  r   Ú
BadZipFiler3  rù  rÐ  rû  r‘  rš  rW   r_   r–   r©   rÁ   rà   rÊ   rï   r÷   r  r  r  r<  Ú!DEFAULT_INTEGRITY_CHECK_MAX_BYTESrE  rV  rZ  rf  rt  r  r…  r�  r—  rŸ  r�  rÔ  rÚ  rÞ  r  r{  r‚  r%  r1  r¯  r  r8  rK  rS  Ú_PRE_UPDATE_DEFAULT_KEEPrX  Ú_PRE_MIGRATION_DEFAULT_KEEPr>  rÅ  rG  rM  rU  rY  rb  ra  r•  rœ  r¤  rª  r´  r·  r»  rÂ  rÏ  rà  rÙ  rî  rô  rú  rÿ  r  r  r  r�  r  r  rL  r$  r-   )r>  s   @r,   Ú<module>rc     sî  øðÞ 0ã Û Û 	Û Û Û Û 
Û Û Û Û Û ß /ß ,Ñ ,Ý ß =× =÷õ õ >Ý 1å 1Ý ;ß Bß PÝ ;÷	÷ 	ó 	ð 
×	Ò	˜8Ó	$€õð )Ð õ4ð ØØ
ØØØØð ð àˆV�_àˆf�f˜o¨}¸mð#€ð, .Ð1EÈÈ	Õ1QÕRÐ ñ
 'Ð(:Ð';Ó<Ð ð ˆg�x ¨m¸[ÐJZð\Ð õ[ð AÐ Ø˜fÐ@Ð'?Ñ@Ð ò >€ð %ØÐ,Ð-Ð.ðÐ ò iÐ ðÛØ59·^±^Ð4E€LÓEð ×Ñ˜Ÿ
™
 Hð<=Ø/;ñ<=Ð ó =ò VÐ ð
  Ð ôK˜Lô Kô	˜<ô 	ð ö#ó ð#ðL öó ðõ*õ@õ	õ
põ	o÷õF	ðZ¸Cð ZÈu÷ Zð2 &€ð %,Ð !ð/?Ø(,ð/?ØAEð/?à6÷/?õdHõ,õ'õ õ<9ð &Ð õõ*-õ&%õ,CõPõ,4õ	%õ@DðT
Ð ð$ Ð ÷'õ
Zð "€ð8Ð ó õ
	ð $Ð Ø"Ð ØÐ Ø(Ð ØÐ Ø*Ð õ;õHõð4 #'Ð4L÷oð #'Ð4O÷c÷
÷"p÷fõ4÷e4õP÷>ISõXõ*õ>÷e÷P"õJ÷DðH8Ð ó õ4õõ÷NQ÷b"÷JðB 4G÷ ð6 $Ø"&÷Põ
3õ"÷Eøðc@ ô ØƒLðús   Ä'L9 Ì9	MÍM