+
    „WÝjÞ  ã                  ó¾   € R t ^ RIHt ^ RIt^ RIHt ^ RIt^ RIt^ RIH	t	H
t
 ^ RIHtHt RtRRRR/R	 R
 lltRR/R R lltR R ltR R ltRt^tRtRR R lltR# )zOOne detached-process primitive; callers must first prove owner/service absence.)ÚannotationsN)ÚPath)Úwindows_detach_popen_kwargsÚ_WINDOWS_GATEWAY_BREAKAWAY_ENV)ÚRuntimeStartErrorÚ	remainingÚ	idle_exitFÚforcec          
     ó,   € V ^8„  d   QhRRRRRRRRRR	/# )
é   Úprofile_homer   ÚdeadlineÚfloatr   Úboolr	   Úreturnzsubprocess.Popen© )Úformats   "ÚTC:\Users\johnn\AppData\Local\hermes\hermes-agent\hermes_cli\gateway_runtime_start.pyÚ__annotate__r   #   s1   € ÷ 01ñ 01¨$ð 01¸Uð 01Ètð 01Ø#'ð01Ø4Dñ01ó    c               ó|  € V P                  4       p\        \        4      P                  4       P                  P                  pVP                  P                  R8X  d   . MRR.p\
        P                  RR.VORNRNRNV'       d   R	.M. OV'       d   R
.M. Op^ RIHp V! \        \        P                  4      VRR7      p	\
        P                  R8X  d?   ^ RIHp
 V
! V4      w  r{pV'       g   \        R4      hV	P!                  V4       RV	\"        &   T	P!                  \%        V4      RRR7       ^ RIHp . \*        OVO F  pV	P-                  VR4       K  	  \/        V4       VR,          pVP1                  RRR7        VR,          P3                  R^ R7      ;_uu_ 4       p\/        V4       \4        P6                  ! V3RVRV	RRR\4        P8                  RVR V/\;        4       B uuRRR4       #   + '       g   i     R# ; i  \<         d+   p\
        P                  R8X  d   R!MR"p\        T4      ThRp?ii ; i)#aL  Request a daemon, not readiness. Refuse Windows no-breakaway fallback.

No --replace, persistence, login changes, elevation, shell, or inherited stdio.
The gateway runtime's own exclusive ownership fence arbitrates racing starts.
``idle_exit``: the daemon ends itself once idle (a chat/TUI/cron client's own start; never
Desktop's ``gateway ensure``, which keeps its attached gateway for the app's lifetime).
``force``: a ``gateway restart --force --detach`` replacement keeps the ``--force`` its old owner
needed (a named profile under a multiplexer), or it exits on the run-side guard.
Úprofilesz	--profileÚdefaultz-mzhermes_cli.mainÚgatewayÚrunz--quietz--idle-exitz--force)Úserved_profile_child_envT)ÚbaseÚtarget_homeÚinherit_credentialsÚwin32)Úwindowless_gateway_restart_specÚwindows_interpreter_unavailableÚ1úutf-8)ÚHERMES_HOMEÚHERMES_GATEWAY_DETACHEDÚPYTHONIOENCODING)Ú_VAR_MAPNÚlogs)ÚparentsÚexist_okúgateway-stdio.logÚab)Ú	bufferingÚcwdÚenvÚ	close_fdsÚstdinÚstdoutÚstderrÚwindows_breakaway_unavailableÚspawn_failed)Úresolver   Ú__file__ÚparentÚnameÚsysÚ
executableÚtools.environments.localr   ÚdictÚosÚenvironÚplatformÚhermes_cli.gateway_windowsr    r   Úupdater   ÚstrÚgateway.session_contextr'   ÚDAEMON_STRIPPED_ENVÚpopr   ÚmkdirÚopenÚ
subprocessÚPopenÚDEVNULLr   ÚOSError)r   r   r   r	   ÚhomeÚrootÚselectorÚcommandr   r/   r    Ú_Úoverlayr'   Úkeyr(   ÚoutputÚexcÚreasons   &$$$               r   Úspawn_unmanaged_gatewayrW   #   s(  € ð ×ÑÓ!€DÜ”‹>×!Ñ!Ó#×*Ñ*×1Ñ1€Dð —[‘[×%Ñ%¨Ô3‰r¸+ÀyÐ9Q€HÜ�~‰~˜tÐ%6ð Y¸ð YÀ9ð YÈeð YÐU^ð Yß$-�-‘°2ðYßIN¸9¹+ÐTVðY€Gõ BÙ
"¬¬R¯Z©ZÓ(8ÀdÐ`dÔ
e€CÜ
‡|�|�wÔÝNÙ=¸gÓFÑˆ�GßÜ#Ð$EÓFÐFØ�
‰
�7ÔØ.1ˆÔ*Ñ+Ø‡J�Jœ3˜t›9¸cÐT[€JÔ\õ 1Ø0Ô$Ð0 xÓ0ˆØ�‰��TÖñ 1äˆhÔØ�&�=€DØ‡J�J�t d€JÔ+ð1ØÐ(Õ(×.Ñ.¨t¸qÐ.×AÔAÀVÜ�hÔÜ×#Ò# Gñ E°ð E¸3ð EÈ$ð EÜ*4×*<Ñ*<ðEØEKðEØTZðEä&AÓ&CñE÷ B×A×AÓAûô
 ô 1Ü47·L±LÀGÔ4KÑ0ÐQ_ˆÜ Ó'¨SÐ0ûð1ús7   Æ"H Æ#AG2Ç'
H Ç2H	Ç=H ÈH ÈH;È%H6È6H;c               ó$   € V ^8„  d   QhRRRRRR/# )r   r   r   r	   r   r   Úintr   )r   s   "r   r   r   V   s!   € ÷ ñ ¨Tð ¸Tð Ècñ r   c               óØ   € ^ RI p \        WP                  4       ^,           VR7       \	        R4       ^ #   \         d*   p\	        RT 2\
        P                  R7        Rp?^# Rp?ii ; i)a  ``gateway restart --detach`` with no service: start the stopped owner's replacement the way
``gateway ensure`` starts an absent one. In the foreground, the restarting client (Desktop's
bounded, piped call) would itself become the long-lived gateway it only meant to restart.N)r   r	   u3   âœ— Could not start the gateway in the background: )Úfileu)   âœ“ Started the gateway in the background)ÚtimerW   Ú	monotonicr   Úprintr:   r3   )r   r	   r\   rU   s   &$  r   Ústart_detached_replacementr_   V   s_   € ó ðÜ ·~±~Ó7GÈ"Õ7LÐTYÕZô 
Ð
5Ô6Ùøô	 ô ÜÐCÀCÀ5ÐIÔPS×PZÑPZÕ[Ýûðús   †"5 µA)Á A$Á$A)c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r   r   )r   s   "r   r   r   d   s   € ÷ 7ñ 7 ð 7¨$ñ 7r   c                ó"   € V R ,          R,          # )r(   r+   r   ©r   s   &r   Ústdio_log_pathrc   d   s   € Ø˜&Õ Ð#6Õ6Ð6r   c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r   rY   r   )r   s   "r   r   r   h   s   € ÷ ñ  ð ¨#ñ r   c                ón   €  \        V 4      P                  4       P                  #   \         d     ^ # i ; i)zCWhere this launch's output will start in the append-only stdio log.)rc   ÚstatÚst_sizerL   rb   s   &r   Ústdio_log_sizerh   h   s3   € ðÜ˜lÓ+×0Ñ0Ó2×:Ñ:Ð:øÜô Úðús   ‚"% ¥4³4c          
     ó,   € V ^8„  d   QhRRRRRRRRRR	/# )
r   r   r   ÚoffsetrY   ÚstatusÚpidz
int | Noner   rC   r   )r   s   "r   r   r   u   s7   € ÷ fñ f¨ð f°sð fÀCð fÈjð fÐdgñ fr   c           	     ób  € \        V 4      p VP                  R4      ;_uu_ 4       pVP                  \        WP	                  4       P
                  \        ,
          4      4       VP                  4       P                  RRR7      pRRR4       XP                  4        Uu. uFV  pTP                  4       '       g   K  TP                  4       P                  \        4      '       d   KF  TP                  4       NKX  	  up\         ) R pT'       g{   ^ RIHp	 T	! T R,          4      ;'       g    / p
T
P'                  R	4      '       dE   TeA   T
P'                  R
4      T8X  d+   \)        T
R	,          4      R,          .pT R,          R,          p^ RIHp T! RP/                  T4      RRR7      p\0        P2                  R8X  d   RT R2MRT R2pT'       d'   RP/                  R TP                  4        4       4      MRpRT RT RT 2#   + '       g   i     ELˆ; i  \         d    Rp EL›i ; iu upi )a  What a client prints when the gateway it started died before serving: the exit status, the
redacted tail of THIS launch's stdio (the traceback lives there, written before logging is up and
before the detached-stdio redactor is installed) and the command that shows the whole log.Úrbr#   Úreplace)ÚerrorsNÚ )Úread_runtime_statuszgateway_state.jsonÚexit_reasonrl   :NiÐ  Nr(   zgateway.log)Úredact_sensitive_textÚ
T)r	   Úredact_url_credentialsr   ztype "Ú"ztail -n 200 'Ú'c              3  ó4   "  € T F  pR V,           x € K  	  R# 5i)z  Nr   )Ú.0Úlines   & r   Ú	<genexpr>Ú)startup_failure_report.<locals>.<genexpr>�   s   é € Ð?Ñ-> T�T˜D—[’[Ó->ùs   ‚z  (it wrote no output)zthe gateway exited with status z before it could serve:
z
Full log: )rc   rH   ÚseekÚmaxrf   rg   Ú_TAIL_BYTESÚreadÚdecoderL   Ú
splitlinesÚstripÚlstripÚ
startswithÚ_BANNER_PREFIXESÚrstripÚ_TAIL_LINESÚgateway.statusrr   ÚgetrC   Úagent.redactrt   Újoinr:   r@   )r   rj   rk   rl   ÚpathÚlogÚtextr{   Úlinesrr   Ústatus_filert   ÚtailÚseeÚbodys   &&&&           r   Ústartup_failure_reportr–   u   sÓ  € ô ˜,Ó'€DðØ�Y‰Y�t�_Œ_ Ø�H‰H”S˜§¡£×!4Ñ!4´{Õ!BÓCÔDØ—8‘8“:×$Ñ$ W°YÐ$Ó?ˆD÷ ð
 (,§¡Ô'8ó QÑ'8˜tØ—
‘
—ô Ø%)§[¡[£]×%=Ñ%=Ô>N×%Oô ˆT�[‰[Ž]Ñ'8ñ QÜR]ÐQ]ÐQ^ð`€Eçõ 	7Ù)¨,Ð9MÕ*MÓN×TÐTÐRTˆØ�?‰?˜=×)Ò)¨cªoÀ+Ç/Á/ÐRWÓBXÐ\_ÔB_Ü˜ ]Õ3Ó4°UÕ;Ð<ˆEØ &Õ(¨=Õ8ˆDÝ2Ù  §¡¨5Ó!1¸ÐVZÔ[€DÜ!Ÿl™l¨gÔ5ˆF�4�&˜Ñ
¸]È4È&ÐPQÐ;R€CßCGˆ4�9‰9Ñ?¨T¯_©_Ô->Ó?Ô?ÐMe€DØ,¨V¨HÐ4MÈdÈVÐS_Ð`cÐ_dÐeÐe÷' �_ˆ_ûô ô Ø‹ðüòQsA   �H ¦AHÂH ÂH,Â<&H,Ã'H,ÈH	ÈH ÈH ÈH)È(H)) ÚHERMES_PROFILEÚHERMES_YOLO_MODEÚHERMES_IGNORE_RULESÚHERMES_SAFE_MODEÚHERMES_IGNORE_USER_CONFIGÚHERMES_ACCEPT_HOOKSÚHERMES_SESSION_SOURCEÚTERMINAL_CWDÚHERMES_KANBAN_TASKÚHERMES_KANBAN_WORKSPACEÚHERMES_KANBAN_BRANCHÚHERMES_KANBAN_RUN_IDÚHERMES_KANBAN_CLAIM_LOCKÚHERMES_KANBAN_CLAIM_TTL_SECONDSÚHERMES_KANBAN_GOAL_MODEÚHERMES_KANBAN_GOAL_MAX_TURNSÚHERMES_KANBAN_DBÚHERMES_KANBAN_WORKSPACES_ROOTÚHERMES_KANBAN_BOARDÚHERMES_TENANTÚHERMES_SESSION_SOURCE_EXPLICITÚHERMES_TURN_AUTHORÚHERMES_INTERACTIVEÚHERMES_GATEWAY_SESSIONÚHERMES_SINGLE_QUERY_SESSIONÚHERMES_EPHEMERAL_SYSTEM_PROMPTÚHERMES_PREFILL_MESSAGES_FILEÚHERMES_INFERENCE_PROVIDERÚHERMES_ENABLE_PROJECT_PLUGINSÚHERMES_TUI_CLIENT_ENVÚINVOCATION_IDÚJOURNAL_STREAM)u   â”Œu   â”‚u   â”œu   â””i   )N)Ú__doc__Ú
__future__r   r>   Úpathlibr   rI   r:   Úhermes_cli._subprocess_compatr   r   Ú"hermes_cli.gateway_runtime_servicer   r   rE   rW   r_   rc   rh   r‡   r‰   r€   r–   r   r   r   Ú<module>r¼      so   ðÙ UÝ "ã 	Ý Û Û 
ç eß KðÐ ð"01ÐV[ð 01Ø*/÷01ðfÀE÷ õ7õð 0Ð Ø€Ø€÷fñ fr   