+
    jHàjY#  ã                  ó¾  € R t ^ RIHt ^ RItR R ltR R ltRt] R] 2tR	] R
] R] R2tR]P                  ! R] 2]P                  4      3R]P                  ! R] 2]P                  4      3R]P                  ! R] R] R] R2]P                  4      3R]P                  ! R]P                  4      3R]P                  ! R]P                  4      3R]P                  ! R] R] R] R] R2	4      3R]P                  ! R] R] R 24      33t]P                  ! R!4      t]P                  ! R"]P                  4      t]P                  ! R#4      tR$ R% ltR& R' ltR# )(uO  Inline-source (``python -c <src> â€¦``) command-line parsing for gateway process identity.

Everything after ``-c`` is data for the inline program, not the process's own identity -- except
Hermes' own bootstraps, which run an entry point in-process and are mapped back to the equivalent
``python -m <module> <argvâ€¦>`` (see #107002).
)ÚannotationsNc               ó    € V ^8„  d   QhRRRR/# )é   Útokensú	list[str]Úreturnz
int | None© )Úformats   "ÚA/home/ubuntu/.hermes/hermes-agent/gateway/status_inline_source.pyÚ__annotate__r      s   € ÷ 3ñ 3 Yð 3°:ñ 3ó    c                ó²  € ^ RI HpHp ^pV\        V 4      8  d½   W,          pVR8X  d   R# WA9   d   V^,          pK2  VP	                  R4      '       d   V^,          pKT  VP	                  R4      '       d   VR8X  d   R# VR,          p\        V4       F5  w  rgVR8X  d   Vu # Wr9   g   K  Y5V^,           R '       d   ^M^,          p K¿  	  V^,          pKÌ  R# )u.  Index of the ``-c`` token when *tokens* is an interpreter running INLINE SOURCE, else None.

Everything after ``-c`` is data the inline program receives, not this process's own identity.
The detached gateway restart watcher (``gateway._spawn_gateway_restart_watcher``) is spawned as
``python -c <watcher source> <old_pid> <python> -m hermes_cli.main gateway run``: its trailing
argv is the command the watcher will LATER spawn, so every argv matcher used to read it as a
live gateway. See #107002 and the "never infer process identity from argv substrings" rule.

Only interpreter options may precede ``-c``; the first non-option token ends the option block
(``python -m hermes_cli.main â€¦`` therefore never matches).

The walk is VALUE-AWARE: ``-X``/``-W``/``-Q`` and ``--check-hash-based-pycs``/``--jit`` take a
SEPARATE operand, so a naive "first non-option token ends the block" walk mistakes that operand
for the end of the block and never reaches the ``-c`` behind it (``python -X utf8 -c <src> â€¦``
was still read as a live gateway). The operand sets are the canonical ones in
``hermes_state_holders``, not a second hand-rolled copy.

*tokens* must be CASE-PRESERVING: the operand-taking ``-Q``/``-W``/``-X`` differ from the
operand-less ``-q``/``-b``, so a lowercased argv would skip the token after a plain ``-q``.
)Ú"_PYTHON_LONG_OPTIONS_WITH_OPERANDSÚ#_PYTHON_SHORT_OPTIONS_WITH_OPERANDSz--NÚ-ºé   NNÚc)Úhermes_state_holdersr   r   ÚlenÚ
startswithÚ	enumerate)r   r   r   ÚindexÚtokenÚclusterÚpositionÚletters   &       r
   Úinline_source_flag_indexr      sË   € ÷*ð
 €EØ
”#�f“+Ô
Ø•ˆØ�DŒ=ÙØÔ6Ø�Q�JˆEÙØ×Ñ˜D×!Ò!Ø�Q�JˆEÙØ×Ñ ×$Ò$¨°¬Ùð ˜•)ˆÜ )¨'Ö 2ÑˆHØ˜Œ}Ø’ØÖ<Ø h°¥l n×5™¸1Õ<�Úñ !3ð �Q�JŠEÙr   c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r   Úboolr   )r	   s   "r
   r   r   C   s   € ÷ 8ñ 8¨Ið 8¸$ñ 8r   c                ó   € \        V 4      RJ# )zXTrue when *tokens* is an interpreter running INLINE SOURCE (``python -c <src> [args]``).N)r   )r   s   &r
   Úcommand_line_runs_inline_sourcer!   C   s   € ä# FÓ+°4Ð7Ð7r   z['"]?Ú__main__zrunpy\.run_module\(\s*z(?P<target>[\w.]+)z\s*,\s*run_name\s*=\s*z \s*,\s*alter_sys\s*=\s*True\s*\)Úmodulezimport os, sys, runpy;.*\bz*import sys, runpy; sys\.path\.insert\(.*\bÚpathz>import sys, runpy; sys\.path\.insert\(.*\brunpy\.run_path\(\s*z(?P<target>[^'\"]+?)z\s*\)ÚexeczCimport sys, runpy; sys\.path\.insert\(.*?;\s*exec\((?P<target>.+)\)Úentryzpimport os, re, sys\s.*\bfrom\s+(?P<target>[\w.]+)\s+import\s+(?P<func>\w+)\b.*\bsys\.exit\(\s*(?P=func)\(\)\s*\)z-import os, site, sys;\s*sys\.argv\[0\]\s*=\s*z[\w.-]+z#;\s*site\.addsitedir\(os\.environ\[ÚHERMES_SITEz]\]\);\s*from\s+(?P<target>hermes_cli\.main)\s+import\s+main\s*;\s*sys\.exit\(\s*main\(\)\s*\)Úbase64z(import base64; exec\(base64\.b64decode\(z(?P<target>[A-Za-z0-9+/=]+)z\)\)z\bsys\.argv\s*=\s*\[(.*?)\]\s*;zmimport os, re, sys\W.*?from\s+(?P<target>[\w.]+)\s+import\s+(?P<func>\w+)\b.*sys\.exit\(\s*(?P=func)\(\)\s*\)zCimport base64; exec\(base64\.b64decode\(\W*(?P<b64>[A-Za-z0-9+/=]+)c               ó$   € V ^8„  d   QhRRRRRR/# )r   ÚsourceÚstrÚargvr   r   úlist[str] | Noner   )r	   s   "r
   r   r   m   s'   € ÷ "Hñ "H˜Sð "H¨	ð "HÐ6Fñ "Hr   c                óð  a a€ S P                  4       o \        VV 3R l\         4       R4      w  r#Vf   R# VR,          pVR8X  d6   ^ RIp^ RIp \        VP                  VRR7      P                  R4      V4      # VR8X  dï   \        P                  S 4      ;p'       dT   VP                  ^4      P                  R	4       Uu. uF!  qˆP                  4       P                  R
4      NK#  	  upR,          p\        P                  V4      ;p	'       d=   ^ RIp^ RIp \        VP                  V	R,          RR7      P                  R4      V4      # \        P                  V4      p
V
f   R# RV
R,          rBVR8X  d:   VR,          R.8X  d%   \!        V4      ^8”  d   RV^,          .VR,          O# RV.VO# \        P                  S 4      ;p'       dT   VP                  ^4      P                  R	4       Uu. uF!  qˆP                  4       P                  R
4      NK#  	  upR,          pVR8X  d   V.VO# RV.VO#   TP                  \        3 d     R# i ; iu upi   TP                  \        3 d     R# i ; iu upi )zb``[-m, <module>, *argv]`` (or ``[<path>, *argv]``) the inline *source* runs in-process, else None.c              3  óf   <"  € T F&  w  rVP                  S4      ;o'       g   K   VS3x € K(  	  R # 5i)N)Ú	fullmatch)Ú.0ÚkÚpÚmr*   s   &  €€r
   Ú	<genexpr>Ú#_bootstrap_entry.<locals>.<genexpr>p   s,   øé € ÐU©;¡4 1ÀÇÁÈFÓ@SÐ;S¸1Ó;Sœ˜˜A�«;ùs   ƒ1¥1NÚtargetr(   T)Úvalidatezutf-8r%   Ú,z'"r   Úb64r&   :Nr   Nz--run-modulez-m:r   NNr$   )NN)ÚstripÚnextÚ_BOOTSTRAPSr(   ÚbinasciiÚ_bootstrap_entryÚ	b64decodeÚdecodeÚErrorÚUnicodeDecodeErrorÚ_ASSIGNED_ARGVÚsearchÚgroupÚsplitÚ_EXEC_BASE64Ú_EXEC_LAUNCHERr   )r*   r,   ÚkindÚmatchr7   r(   r>   ÚassignedÚitemÚwrappedÚlauncherr4   s   f&         @r
   r?   r?   m   sP  ù€ à�\‰\‹^€FÜÕU­;ÓUÐWcÓd�K€DØ‚}ÙØ�8�_€FØˆxÔÛÛð	Ü# F×$4Ñ$4°VÀdÐ$4Ó$K×$RÑ$RÐSZÓ$[Ð]aÓbÐbð ˆv„~ô &×,Ñ,¨VÓ4Ð4ˆ8Ö4Ø:B¿.¹.ÈÓ:K×:QÑ:QÐRUÔ:VÓWÑ:V°$—J‘J“L×&Ñ& uÖ-Ñ:VÑWÐXZÕ[ˆDÜ"×)Ñ)¨&Ó1Ð1ˆ7Ö1ÛÛðÜ'¨×(8Ñ(8¸À½ÐRVÐ(8Ó(W×(^Ñ(^Ð_fÓ(gÐimÓnÐnô "×(Ñ(¨Ó0ˆØÒÙØ ¨Õ 2ˆfØˆw„Ø-1°"­X¸.Ð9IÔ-IÌcÐRVËiÐZ[Ìm��d˜1•gÐ)  R¥Ð)ÐvÐbfÐhnÐavÐquÐavÐvÜ!×(Ñ(¨Ó0Ð0€xÖ0Ø6>·n±nÀQÓ6G×6MÑ6MÈcÔ6RÓSÑ6R¨d—
‘
“×"Ñ" 5Ö)Ñ6RÑSÐTVÕWˆØ" fœnˆFˆ?�Tˆ?ÐG°4¸Ð2GÀ$Ð2GÐGøð- —‘Ô 2Ð3ô 	Úð	üò Xøð —N‘NÔ$6Ð7ô Úðüò Ts0   Á+H2 Ã'IÄ2I Ç/'I3È2IÉIÉI0É/I0c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r   r-   r   )r	   s   "r
   r   r   ’   s   € ÷ ñ  )ð Ð0@ñ r   c           	     óT  € \        V 4      pVf   R# \        V^,           \        V 4      4       Fv  pW,          P                  4       P	                  R4      '       g   K0  \        RP                  W^,           V^,            4      W^,           R 4      pVf   Kj  V ^ ,          .VOu # 	  R# )u¹  *tokens* as the equivalent ``python -m <module> <argvâ€¦>`` when this interpreter's ``-c`` source
is a Hermes bootstrap running an entry point in-process; None for any other inline source.

Command lines usually arrive space-joined (``/proc``, psutil, ``ps``), which splits the source
across tokens; the shortest token run that ends in a recognised tail is the source, whatever
joined it, and the tokens after it are the entry point's argv.
NÚ)Ú )r   Úranger   ÚrstripÚendswithr?   Újoin)r   r   Úendr&   s   &   r
   Úinline_bootstrap_argvrY   ’   s–   € ô % VÓ,€EØ‚}ÙÜ�U˜Q•Y¤ F£Ö,ˆØ�;×ÑÓ×(Ñ(¨×-Ô-Ü$ S§X¡X¨f¸QµYÀÀqÅÐ.IÓ%JÈFÐYZÕSZÐS\ÐL]Ó^ˆEØÔ Ø˜q�	Ð* EÐ*Ò*ñ	 -ñ
 r   )Ú__doc__Ú
__future__r   Úrer   r!   Ú_QÚ_MAINÚ_RUN_MODULEÚcompileÚDOTALLr=   rD   rI   rH   r?   rY   r   r   r
   Ú<module>rb      sã  ðñõ #ã 	õ3õl8ð €Øˆ4ˆx˜�tÐ€Ø'¨ tÐ+=¸b¸TÐAWÐX]ÐW^Ð^~Ð€ð ˆr�zŠzÐ7¸°}ÐEÀrÇyÁyÓQÐRàˆr�zŠzÐGÈÀ}ÐUÐWY×W`ÑW`ÓaÐbØˆR�ZŠZØIÈ"ÈÐMaÐbdÐaeÐe{ð  }Bð  |Cð  CHð  	IØ
�	‰	óð ð
 ˆR�ZŠZÐ^Ð`b×`iÑ`iÓjÐkàˆb�jŠjð  Mð  OQ÷  OXñ  OXó  Yð  Zð ˆr�zŠzØ8¸¸¸GÀBÀ4ð H+Ø+-¨$¨k¸"¸ð >dð	dóeð fð
 ˆr�zŠzÐEÀbÀTÐIdÐegÐdhÐhlÐmÓnÐoð+€ð. —’Ð>Ó?€Ø—’àtÐvx×vÑvóA€ð �zŠzÐ`Óa€õ"H÷Jr   