+
    jHàj  ã                   óX   € R t ^ RIHt ^ RIHt ^ RIt^ RIHt R tR t	R t
]R 4       tR# )	zGEditor policy lives with execution; an ACP connection is only a viewer.)Úcontextmanager)ÚasdictN)ÚRuntimeStoreErrorc           
     óh  € Vf   R# V R8w  d   \        RRRV  2R7      h\        V\        4      '       g%   \        RRR\        V4      P                   2R7      h\        \        V4      RR	0,
          4      pV'       d   \        RR
V^ ,           2RR7      hVP                  R	R4      R8w  d   \        RRRR7      h\        VP                  R. 4      \        4      '       g4   \        RRR\        VP                  R4      4      P                   2R7      h^ RI	H
p V! VP                  R. 4      4       R# )a   The launch's editor policy, or a refusal that names the key it read (create path totality).

An ACP connection is a viewer; the policy itself lives with execution. Every branch below refuses
with its own field, so a rejected editor launch says which key was wrong instead of a bare code.
NÚacpÚinvalid_paramsÚeditorz:an editor policy is only accepted from an ACP launch, not )ÚfieldÚdetailzmust be a mapping, got Úmcp_serversÚedit_approval_policyzeditor.zunknown editor keyÚaskzeditor.edit_approval_policyz3must be 'ask': every edit is approved one at a timezeditor.mcp_serverszmust be a list, got )Úvalidate_servers)r   Ú
isinstanceÚdictÚtypeÚ__name__ÚsortedÚsetÚgetÚlistÚgateway.session_local_mcpr   )Úsourcer   Úunknownr   s   &&  ÚA/home/ubuntu/.hermes/hermes-agent/gateway/session_local_editor.pyÚvalidate_editorr   	   s3  € ð ‚~ÙØ�„ÜÐ 0¸Ø)cÐdjÐckÐ'lônð 	nä�fœd×#Ò#ÜÐ 0¸Ø)@ÄÀfÃ×AVÑAVÐ@WÐ'XôZð 	Zä”S˜“[ MÐ3IÐ#JÕJÓK€GßÜÐ 0¸'À'È!Å*ÀÐ8NØ';ô=ð 	=à‡z�zÐ(¨%Ó0°EÔ9ÜÐ 0Ð8UØ'\ô^ð 	^ä�f—j‘j °Ó3´T×:Ò:ÜÐ 0Ð8LØ)=¼dÀ6Ç:Á:ÈmÓC\Ó>]×>fÑ>fÐ=gÐ'hôjð 	jå:Ù�V—Z‘Z ¨rÓ2Ö3ó    c                 óð  € ^ RI Hp ^ RIHp ^ RIHp V! 4       pVP                  ;_uu_ 4        VP                  P                  V4      pRRR4       Xf   R# RRV P                   2RR	R
R\        P                  ! 4       P                  ,           RRRRR\        V 4      /pVR
,          .VR&   V! WEVRR7      pVP                  R4      ;'       d    VP                  R4      R8H  #   + '       g   i     L£; i)é    )Úapproval)Úget_current_session_key)Ú_await_gateway_decisionNFÚcommandzEdit ÚdescriptionzApprove proposed file changeÚpattern_keyzeditor-Úallow_sessionÚallow_permanentÚeditÚpattern_keysr   )ÚsurfaceÚresolvedÚchoiceÚonce)Útoolsr   Útools.approval_contextr    Útools.approval_gateway_waitr!   Ú_lockÚ_gateway_notify_cbsr   ÚpathÚuuidÚuuid4Úhexr   )Úproposalr   r    r!   ÚrouteÚnotifyÚdataÚdecisions   &       r   Úrequest_editor_editr;   %   sÔ   € ÝÝ>ÝCÙ#Ó%€EØ	��‹Ø×-Ñ-×1Ñ1°%Ó8ˆ÷ 
à‚~Ùà˜˜xŸ}™}˜oÐ.°Ð?]Ø˜9¤t§z¢z£|×'7Ñ'7Õ7Ø˜UÐ$5°u¸fÄfÈXÓFVðX€Dð ! Õ/Ð0€DˆÑÙ& u°dÀEÔJ€HØ�<‰<˜
Ó#×HÐH¨¯©°XÓ(>À&Ñ(HÐH÷ 
�ús   ®C%Ã%C5	c                óR   a a€ ^ RI Ho S P                  R8X  d   \        # V V3R lpV# )z¸The session's edit approval policy in front of the editor's consent (main's ACP modes): Accept
Edits / Don't Ask let an edit run unasked; sensitive paths and everything else still ask.)Úshould_auto_approve_editr   c                 óf   <€ S! V SP                   SP                  4      '       d   R # \        V 4      # )T)r   Úcwdr;   )r6   Úpolicyr=   s   &€€r   ÚrequestÚ"_policy_requester.<locals>.request>   s*   ø€ Ù# H¨f×.IÑ.IÈ6Ï:É:×VÒVÙÜ" 8Ó,Ð,r   )Úacp_adapter.edit_approvalr=   r   r;   )r@   rA   r=   s   f @r   Ú_policy_requesterrD   7   s)   ù€ õ CØ×"Ñ" eÔ+Ü"Ð"ö-ð €Nr   c              #   óš   "  € ^ RI HpHp T! V P                  R8X  d   \	        V 4      MR4      p Rx € V! V4       R#   T! T4       i ; i5i)r   )Úset_edit_approval_requesterÚreset_edit_approval_requesterr   N)rC   rF   rG   r   rD   )r@   rF   rG   Útokens   &   r   Úeditor_scoperI   E   s@   é € çdÙ'ÀVÇ]Á]ÐV[ÔE[Ô(9¸&Ô(AÐaeÓf€Eð-Ûá% eÖ,øÑ% eÕ,üs   ‚-A°> ´
A¾
AÁA)Ú__doc__Ú
contextlibr   Údataclassesr   r3   Úhermes_state_runtimer   r   r;   rD   rI   © r   r   Ú<module>rO      s8   ðÙ MÝ %Ý Û å 2ò4ò8Iò$ð ñ-ó ò-r   