+
    jHàjj;  ã                  ón  a € 0 t $ R t^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	H
t
 ^ RIHtHt ^ RIHt ^ RIHtHtHtHt ^ RIHtHt ^ RIHtHt ^ R	IHt ^ R
IHt ^ RIH t  ^ RI!H"t" ]PF                  ! R4      t$]%! 0 R<m4      t&]%! 0 R=m4      t'/ t(R])R&   / t*R])R&   ]PV                  ! 4       t,^t-Rt./ t/R])R&   Rt0/ t1R])R&   R R lt2R R lt3R R lt4R>R R llt5R  R! lt6R" R# lt7R$ R% lt8R& R' lt9R( R) lt:R* R+ lt;R, R- lt<R. R/ lt=]R0 R1 l4       t>R2 R3 lt?R4 R5 lt@R6 R7 ltAR8 R9 ltBR: R; ltCR# )?aß  Dashboard plugins of a secondary served profile (PLG-3, #134889).

A gateway serving several profiles imports dashboard plugin code for its launch profile only. A
request scoped to another served profile (its native grant, a ``?profile=`` selection) gets that
profile's own plugins: discovered under its own home and the root, gated by its own ``plugins.enabled`` /
``plugins.disabled``, and run in its own plugin host (bound to its home and secret scope) whatever
its ``plugins.isolation`` says, so another profile's plugin code never enters this process. Bundled
plugins are Hermes code and stay in-process. The host protocol is request/response, so a secondary
profile's plugin websockets are refused by name until it carries them.
)ÚannotationsN)ÚThreadPoolExecutor)Ú	ExitStackÚcontextmanager)ÚPath)ÚAnyÚCallableÚIteratorÚOptional)Ú	parse_qslÚ	urlencode)ÚJSONResponseÚResponse)Ústatus)Úget_route_path)Ú	WebSocket)Úget_process_hermes_homezhermes_cli.web_serverzdict[str, list]Ú_profile_pluginszdict[str, int]Ú_profile_rescansg      N@zdict[str, ThreadPoolExecutor]Ú_hosted_executorsg      $@zdict[tuple[str, str], float]Ú_unknown_pluginsc               ó   € V ^8„  d   QhRR/# )é   ÚreturnúOptional[Path]© )Úformats   "ÚJ/home/ubuntu/.hermes/hermes-agent/hermes_cli/web_server_plugin_profiles.pyÚ__annotate__r   =   s   € ÷ gñ g ñ gó    c                 óp   € ^ RI Hp Hp V ! 4       pV! V4      V! \        4       4      8X  d   R# \	        V4      # )zVThe active scope's home when it is a profile other than the launch profile, else None.)Úget_hermes_homeÚhermes_home_keyN)Úhermes_constantsr!   r"   r   r   )r!   r"   Úhomes      r   Úsecondary_profile_homer%   =   s4   € çAÙÓ€DÙ" 4Ó(©OÔ<SÓ<UÓ,VÔVˆ4ÐfÔ\`ÐaeÓ\fÐfr   c               ó    € V ^8„  d   QhRRRR/# )r   r$   r   r   Úlistr   )r   s   "r   r   r   D   s   € ÷ _ñ _ ð _¨ñ _r   c           	     ód  € ^ RI Hp ^ RIHp ^ RIHp V! 4       \        V 4      R,          rTV.V! 4       R,          3 Uu. uF.  pVP                  RR7      VP                  RR7      8w  g   K,  VNK0  	  up,           pT! V Uu. uF  qˆR3NK  	  upVR,          R	3VR	3.,           4      # u upi u upi )
zíThe profile at ``home``'s dashboard plugins, read from disk: its own ``plugins/``, then the
root's (as a standalone ``hermes --profile <name> serve`` scanned them; the profile's own copy
wins a same-name conflict), then the bundled ones.)Úget_bundled_plugins_dir)Ú_get_default_hermes_home)Ú_discover_dashboard_pluginsÚpluginsF)ÚstrictÚuserÚmemoryÚbundled)Úhermes_cli.pluginsr)   Úhermes_cli.profilesr*   Úhermes_cli.web_server_dashboardr+   r   Úresolve)	r$   r)   r*   r+   r0   ÚownÚrÚdirsÚds	   &        r   Ú_scan_profile_pluginsr9   D   s½   € õ ;Ý<ÝKÙ*Ó,¬d°4«j¸9Õ.DˆSØˆ5Ñ 8Ó :¸YÕ FÑGó MÑG˜!Ø—y‘y¨�yÓ.°#·+±+ÀU°+Ó2KÑK÷ �AÑGñ Mõ M€Dá&Ù"Ó#™d˜ˆV‹™dÑ#¨°(Õ(:¸IÐ'FÈÐR[ÐH\Ð&]Õ]ó_ð _ùòMùò 	$s   ¾)B(Á,B(ÂB-c               ó(   € V ^8„  d   QhRRRRRRRR/# )r   ÚkeyÚstrÚrescansÚintr,   r'   r   r   )r   s   "r   r   r   R   s(   € ÷ ñ �Cð  #ð °ð ¸ñ r   c                ó¤   € \         ;_uu_ 4        \        P                  V ^ 4      V8X  d
   V\        V &   RRR4       V#   + '       g   i     T# ; i)z_Cache ``plugins`` for ``key`` unless an explicit rescan began after this scan did; return them.N)Ú_profile_plugins_lockr   Úgetr   )r;   r=   r,   s   &&&r   Ú
_publishedrB   R   sD   € ç	Ö	Ü×Ñ  QÓ'¨7Ô2Ø$+Ô˜SÑ!÷ 
ð €N÷ 
Ö	ð €Nús	   �%>¾A	c               ó$   € V ^8„  d   QhRRRRRR/# )r   r$   r   Úforce_rescanÚboolr   r'   r   )r   s   "r   r   r   Z   s!   € ÷ ñ  Dð ¸ð Èñ r   c                óJ  € ^ RI Hp V! V 4      p\        ;_uu_ 4        V'       dX   \        P	                  V^ 4      ^,           \        V&   \
         Uu. uF  qD^ ,          V8X  g   K  VNK  	  up F
  p\
        V K  	  \        P	                  V4      \        P	                  V^ 4      rvRRR4       XeC   V'       g;   \        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      '       d   \        VX\        V 4      4      pV# u upi   + '       g   i     Ls; i)zºDashboard plugins of the profile at ``home`` (:func:`_scan_profile_plugins`), cached per home
like the launch profile's list. An explicit rescan also forgets the profile's cached misses.©r"   Nc              3  ól   "  € T F*  p\        VR ,          4      P                  4       '       * x € K,  	  R# 5i)Ú_dirN)r   Úis_dir)Ú.0Úps   & r   Ú	<genexpr>Ú,profile_dashboard_plugins.<locals>.<genexpr>e   s)   é € Ð,ZÑSYÈa´°a¸µi³×1GÑ1GÓ1I×-IÑ-IÓSYùs   ‚24TF)
r#   r"   r@   r   rA   r   r   ÚanyrB   r9   )r$   rD   r"   r;   ÚkÚunknownÚcachedr=   s   &&      r   Úprofile_dashboard_pluginsrS   Z   sÝ   € õ 1Ù
˜$Ó
€Cß	Ö	ßÜ$4×$8Ñ$8¸¸aÓ$@À1Õ$DÔ˜SÑ!Ý'7ÓGÑ'7 !¸Q½4À3¹;ŸA˜AÑ'7ÔG�Ü$ WÒ-ñ Hä*×.Ñ.¨sÓ3Ô5E×5IÑ5IÈ#ÈqÓ5Q�÷ 
ð ‚~Ÿ¯«Ñ,ZÑSYÓ,Z¯¯ªÑ,ZÑSYÓ,Z×)ZÒ)ZÜ˜C Ô*?ÀÓ*EÓFˆØ€Mùò H÷ 
×	ús#   �5DÁDÁ&DÁ,;DÄDÄD"	c               ó$   € V ^8„  d   QhRRRRRR/# )r   r,   r'   Únamer<   r   úOptional[dict]r   )r   s   "r   r   r   j   s&   € ÷ Eñ E�Dð E ð E¨ñ Er   c                ó0   a€ \        V3R  lV  4       R4      # )c              3  óV   <"  € T F  qP                  R 4      S8X  g   K  Vx € K   	  R# 5i)rU   N)rA   )rK   rL   rU   s   & €r   rM   Ú_named.<locals>.<genexpr>k   s    øé € Ð=™G�q§u¡u¨V£}¸Ñ'<—’›Gùs   ƒ)Ÿ
)N)Únext)r,   rU   s   &fr   Ú_namedr[   j   s   ø€ ÜÔ=™GÓ=¸tÓDÐDr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r$   r   rU   r<   r   rV   r   )r   s   "r   r   r   n   s!   € ÷ ñ ˜4ð  sð ¨~ñ r   c           	     óÌ  € ^ RI Hp V! V 4      \        P                  ! 4       rCW13p\        ;_uu_ 4        \
        P                  WT4      V8”  d    RRR4       R# \        P                  V^ 4      pRRR4       \        \        VX\        V 4      4      V4      p\        ;_uu_ 4        \
        P                  4        UU	u. uF  w  r‰W”8:  g   K  VNK  	  up	p F
  p
\
        V
 K  	  Ve   \
        P                  VR4       M/\        P                  V^ 4      V8X  d   V\        ,           \
        V&   RRR4       V#   + '       g   i     LÑ; iu up	pi   + '       g   i     T# ; i)zÞThe profile at ``home``'s entry for ``name`` after a rescan, or None; a name found missing
within the last :data:`_UNKNOWN_PLUGIN_RESCAN_SECS` is answered without one. Blocking: the
request gate runs it on a worker thread.rG   N)r#   r"   ÚtimeÚ	monotonicr@   r   rA   r   r[   rB   r9   ÚitemsÚpopÚ_UNKNOWN_PLUGIN_RESCAN_SECS)r$   rU   r"   Úhome_keyÚnowr;   r=   ÚpluginrP   ÚuntilÚexpireds   &&         r   Úrescanned_pluginrh   n   s  € õ 1Ù# DÓ)¬4¯>ª>Ó+;ˆcØÐ
€Cß	Ö	Ü×Ñ Ó)¨CÔ/Ø÷ 
Ñ	ô #×&Ñ& x°Ó3ˆ÷ 
ô ”J˜x¨Ô2GÈÓ2MÓNÐPTÓU€Fß	Ö	Ü*:×*@Ñ*@Ô*BÔSÑ*B™h˜aÀeÁlŸ˜Ñ*BÕSˆGÜ  Ò)ñ TàÒÜ× Ñ   dÕ+Ü×!Ñ! (¨AÓ.°'Ô9Ø$'Ô*EÕ$EÔ˜SÑ!÷ 
ð €M÷ 
×	üó T÷ 
Ö	ð €Mús6   ´D9ÁD9Â&EÂ>
E
ÃE
ÃAEÄ9E		ÅEÅE#	c               ó    € V ^8„  d   QhRRRR/# )r   re   rV   r   r   r   )r   s   "r   r   r   †   s   € ÷ Bñ B˜Nð B¨~ñ Br   c                ó    € V '       d   V P                  R4      '       g   R# \        V R,          4      V R,          ,          P                  4       # )z@The resolved backend file of a discovered plugin entry, or None.Ú	_api_fileNrI   )rA   r   r4   ©re   s   &r   Úplugin_api_pathrm   †   s8   € ç˜Ÿ™ K×0Ò0ÙÜ�˜•Ó  6¨+Õ#6Õ6×?Ñ?ÓAÐAr   c               ó    € V ^8„  d   QhRRRR/# )r   rU   r<   r   r   r   )r   s   "r   r   r   �   s   € ÷ Gñ G˜sð G ~ñ Gr   c                ón  € ^ RI p^ RIHpHp ^ RIHpHp V! W04      '       dM   \        VP                  P                  RV  24      RR4      pV'       d   \        V4      P                  4       # R# V! 4       ;_uu_ 4        \        \        V! 4       V 4      4      uuRRR4       #   + '       g   i     R# ; i)zâThe file this process's ``/api/plugins/<name>/`` router runs: the imported module's when one is
mounted (a hosted forward route has none here), else the copy the first request would mount,
the launch profile's discovery entry.N)Ú_get_dashboard_pluginsÚapp)Ú_launch_profile_scopeÚ_plugin_api_mountedÚhermes_dashboard_plugin_Ú__file__)ÚsysÚhermes_cli.web_serverrp   rq   r3   rr   rs   ÚgetattrÚmodulesrA   r   r4   rm   r[   )rU   rv   rp   rq   rr   rs   Úfiles   &      r   Ú_in_process_api_filer{   �   s�   € ó ßAßZÙ˜3×%Ò%Ü�s—{‘{—‘Ð)AÀ$ÀÐ'HÓIÈ:ÐW[Ó\ˆß'+Œt�D‹z×!Ñ!Ó#Ð5°Ð5Ù	×	 Õ	 ÜœvÑ&<Ó&>ÀÓEÓF÷ 
!×	 ×	 Ó	 ús   Á>B#Â#B4	c               ó    € V ^8„  d   QhRRRR/# )r   re   rV   r   rE   r   )r   s   "r   r   r   ›   s   € ÷ Qñ Q˜^ð Q°ñ Qr   c                óŽ   € V RJ;'       d;    V P                  R4      R8H  ;'       d    \        V R,          4      \        V 4      8H  # )zÞWhether a secondary profile's entry may use this process's router: only its bundled copy,
and only when that router runs that very file (a launch-profile user plugin can shadow the
bundled name, or a disabled one hide it).NÚsourcer0   rU   )rA   r{   rm   rl   s   &r   Ú_runs_in_processr   ›   sP   € ð ˜$Ð÷ Pð P 6§:¡:¨hÓ#7¸9Ñ#D÷ Pð PÜ$ V¨F¥^Ó4¼ÈÓ8OÑOðQr   c               ó    € V ^8„  d   QhRRRR/# ©r   rU   r<   r   rV   r   )r   s   "r   r   r   £   s   € ÷ Sñ S˜3ð S >ñ Sr   c                óL   € \        4       pVf   R# \        \        V4      V 4      # )zZThe active secondary profile's own entry for ``name``, or None (also in the launch scope).N)r%   r[   rS   )rU   r$   s   & r   Úsecondary_pluginrƒ   £   s&   € ä!Ó#€DØ’<ˆ4ÐR¤VÔ,EÀdÓ,KÈTÓ%RÐRr   c               ó    € V ^8„  d   QhRRRR/# r�   r   )r   s   "r   r   r   ©   s   € ÷ Jñ J 3ð J¨>ñ Jr   c                óJ   € \        V 4      pVe   \        V4      '       d   R# T# )z²The active secondary profile's own entry for ``name`` when its plugin host serves it, or None:
the launch profile's scope, an unknown name, or the bundled copy this process runs.N)rƒ   r   )rU   re   s   & r   Ú_secondary_hosted_pluginr†   ©   s(   € ô ˜dÓ#€FØ’>Ô%5°f×%=Ò%=ˆ4ÐIÀ6ÐIr   c               ó    € V ^8„  d   QhRRRR/# ©r   rU   r<   r   rE   r   )r   s   "r   r   r   °   s   € ÷ añ a Cð a¨Dñ ar   c                ó\   € \        4       RJ;'       d    \        \        V 4      4      '       * # )z¬Whether this process's ``/api/plugins/<name>/`` router (the launch profile's copy) must not
serve the active scope: a secondary profile runs only its own bundled copy here.N)r%   r   rƒ   )rU   s   &r   Úin_process_router_refusedrŠ   °   s*   € ô "Ó#¨4Ð/×`Ð`Ô8HÔIYÐZ^ÓI_Ó8`Ô4`Ð`r   c               ó   € V ^8„  d   QhRR/# )r   r   zIterator[None]r   )r   s   "r   r   r   ·   s   € ÷ ñ  >ñ r   c              #  óÈ  "  € ^ RI Hp ^ RIHpHp \        \        V P                  RR4      P                  R4      4      4      P                  R4      p\        4       ;_uu_ 4       pV! V4      '       g    VP                  V! V4      4       Rx € RRR4       R#   T d+   p\        P                  RYFP                  4        Rp?L:Rp?ii ; i  + '       g   i     R# ; i5i)	zÙBind a plugin request's ``?profile=`` selection for its routing decision (the route
dependency binds it again for the handler). An unknown profile binds nothing: the route
dependency answers it as for any other route.)ÚHTTPException)Ú_config_profile_scopeÚ_is_current_profileÚquery_stringr   zlatin-1Úprofilez/Plugin request for profile %r left unscoped: %sN)Úfastapir�   Úhermes_cli.web_server_profilesrŽ   r�   Údictr   rA   Údecoder   Úenter_contextÚ_logÚdebugÚdetail)Úscoper�   rŽ   r�   r‘   ÚstackÚexcs   &      r   Úplugin_request_scoper�   ¶   s­   é € õ
 &ßYÜ”9˜UŸY™Y ~°sÓ;×BÑBÀ9ÓMÓNÓO×SÑSÐT]Ó^€GÜ	�Œ˜Ù" 7×+Ò+ðcØ×#Ñ#Ñ$9¸'Ó$BÔCó 	÷ 
‰øð !ô cÜ—
‘
ÐLÈg×WaÑWa×bÑbûðcú÷	 
�ˆüsH   ‚A#C"Á%CÁ5BÂCÂ
C"ÂCÂ! CÃCÃCÃCÃC	Ã	C"c               ó    € V ^8„  d   QhRRRR/# )r   Úresultúdict[str, Any]r   r   r   )r   s   "r   r   r   Ç   s   € ÷ ñ ˜Nð ¨xñ r   c                óÖ   € \        V R,          \        V R,          4      R7      pV R,           F7  w  r#VP                  4       R9  g   K  VP                  P	                  W#4       K9  	  V# )z7A plugin host's buffered ``asgi`` answer as a response.Úbodyr   )ÚcontentÚstatus_codeÚheaders>   Ú
connectionúcontent-lengthútransfer-encoding)r   r>   Úlowerr¥   Úappend)rŸ   Úresponser;   Úvalues   &   r   Úhosted_responser­   Ç   sZ   € ä  v¥¼CÀÀxÕ@PÓ<QÔR€HØ˜Y×'Ð'‰
ˆØ�9‰9‹;ÐSÖSØ×Ñ×#Ñ# CÖ/ñ (ð €Or   c               ó    € V ^8„  d   QhRRRR/# )r   r$   r   r   r   r   )r   s   "r   r   r   Ð   s   € ÷ ñ ˜4ð Ð$6ñ r   c           	     ó  € ^ RI Hp V! V 4      p\        ;_uu_ 4        \        P	                  V4      pVf1   \        \        R\        V 4      P                   2R7      ;p\        V&   VuuRRR4       #   + '       g   i     R# ; i)é    rG   Nzplugin-host-requests-)Úthread_name_prefix)	r#   r"   r@   r   rA   r   Ú_HOSTED_REQUEST_THREADSr   rU   )r$   r"   r;   Úexecutors   &   r   Ú_hosted_executorr´   Ð   sq   € Ý0Ù
˜$Ó
€Cß	Ö	Ü$×(Ñ(¨Ó-ˆØÒÜ0BÜ'Ð>SÔTXÐY]ÓT^×TcÑTcÐSdÐ<eô1gð gˆHÔ(¨Ñ-à÷ 
×	×	Ó	ús   �AA3Á3B	c               ó(   € V ^8„  d   QhRRRRRRRR/# )	r   r$   r   rU   r<   Úcallz!Callable[[float], dict[str, Any]]r   r   r   )r   s   "r   r   r   Û   s0   € ÷ pñ p 4ð p¨sð pÐ:[ð pÐ`hñ pr   c           	   ƒ  óÌ  aa"  € \         p\        P                  ! 4       V,           \        P                  ! 4       uop\
        P                  ! 4       P                  \        V 4      VP                  VV3R l4      p \        \
        P                  ! WS4      G Rj  x€L
 4      #  L  \         d2    \        P                  RY4       \        RRT: RTR R2/R	R
7      u # i ; i5i)zûRun ``call(timeout)``, one plugin host ``asgi`` round trip for plugin ``name`` of the profile at
``home``, on that profile's own threads in this request's context; its answer, or 504 after
:data:`HOSTED_REQUEST_TIMEOUT_SECS`. Other failures propagate.c                 ó\   <€ S ! \        S\        P                  ! 4       ,
          R 4      4      # )g{®Gáz„?)Úmaxr^   r_   )r¶   Údeadlines   €€r   Ú<lambda>Ú$run_hosted_request.<locals>.<lambda>â   s   ø€ ±T¼#¸hÌÏÊÓIYÕ>YÐ[_Ó:`Ô5ar   Nz4Plugin %s: its plugin host did not answer within %gsr™   úplugin z did not answer within ÚgÚsiø  ©r¤   )ÚHOSTED_REQUEST_TIMEOUT_SECSr^   r_   ÚcontextvarsÚcopy_contextÚasyncioÚget_running_loopÚrun_in_executorr´   Úrunr­   Úwait_forÚTimeoutErrorr—   Úwarningr   )r$   rU   r¶   ÚtimeoutÚcontextÚjobrº   s   &&f   @r   Úrun_hosted_requestrÎ   Û   sÂ   ùé € ô *€GÜŸšÓ(¨7Õ2´K×4LÒ4LÓ4NÐ€HˆgÜ
×
"Ò
"Ó
$×
4Ñ
4Ü˜Ó §¡Õ-aóc€CðpÜ¤W×%5Ò%5°cÓ%C×CÓDÐDÑCøÜô pÜ�‰ÐKÈTÔ[Ü˜X¨°±Ð8OÐPWÐXYÈ{ÐZ[Ð'\Ð]ÐknÔoÒoðpüs<   „A7C$Á<B% ÂB#ÂB% Â"C$Â#B% Â%9C!ÃC$Ã C!Ã!C$c               ó    € V ^8„  d   QhRRRR/# )r   rU   r<   r   zOptional[Response]r   )r   s   "r   r   r   ê   s   € ÷ -ñ -¸#ð -ÐBTñ -r   c           	   ƒ  ó   a aa	a
aaaa"  € \        S4      \        4       uopSe   Vf   R# SP                  R4      '       g   \        RR/RR7      # \	        S P
                  4      P                  R^4      pR\        V4      ^8”  d
   V^,          MR,           o\        \        S P                  P                  R	R
7       UUu. uF  w  rEV\        9  g   K  WE3NK  	  upp4      oS P                  P                  4        UUu. uF#  w  rEVP                  4       \         9  g   K   WE3NK%  	  uppoS P#                  4       G Rj  x€L
 o
^ RIHp V! S 4      o	R V	V
VVVVVV 3R llp \)        VSV4      G Rj  x€L
 # u uppi u uppi  LD L  \*         d7   p\,        P/                  RSST4       \        RRS: R2/RR7      u Rp?# Rp?ii ; i5i)zâServe ``/api/plugins/<name>/`` for a secondary profile through its own plugin host, or None
when the in-process router answers (the launch profile, or a bundled plugin). Consent has been
checked in the request's scope already.Nrk   r™   z	Not Foundi”  rÀ   Ú/Ú T)Úkeep_blank_values)Úadmitted_for_sensitive_routec               ó    € V ^8„  d   QhRRRR/# )r   rË   Úfloatr   r    r   )r   s   "r   r   Ú6forward_secondary_plugin_request.<locals>.__annotate__ü   s   € ÷ eñ e�eð e ñ er   c                óÄ   <€ ^ RI Hp V! 4       P                  4       pVP                  S\	        SR,          4      \	        SR,          4      S
P
                  SS	SSV SR7
      # )r°   )Úget_plugin_managerrI   rk   )rË   Úauthenticated)r1   rÙ   Ú_plugin_hostÚasgi_requestr<   Úmethod)rË   rÙ   ÚhostrÚ   r¢   r¥   rU   Úpathre   ÚqueryÚrequests   &  €€€€€€€€r   r¶   Ú.forward_secondary_plugin_request.<locals>.callü   sb   ø€ Ý9Ù!Ó#×0Ñ0Ó2ˆØ× Ñ  ¤s¨6°&­>Ó':¼CÀÀ{Õ@SÓ<TÐV]×VdÑVdÐfjØ!&¨°¸wÐVcð !ó eð 	er   z;Plugin %s: its profile's plugin host could not serve %s: %sr½   z, could not run in this profile's plugin hostiö  )r†   r%   rA   r   r   rš   ÚsplitÚlenr   r   Úurlrà   Ú_GATEWAY_QUERY_KEYSr¥   r`   r©   Ú_GATEWAY_CREDENTIAL_HEADERSr¢   Ú hermes_cli.plugin_host_http_authrÔ   rÎ   Ú	Exceptionr—   rÊ   )rá   rU   r$   ÚrestrP   ÚvrÔ   r¶   rœ   rÚ   r¢   r¥   rß   re   rà   s   ff       @@@@@@r   Ú forward_secondary_plugin_requestrì   ê   sŽ  ÿé € ô ,¨DÓ1Ô3IÓ3K€L€FˆDØ‚~˜šÙØ�:‰:�k×"Ò"Ü˜X {Ð3ÀÔEÐEÜ˜'Ÿ-™-Ó(×.Ñ.¨s°AÓ6€DØœS ›Y¨œ]�$�q–'°Õ3€DÜ¬)°G·K±K×4EÑ4EÐY]Õ*^ô 8Ñ*^¡$ !ØÔ#6Ñ6ô ˜“vÑ*^ò 8ó 9€Eà")§/¡/×"7Ñ"7Ô"9ÔjÑ"9™$˜!¸Q¿W¹W»YÔNiÑ=iŒv�‹vÑ"9Òj€GØ—‘“×€DÝMÙ0°Ó9€M÷e÷ eð-Ü'¨¨d°DÓ9×9Ð9ùó8ùãjÙñ :øÜô -Ü�‰ÐRÐTXÐZ^Ð`cÔdÜ˜X¨°±Ð8dÐ'eÐfØ(+ô-õ 	-ûð-üs~   Š7GÁA?GÃE:
ÃE:
Ã%GÄF Ä#F Ä*GÅFÅ"GÅ%F
 Å5FÅ6F
 Å9GÆF
 Æ
GÆ+GÇ GÇGÇGÇGc               ó    € V ^8„  d   QhRRRR/# rˆ   r   )r   s   "r   r   r   
  s   € ÷ ñ ÀSð ÈTñ r   c           	   ƒ  óT  "  € \        V4      f   R# ^ RIHp \        WV4      pV P	                  R4      ;'       g    / P	                  R4      '       g3   V! V4      '       g%   V! RRR\
        P                  /4      G Rj  x€L
  R	# R
V: R2p\        P                  RV\        4       V4       RV P	                  R4      ;'       g    / 9   d)   VP                  \        RV/RR7      4      G Rj  x€L
  R	# V! RRR\
        P                  RVR,          /4      G Rj  x€L
  R	#  L¢ L5 L
5i)a  Answer a secondary profile's socket to a plugin its host serves, and return True; False when
the in-process router takes it. An authenticated dial is refused by name (HTTP 501 before
accept, so Desktop's reconnect budget counts it); any other gets the plain policy close.NF)Ú_ws_auth_okÚstateÚnative_http_principalÚtypezwebsocket.closeÚcodeTr½   zH runs in this profile's plugin host, which does not carry websockets yetz)Plugin %s: refused a websocket for %s: %szwebsocket.http.responseÚ
extensionsr™   iõ  rÀ   Úreason:Néx   N)r†   Úhermes_cli.web_server_chatrï   r   rA   r   ÚWS_1008_POLICY_VIOLATIONr—   Úinfor%   Úsend_denial_responser   )rš   ÚreceiveÚsendrU   rï   Úsocketr™   s   &&&&   r   Úrefuse_secondary_plugin_socketrþ   
  s  é € ô   Ó%Ò-ÙÝ6Ü�u tÓ,€FØ�Y‰Y�wÓ×%Ð% 2×*Ñ*Ð+B×CÒCÁ{ÐSY×GZÒGZÙ�FÐ-¨v´v×7VÑ7VÐWÓX×XÐXÙØ�t‘hÐfÐg€FÜ‡I�IÐ9¸4ÔAWÓAYÐ[aÔbØ  U§Y¡Y¨|Ó%<×%BÐ%BÀÔCØ×)Ñ)¬,¸À&Ð7IÐWZÔ*[Ó\×\Ð\ñ ñ �FÐ-¨v´v×7VÑ7VÐX`ÐbhÐimÕbnÐoÓp×pÐpÙñ 	Yñ
 	]ápùsM   ‚9D(¼D(ÁD(Á"D(Á?D"Â AD(Ã(D(Ã.D$Ã/,D(ÄD&ÄD(Ä$D(Ä&D(>   rÞ   ÚcookieÚauthorizationúx-hermes-session-tokenúx-hermes-gateway-ticket>   ÚtokenÚattachÚticketr‘   ÚinternalÚdisplay_ticket)F)DÚ__conditional_annotations__Ú__doc__Ú
__future__r   rÄ   rÂ   ÚloggingÚ	threadingr^   Úconcurrent.futuresr   Ú
contextlibr   r   Úpathlibr   Útypingr   r   r	   r
   Úurllib.parser   r   Úfastapi.responsesr   r   Ú	starletter   Ústarlette._utilsr   Ústarlette.websocketsr   Úhermes_cli.configr   Ú	getLoggerr—   Ú	frozensetrç   ræ   r   Ú__annotations__r   ÚLockr@   r²   rÁ   r   rb   r   r%   r9   rB   rS   r[   rh   rm   r{   r   rƒ   r†   rŠ   r�   r­   r´   rÎ   rì   rþ   )r  s   @r   Ú<module>r     s:  øðô	õ #ã Û Û Û Û Ý 1ß 0Ý ß 4Ó 4ß -ç 4Ý Ý +Ý *å 5à×ÒÐ0Ó1€ñ (ò )\ó ]Ð ñ  Ò fÓgÐ à$&Ð �/Ó &à#%Ð �.Ó %à!ŸšÓ(Ð ð
 Ð ð #Ð Ø35Ð Ð0Ó 5ð #Ð Ø13Ð Ð.Ó 3õgõ_õ÷õ Eõõ0BõGõQõSõJõað ôó ðõ õõpõ-÷@r   