+
    „WÝjw  ã                  ój   € R t ^ RIHt ^ RIt^ RIt^ RIt]P                  ! R4      tR R ltR R lt	R# )a.  Startup auto-maintenance for the classic CLI: state-db pack/vacuum and checkpoint pruning run off the prompt thread.

Split out of ``cli.py``; ``cli`` re-exports every public name and moved bodies late-bind
cli-level names through ``from cli import ...`` at call time so facade monkeypatch seams hold.
)ÚannotationsNÚclic               ó   € V ^8„  d   QhRR/# ©é   ÚreturnÚNone© )Úformats   "ÚSC:\Users\johnn\AppData\Local\hermes\hermes-agent\hermes_cli\cli_auto_maintenance.pyÚ__annotate__r      s   € ÷ 8Cñ 8C°$ñ 8Có    c                óN  a a€ S f   R#  ^ RI Hp ^ RIHp V! 4       oRVV 3R lRR3RS P                  R	R
33 FX  w  r4rVS P                  V4      '       d   K   V! 4       pS P                  VR4       V'       g   KC  \        P                  WW4       KZ  	  V! 4       P                  R4      ;'       g    / p	V	P                  RR4      '       dF   S P!                  \#        V	P                  R^4      4      \%        V	P                  R^4      4      R7       V	P                  RR4      '       g   R# S P'                  \%        V	P                  R^Z4      4      \%        V	P                  R^4      4      \%        V	P                  R^4      4      \)        V	P                  RR4      4      SR,          R7       R#   \        P                  \        \        \        3 d#   p\        P                  Yh4       ^ p Rp?EL‘Rp?ii ; i  \*         d"   p
\        P-                  RT
4        Rp
?
R# Rp
?
ii ; i)zXOne-time repairs + auto-archive/prune/vacuum per the ``sessions:`` config. Never raises.N)Úload_config)Úget_hermes_homeÚghost_session_prune_v1c                 ó6   <€ SP                  S R ,          R7      # )Úsessions)Úsessions_dir)Úprune_empty_ghost_sessions)Ú_hermes_home_maintÚ
session_dbs   €€r   Ú<lambda>Ú0_run_state_db_auto_maintenance.<locals>.<lambda>   s   ø€ ˜
×=Ñ=ÐK]Ð`jÕKjÐ=Ôkr   z"Pruned %d empty TUI ghost sessionszGhost session prune skipped: %sÚ orphaned_compression_finalize_v1z*Finalized %d orphaned compression sessionsz'Orphan compression finalize skipped: %sÚ1r   Úauto_archiveFÚauto_archive_daysÚmin_interval_hours)Ú	idle_daysr   Ú
auto_pruneÚretention_daysÚmin_vacuum_interval_daysÚvacuum_after_pruneT)r!   r   r"   Úvacuumr   z%state.db auto-maintenance skipped: %s)Úhermes_cli.configr   Úhermes_constantsr   Ú&finalize_orphaned_compression_sessionsÚget_metaÚsqlite3ÚErrorÚOSErrorÚ
ValueErrorÚRuntimeErrorÚloggerÚwarningÚset_metaÚinfoÚgetÚmaybe_auto_archiveÚfloatÚintÚmaybe_auto_prune_and_vacuumÚboolÚ	ExceptionÚdebug)r   Ú_load_full_configÚ_get_hermes_homeÚmeta_keyÚrepairÚdone_msgÚskip_msgÚcountÚ_excÚcfgÚexcr   s   f          @r   Ú_run_state_db_auto_maintenancerD      sæ  ù€ àÒÙð4CÝFÝHÙ-Ó/Ðð
 )ÝkØ4Ð6Wðð 3Ø×AÑAØ<Ð>gðó5
Ñ0ˆH˜hð ×"Ñ" 8×,Ò,ÙðÙ›�ð ×Ñ ¨#Ô.ß‰uÜ—‘˜HÖ,ñ35
ñ6 !Ó"×&Ñ& zÓ2×8Ð8°bˆð �7‰7�> 5×)Ò)Ø×)Ñ)Ü §¡Ð(;¸QÓ ?Ó@Ü#& s§w¡wÐ/CÀRÓ'HÓ#Ið *ô ð
 �w‰w�| U×+Ò+ÙØ×.Ñ.Ü˜sŸw™wÐ'7¸Ó<Ó=Ü" 3§7¡7Ð+?ÀÓ#DÓEÜ%(¨¯©Ð1KÈRÓ)PÓ%QÜ˜Ÿ™Ð 4°dÓ;Ó<Ø+¨jÕ8ð 	/ö 	
øô) —M‘M¤7¬J¼ÐEô ô —‘˜xÔ.Ø–ûð	ûô6 ô CÜ�‰Ð<¸c×BÒBûðCús\   ŠAG8 ÁF.ÁG8 Á;5G8 Â1G8 ÃAG8 Ä+BG8 Æ.%G5ÇG0Ç*G8 Ç0G5Ç5G8 Ç8H$ÈHÈH$c               ó   € V ^8„  d   QhRR/# r   r	   )r
   s   "r   r   r   L   s   € ÷ gñ g¨$ñ gr   c                 ó`   € ^ RI Hp  \        P                  ! V RRR7      P	                  4        R# )zíCheckpoint store retention on a daemon thread: its ``git gc`` can block for tens of seconds
on a large store, which used to stall the prompt once a day. ``auto_prune_from_config`` owns the
config gate and the 24h marker and never raises.©Úauto_prune_from_configzcheckpoint-auto-pruneT)ÚtargetÚnameÚdaemonN)Útools.checkpoint_maintenancerH   Ú	threadingÚThreadÚstartrG   s    r   Ú _run_checkpoint_auto_maintenancerP   L   s&   € õ DÜ×ÒÐ2Ð9PÐY]Ô^×dÑdÖfr   )
Ú__doc__Ú
__future__r   Úloggingr)   rM   Ú	getLoggerr.   rD   rP   r	   r   r   Ú<module>rU      s7   ðñõ #ã Û Û ð 
×	Ò	˜5Ó	!€õ8C÷vgr   