+
    „WÝjÇH  ã                  ó  € 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 ^ RIHtHt ^ RIHt ^ RIHt ^ RIHt R	 t]P.                  ! R
4      tR R ltR R ltR R lt]P8                  ! 4       t]
R 4       tR R ltR<R R llt R R lt!R R lt"R=R R llt#R^<RRRR/R  R! llt$R" R# lt%R$ R% lt&R=R& R' llt'R( R) lt(R* R+ lt)R, R- lt*R. R/ lt+R<R0 R1 llt,R^<RR/R2 R3 llt-R4 R5 lt.R6 R7 lt/R8 R9 lt0R: R; lt1R# )>aU  Plugin install metadata (``.install-metadata.json`` source/revision/pin records) and the git plumbing
behind clone, exact-revision checkout, credential scrubbing and the autostashing ``git pull``.

Sibling of :mod:`hermes_cli.plugins_cmd` (the facade re-exports the names other modules use and is
imported late here, never at module level).
)ÚannotationsN)Úcontextmanager)ÚPath)ÚCallableÚOptional)Únoninteractive_git_env©Úget_hermes_home)Úatomic_write_textc                 ó   € ^ RI Hp  V # )z`The facade, read at call time: tests patch ``plugins_cmd.<name>`` and sibling calls must see it.©Úplugins_cmd)Ú
hermes_clir   r   s    ÚNC:\Users\johnn\AppData\Local\hermes\hermes-agent\hermes_cli\plugins_cmd_git.pyÚ_pcr      s   € å&ØÐó    z^[0-9a-fA-F]{40}$c               ó   € V ^8„  d   QhRR/# )é   Úreturnr   © )Úformats   "r   Ú__annotate__r   !   s   € ÷ Dñ D ñ Dr   c                 ó2   € \        4       R ,          R,          # )Úpluginsz.install-metadata.jsonr   r   r   r   Ú_install_metadata_pathr   !   s   € ÜÓ˜yÕ(Ð+CÕCÐCr   c               ó   € V ^8„  d   QhRR/# )r   r   údict[str, dict[str, object]]r   )r   s   "r   r   r   %   s   € ÷ ñ Ð <ñ r   c                 óv  € \        4       p V P                  4       '       g   / #  \        P                  ! V P	                  RR7      4      p\        T\        4      '       g   \        4       P                  R4      hT#   \
        \        P                  3 d#   p\        4       P                  RT 24      ThRp?ii ; i)z@Read profile-local, non-secret plugin source metadata from disk.z	utf-8-sig©Úencodingz(Could not read plugin install metadata: Nz.Plugin install metadata must be a JSON object.)r   ÚexistsÚjsonÚloadsÚ	read_textÚOSErrorÚJSONDecodeErrorr   ÚPluginOperationErrorÚ
isinstanceÚdict)ÚpathÚvalueÚexcs      r   Ú_read_install_metadatar,   %   s    € ä!Ó#€DØ�;‰;�=Š=Øˆ	ðdÜ—
’
˜4Ÿ>™>°;˜>Ó?Ó@ˆô �eœT×"Ò"Ü‹e×(Ñ(Ð)YÓZÐZØ€Løô	 ”T×)Ñ)Ð*ô dÜ‹e×(Ñ(Ð+SÐTWÐSXÐ)YÓZÐ`cÐcûðdús   ¤&A; Á;B8ÂB3Â3B8c               ó    € V ^8„  d   QhRRRR/# )r   Úmetadatar   r   ÚNoner   )r   s   "r   r   r   3   s   € ÷ eñ eÐ&Bð eÀtñ er   c           	     óŒ   € \        4       p\        V\        P                  ! V ^RR7      R,           VP                   R2R7       R# )zEAtomically replace the profile-local plugin install metadata sidecar.T)ÚindentÚ	sort_keysÚ
z.tmp-)Ú
tmp_prefixN)r   r
   r!   ÚdumpsÚname)r.   r)   s   & r   Ú_write_install_metadatar7   3   s<   € ä!Ó#€DÜØŒd�jŠj˜¨!°tÔ<¸tÕCÐSW×S\ÑS\ÐR]Ð]bÐPc÷er   c               #  óÖ   "  € ^ RI Hp  \        4       pV ! VP                  VP                   R24      \
        RR4      ;_uu_ 4        Rx € RRR4       R#   + '       g   i     R# ; i5i)zöSerialize read-modify-write of the sidecar across threads and processes. Installs overlap (the
Desktop install card runs its rows a second apart); each held a snapshot read before its clone, so
the later write dropped the earlier plugin's record.)Ú
_file_lockz.lockg      $@z6Timed out waiting for the plugin install metadata lockN)Úhermes_cli.authr9   r   Ú	with_namer6   Ú_INSTALL_METADATA_LOCK_HOLDER)r9   r)   s     r   Ú_install_metadata_lockr=   =   s[   é € õ
 +ä!Ó#€DÙ	�D—N‘N d§i¡i [°Ð#6Ó7Ô9VÐX\ØL÷
Nõ 
Nã÷
N÷ 
N÷ 
Nò 
Nüs   ‚AA)ÁAÁ
A)ÁA&	Á 	A)c               ó$   € V ^8„  d   QhRRRRRR/# )r   r6   ÚstrÚupdatez*Callable[[Optional[dict]], Optional[dict]]r   r/   r   )r   s   "r   r   r   J   s#   € ÷ 0ñ 0 ð 0Ð.Xð 0Ð]añ 0r   c                ó,  € \        4       ;_uu_ 4        \        4       P                  4       pV! VP                  V 4      4      pVf   W9  d    RRR4       R# W  MW2V &   \        4       P	                  V4       RRR4       R#   + '       g   i     R# ; i)zòRewrite one plugin's record in the CURRENT sidecar, under the lock. *update* maps the current
record (None when absent) to the new one (None removes it); every other record is re-read here,
never carried over from a caller's earlier snapshot.N)r=   r   r,   Úgetr7   )r6   r@   r.   Úrecords   &&  r   Ú_update_install_recordrD   J   ss   € ô 
 ×	!Õ	!Ü“5×/Ñ/Ó1ˆÙ˜Ÿ™ TÓ*Ó+ˆØŠ>ØÔ#Ø÷ 
"Ñ	!ð ‘à#�T‰NÜ‹×%Ñ% hÔ/÷ 
"×	!×	!Ò	!ús   “;BÁ BÂB	c               ó$   € V ^8„  d   QhRRRRRR/# )r   r6   r?   r.   zOptional[dict]r   úOptional[str]r   )r   s   "r   r   r   Z   s!   € ÷ ñ ˜#ð ¨ð À=ñ r   c                ó  € Ve   TM\        4       P                  4       P                  V 4      p\        V\        4      '       dD   VP                  R4      RJ d/   \        VP                  R4      \
        4      '       d
   VR,          # R# )zCFull SHA a ``--ref`` install of *name* is pinned to, else ``None``.NÚpinnedTÚrevision)r   r,   rB   r'   r(   r?   )r6   r.   Úentrys   && r   Úpinned_revisionrK   Z   sg   € à!Ò-‰X´3³5×3OÑ3OÓ3Q×VÑVÐW[Ó\€EÜ�%œ×Ò 5§9¡9¨XÓ#6¸$Ó#>Ä:ÈeÏiÉiÐXbÓNcÔeh×CiÒCiØ�ZÕ Ð Ùr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r6   r?   r.   r(   r   rF   r   )r   s   "r   r   r   b   s!   € ÷ 4ñ 4˜#ð 4¨ð 4°-ñ 4r   c                óD   € \        W4      pV'       d   R VR,           2# R# )zgit pinned@:Né   NN)rK   )r6   r.   Úshas   && r   Ú_pin_annotationrP   b   s$   € Ü
˜$Ó
)€Cß&)ˆ[˜˜R�˜	Ð"Ð3¨tÐ3r   c               ó    € V ^8„  d   QhRRRR/# )r   Úrefr?   r   r   )r   s   "r   r   r   g   s   € ÷ ñ  3ð ¨3ñ r   c                ó¶   € \        V \        4      '       d   \        P                  V 4      '       g   \	        4       P                  R4      hV P                  4       # )zLLowercase a full 40-hex commit SHA; anything else is a PluginOperationError.z---ref must be a full 40-character commit SHA.)r'   r?   Ú_EXACT_COMMIT_REÚ	fullmatchr   r&   Úlower)rR   s   &r   Ú_normalize_exact_revisionrW   g   s@   € ä�cœ3×ÒÔ'7×'AÑ'AÀ#×'FÒ'FÜ‹e×(Ñ(Ð)XÓYÐYØ�9‰9‹;Ðr   Ú c               ó$   € V ^8„  d   QhRRRRRR/# )r   Úresultúsubprocess.CompletedProcessÚ
source_urlr?   r   r   )r   s   "r   r   r   n   s#   € ÷ (ñ (Ð7ð (ÀSð (ÐRUñ (r   c                óÔ   € ^ RI Hp V P                  ;'       g    V P                  ;'       g    RP	                  4       pV'       d   VP                  V\        V4      4      pV! V4      # )z<Diagnosable Git output without echoing embedded credentials.)Úredact_sensitive_textrX   )Úagent.redactr^   ÚstderrÚstdoutÚstripÚreplaceÚ_scrub_git_url)rZ   r\   r^   Úerrors   &&  r   Ú_safe_git_errorrf   n   sN   € å2Ø�]‰]×1Ð1˜fŸm™m×1Ð1¨r×8Ñ8Ó:€EßØ—‘˜j¬.¸Ó*DÓEˆÙ  Ó'Ð'r   Útimeoutr\   Úauth_urlc               ó8   € V ^8„  d   QhRRRRRRRRRRR	RR
RRR/# )r   Úgit_exer?   Úrepor   ÚargsÚfailure_prefixrg   Úintr\   rh   r   r[   r   )r   s   "r   r   r   w   sN   € ÷ 	ñ 	Øð	Øð	Ø%(ð	Ø:=ð	ØHKð	Ø^að	àð	ð !ñ	r   c               ó¾   € \        4       P                  ! W.VO5RVRV/ pVP                  ^ 8w  d,   \        4       P                  V\	        Wt4      ,           RR7      hV# )zZRun git in *repo*; on a non-zero exit raise PluginOperationError(prefix + scrubbed error).rg   rh   Úclone_failed©Úfailure_class)r   Ú_run_plugin_gitÚ
returncoder&   rf   )rj   rk   rm   rg   r\   rh   rl   rZ   s   &&$$$$* r   Ú_git_or_raiseru   w   sd   € ô
 ‹U×"Ò" 7Ð\°4Ò\ÀÐ\ÐS[Ñ\€FØ×Ñ˜AÔÜ‹e×(Ñ(¨¼/È&Ó:]Õ)]Ø7Eð )ó Gð 	Gà€Mr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   rk   r   rj   r?   r   r   )r   s   "r   r   r   ƒ   s!   € ÷ ñ ˜Tð ¨Cð °Cñ r   c           	     ón   € \        WR R^RR7      P                  P                  4       P                  4       # )ú	rev-parseÚHEADz,Could not determine installed Git revision:
©rg   rm   )ru   ra   rb   rV   )rk   rj   s   &&r   Ú_git_head_revisionr{   ƒ   s.   € ÜØ�{ F°BØFô÷ �f�U‰U‹W—U‘U“Wðr   c               ó(   € V ^8„  d   QhRRRRRRRR/# )r   rk   r   rj   r?   rI   r   r   )r   s   "r   r   r   Š   s.   € ÷ Iñ I˜dð I¨Sð I¸Cð IÀCñ Ir   c           
     ó  €  \        4       P                  WRRRV R2^R7      pTP
                  P                  4       P                  4       pTP                  ^ 8X  d   T'       d   T# T#   \        \        P                  3 d    Tu # i ; i)uy  The COMMIT a revision names, peeling annotated tags.

A catalog pin is 40 hex, but that does not make it a commit: a tag object
has a sha of its own, and a pin recorded as `git rev-parse <tag>` names the
tag object, not the commit it points at. Git detaches at the commit, so
comparing HEAD against the tag object's sha refuses a correct checkout
(and the catalog installer then cannot install that entry at all). Peeling
first keeps the guard â€” HEAD must still BE that commit â€” while admitting
the pins authors actually publish. Returns `revision` unchanged when it
resolves to nothing, so the mismatch guard below still fires.
rx   ú--verifyz--quietz	^{commit}©rg   )	r   rs   r$   Ú
subprocessÚTimeoutExpiredra   rb   rV   rt   )rk   rj   rI   rZ   Úresolveds   &&&  r   Ú_git_resolve_commitrƒ   Š   s‹   € ðÜ“×&Ñ&Ø˜;¨
°IÀ(ÀÈ;Ð?WÐacð 'ó 
ˆð
 �}‰}×"Ñ"Ó$×*Ñ*Ó,€HØ×(Ñ(¨AÔ-·(ˆ8ÐHÀÐHøô ”Z×.Ñ.Ð/ô ØŠðús   ‚"A) Á)B	ÂB	c          
     ó,   € V ^8„  d   QhRRRRRRRRRR/# )	r   rk   r   rj   r?   rI   r\   r   r/   r   )r   s   "r   r   r       s1   € ÷ *ñ * 4ð *°#ð *Àð *ÐRUð *Ð_cñ *r   c                óð  € \        4       P                  4       pRRRRRV3RV R23RRRV3R	V R
233 F  w  rVp \        W.VO5RVRVRVRV/  K  	  \        4       P                  W4      p	V	\        WV4      8w  d#   \        4       P                  RV	 RV R2RR7      hR#   \        P                   d@   p\        4       P                  RT RT RT R\        4       P                   2RR7      ThRp?ii ; i)z¯Fetch and detach at one immutable commit, then verify the resulting HEAD. The checkout is
a network verb too: in a partial (subdirectory) clone it downloads the file contents.Úfetchú--depthÚ1ÚoriginzGit commit 'z' could not be fetched:
Úcheckoutz--detachzGit checkout of commit 'z
' failed:
rm   r\   rh   rg   zGit z of commit 'z' timed out after ú
 seconds. rp   rq   NzChecked-out revision 'z#' does not match requested commit 'z'.)	r   Ú_clone_timeout_secondsru   r€   r�   r&   Ú_CLONE_TIMEOUT_HINTr{   rƒ   )
rk   rj   rI   r\   rg   Úverbrl   rm   r+   Úactuals
   &&&&      r   Ú_checkout_exact_revisionr�       sY  € ô ‹e×*Ñ*Ó,€Gà	�7˜I s¨H°hÐ?À<ÐPXÈzÐYrÐAsÐtØ	�j *¨hÐ7Ð;SÐT\ÐS]Ð]hÐ9iÐjó'Ñ"ˆ�Nð	7Ü˜'ð @¨$ò @¸~ð @ÐZdð @Ø#-ð@Ø7>ô@ñ'ô ‹U×%Ñ% dÓ4€FØÔ$ T°HÓ=Ô=Ü‹e×(Ñ(Ø$ V HÐ,OÐPXÈzÐY[Ð\Ø(ð )ó *ð 	*ñ >øô ×(Ñ(ô 	7Ü“%×,Ñ,Ø�t�f˜L¨¨
Ð2DÀWÀIÈZÔX[ÓX]×XqÑXqÐWrÐsØ,ð -ó .à36ð7ûð	7ús   ºB!Â!C5Â6:C0Ã0C5c               ó    € V ^8„  d   QhRRRR/# )r   Úgit_urlr?   r   r   )r   s   "r   r   r   ¶   s   € ÷ ñ ˜Cð  Cñ r   c                ó�  € \         P                  P                  V 4      pVP                  R9   d–   VP                  '       d„   RVP                  9   d   RVP                   R2MVP                  pVP
                  e   V RVP
                   2p\         P                  P                  VP                  W!P                  RR34      # V # )z?Strip credentials and query/fragment data from an HTTP Git URL.Ú:Ú[Ú]rX   >   ÚhttpÚhttps)ÚurllibÚparseÚurlsplitÚschemeÚhostnameÚportÚ
urlunsplitr)   )r’   ÚparsedÚhosts   &  r   rd   rd   ¶   s˜   € ä�\‰\×"Ñ" 7Ó+€FØ‡}�}Ð)Ô)¨f¯o¯o¨oØ),°·±Ô)?��6—?‘?Ð# 1Ñ%ÀVÇ_Á_ˆØ�;‰;Ò"Ø�V˜1˜VŸ[™[˜MÐ*ˆDÜ�|‰|×&Ñ&¨¯©°t¿[¹[È"ÈbÐ'QÓRÐRØ€Nr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r’   r?   ÚsubdirrF   r   r   )r   s   "r   r   r   Á   s!   € ÷ :ñ :˜sð :¨Mð :¸cñ :r   c                ó:   € \        V 4      pV'       d   V R V 2# T# )Ú#)rd   )r’   r£   Úscrubbeds   && r   Ú_canonical_sourcer§   Á   s$   € Ü˜gÓ&€Hß%+ˆhˆZ�q˜˜Ð!Ð9°Ð9r   c               ó(   € V ^8„  d   QhRRRRRRRR/# )r   rk   r   rj   r?   r’   r   r/   r   )r   s   "r   r   r   Æ   s.   € ÷ ]ñ ]˜tð ]¨cð ]¸Cð ]ÀDñ ]r   c                óR   € \        V4      pW28w  d   \        WRRRV^RVR7	       R# R# )zFEnsure credentials used for cloning do not survive in ``.git/config``.Úremotezset-urlr‰   z)Could not sanitize installed Git remote:
)rg   rm   r\   N)rd   ru   )rk   rj   r’   r¦   s   &&& r   Ú_scrub_cloned_originr«   Æ   s3   € ä˜gÓ&€HØÔÜØ˜8 Y°¸(ÈBØGÐT[÷	]ñ r   c               ó(   € V ^8„  d   QhRRRRRRRR/# )r   rk   r   rj   r?   r£   r   r/   r   )r   s   "r   r   r   Ï   s.   € ÷ @ñ @ tð @°cð @À3ð @È4ñ @r   c           
     ó  € \        WRRR^RR7       V R,          R,          R,          pVP                  P                  R	R	R
7       \        P                  ! RRVP                  R4      4      pVP                  RV R2RR7       R# )z›Sparse-check-out only *subdir*. Written as the classic ``info/sparse-checkout`` file
rather than ``git sparse-checkout set`` so older Git clients work too.Úconfigzcore.sparseCheckoutÚtruez"Could not enable sparse checkout:
rz   z.gitÚinfozsparse-checkoutT)ÚparentsÚexist_okz
([\\*?\[])z\\\1Ú/z/
úutf-8r   N)ru   ÚparentÚmkdirÚreÚsubrb   Ú
write_text)rk   rj   r£   Úpattern_fileÚescapeds   &&&  r   Ú_restrict_checkout_to_subdirr¼   Ï   s€   € ô �' Ð+@À&ÐRTØ!FõHà˜&•= 6Õ)Ð,=Õ=€LØ×Ñ×Ñ d°TÐÔ:Ü�fŠf�] G¨V¯\©\¸#Ó->Ó?€GØ×Ñ˜a ˜y¨Ð,°wÐÖ?r   c          
     ó,   € V ^8„  d   QhRRRRRRRRRR/# )	r   Ú	tmp_cloner   r’   r?   rI   rF   r£   r   r   )r   s   "r   r   r   Ú   s1   € ÷ '8ñ '8 $ð '8°ð '8Àð '8Ø,ð'8Ø8;ñ'8r   c                óp  € \        4       P                  4       pV'       g   \        4       P                  RRR7      h\        4       P                  4       pV'       d   R.M. pV'       g	   V'       d   R.M. p. ROVOVOVN\	        V 4      Np \        4       P
                  ! W@P                  .VO5RVRV/ p	T	P                  ^ 8w  d=   \        4       P                  \        4       P                  T\        Y‘4      4      RR7      h\        YT4       T'       d   \        YT4       T'       d   \!        YY!R7       MT'       d    \#        Y@RRYQTRR7       \        4       P%                  Y4      #   \         d"   p
\        4       P                  RRR7      T
hRp
?
i\        P                   d:   p
\        4       P                  R	T R
\        4       P                   2RR7      T
hRp
?
ii ; i  \        P                   d:   p
\        4       P                  RT R
\        4       P                   2RR7      T
hRp
?
ii ; i)a¥  Shallow-clone *git_url* into *tmp_clone* (detached at *revision* when given), scrub any
credentials from the recorded origin, and return the installed HEAD SHA.

A *subdir* install is a blobless clone with a sparse checkout of that subdirectory: a plugin
living in a monorepo (Hindsight: 170 MB at depth 1, 2 MB for its plugin folder) otherwise
downloads every file in the repository, which times out on slow connections.ú$git is not installed or not in PATH.Úgit_missingrq   z--filter=blob:nonez--no-checkoutrh   rg   NzGit clone timed out after r‹   rp   )r\   rŠ   ry   z0Git checkout of the plugin subdirectory failed:
)rg   r\   rh   rm   zGit checkout timed out after )Úcloner‡   rˆ   )r   Ú_resolve_git_executabler&   rŒ   r?   rs   rµ   ÚFileNotFoundErrorr€   r�   r�   rt   Ú_clone_failure_messagerf   r«   r¼   r�   ru   r{   )r¾   r’   rI   r£   rj   Úclone_timeoutÚpartialÚno_checkoutÚ
clone_argsrZ   Úes   &&&&       r   Ú_clone_plugin_reporË   Ú   s  € ô ‹e×+Ñ+Ó-€GßÜ‹e×(Ñ(Ð)OÐ_lÐ(ÓmÐmÜ“E×0Ñ0Ó2€Mß(.Ð#Ñ$°B€Gß'/·6�?Ñ#¸r€KÚ[¨GÐ[°kÐ[À7Ð[ÌCÐPYËNÐ[€JðNÜ“×&Ò& w×0@Ñ0@ð 8À:ò 8ÐX_ð 8Ø)6ñ8ˆð ×Ñ˜AÔÜ‹e×(Ñ(¬«×)EÑ)EÀgÌÐ_eÓOoÓ)pØ7Eð )ó Gð 	Gä˜¨WÔ5ßÜ$ Y¸Ô@ßÜ  °XÖRß	ð	5Ü˜'¨j¸&È-Ø#*Ð;nõpô ‹5×#Ñ# IÓ7Ð7øô+ ô uÜ‹e×(Ñ(Ð)OÐ_lÐ(ÓmÐstÐtûÜ×$Ñ$ô NÜ‹e×(Ñ(Ð+EÀmÀ_ÐT^Ô_bÓ_d×_xÑ_xÐ^yÐ)zØ7Eð )ó GØLMð	NûðNûô ×(Ñ(ô 	5Ü“%×,Ñ,Ø/°¨¸jÌË×IbÑIbÐHcÐdØ,ð -ó .à34ð5ûð	5úsB   Â*E, ÅG' Å,G$Å7FÆG$Æ*G$Æ+4GÇG$Ç'H5Ç<4H0È0H5c               ó0   € V ^8„  d   QhRRRRRRRRRRR	R
/# )r   rj   r?   Útargetr   rl   rg   rn   rh   r   r[   r   )r   s   "r   r   r     sD   € ÷ 	Nñ 	NØð	NØð	NØ'*ð	NØ58ð	NØILð	Nà ñ	Nr   c               óX   € ^ RI Hp V! V .VOV\        4       RRRRV\        V4      R7	      # )a  Run one git command inside a plugin checkout (non-interactive). *auth_url* names the remote
a network verb talks to; it runs anonymously first and a stored user credential for that host
is attached only when the remote refuses anonymous access (private repos).)Ú run_git_with_credential_fallbackTr´   rc   )ÚenvÚcapture_outputÚtextr   Úerrorsrg   Úcwd)Úhermes_cli.git_credentialsrÏ   r   r?   )rj   rÍ   rg   rh   rl   rÏ   s   &&$$* r   rs   rs     s=   € õ LÙ+Ø	Ð�4Ð˜(Ô(>Ó(@ÐQUÐ\`Ø °GÄÀVÃôNð Nr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   rj   r?   rÍ   r   r   r   )r   s   "r   r   r     s&   € ÷ Añ A˜ð A Tð A¨cñ Ar   c                ó”   € \        4       P                  WRRR4      pVP                  ^ 8X  d   VP                  P	                  4       # R# )zDCurrent ``refs/stash`` commit, or empty string when no stash exists.rx   r~   z
refs/stashrX   )r   rs   rt   ra   rb   )rj   rÍ   Úprobes   && r   Ú
_stash_refrÙ     s?   € ä‹E×!Ñ! '°;À
ÈLÓY€EØ#(×#3Ñ#3°qÔ#8ˆ5�<‰<×ÑÓÐ@¸bÐ@r   c               ó(   € V ^8„  d   QhRRRRRRRR/# )r   rj   r?   rÍ   r   Ú	stash_shar   Úboolr   )r   s   "r   r   r     s(   € ÷ ñ ˜Cð ¨ð ¸#ð À$ñ r   c                ó2  € \        4       P                  WRRV4      p\        4       P                  WRRR4      pVP                  ^ 8w  g!   VP                  P	                  4       '       d   R# \        W4      V8X  d   \        4       P                  WRR4       R# )	a§  ``stash apply`` the autostash commit *stash_sha*; drop it on a clean apply. False when it
applied with errors or left unmerged paths (the stash entry is kept in that case).

Git is addressed by the stash's commit sha, never a ``stash@{N}`` selector: on native Windows
the MSYS runtime re-parses git.exe's argv and strips the braces, so ``stash@{0}`` reaches git
as ``stash@0`` and both the apply and the drop fail (#87542).ÚstashÚapplyÚdiffz--name-onlyz--diff-filter=UFÚdropT)r   rs   rt   ra   rb   rÙ   )rj   rÍ   rÛ   ÚrestoreÚunmergeds   &&&  r   Ú_reapply_stashrä     s~   € ô ‹e×#Ñ# G°W¸gÀyÓQ€GÜ‹u×$Ñ$ W°f¸mÐM^Ó_€HØ×Ñ˜QÔ (§/¡/×"7Ñ"7×"9Ò"9Ùô �'Ó" iÔ/Ü‹×Ñ˜g¨w¸Ô?Ùr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   rj   r?   rÍ   r   r   ztuple[str, str]r   )r   s   "r   r   r   (  s!   € ÷ ñ  3ð °ð ¸ñ r   c           	     óV  € \        4       P                  WRRR4      pVP                  ^ 8w  g!   VP                  P	                  4       '       g   R# ^ RIHp V! VP                  4      pV'       d   \        4       P                  ! WRR.VO5!   \        W4      p\        4       P                  WRR	R
RR4      p\        W4      pV'       d   Wu8X  d+   \        V4      pRRV'       d   RV 2,           3# R,           3# VP                  ^ 8w  d   \        4       P                  WRRR4       VR3# )zÍStash local edits before a pull. Returns ``(stash_sha, error)``; *stash_sha* is empty when
the tree was clean, and a non-empty error means the tree is dirty but nothing was saved, so
the pull must not run.Ústatusz--porcelainz-zrX   )Ú_intent_to_add_pathsÚaddz--rÞ   Úpushz--include-untrackedz-mzhermes-plugin-update-autostashzgLocal changes in the plugin checkout could not be stashed; update aborted before touching the checkout.r3   Úresetú--hardry   )rX   rX   )	r   rs   rt   ra   rb   Úhermes_cli.update_cmd_stashrè   rÙ   rf   )	rj   rÍ   rç   rè   Úintent_to_addÚ	pre_stashrê   Ú
post_stashÚerrs	   &&       r   Ú_autostash_dirty_treerò   (  s   € ô ‹U×"Ñ" 7°H¸mÈTÓR€FØ×Ñ˜AÔ V§]¡]×%8Ñ%8×%:Ò%:Øˆõ Aá(¨¯©Ó7€MßÜ‹×Ò˜g¨u°dÐK¸]ÔKÜ˜7Ó+€IÜ‹5× Ñ Ø˜ &Ð*?ÀÐGgói€Dä˜GÓ,€Jß˜Ô0Ü˜dÓ#ˆØðDç ��C�5ˆzõ*ð+ð 	+ð ')õ*ð+ð 	+ð ‡�˜!Ôô 	‹×Ñ˜g¨w¸À&ÔIØ�rˆ>Ðr   c               ó    € V ^8„  d   QhRRRR/# )r   rÍ   r   r   ztuple[bool, str]r   )r   s   "r   r   r   G  s   € ÷ /Bñ /B ð /BÐ*:ñ /Br   c           	     óö  € \        4       P                  4       pV'       g   R#  \        W4      w  r#V'       d   RV3# \        4       P                  WRRR^R7      p\        4       P                  WRRVP                  P                  4       R7      pVP                  ^ 8w  dB   \        V4      ;'       g    R	pV'       g   RV3# \        WV4      '       d   R
pMRpRV RV 23# VP                  P                  4       pV'       g   RV3# \        WV4      '       d   RVR,           3# \        4       P                  WRRR4       RVRV  R2,           3#   \         d    Ru # \        P                   d    Ru # i ; i)u}  ``git pull --ff-only`` a plugin checkout, autostashing local edits (users patch installed
plugins in place, and a plain ff-only pull would then refuse forever).

Users tweak installed plugins in place (config constants, small patches), and a plain ``pull --ff-only``
then aborts with "Your local changes ... would be overwritten by merge" â€” making the plugin permanently
un-updatable until they hand-run git. Same UX class Factory Droid fixed in v0.188 ("Updating a plugin
marketplace now succeeds when its checkout has local changes"), and the same autostash approach ``hermes
update`` already uses for the main checkout (PR #70161).
Frª   zget-urlr‰   r   Úpullz	--ff-only)rh   zgit pull failed.zLocal changes were restored.zGLocal changes are preserved in git stash (restore with: git stash pop).r3   Tz4
Local changes were re-applied on top of the update.rë   rì   ry   uÄ   
âš  Local changes in this plugin conflicted with the update and were NOT re-applied. They are preserved in git stash â€” inspect with `git stash show -p` and re-apply with `git stash pop` inside Ú.)FrÀ   )Fz)Git operation timed out after 60 seconds.)r   rÃ   rò   rs   ra   rb   rt   rf   rä   rÄ   r€   r�   )rÍ   rj   rÛ   rñ   r‰   rZ   ÚnoteÚpulleds   &       r   Ú_git_pull_plugin_dirrù   G  s‰  € ô ‹e×+Ñ+Ó-€GßØ<Ð<ð"BÜ.¨wÓ?‰ˆ	ßØ˜#�:ÐÜ“×&Ñ& w¸À)ÈXÐ_aÐ&ÓbˆÜ“×&Ñ& w¸ÀÐV\×VcÑVc×ViÑViÓVkÐ&ÓlˆØ×Ñ Ô!Ü! &Ó)×?Ð?Ð-?ˆCßØ˜c�zÐ!ä˜g¨y×9Ò9Ø5‘à`�Ø˜S˜E  D 6Ð*Ð*Ð*à—‘×$Ñ$Ó&ˆßØ˜�<ÐÜ˜'¨9×5Ò5Ø˜Ð"YÕYÐYÐYô 	‹×Ñ˜g¨w¸À&ÔIØ�Vð&ð '- X¨Qð0õ1ð 1ð 	1øô
 ô =Ø<Ò<Ü×$Ñ$ô BØAÒAðBúsM   ¤E ½A5E Â3
E Â>E ÃE Ã"!E ÄE ÄE Ä%*E ÅE8ÅE8Å2E8Å7E8)N)rX   )2Ú__doc__Ú
__future__r   r!   r·   r€   Ú	threadingÚurllib.parser™   Ú
contextlibr   Úpathlibr   Útypingr   r   Úhermes_cli._subprocess_compatr   Úhermes_constantsr	   Úutilsr
   r   ÚcompilerT   r   r,   r7   Úlocalr<   r=   rD   rK   rP   rW   rf   ru   r{   rƒ   r�   rd   r§   r«   r¼   rË   rs   rÙ   rä   rò   rù   r   r   r   Ú<module>r     s  ðñõ #ã Û 	Û Û Û Ý %Ý ß %å @Ý ,Ý #òð —:’:Ð2Ó3Ð õDõõeð !*§¢Ó 1Ð ð ñ	ó ð	õ0÷ õ4õ
÷(ð	ØNPð	Ødfð	à÷	õõI÷,*õ,õ:õ
]õ@÷'8ðT	NØ;=ð	NØOQ÷	NõAõõ$÷>/Br   