+
    iHàjib  ã                   óÔ  € R t  ^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
Ht ^ RIt^ RIt]P                  ! ]4      tRt0 RmtRtR tR]RR!/tR tR tR tR	 tR
 tR tR tR t ! R R4      t]! 4       t ^
t!R t" ! R R4      t#]	PH                  ! R4      t%R t&R t'R t(R t)R t*R t+R t,R t-]R8X  d   ].! ]-! 4       4      hR#   ] d   t]P                  R8w  d   h  RtALÚRtAii ; i)"a3  Private exec entry. No agent/config imports before adopted process authority.

stdin is the owner's bounded bootstrap/control pipe; a duplicate of stdout is
reserved for framed events before runtime imports redirect ordinary output.
Neither assignment secrets nor launch credentials appear in argv or logs.
NÚhermes_bootstrap)ÚPathÚbilling_blockÚ	free_tierc                 ó°   € V R J ;'       gL    \        V 4      \        \        \        39   ;'       g'    \	        V \
        4      ;'       d    \        V 4      R8*  # )Ni   )ÚtypeÚboolÚintÚfloatÚ
isinstanceÚstrÚlen)Úvalues   &Ú9/home/ubuntu/.hermes/hermes-agent/agent/managed_worker.pyÚ_scalarr   -   sI   € Ø�Dˆ=×pÐpœD ›K¬D´#´uÐ+=Ñ=×pÐpÄ*ÈUÔTWÓBX×BoÐBoÔ]`ÐafÓ]gÐkoÑ]oÐpó    c                 óæ   € \        V\        4      ;'       d[    \        V4      \        \        V ,          4      ,
          '       * ;'       d(    \	        \        \        VP                  4       4      4      # ©N)r   ÚdictÚsetÚSTRUCTURED_FIELDSÚallÚmapr   Úvalues)Úkeyr   s   &&r   Ú_structuredr   1   sO   € Ü�eœTÓ"×yÐy¬3¨u«:¼Ô<MÈcÕ<RÓ8SÕ+SÔ'S×yÐyÔX[Ô\_Ô`gÐin×iuÑiuÓiwÓ\xÓXyÐyr   c           
     ó¶  € V P                  4        UUu/ uFr  w  rV\        9   g   K  V\        9  g   K  Ve'   \        V4      \        \
        \        \        39   g   KI  T\        V\        4      '       d   VR8w  d
   VR,          MTbKt  	  ppp\        P                  4        F¦  w  rE\        V P                  V4      ;p\        4      '       g   K.  VP                  4        UUu/ uFY  w  rW9   g   K  Ve'   \        V4      \        \
        \        \        39   g   K7  T\        V\        4      '       d
   VR,          MTbK[  	  uppW4&   K¨  	  V# u uppi u uppi )z]Worker side: the receipt fields of ``run_conversation``'s result, scalars only, text bounded.Úfinal_response:Ni   N)ÚitemsÚRESULT_FIELDSr   r   r   r	   r
   r   r   Úgetr   )ÚresultÚkÚvÚframer   ÚfieldsÚblocks   &      r   Úresult_framer'   5   s6  € à^d×^jÑ^jÔ^lô yÑ^lÑVZÐVWØ”]Ñ"ô QØ'(Ô0AÑ'Aô QØGHÂyÔTXÐYZÓT[Ô`dÔfiÔkpÔruÐ_vÑTvô QˆQœZ¨¬3×/Ò/°AÐ9IÔ4I��5–ÈqÒPÑ^l€Eñ yä(×.Ñ.Ö0‰ˆÜ˜vŸz™z¨#›Ð.�e´×5Ô5ØOTÏ{É{Ì}ô `É}ÁtÀqØ™[ô CØ./ªi¼4À»7ÄtÌSÔRWÔY\ÐF]Ñ;]ô C˜!¬°A´s×);Ò);˜Q˜užXÀÒBÉ}ò `ˆE‹Jñ 1ð €Lùóyùó`s'   ”E¨Eµ%EÁ-EÃ$
EÃ3%EÄ&Ec                óš  a € \        S \        4      '       dé   \        S 4      \        \        4      ,
          '       gÄ   \        S P	                  R4      \
        4      '       dŸ   \        ;QJ d#    V 3R l\         4       F  '       g   K   RM	  RM! V 3R l\         4       4      '       gW   \        ;QJ d*    R S P                  4        4       F  '       g   K   RM	  RM! R S P                  4        4       4      '       d   \        R4      h\        S 4      p\         F*  pVP	                  V4      e   K  VP                  VR4       K,  	  VP                  RR4      VP                  R	R4      rC\        ;QJ d    R
 W43 4       F  '       g   K   RM	  RM! R
 W43 4       4      '       d   \        R4      hVP                  RR4      VP                  RR4      reVf	   Vf   V/ 3# RVf   T;'       g    ^ MTRVf   T;'       g    ^ MT/pVR,          VR,          ,           VR&   TP                  T;'       g    ^ T;'       g    ^ R7       W3# )zªOwner side of the worker's result frame: ``(result, usage)`` in the in-process turn's shape
(gateway projection: prompt/completion tokens as input/output), or ValueError.r   c              3   óŠ   <"  € T F8  pSP                  V4      R J;'       d    \        VSV,          4      '       * x € K:  	  R # 5ir   )r    r   )Ú.0r   r!   s   & €r   Ú	<genexpr>Ú accept_result.<locals>.<genexpr>D   s:   øé € ÐrÑ`qÐY\�6—:‘:˜c“?¨$Ð.×TÐT´{À3ÈÈsÍÓ7TÔ3TÔTÓ`qùs
   ƒA¢!ATFc              3   ór   "  € T F-  w  rVR 8w  g   K  V\         9  g   K  \        V4      '       * x € K/  	  R# 5i)r   N)r   r   )r*   r   r   s   &  r   r+   r,   E   s;   é € ð P¹©*¨#ØÐ-Ñ-ô &Ø25Ô=NÑ2Nô &”w˜u“~×%Ñ%»ùs   ‚7’7Ÿ7Úinvalid_worker_resultNÚ_turn_input_tokensÚ_turn_output_tokensc              3   ót   "  € T F.  qR J;'       d    \        V4      \        J;'       g    V^ 8  x € K0  	  R # 5ir   )r   r	   )r*   r   s   & r   r+   r,   N   s5   é € Ð
hÑTgÈ5˜Ð×FÐF¤$ u£+´SÐ"8×"EÐ"E¸EÀA¹IÔFÓTgùs   ‚8‘8ª8Úprompt_tokensÚcompletion_tokensÚinput_tokensÚoutput_tokensÚtotal_tokens)r4   r5   )r   r   r   r   r    r   Úanyr   r   Ú
ValueErrorÚpopÚupdate)r!   Úacceptedr   Úturn_inÚturn_outÚincomingÚoutgoingÚusages   f       r   Úaccept_resultrA   @   sÓ  ø€ ô �vœt×$Ò$¬¨F«´c¼-Ó6H×(HÔ(HÔPZÐ[a×[eÑ[eÐfvÓ[wÔy|×P}ÒP}ß‹sÔrÕ`qÓr�s�sŠsÔrÕ`qÓr×rÒrß‹sñ P¸¿¹¼ó P�s�sŠsñ P¸¿¹¼ó P÷ Pò PäÐ0Ó1Ð1Ü�F‹|€Hß ˆØ�<‰<˜ÓÔ$à�L‰L˜˜dÖ#ñ !ð !Ÿ™Ð%9¸4Ó@À(Ç,Á,ÐOdÐfjÓBkˆXß
ƒsÑ
hÐU\ÑTgÓ
h‡s‡s‚sÑ
hÐU\ÑTgÓ
h×hÒhÜÐ0Ó1Ð1Ø!Ÿ™ o°tÓ<¸h¿l¹lÐK^Ð`dÓ>eˆhØÒ˜HÒ,Ø˜ˆ|ÐØ¨gªo˜XŸ]˜]¨øÀ7Ø¨xÒ/?˜hŸm˜m¨!øÀXðO€Eà! .Õ1°E¸/Õ4JÕJ€Eˆ.ÑØ‡O�O § ¨Q¸h¿m¸mÈ!€OÔLØˆ?Ðr   c                 ó>  € V P                  \        ^,           4      pV'       g   \        R4      h\        V4      \        8”  g   VP	                  R4      '       g   \        R4      h\        P                  ! V4      p\        V\        4      '       g   \        R4      hV# )é   Úmanaged_worker_pipe_closedó   
Úmanaged_worker_frame_too_largeÚinvalid_managed_worker_frame)
ÚreadlineÚ	MAX_FRAMEÚEOFErrorr   Úendswithr8   ÚjsonÚloadsr   r   )ÚstreamÚliner$   s   &  r   Ú
read_framerP   Z   su   € Ø�?‰?œ9 q�=Ó)€DßÜÐ3Ó4Ð4Ü
ˆ4ƒy”9Ô D§M¡M°%×$8Ò$8ÜÐ9Ó:Ð:Ü�JŠJ�tÓ€EÜ�eœT×"Ò"ÜÐ7Ó8Ð8Ø€Lr   c                 ó¢   € \         P                  ! V R RRR7      P                  4       R,           p\        V4      \        8”  d   \        R4      hV# )TF)Úensure_asciiÚ	allow_nanÚ
separatorsrE   rF   )Ú,Ú:)rL   ÚdumpsÚencoder   rI   r8   )r$   Údatas   & r   Úencode_framerZ   f   sB   € Ü�:Š:�e¨$¸%ÈJÔW×^Ñ^Ó`ÐchÕh€DÜ
ˆ4ƒy”9ÔÜÐ9Ó:Ð:Ø€Kr   c                 óî  a € \        S 4      R 0,
          \        8w  g   S R,          ^8w  d   \        R4      hS R,          p0 Rmp\        V\        4      '       EdF   \        V4      V8w  Eg5   VR,          \
        P                  ! 4       8w  Eg   VR,          S R,          8w  gþ   \        S R,          4      P                  4       '       dØ   \        S R,          \        4      '       d»   \        ;QJ d    V 3R lR 4       F  '       g   K   R	M	  R
M! V 3R lR 4       4      '       g{   \        S R,          4      \        Jga   \        S R,          4      \        JgG   S R,          '       d   S R,          '       d)   S R,          e)   \        S R,          \        4      '       g   \        R4      h^ RIHp S R,          e:   \        S R,          \        4      '       d   V! S R,          4      f   \        R4      hS # )Úattachments_v1ÚversionÚ invalid_managed_worker_bootstrapÚscopeÚ
profile_idÚpidÚhomeÚpolicyc              3   ó\   <"  € T F!  p\        SV,          \        4      '       * x € K#  	  R # 5ir   )r   r   )r*   r"   r$   s   & €r   r+   Ú%validate_bootstrap.<locals>.<genexpr>u   s$   øé € ÐbÑ:a°Q”z %¨¥(¬CÓ0×0Ñ0Ó:aùs   ƒ),TFÚ	safe_modeÚignore_user_configÚapi_key)Úparse_turn_authorÚturn_author>   ra   ÚbirthÚepochÚsecretÚ
generationr`   Ú
session_idÚexecution_id)ÚtextÚrouteÚuser_idÚchat_id)r   ÚBOOTSTRAP_FIELDSr8   r   r   ÚosÚgetpidr   Úis_absoluter7   r   r   r   Úagent.turn_authorri   )r$   r_   r%   ri   s   f   r   Úvalidate_bootstraprz   m   sj  ø€ Ü
ˆ5ƒzÐ%Ð&Õ&Ô*:Ô:¸eÀIÕ>NÐRSÔ>SÜÐ;Ó<Ð<Ø�'�N€EÚj€FÜ�uœd×#Ó#¤s¨5£z°VÕ';¸uÀU½|ÌrÏyÊyË{Õ?ZØ�\Õ" e¨F¥mÔ3¼4ÀÀfÅÓ;N×;ZÑ;Z×;\Ò;\Ü˜e H�o¬t×4Ò4ß‹sÔbÑ:aÓb�s�sŠsÔbÑ:aÓb×bÒbÜ�E˜+Õ&Ó'¬tÓ3´t¸EÐBVÕ<WÓ7XÔ`dÓ7dØ�k×"Ô"¨5Ð1E×+FÔ+FØ�iÕ Ò,´ZÀÀiÕ@PÔRU×5VÒ5VÜÐ;Ó<Ð<Ý3Øˆ]ÕÒ'´¸EÀ-Õ<PÔRV×1WÒ1WÙ/@ÀÀ}ÕAUÓ/VÒ/^ÜÐ;Ó<Ð<Ø€Lr   c                ó¼   € \         P                  ! V R,          R,          4      pV R,          '       g   ^ RIHp V! V4       R# ^ RIHp V! V R,          RVR	7       R# )
a”  Freeze the owner's assignment process-wide before any config/provider/agent import.

The session's frozen config (never the live profile file) is what every config reader in
this process returns afterwards, so a profile edit after creation cannot reshape it (MCP
server definitions included). Ordinary sessions keep plugins, MCP and hooks; bypass sessions
also bind the safe / ignore-user-config policy.
rc   Úconfig_jsonrg   )Ú_bind_worker_configN)Ú_bind_safe_worker_policyrf   T)rf   rg   Úconfig)rL   rM   Úagent.safe_worker_policyr}   r~   )r$   r   r}   r~   s   &   r   Úbind_worker_policyr�   �   sJ   € ô �ZŠZ˜˜h�¨Õ6Ó7€FØÐ%×&Ô&Ý@Ù˜FÔ#ÙÝAÙ u¨[Õ'9ÈdÐ[a×br   c                   ó,   a € ] tR t^’t o R tR tRtV tR# )ÚWorkerChannelc                óF   € Wn         \        P                  ! 4       V n        R # r   )rN   Ú	threadingÚLockÚlock)ÚselfrN   s   &&r   Ú__init__ÚWorkerChannel.__init__“   s   € ØŒÜ—N’NÓ$ˆŽ	r   c                óð   € \        R V/VC4      pV P                  ;_uu_ 4        V P                  P                  V4       V P                  P	                  4        RRR4       R#   + '       g   i     R# ; i)r   N)rZ   r‡   rN   ÚwriteÚflush)rˆ   ÚkindÚpayloadrY   s   &&, r   ÚsendÚWorkerChannel.send—   sM   € Ü˜V TÐ5¨WÐ5Ó6ˆØ�Y�Y‹YØ�K‰K×Ñ˜dÔ#Ø�K‰K×ÑÔ÷ �Y�YŠYús   ¤6A$Á$A5	)r‡   rN   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r‰   r�   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   rƒ   rƒ   ’   s   ø‡ € ò%÷ ð  r   rƒ   c                 ó^   € R p \         P                  ! \        V 4      P                  4        R# )a.  Then end this worker and, on POSIX, every descendant still in its process group: the owner
spawns it as a group leader (``start_new_session``). Tools that open their own session (the
terminal tool, background processes meant to outlive the turn) are not in it. Never a group
this process does not lead.c                  ó&  € \         P                  R 8w  df   \         P                  ! 4       \         P                  ! 4       8X  d9   ^ RIp \         P
                  ! \         P                  ! 4       V P                  4       \         P                  ! ^4       R# )ÚntN)rv   ÚnameÚgetpgrprw   ÚsignalÚkillpgÚSIGKILLÚ_exit)rŸ   s    r   ÚkillÚ_die_with_owner.<locals>.kill©   sF   € Ü�7‰7�dŒ?œrŸzšz›|¬r¯yªy«{Ô:ÛÜ�IŠI”b—i’i“k 6§>¡>Ô2Ü
�Š�Žr   N)r…   ÚTimerÚORPHAN_GRACE_SECONDSÚstart)r£   s    r   Ú_die_with_ownerr¨   ¤   s!   € ò
ô
 ‡O‚OÔ(¨$Ó/×5Ñ5Ö7r   c                   óD   a € ] tR t^±t o R tR tR tR tR tR t	Rt
V tR# )	ÚWorkerControlsc                ó^  € WuV n         V n        R V n        \        P                  ! 4       V n        \        P                  ! 4       V n        / V n        \        P                  ! 4       V n	        \        P                  ! V P                  RRR7      V n        V P                  P                  4        R # )Nzmanaged-controlsT)Útargetr�   Údaemon)Úchannelrr   Úagentr…   ÚEventÚstoppedÚfinishÚclarificationsr†   r‡   ÚThreadÚreadÚreaderr§   )rˆ   r®   rr   s   &&&r   r‰   ÚWorkerControls.__init__²   su   € Ø#*Ð ˆŒ�d”jØˆŒ
Ü —’Ó(ˆŒÜ—o’oÓ'ˆŒØ ˆÔÜ—N’NÓ$ˆŒ	Ü×&Ò&¨d¯i©iÐ>PÐY]Ô^ˆŒØ�‰×ÑÖr   c                ój  € V P                   P                  4        V P                  e   ^ RIHp V! V P                  4       V P
                  ;_uu_ 4        V P                  P                  4        F#  p\        VR&   VR,          P                  4        K%  	  R R R 4       R #   + '       g   i     R # ; i)N©Úrequest_hard_interruptÚanswerÚevent)	r±   r   r¯   Úagent.interrupt_compatrº   r‡   r³   r   Ú_INTERRUPTED)rˆ   rº   Ústates   &  r   ÚstopÚWorkerControls.stop¼   sr   € Ø�‰×ÑÔØ�:‰:Ò!ÝEÙ" 4§:¡:Ô.Ø�Y�Y‹YØ×,Ñ,×3Ñ3Ö5�Ü".��h‘Ø�g•×"Ñ"Ö$ñ 6÷ �Y�YŠYús   ÁAB!Â!B2	c                óN  € ^ RI Hp   \        \        P                  P
                  4      pVRR/8X  d   V P                  4        K?  VRR/8X  d   V P                  P                  4        R# \        V4      0 Rm8w  g`   VR,          R9  gR   \        VR,          \        4      '       d5   \        VR,          \        4      '       d   \        VR,          4      R	8”  d   \        R
4      hVR,          R8X  d@   VR,          R9  d   \        R
4      hV! V P                  VR,          VR,          R7       EK-  V P                  ;_uu_ 4        V P                  P!                  VR,          4      pVe$   VR,          VR&   VR,          P                  4        RRR4       EK–    + '       g   i     EK¨  ; i  \"        \$        \        3 d\   pT P                  4        T P                  P                  4        \        T\        4      '       g   \'        4         Rp?R#  Rp?R# Rp?ii ; i)é    )Úresolve_gateway_approvalr   rÀ   r²   NÚ	prompt_idr   Úapprovali @  Úinvalid_managed_control)Ú
request_idr»   r¼   >   r   r   rÅ   >   ÚclarifyrÆ   >   ÚdenyÚonceÚalwaysÚsession)Útools.approvalrÄ   rP   ÚsysÚstdinÚbufferrÀ   r²   r   r   r   r   r8   rr   r‡   r³   r    rJ   ÚOSErrorr¨   )rˆ   rÄ   r$   r¿   Úexcs   &    r   rµ   ÚWorkerControls.readÆ   s”  € Ý;ð	"ØÜ"¤3§9¡9×#3Ñ#3Ó4�Ø˜V VÐ,Ô,Ø—I‘I”KÙØ˜V XÐ.Ô.Ø—K‘K—O‘OÔ%ÙÜ˜“JÒ"@Ô@ÀEÈ&ÅMÐYpÔDpÜ)¨%°Õ*<¼c×BÒBÌ*ÐUZÐ[bÕUcÔeh×JiÒJiÜ˜u W�~Ó.°Ô6Ü$Ð%>Ó?Ð?Ø˜•= JÔ.Ø˜W•~Ð-RÔRÜ(Ð)BÓCÐCÙ,¨T¯Z©Z¸¸w½ÐTYÐZeÕTf×gÐgàŸŸ›Ø $× 3Ñ 3× 7Ñ 7¸¸kÕ8JÓ K˜Ø Ò,Ø.3°G­n˜E (™OØ! '�N×.Ñ.Ô0÷	 #ŸŸœûô
 œ'¤:Ð.ô 	"Ø�I‰IŒKØ�K‰K�O‰OÔÜ˜c¤:×.Ò.Ü×!Ò!õ /ûð	"ús9   ˆA"F3 Á,CF3 Å	A
FÆF3 ÆF0	Æ)
F3 Æ3H$Ç	A
HÈH$c           	     óè   € ^ RI Hp 0 RmpV P                  P                  RVP	                  4        UUu/ uF  w  rEWC9   g   K  WEbK  	  uppR7       V! V P
                  VR,          4       R# u uppi )rÃ   )Úack_gateway_approvalrÈ   rÆ   )rY   N>   ÚeditÚcommandrÈ   ÚdescriptionÚsmart_deniedÚallow_sessionÚallow_permanent)rÎ   rÖ   r®   r�   r   rr   )rˆ   rY   rÖ   r%   r"   r#   s   &&    r   rÆ   ÚWorkerControls.approvalå   sY   € Ý7ÚuˆØ�‰×Ñ˜*¸T¿Z¹Z¼\Ô+Y¹\±T°QÈQÉ[¬D¨AªD¹\Ò+YÐÔZÙ˜TŸZ™Z¨¨lÕ);Ö<ùó ,Zs   ´
A.ÁA.c                ó.  € ^ RI HpHp V! 4       RJ d   V! 4       # / pRVRR/pV Fl  pV P                  VR,          VR,          VR,          4      pV\        J d	   R	VR&    V# Vf	   RVR&    V# VP                  4       ;'       g    R
WFR,          &   Kn  	  V# )ac  clarify_tool's batch contract: ``callback(questions) -> {answers, outcome, notice?}``.
One owner prompt per question, stopping at the first that is interrupted or unanswered;
an empty answer is a skip (``None``), as on the other surfaces. A finite turn (``chat -q`` /
``-z``, bound by worker_turn_scope) answers headless at once: its viewer cannot answer.)Úfinite_clarify_replyÚfinite_turn_requiredTÚanswersÚoutcomeÚ	submittedÚquestionÚchoicesÚmulti_selectÚ	cancelledNÚ	timed_outÚqid)Úgateway.session_finiterß   rà   Ú_askr¾   Ústrip)rˆ   Ú	questionsrß   rà   rá   ÚreplyÚentryr»   s   &&      r   rÉ   ÚWorkerControls.clarifyë   s²   € ÷
 	VÙÓ! TÓ)Ù'Ó)Ð)ØˆØ˜G Y°Ð<ˆÛˆEØ—Y‘Y˜u ZÕ0°%¸	Õ2BÀEÈ.ÕDYÓZˆFØœÓ%Ø#.��iÑ Øð
 ˆð	 Š~Ø#.��iÑ Øàˆð %+§L¡L£N×$:Ð$:°dˆG˜%•LÓ!ñ ð ˆr   c           	     ó  € ^ RI p^ RIHp V! 4       pVP                  4       P                  pR\
        P                  ! 4       RR/pV P                  ;_uu_ 4        V P                  P                  4       '       g   \        V P                  4      ^8¼  d   \        uuRRR4       # W€P                  V&   RRR4        V P                  P                  RYq\        T;'       g    . 4      \!        V4      R7       VR,          P#                  V^ 8”  d   TMR4       VR,          V P                  ;_uu_ 4        V P                  P%                  VR4       RRR4       V P                  P                  RVR7       #   + '       g   i     LÌ; i  + '       g   i     LA; i  T P                  ;_uu_ 4        T P                  P%                  TR4       RRR4       M  + '       g   i     M; iT P                  P                  RTR7       i ; i)	rÃ   N)Úget_clarify_timeoutr¼   r»   rÉ   )rÅ   rä   rå   ræ   Úprompt_settled)rÅ   )ÚuuidÚtools.clarify_gatewayrò   Úuuid4Úhexr…   r°   r‡   r±   Úis_setr   r³   r¾   r®   r�   Úlistr   Úwaitr9   )	rˆ   rä   rå   ræ   rô   rò   ÚtimeoutrÅ   r¿   s	   &&&&     r   rë   ÚWorkerControls._ask   sj  € ÛÝ=Ù%Ó'ˆØ—J‘J“L×$Ñ$ˆ	Øœ)Ÿ/š/Ó+¨X°tÐ<ˆØ�Y�Y‹YØ�|‰|×"Ñ"×$Ò$¬¨D×,?Ñ,?Ó(@ÀBÔ(FÜ#÷ ŠYð .3×Ñ 	Ñ*÷ ð	EØ�L‰L×Ñ˜i°9Ü&*¨7¯=¨=°bÓ&9ÌÈ\ÓHZð ô \à�'�N×Ñ¨7°Q¬;¡¸DÔAØ˜•?à——“Ø×#Ñ#×'Ñ'¨	°4Ô8÷ à�L‰L×ÑÐ.¸)ÐÕD÷ �Yú÷ —û�——“Ø×#Ñ#×'Ñ'¨	°4Ô8÷ ——�úà�L‰L×ÑÐ.¸)ÐÕDúsI   ÁA E6Â$E6Â;$F Ã ?F Ä3F	Å6F	Æ	FÆHÆ1G	Ç	HÇG'Ç"&H)r¯   r®   r³   r²   r‡   r¶   rr   r±   N)r’   r“   r”   r•   r‰   rÀ   rµ   rÆ   rÉ   rë   r–   r—   r˜   s   @r   rª   rª   ±   s*   ø‡ € òò%ò"ò>=ò÷*Eð Er   rª   z[A-Za-z0-9_-]{1,200}c                óÔ   € \        V\        4      '       d   VP                  RR4      MRp\        P	                  V4      '       g   \        R4      h\        V 4      R,          V,          # )z°execution_id is a ledger key ('admission-worker:<hex>'); ':' is not a legal Windows path
character, so the private outbox directory is a portable spelling of the same identity.rV   Ú-Ú Úinvalid_execution_idzworker-outboxes)r   r   ÚreplaceÚ_OUTBOX_NAMEÚ	fullmatchr8   r   )rb   rp   r�   s   && r   Ú
outbox_dirr    sW   € ô
 .8¸Äc×-JÒ-Jˆ<×Ñ  SÔ)ÐPR€DÜ×!Ñ! $×'Ò'ÜÐ/Ó0Ð0Ü�‹:Ð)Õ)¨DÕ0Ð0r   c                ó®   € ^ RI Hp ^ RIHp V! 4       ;_uu_ 4        V! \	        V P
                  4      R7       RRR4       R#   + '       g   i     R# ; i)a  The owner's MCP registry never crosses into this fresh interpreter; connect the profile's
configured servers here, filtered to the frozen toolset selection, before tool discovery snapshots
agent.tools. Safe mode keeps its deliberate no-MCP policy (discover_mcp_tools returns []).)Úsuppress_interactive_oauth)Údiscover_mcp_tools)Úallowed_mcp_namesN)Útools.mcp_oauthr  Útools.mcp_tool_discoveryr  rù   Útoolsets)rc   r  r  s   &  r   Údiscover_profile_mcpr  #  s3   € õ ;Ý;Ù	#×	%Õ	%Ù¬T°&·/±/Ó-BÕC÷ 
&×	%×	%Ò	%ús   œAÁA	c                óØ   € \        V RR4      pVe   VP                  ^
R7       \        V RR4      pT P                  \        V\        4      '       d   TMR4       V P                  4        R# )zøA settled admission is a turn boundary, not the end of the session: the owner's
in-process agent keeps its background processes, sandbox and browser between turns
(release_clients), so the worker must too. Only memory extraction is turn-final work.Ú_memory_managerN)rû   Ú_session_messages)ÚgetattrÚflush_pendingÚshutdown_memory_providerr   rù   Úrelease_clients)r¯   ÚmanagerÚmessagess   &  r   Úretire_agentr  -  sa   € ô �eÐ.°Ó5€GØÒØ×Ñ bÐÔ)Ü�uÐ1°4Ó8€HØ	×"Ñ"¬z¸(ÄD×/IÒ/I¡8ÈtÔTØ	×ÑÖr   c           	     óL  € R\        T ;'       g    R4      R\        T;'       g    R4      R\        V\        4      '       d   TM/ /pV'       dl   ^ RIHp \        V^ ,          \         4      '       d
   V^ ,          M\        V^ ,          4      VR&   \        V! VR,          V^ ,          4      ^ ,          4      VR&   ^ R	IHpHp V! VR,          4      VR&   V'       d   V! V^ ,          VR,          4      VR&   \        P                  ! \        P                  ! V\         R
7      4      # )z°The callback arguments an in-process turn publishes from (executor-redacted display args,
the result and its failure verdict); the owner builds the shared tool event from them.Útool_call_idrÿ   r�   ÚtoolÚargs)Ú_detect_tool_failurer!   Úis_error)Úbounded_argsÚbounded_result)Údefault)r   r   r   Úagent.displayr  r   Úgateway.session_tool_eventsr  r  rL   rM   rW   )Úcall_idr�   r  r!   r$   r  r  r  s   &&&*    r   Ú
tool_framer#  ;  sÝ   € ð œS § ¨BÓ/°¼¸T¿^¸^ÀVÓ9LÈfÔ^hÐimÔos×^tÒ^tÑVZÐz|Ð}€EßÝ6Ü'1°&¸µ)¼S×'AÒ'A˜& ž)ÄsÈ6ÐRSÍ9Ã~ˆˆh‰Ü Ñ!5°e¸FµmÀVÈAÅYÓ!OÐPQÕ!RÓSˆˆjÑßHÙ   v¥Ó/€Eˆ&�MßÙ(¨°­°E¸*Õ4EÓFˆˆh‰Ü�:Š:”d—j’j ´Ô4Ó5Ð5r   c                 óJ  a€ \        V 4       ^ RIHpHp \	        V R,          4      pV! V R,          4      pT! RG/ VP                  4        UUu/ uF  w  rgVR8w  g   K  WgbK  	  uppB pVR,          VR,          8w  d   \        R4      hT! WT\        V R,          VR,          4      V4      p	^ RIH	p
 V
! V 4       ^ R	I
Hp VP                  4        ^ R
IHpHpHp V! V R,          4      pV! V4       \#        V4       ^ RIHp ^ RIHpHp ^ RIHp V! V R,          4       R\2        P4                  R&   ^ RIHpHpHp RVP>                  /V! V 4      Cp\A        SV R,          4      pV! V R,          VPB                  4       Rp V! V4      ;_uu_ 4        \E        V VV3/ RVPF                  bRVPH                  bRVPJ                  bRV R,          bRV	bRVR,          bR\M        VPN                  4      bRVPP                  bRVPR                  bRVPT                  RH9   d   VPV                  MVPT                  bRV R,          bR V R ,          bR!V R!,          bR"VPX                  bR#VPX                  '       * bR$VPX                  bR%R&bR'R&bR(VPZ                  bV! VP]                  4       4      BVBV! VP]                  4       VPF                  VPH                  VPJ                  4      BR)V3R* lR+VP^                  R,V3R- lR.V3R/ l/B pVVn0        VPb                  Pe                  4       '       d   ^ R0I3H4p V! V4       SPk                  R1\2        Pl                  ! 4       R27       V	Po                  VR,          4      p^ R3IH8p R4V 9   dJ   ^ R5I9H:p ^ R6I;H<p V! V 4      pV! V R7,          VR8,          4      w  p p!V!'       d   \{        R94      h/ V CR7V /Cp \}        VR:^ 4      ;'       g    ^ \}        VR;^ 4      ;'       g    ^ 3p"R\}        VRR4      R\}        VRR4      /V! VV V4      Cp#\        ^ \}        VR:^ 4      ;'       g    ^ V"^ ,          ,
          4      V#R<&   \        ^ \}        VR;^ 4      ;'       g    ^ T"^,          ,
          4      V#R=&   \�        V4       Rp^ R>IAHBp$ V$! 4        V	P‡                  4        V#P‰                  R?4      f4   V#P‰                  R@4      '       g   V#P‰                  RA4      '       d   RBV#R?&   SPk                  RC\‹        V#4      RD7       VPŒ                  P�                  ^4      '       g   \{        RE4      hV	P�                  4        SPk                  RF4       RRR4       V! V R,          4       Ve   \�        V4        V	P‘                  4        \’        P”                  ! \–        4      ;_uu_ 4        VP‘                  4        RRR4       R# u uppi   + '       g   i     L‚; i  + '       g   i     R# ; i  \’        P”                  ! \–        4      ;_uu_ 4        TP‘                  4        RRR4       i   + '       g   i     i ; i; i  T! T R,          4       Te   \�        T4        T	P‘                  4        \’        P”                  ! \–        4      ;_uu_ 4        TP‘                  4        RRR4       i   + '       g   i     i ; i  \’        P”                  ! \–        4      ;_uu_ 4        TP‘                  4        RRR4       i   + '       g   i     i ; i; i; i)IrÃ   )ÚRuntimeSessionStoreÚ	WorkerRPCr_   rb   rl   Úowner_epochÚstale_epochrp   )Úbind_worker_context)Úprocess_registry)Úrestore_policyÚpolicy_scopeÚregister_worker_hooksrc   )ÚAIAgent)Úregister_gateway_notifyÚunregister_gateway_notify)Úset_current_session_keyrr   Ú1ÚHERMES_GATEWAY_SESSION)Úcheckpoint_agent_kwargsÚconstruct_kwargsÚrouting_agent_kwargsÚephemeral_system_promptNÚmodelÚproviderÚbase_urlrh   Ú
session_dbro   Úenabled_toolsetsÚmax_iterationsÚreasoning_configÚplatformÚgateway_session_keyrs   rt   Úskip_context_filesÚload_soul_identityÚskip_memoryÚskip_background_reviewTÚ
quiet_modeÚpass_session_idÚstream_delta_callbackc                 ó>   <€ V '       d   SP                  R V R7      # R# )Údelta)rq   N)r�   )rq   r®   s   &€r   Ú<lambda>Úexecute.<locals>.<lambda>z  s   ø€ ×W[°7·<±<ÀÈd°<Ó3SÐ3eÐaeÐ3er   Úclarify_callbackÚtool_start_callbackc           	      ó<   <€ SP                   ! R/ \        WV4      B # )ú
tool.start)rO  ©r�   r#  )r"  r�   r  r®   s   &&&€r   rJ  rK  |  s   ø€ ÀÇÂÑ@}Ô]gÐhoÐw{Ó]|Ò@}r   Útool_complete_callbackc           
      ó<   <€ SP                   ! R/ \        WW#4      B # )útool.complete)rS  rP  )r"  r�   r  r!   r®   s   &&&&€r   rJ  rK  }  s'   ø€ È7Ï<Ê<ñ LDÜ[eÐfmÐuyó  \CòLDr   r¹   Úready)ra   )Úrun_worker_turnsr\   )Úrestore_attachments)Úbuild_native_content_partsrq   Ú
media_urlsÚmanaged_attachment_unavailableÚsession_prompt_tokensÚsession_completion_tokensr/   r0   )Úwait_for_title_upgradesr   ÚinterruptedÚfailedrÿ   r!   )r!   Úmanaged_finish_timeoutÚfinished)zworker.adopt)r  Úoneshot)Lr�   Úagent.runtime_session_storer%  r&  r   r   ÚRuntimeErrorr  Úgateway.session_kanbanr)  Útools.process_registryr*  Úrecover_from_checkpointÚgateway.session_policyr+  r,  r-  r  Ú	run_agentr.  rÎ   r/  r0  Útools.approval_contextr1  rv   ÚenvironÚ gateway.session_worker_constructr4  r5  r6  Úskills_promptrª   rÆ   Ú_construct_agentr8  r9  r:  rù   r  Ú	max_turnsr>  Úsourcer?  Úignore_rulesrF  r   rÉ   r¯   r±   rø   r½   rº   r�   rw   Úget_messages_as_conversationrU  Úgateway.session_ingress_mediarV  Úagent.image_routingrW  r8   r  Úmaxr  Úagent.title_generatorr\  Úflush_token_countsr    r'   r²   rú   ÚcloseÚ
contextlibÚsuppressÚ	Exception)%r$   r®   r%  r&  r_   Úrpcr"   r#   ÚadoptedÚstorer)  r*  r+  r,  r-  rc   r.  r/  r0  r1  r4  r5  r6  Ú	constructÚcontrolsr¯   rº   ÚhistoryrU  rV  rW  ÚmediaÚcontentÚskippedÚbeforer!   r\  s%   &f                                   r   Úexecuter…  J  sc  ø€ ô �uÔßJÜ��w•Ó €EÙ
�E˜&•MÓ
"€CÙÑU°e·k±k´mÔ$T±m©d¨aÀqÈGÁ|¤T Q¢T±mÒ$TÑU€GØˆ}Õ  w¥Ô/Ü˜=Ó)Ð)Ù ¬J°u¸Vµ}ÀeÈNÕF[Ó,\Ð^eÓf€EÝ:Ù˜Ôõ 8Ø×,Ñ,Ô.çZÑZÙ˜E (�OÓ,€FÙ˜&Ô!Ü˜Ô Ý!ßQÝ>Ù˜E '�NÔ+Ø+.„B‡J�JÐ'Ñ(ßpÑpØ*¨F×,@Ñ,@Ð\ÑDTÐUZÓD[Ð\€IÜ˜g u¨W¥~Ó6€HÙ˜E '�N¨H×,=Ñ,=Ô>Ø€EðAÙ˜&×!Õ!Ü$ U¨G°Vò EÀ6Ç<Â<ð EÐZ`×ZiÒZið EÐtz÷  uDò  uDð EØ˜iÖ(ðEÙ5:ðEØGLÈ\ÖGZðEô "& f§o¡oÔ!6ð	Eð HN×GWÒGWð	Eð
 "(×!8Ò!8ðEð -3¯M©MÐ=PÔ,P˜ŸšÐV\×VcÑVcøðEð %*¨'¦NðEð =BÀ)Ö<LðEð W\Ð\eÖVfðEð $*×#6Ò#6ðEð PV×ObÑObÕKbðEð #×/Ò/ðEñ IMðEñ Z^ðEð !'× 6Ò 6Ù)¨&¯-©-«/Ó:ðEð ?HðEñ ' v§}¡}£¸¿¹ÀfÇoÁoÐW]×WfÑWfÓgñEô 'fðEð "*×!1Ñ!1ðEô  %~ð!Eô"(Dò#EˆEð& #ˆHŒNØ×Ñ×&Ñ&×(Ò(ÝIÙ& uÔ-Ø�L‰L˜¤b§i¢i£kˆLÔ2Ø×8Ñ8¸¸|Õ9LÓMˆGÝ?Ø 5Ô(ÝMÝJÙ+¨EÓ2�Ù#=¸eÀF½mÈUÐS_ÕM`Ó#aÑ �˜ßÜ$Ð%EÓFÐFØ2˜5Ð2 &¨'Ñ2�Ü˜eÐ%<¸aÓ@×EÐEÀAÜ˜eÐ%@À!ÓD×IÐIÈðKˆFð !¤'¨%°¸TÓ"BÀGÌWÐUZÐ\cÐeiÓMjð AÙ(¨°°wÓ?ðAˆFä+.¨q´7¸5ÐBYÐ[\Ó3]×3bÐ3bÐabÐflÐmnÕfoÕ2oÓ+pˆFÐ'Ñ(Ü,/°´G¸EÐC^Ð`aÓ4b×4gÐ4gÐfgÐkqÐrsÕktÕ3tÓ,uˆFÐ(Ñ)Ü˜ÔØˆEõ FÙ#Ô%Ø×$Ñ$Ô&Ø�z‰zÐ*Ó+Ò3¸¿¹ÀM×9RÒ9RÐV\×V`ÑV`Ðai×VjÒVjØ+-�Ð'Ñ(Ø�L‰L˜¬,°vÓ*>ˆLÔ?Ø—?‘?×'Ñ'¨×+Ò+Ü Ð!9Ó:Ð:Ø�L‰LŒNØ�L‰L˜Ô$÷o "ñr 	" %¨¥.Ô1ØÒÜ˜Ôð	Ø�K‰KŒMä×$Ò$¤Y×/Õ/Ø—	‘	”÷ 0Ñ/ùós %U÷4 "×!ú÷~ 0×/Ð/û”×$Ò$¤Y×/Õ/Ø—	‘	”÷ 0×/×/Ð/þñ 	" %¨¥.Ô1ØÒÜ˜Ôð	Ø�K‰KŒMä×$Ò$¤Y×/Õ/Ø—	‘	”÷ 0×/×/Ð/û”×$Ò$¤Y×/Õ/Ø—	‘	”÷ 0×/×/Ð/ÿøs×   ÁWÁWÆY ÆFWÌ)BWÎ8&WÏWÏ5A5WÑ+A+WÓWÓ.A.WÕY ÖW= Ö5W)×W&	×!Y ×)W:	×=#YØ X:	Ø1	YØ:Y
ÙYÙ\"Ù0[Ú "\"Ú"Z<	Ú3	\"Ú<[Û\"Û#\Û2\Ü	\Ü\Ü\Ü\"c                ó�   €  VR,          f   ^ RI Hp V! W#4      VR&   V! R/ VB #   \         d   p^ RIHp T! Y4       h Rp?ii ; i)z«Agent construction resolves the provider credentials; a Kanban attempt that fails here
still books the one-shot exit mapping (quota wall 75, re-login 78) before the crash.rh   N)Úworker_api_key)Úrecord_start_failure© )rk  r‡  rz  rd  rˆ  )r$   Úfactoryrc   Úkwargsr‡  rÓ   rˆ  s   &&&,   r   rm  rm  ®  sP   € ðØ�)ÕÒ$ÝGÙ .¨vÓ >ˆF�9ÑÙÑ ˜Ñ Ð øÜô Ý?Ù˜UÔ(Øûðús   ‚#& ¦A±A Á Ac            	     óÌ   € ^ RI p ^ RIHp V P                  4       pRVP                  RV! V4      RVP                  4       R,           Uu. uF  q3P                  NK  	  up/# u upi )a  Identity the owner verifies before it reserves: this interpreter's pid and birth plus
the ancestor chain it observes. Launchers (uv's venv python.exe) put the owner's Popen
handle one or two hops above; the owner, never this process, decides whether they match.N)Úprocess_birthra   rk   Ú	ancestors:Né   N)ÚpsutilÚhermes_cli.process_identityr�  ÚProcessra   Úparents)r�  r�  ÚmeÚps       r   Úhellor–  ¼  sX   € ó Ý9Ø	�‰Ó	€BØ�2—6‘6˜7¡M°"Ó$5°{ÐTV×T^ÑT^ÓT`ÐacÖTdÓDeÑTdÈqÇUÄUÑTdÑDeÐfÐfùÒDes   Á	A!c                  ó¸  € \        \        P                  ! \        P                  ! \        P
                  P                  4       4      R ^ R7      4      p \        P                  ! \        P                  P                  4       \        P
                  P                  4       4       \        P                  '       g8   \        P                  \        P                  ! \        P                  4      4       R\        n         V P                  ! R/ \!        4       B  \#        \%        \        P&                  P(                  4      4      p\+        W4        T P0                  P3                  4        ^ #   \,         dG    \        P/                  R4       T P                  RRR7        T P0                  P3                  4        ^# i ; i  T P0                  P3                  4        i ; i)Úwb)Ú	bufferingFzmanaged worker failedÚerrorÚmanaged_worker_failed)Úreason)r–  )rƒ   rv   ÚfdopenÚduprÏ   ÚstdoutÚfilenoÚdup2ÚstderrÚloggerÚhandlersÚ
addHandlerÚloggingÚStreamHandlerÚ	propagater�   r–  rz   rP   rÐ   rÑ   r…  rz  Ú	exceptionrN   rw  )r®   r$   s     r   Úmainrª  Æ  s+  € ÜœBŸIšI¤b§f¢f¬S¯Z©Z×->Ñ->Ó-@Ó&AÀ4ÐSTÔUÓV€GÜ‡G‚GŒC�J‰J×ÑÓ¤§¡×!2Ñ!2Ó!4Ô5ô �?�?ˆ?Ü×Ñœ'×/Ò/´·
±
Ó;Ô<Ø„FÔð
Ø�ŠÑ(¤£Ò(Ü"¤:¬c¯i©i×.>Ñ.>Ó#?Ó@ˆÜ�Õð 	�‰×ÑÔÙøô ô ä×ÑÐ0Ô1Ø�‰�WÐ%<ˆÔ=Øà�‰×ÑÖðûð 	�‰×ÑÕús%   Ã;AE) Å)3F:ÆF= Æ9F:Æ:F= Æ=GÚ__main__i  @ >   rb   rq   rr   r_   rc   rh   rt   rs   r]   rf   rj   rg   )r   r^  r]  Ú	completedÚpartialrš  Úturn_exit_reasonÚ	api_callsr8  r9  r2   r3   r6   Úcache_read_tokensÚcache_write_tokensÚreasoning_tokensÚestimated_cost_usdÚcost_statusÚcost_sourceÚservice_tierÚfailure_reasonro   Úrequested_modelÚserved_modelr/   r0   Úfailure_retryableÚfailure_resets_atr   r   Úusage_window_message)r9  Úprovider_labelr8  Úbilling_urlÚis_nousÚmessageÚ
unverified)rŽ   rÀ  )/Ú__doc__r   ÚModuleNotFoundErrorrÓ   r�   rx  rL   r¦  rv   ÚreÚpathlibr   rÏ   r…   Ú	getLoggerr’   r£  rI   ru   r   ÚBILLING_FIELDSr   r   r   r'   rA   rP   rZ   rz   r�   rƒ   Úobjectr¾   r¦   r¨   rª   Úcompiler  r  r  r  r#  r…  rm  r–  rª  Ú
SystemExitr‰  r   r   Ú<module>rË     sE  ðñðÛó
 Û Û Û 	Û 	Ý Û 
Û à	×	Ò	˜8Ó	$€à€	òFÐ ðq€ð l€Ø$ n°kÐCVÐWÐ òqòzòòò4	òòò(c÷"	 ñ 	 ñ ‹x€ð Ð ò
8÷aEñ aEðH �zŠzÐ1Ó2€ò1òDòò6òaòHògòð. ˆzÔÙ
‘T“VÓ
Ðñ øðe ô Ø
‡x�xÐ%Ô%Øô &ûðús   „C ÃC'ÃC"Ã"C'