+
    io
                         R t ^ RIt^ RIt^ RIt^ RIHt ]P                  ! R4      t]! ]P                  P                  R]P                  ! 4       R,          4      4      t]R,          tR R ltR	 R
 ltR R ltR# )ua  Built-in boot-md hook — run ~/.hermes/BOOT.md on gateway startup.

This hook is always registered. It silently skips if no BOOT.md exists.
To activate, create ``~/.hermes/BOOT.md`` with instructions for the
agent to execute on every gateway restart.

Example BOOT.md::

    # Startup Checklist

    1. Check if any cron jobs failed overnight
    2. Send a status update to Discord #general
    3. If there are errors in /opt/app/deploy.log, summarize them

The agent runs in a background thread so it doesn't block gateway
startup. If nothing needs attention, it replies with [SILENT] to
suppress delivery.
N)Pathzhooks.boot-mdHERMES_HOMEz.hermeszBOOT.mdc                0    V ^8  d   QhR\         R\         /# )   contentreturnstr)formats   ":/home/ubuntu/hermes-agent/gateway/builtin_hooks/boot_md.py__annotate__r      s            c                    RV  R2# )z3Wrap BOOT.md content in a system-level instruction.z^You are running a startup boot checklist. Follow the BOOT.md instructions below exactly.

---
z
---

Execute each instruction. If you need to send a message to a platform, use the send_message tool.
If nothing needs attention and there is nothing to report, reply with ONLY: [SILENT] )r   s   &r   _build_boot_promptr      s    	 ) $	$
r   c                (    V ^8  d   QhR\         RR/# )r   r   r   Nr   )r
   s   "r   r   r   .   s     4 4S 4T 4r   c                l    ^ RI Hp \        V 4      pV! RRR^R7      pVP                  V4      pVP	                  RR4      pV'       d'   RV9  d    \
        P                  RVR,          4       R# \
        P                  R	4       R#   \         d"   p\
        P                  R
T4        Rp?R# Rp?ii ; i)z@Spawn a one-shot agent session to execute the boot instructions.)AIAgentT)
quiet_modeskip_context_filesskip_memorymax_iterationsfinal_response z[SILENT]zboot-md completed: %s:N   Nz%boot-md completed (nothing to report)zboot-md agent failed: %sN)		run_agentr   r   run_conversationgetloggerinfo	Exceptionerror)r   r   promptagentresultresponsees   &      r   _run_boot_agentr'   .   s    4%#G,#	
 ''/::.3
(2KK/$@KK?@ 4/334s   A,B 0B B3B..B3c                4    V ^8  d   QhR\         R\        RR/# )r   
event_typecontextr   N)r	   dict)r
   s   "r   r   r   D   s!      S 4 D r   c                >  "   \         P                  4       '       g   R# \         P                  RR7      P                  4       pV'       g   R# \        P                  R\        V4      4       \        P                  ! \        V3RRR7      pVP                  4        R# 5i)u5   Gateway startup handler — run BOOT.md if it exists.Nzutf-8)encodingzRunning BOOT.md (%d chars)zboot-mdT)targetargsnamedaemon)	BOOT_FILEexists	read_textstripr   r   len	threadingThreadr'   start)r)   r*   r   threads   &&  r   handler;   D   sw     !!7!399;G
KK,c'l; Z	F LLNs   ABAB)__doc__loggingosr7   pathlibr   	getLoggerr   environr   homer   r2   r   r'   r;   r   r   r   <module>rC      se   &  	  			?	+2::>>-y1HIJ)#	4,r   