+
    lHàjÂ  ã                   ó”   € R t ^ RIt^ RIt]P                  ! R 4      P                  tR
R R llt ! R R4      t0 RmtRR/R R	 llt	R# )u$  Seam for the server.py handler/helper split. server.py's JSON-RPC handlers and helpers close
over its module globals (``_sessions``, ``_ok``, ``_err``, ...). Split modules define their code
normally and server.py calls :func:`bind_module` at the end of its own import, once every global
exists: bodies are re-created with ``types.FunctionType`` against server.py's namespace, so they
stay byte-identical and ``global X`` keeps mutating server.py state. No import cycle: split
modules never import server at module level â€” server passes itself in.Nc               #   ó   "  € R x €# ©N© r   ó    Ú;/home/ubuntu/.hermes/hermes-agent/tui_gateway/method_ctx.pyÚ<lambda>r      s   é € ³Ur   c                ó$   € V ^8„  d   QhR\         /# )é   Úg©Údict)Úformats   "r   Ú__annotate__r      s   € ÷ ñ ”$ñ r   c                ó¤  a aaa€ Sf   / MSo\        S 4      S9   d   S\        S 4      ,          # \        S RR4      pVe6   S P                  \        J d"   \        P
                  ! \        VSS4      4      # S P                  pV'       d;   VV V3R lo\        ;QJ d    . V3R lV 4       F  NK  	  5M! V3R lV 4       4      p\        P                  ! S P                  SS P                  S P                  V4      pS P                  Vn        S P                  Vn        VP                  P!                  S P                  4       VS\        S 4      &   V# )z£Copy ``fn`` with globals ``g``; closure cells holding same-module functions are rebound too
(so handlers produced by import-time decorator factories keep working).NÚ__wrapped__c                 ó   <€  V P                   p\        T\        P                  4      '       d=   TP
                  SP
                  8X  d"   \        P                  ! \        TSS4      4      # T #   \         d    T u # i ; ir   )Úcell_contentsÚ
ValueErrorÚ
isinstanceÚtypesÚFunctionTypeÚ
__module__ÚCellTypeÚrebind)ÚcellÚvalÚ_seenÚfnr
   s   & €€€r   Ú_cellÚrebind.<locals>._cell   sj   ø€ ðØ×(Ñ(�ô ˜#œu×1Ñ1×2Ò2°s·~±~ÈÏÉÔ7VÜ—~’~¤f¨S°!°UÓ&;Ó<Ð<ØˆKøô	 ô Ø’ðús   ƒA- Á-A=Á<A=c              3   ó4   <"  € T F  pS! V4      x € K  	  R # 5ir   r   )Ú.0Úcr   s   & €r   Ú	<genexpr>Úrebind.<locals>.<genexpr>#   s   øé € Ð2©' Q™˜aŸ˜«'ùó   ƒ)ÚidÚgetattrÚ__code__Ú_CM_HELPER_CODEÚ
contextlibÚcontextmanagerr   Ú__closure__Útupler   r   Ú__name__Ú__defaults__Ú__kwdefaults__Ú__doc__Ú__dict__Úupdate)r   r
   r   ÚwrappedÚclosureÚrealr   s   fff   @r   r   r      sø   û€ ð ’-‰B U€EÜ	ˆ"ƒv�„Ø”R˜“V�}ÐÜ�b˜-¨Ó.€GØÒ˜rŸ{™{¬oÓ=Ü×(Ò(¬°¸¸EÓ)BÓCÐCØ�n‰n€Gß÷	÷ ”%Ô2©'Ó2—%‘%Ô2©'Ó2Ó2ˆÜ×Ò˜bŸk™k¨1¨b¯k©k¸2¿?¹?ÈGÓT€DØ×+Ñ+€DÔØ—:‘:€D„LØ‡M�M×Ñ˜Ÿ™Ô%Ø€EŒ"ˆR‹&�MØ€Kr   c                   ór   a € ] tR t^,t o RtV 3R lR ltV 3R lR ltV 3R lR ltR tV 3R	 lR
 lt	Rt
V tR# )ÚHandlerRegistryz5Deferred @method registrar used by the split modules.c                ó   <€ V ^8„  d   QhRR/# ©r	   ÚreturnNr   )r   Ú__classdict__s   "€r   r   ÚHandlerRegistry.__annotate__/   s   ø€ ÷ Añ A˜$ñ Ar   c                ó   € . V n         R # r   ©Ú_pending)Úselfs   &r   Ú__init__ÚHandlerRegistry.__init__/   s	   € Ø>@ˆŽr   c                ó    <€ V ^8„  d   QhRS[ /# )r	   Úname)Ústr)r   r<   s   "€r   r   r=   2   s   ø€ ÷ ñ ™3ñ r   c                ó   a a€ VV 3R lpV# )zDDrop-in for server.py's ``@method`` decorator (defers registration).c                 óB   <€ SP                   P                  SV 34       V # r   )r@   Úappend)r   rE   rA   s   &€€r   ÚdecÚ#HandlerRegistry.method.<locals>.dec4   s   ø€ Ø�M‰M× Ñ  $¨ Ô,ØˆIr   r   )rA   rE   rJ   s   ff r   ÚmethodÚHandlerRegistry.method2   s   ù€ ö	ð ˆ
r   c                ó0   <€ V ^8„  d   QhRS[ S[,          /# )r	   r;   )ÚsetrF   )r   r<   s   "€r   r   r=   9   s   ø€ ÷ 3ñ 3‘s™3•xñ 3r   c                óN   € V P                    UUu0 uF  w  rVkK	  	  upp# u uppi r   r?   )rA   rE   Ú_s   &  r   ÚnamesÚHandlerRegistry.names9   s    € Ø$(§M¢MÔ2¡M™˜“¡MÒ2Ð2ùÓ2s   �!c                ó   € RVn         V# )zBDrop-in for server.py's ``@_profile_scoped`` (applied at install).T)Ú_hermes_profile_scoped)rA   r   s   &&r   Úprofile_scopedÚHandlerRegistry.profile_scoped<   s   € à$(ˆÔ!Øˆ	r   c                ó   <€ V ^8„  d   QhRR/# r:   r   )r   r<   s   "€r   r   r=   A   s   ø€ ÷ /ñ / ñ /r   c                óÆ   € \        V4      pV P                   FE  w  r4\        WB4      p\        VRR4      '       d   VP	                  V4      pVP                  W54       KG  	  R# )zDRebind pending handlers onto ``server``'s globals and register them.rU   FN)Úvarsr@   r   r'   Ú_profile_scopedÚregister_method)rA   Úserverr
   rE   r   r6   s   &&    r   ÚinstallÚHandlerRegistry.installA   sR   € ä�‹LˆØŸœ‰HˆDÜ˜"“=ˆDÜ�rÐ3°U×;Ò;Ø×-Ñ-¨dÓ3�Ø×"Ñ" 4Ö.ó	 &r   r?   N)r.   r   Ú__qualname__Ú__firstlineno__r1   rB   rL   rR   rV   r^   Ú__static_attributes__Ú__classdictcell__)r<   s   @r   r8   r8   ,   s7   ø‡ € Ù?÷Að A÷ð ÷3ð 3ò÷
/ö /r   r8   Úskipc                ó(   € V ^8„  d   QhR\         RR/# )r	   Úmodule_globalsr;   Nr   )r   s   "r   r   r   N   s   € ÷ 7!ñ 7!¤ð 7!¸Tñ 7!r   c               óÈ  a
aaaaa€ \        V4      oV R,          o/ oV3R loVVVV3R loV
V3R lo
\        V P                  4       4       EFW  w  r4VP                  R4      '       g8   V\        9   g-   W29   g'   \        V\        P                  \        34      '       d   KV  \        V\        P                  4      '       d5   VP                  S8X  d   \        VSS4      pEM*W4P                  8X  d   K¨  EM\        V\        \        \        34      '       d   S
! V4      '       d   S! V4      ;q@V&   MÚ\        V\        4      '       dÅ   VP                  S8w  d   EK  \        \        V4      P                  4       4       FŠ  w  rV\        V\        P                  4      '       d   \!        WE\        VS4      4       K=  \        V\"        \$        34      '       g   K[  \!        WE\        V4      ! \        VP&                  S4      4      4       KŒ  	  SP)                  V4      p\        V\        P                  4      '       d[   \        V\        P                  4      '       d;   \+        VRR4      pV'       d   VS8w  d   \-        RS R	V R
V R	V 24      hSVn        \!        WV4       EKZ  	  V P)                  R4      p	\        V	\        4      '       d   V	P1                  V4       R# R# )a   Publish everything a split module defines onto ``server``, rebound to its globals.
``module_globals`` is the caller's ``globals()`` (not ``sys.modules[__name__]``: tests that
``patch.dict(sys.modules)`` around the server import drop the submodule entries). Functions
are rebound; classes get their methods rebound in place; dispatch tables (dict/tuple/list of
this module's functions) get their values rebound; other values are copied as-is. Imported
modules/functions, dunders and registry plumbing are skipped; finally ``_registry`` installs.r.   c                 óf   <€ \        V \        P                  4      ;'       d    V P                  S8H  # r   )r   r   r   r   )ÚvÚmod_names   &€r   Ú_own_fnÚbind_module.<locals>._own_fnY   s'   ø€ Ü˜!œU×/Ñ/Ó0×MÐM°Q·\±\ÀXÑ5MÐMr   c                 ó:  <€ S! V 4      '       d   \        V SS4      # \        V \        4      '       d,   V P                  4        UUu/ uF  w  rVS! V4      bK  	  upp# \        V \        \
        34      '       d   \        V 4      ! V3R  lV  4       4      # T # u uppi )c              3   ó4   <"  € T F  pS! V4      x € K  	  R # 5ir   r   )r!   ÚxÚ
_rebind_ins   & €r   r#   Ú2bind_module.<locals>._rebind_in.<locals>.<genexpr>a   s   øé € Ð0©a¨‘z !—}�}«aùr%   )r   r   r   Úitemsr-   ÚlistÚtype)ri   Úkro   rk   rp   r
   Úseens   &  €€€€r   rp   Úbind_module.<locals>._rebind_in\   s~   ø€ Ù�1�:Š:Ü˜!˜Q Ó%Ð%Ü�aœ×ÒØ12·±´Ô;±©¨�A‘z !“}Ò$±Ò;Ð;Ü4>¸qÄ5Ì$À-×4PÒ4PŒt�AŒwÔ0©aÓ0Ó0ÐWÐVWÐWùó <s   ÁBc                 ó  <€ \        V \        4      '       d   V P                  4       M\        V \        \        34      '       d   T MR pVf	   S! V 4      # \
        ;QJ d    V3R lV 4       F  '       g   K   R# 	  R# ! V3R lV 4       4      # )Nc              3   ó4   <"  € T F  pS! V4      x € K  	  R # 5ir   r   )r!   ro   Ú_has_own_fns   & €r   r#   Ú3bind_module.<locals>._has_own_fn.<locals>.<genexpr>e   s   øé € Ð3RÉEÀq±KÀ·N°NËEùr%   TF)r   r   Úvaluesr-   rs   Úany)ri   rr   rz   rk   s   & €€r   rz   Ú bind_module.<locals>._has_own_fnc   sf   ø€ Ü(¨¬D×1Ò1�—‘”
¼JÀqÌ5ÔRVÈ-×<XÒ<X±qÐ^bˆØ"š]‰w�q‹zÐR·³Ô3RÉEÓ3R·´ÐR²ÐR°Ô3RÉEÓ3RÓ0RÐRr   Ú__Ú_hermes_split_moduleNzsplit-module name collision: Ú.z would overwrite Ú	_registry)rZ   rs   rr   Ú
startswithÚ	_PLUMBINGr   r   Ú
ModuleTyper8   r   r   r   r.   r   r-   rt   ÚsetattrÚstaticmethodÚclassmethodÚ__func__Úgetr'   ÚRuntimeErrorr€   r^   )rf   r]   rd   rE   ÚobjÚattrr   ÚprevÚownerÚregistryrz   rk   rp   r
   rj   rv   s   &&$       @@@@@@r   Úbind_moduler‘   N   sA  ý€ ô 	ˆV‹€AØ˜jÕ)€HØ€DõN÷Xð XöSô ˜.×.Ñ.Ó0×1‰	ˆØ�O‰O˜D×!Ò! T¬YÔ%6¸$¼,Ü˜c¤E×$4Ñ$4´oÐ#F×GÒGÙÜ�cœ5×-Ñ-×.Ò.Ø�~‰~ Ô)Ü˜S ! TÓ*’ØŸ™Ô%Ùñ &ä˜œd¤E¬4Ð0×1Ò1±kÀ#×6FÒ6FÙ)3°C«Ð8ˆC Ò&Ü˜œT×"Ò"Ø�~‰~ Ô)ÚÜ!¤$ s£)§/¡/Ó"3Ö4‘	�Ü˜c¤5×#5Ñ#5×6Ò6Ü˜C¤v¨c°1£~Ö6Ü ¤l´KÐ%@×AÔAÜ˜C¤t¨C¤y´¸¿¹ÀaÓ1HÓ'IÖJñ	 5ð
 �u‰u�T‹{ˆÜ�dœE×.Ñ.×/Ò/´J¸sÄE×DVÑDV×4WÒ4WÜ˜DÐ"8¸$Ó?ˆEß˜ (Ô*Ü"Ø3°H°:¸Q¸t¸fÐDUÐV[ÐU\Ð\]Ð^bÐ]cÐdóð ð (0ˆCÔ$Ü�˜c×"ñ7 2ð8 ×!Ñ! +Ó.€HÜ�(œO×,Ò,Ø×Ñ˜Ö ñ -r   r   >   ÚloggerrL   r   Úregisterr8   r[   r   )
r1   r*   r   r+   r(   r)   r   r8   r„   r‘   r   r   r   Ú<module>r”      sS   ðñLó Û ð ×+Ò+©OÓ<×EÑE€÷÷8/ñ /ò> ]€	ð7!°b÷ 7!ñ 7!r   