+
    jHàjvp ã                   óÒ  € R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	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Ht ^ RIHt ]P4                  ! R4      tRtR R	 ltR
 R ltR R lt]P@                  ! R]PB                  4      t"]P@                  ! R]PB                  4      t#R R lt$R R lt%R R lt&R R lt'R R lt(R R lt)Rt*Rt+R®t,R R lt-R  R! lt.R" R# lt/R$ R% lt0R& R' lt1R( R) lt2R*t3R+t4R,t5]3R-]4R.]5R//t6]5R/]4R0]3R1/t7^t8R2 t9R3 R4 lt:R5 R6 lt;R7 R8 lt<R9 R: lt=R; R< lt>R= R> lt?R? R@ lt@RA RB ltARC RD ltBRERF/RG RH lltCRI RJ ltDRK RL ltERM RN ltFRO RP ltGRQ RR ltHRS RT ltIRURV/RW RX lltJRY RZ ltKR[RR\R/R] R^ lltLR_ R` ltMRa Rb ltNRc Rd ltORe Rf ltPRg Rh ltQRi Rj ltRRk Rl ltSRm Rn ltTRo Rp ltURq Rr ltVRs Rt ltWRu Rv ltXRw Rx ltYRy Rz ltZR{ R| lt[R} R~ lt\R R€ lt]R� R‚ lt^Rƒ R„ lt_]`! 0 R¯m4      ta/ ]bPÇ                  R°R…4      C]bPÇ                  R±R†4      CtdR‡ Rˆ lte]`! R²4      tfR‰ RŠ ltgR³R‹ RŒ llthR�R/RŽ R� lltiR� R‘ ltjR’R/R“ R” lltk]! R•4      tl]! R–4      ]! R—4      ]! R˜4      ]! R™4      3tmR´tnRš R› lto^k]p! Rœ4      ,
          tqR�trRž RŸ ltsR  R¡ lttR¢ R£ ltuR¤ R¥ ltvR¦ R§ ltwR¨ R© ltxRª R« ltyR¬ R­ ltzR# )µa6  Desktop (Electron) app: build/stamp, stage-and-swap pack, exe integrity gate, macOS signing, Linux sandbox, launch (hermes gui/desktop).

Split out of ``hermes_cli/main.py``. Names that still live in main (``PROJECT_ROOT``, ...)
are imported lazily inside the functions that use them (avoids an import cycle).
N©ÚPath)ÚCallableÚOptional)Údesktop_console_outputÚdesktop_launch_notice)Úfactszhermes_cli.mainuB     â†© The previous desktop app was left untouched and still works.c                ó0   € V ^8„  d   QhR\         R\        /# ©é   Údesktop_dirÚreturn©r   Úbool)Úformats   "Ú</home/ubuntu/.hermes/hermes-agent/hermes_cli/main_desktop.pyÚ__annotate__r   !   s   € ÷ :ñ :¤dð :¬tñ :ó    c                ó>   € V R,          R,          P                  4       # )z;Return True when a local desktop renderer build is present.Údistú
index.html©Úexists©r   s   &r   Ú_desktop_dist_existsr   !   s   € à˜&Õ  <Õ/×7Ñ7Ó9Ð9r   c                óR   € V ^8„  d   QhR\         R\        R\        \         ,          /# )r   r   Úsource_moder   ©r   r   r   )r   s   "r   r   r   &   s*   € ÷ Sñ S¤dð S¼Dð SÄXÌdÅ^ñ Sr   c               óf   € V'       d
   V R,          # \        V 4      pVf   R# VR,          R,          # )z¹The renderer ``dist`` a launch loads: ``apps/desktop/dist`` in source mode, else the
``app.asar.unpacked/dist`` copy (the only real directory, and the one an interrupted replace tears).r   Nzapp.asar.unpacked)Ú_packaged_resources_dir)r   r   Ú	resourcess   &$ r   Ú_renderer_bundle_dirr!   &   s7   € ÷ Ø˜VÕ#Ð#ä'¨Ó4€IØÒ$ˆ4ÐR¨)Ð6IÕ*IÈFÕ*RÐRr   c                óF   € V ^8„  d   QhR\         R\        \         ,          /# r
   ©r   r   )r   s   "r   r   r   0   s"   € ÷ sñ s¬ð s´(¼4µ.ñ sr   c                ó®   € \        V 4      pVf   R# \        P                  R8X  d   VP                  P                  R,          # VP                  R,          # )zUThe packaged app's ``resources`` dir (renderer bundle, baked ``install-stamp.json``).NÚdarwinÚ	Resourcesr    )Ú_desktop_packaged_executableÚsysÚplatformÚparent)r   Ú
executables   & r   r   r   0   sI   € ä-¨kÓ:€JØÒÙä58·\±\ÀXÔ5Mˆ:×Ñ×#Ñ# kÕ1ÐrÐS]×SdÑSdÐgrÕSrÐrr   z<<(?:script|link)\b[^>]*\b(?:src|href)=["']([^"']+)["'][^>]*>z1\btype=["']module["']|\brel=["']modulepreload["']c                ó0   € V ^8„  d   QhR\         R\        /# ©r   Údist_dirr   r   )r   s   "r   r   r   @   s   € ÷ ñ ¤Dð ¬Tñ r   c                ó:  €  V R,          P                  RRR7      p\        P                  T4       FÔ  pTP	                  ^4      p\
        P                  TP	                  ^ 4      4      '       d-   \        P                  ! RT\        P                  4      '       d   Kl  TP                  R^4      ^ ,          P                  R^4      ^ ,          P                  R	4      pT'       g   Kµ  Y,          P                  4       '       d   KÓ   R
# 	  R#   \         d     R# i ; i)a_  True when ``index.html`` names hashed module chunks that aren't there.

A replace interrupted by locked files leaves index and ``assets/`` from
different generations; the app dies on its first lazy import while the
SOURCE-tree stamp still matches, so no rebuild fixes it. Conservative: an
unreadable index or one naming nothing checkable is NOT torn.
r   ú	utf-8-sigÚreplace)ÚencodingÚerrorsFz^[a-z]+:|^//Ú?Ú#z./T)Ú	read_textÚOSErrorÚ_HTML_TAG_WITH_URLÚfinditerÚgroupÚ_MODULE_TAGÚsearchÚreÚmatchÚ
IGNORECASEÚsplitÚlstripr   )r.   Úhtmlr>   ÚhrefÚrels   &    r   Ú_renderer_bundle_tornrE   @   sÞ   € ðØ˜<Õ'×2Ñ2¸KÐPYÐ2ÓZˆô $×,Ñ,¨TÖ2ˆØ�{‰{˜1‹~ˆä×!Ñ! %§+¡+¨a£.×1Ò1´R·X²X¸oÈtÔUW×UbÑUb×5cÒ5cÙØ�j‰j˜˜aÓ  Õ#×)Ñ)¨#¨qÓ1°!Õ4×;Ñ;¸DÓAˆß‰3˜�×.Ñ.×0Ô0Úñ 3ñ øô ô Úðús   ‚D ÄDÄDc                ó0   € V ^8„  d   QhR\         R\        /# r-   r   )r   s   "r   r   r   Y   s   € ÷ Uñ U¬ð U´$ñ Ur   c                óZ  € V R,          R,          pVR,          P                  4       '       g   R# VR,          R,          .VR,          P                  \        P                   R24      Op\        ;QJ d&    R	 V 4       F  '       g   K   R
'       * # 	  R'       * # ! R	 V 4       4      '       * # )aR  True when the packaged node-pty has no native binary for this OS.

The main process requires node-pty at startup, so such a package dies
before any window opens while the source stamp still matches (#62462).
Same places node-pty's loader and stage-native-deps.mjs look. Conservative:
a package without node-pty at all is not judged here.
Únode_modulesznode-ptyúpackage.jsonFÚbuildÚReleaseÚ	prebuildsz-*c              3   ó†   "  € T F7  qP                  4       '       g   K  \        VP                  R 4      R4      x € K9  	  R# 5i)z*.nodeN)Úis_dirÚnextÚrglob)Ú.0Úds   & r   Ú	<genexpr>Ú-_packaged_node_pty_missing.<locals>.<genexpr>f   s,   é € ÐT¹+°QÏÉÏÔ0”4˜Ÿ™ Ó)¨4×0Ð0»+ùs
   ‚Až#AT)Úis_fileÚglobr(   r)   Úany)r.   ÚrootÚnative_dirss   &  r   Ú_packaged_node_pty_missingrZ   Y   sŽ   € ð �nÕ$ zÕ1€DØ�>Õ!×*Ñ*×,Ò,Ùà˜'•> IÕ-Ð_°¸Õ1C×0IÑ0IÌSÏ\É\ÈNÐZ\ÐJ]Ó0^Ð_€Kß‹sÑT¹+ÓT�sŒsÔTÐTŠsÔTÐTˆsÑT¹+ÓTÓTÔTÐTr   c                óH   € V ^8„  d   QhR\         R\         R\        R\        /# )r   r   Úproject_rootr   r   r   )r   s   "r   r   r   i   s0   € ÷ ]ñ ]¤tð ]¼4ð ]ÔQUð ]ÔZ^ñ ]r   c               óR  € V'       d   \        V 4      '       g   R# M\        V 4      f   R# \        WR7      pVe#   \        V4      '       d   \	        RV R24       R# V'       g#   Ve   \        V4      '       d   \	        R4       R# ^ RIHp VRJ ;'       g    V! VRV4      '       * # )	zWTrue when the desktop build output is stale, missing, torn, or built in the other mode.TN©r   u<     âš  A previous update left the desktop bundle incomplete (z); rebuilding ituK     âš  The packaged desktop app has no node-pty native binary; rebuilding it)Úsource_product_currentÚdesktop)r   r'   r!   rE   ÚprintrZ   Úhermes_cli.source_buildr_   )r   r\   r   r.   r_   s   &&$  r   Ú_desktop_build_neededrc   i   sœ   € çÜ# K×0Ò0Ùð 1ä	% kÓ	2Ò	:Ùô $ KÔI€HØÒÔ 5°h× ?Ò ?ÜÐLÈXÈJÐVfÐgÔhÙç˜8Ò/Ô4NÈx×4XÒ4XÜÐ[Ô\Ùå>à�tÐ×\Ð\Ñ#9¸,È	ÐS[Ó#\Ô\Ð\r   c                ó<   € V ^8„  d   QhR\         R\         R\        /# )r   r   r\   r   r   )r   s   "r   r   r   �   s'   € ÷ Sñ S´Dð SÌð SÔQUñ Sr   c                óÚ   € \        V 4      pVf   R# ^ RIHp ^ RIHp V! V4      P                  R4      p\        V\        4      '       d   WT! VRR4      8w  d   R# \        WRR7      '       * # )aÁ  True when the packaged app was built from HEAD and none of its inputs changed since.

Freshness alone cannot answer this for an update: the baked ``install-stamp.json`` is a
desktop input that only the build itself rewrites, so after a pull that touched no other
desktop input the receipt still reads current while the app names the previous commit.
The commit the packaged app actually ships is the missing half; anything unreadable
means "build".
F)Úread_install_stamp)Ú_run_gitÚcommitz	rev-parseÚHEADr^   )	r   Úhermes_cli.stewardrf   Úhermes_cli.version_inforg   ÚgetÚ
isinstanceÚstrrc   )r   r\   r    rf   rg   rh   s   &&    r   Ú"_packaged_desktop_current_for_headro   �   sc   € ô (¨Ó4€IØÒÙÝ5Ý0á 	Ó*×.Ñ.¨xÓ8€FÜ�fœc×"Ò" f°¸À{ÐTZÓ0[Ô&[ÙÜ$ [ÈEÔRÔRÐRr   c                óF   € V ^8„  d   QhR\         R\        \         ,          /# r
   r#   )r   s   "r   r   r   –   s"   € ÷ Dñ D¬dð D´xÄµ~ñ Dr   c                ó&   € \        V R,          4      # )z?Return the current platform's unpacked Electron app executable.Úrelease)Ú_desktop_packaged_executable_inr   s   &r   r'   r'   –   s   € ä*¨;¸Õ+BÓCÐCr   c                óF   € V ^8„  d   QhR\         R\        \         ,          /# ©r   Úrelease_dirr   r#   )r   s   "r   r   r   ›   s   € ÷  :ñ  :´ð  :¼(Ä4½.ñ  :r   c                ó~  € \         P                  R8X  d   \        V P                  R4      4      pM]\         P                  R8X  d    R Uu. uF  q V,          R,          NK  	  ppM)R	 UUu. uF  pR
 F  q0V,          V,          NK  	  K  	  pppV Uu. uF  qDP	                  4       '       g   K  VNK  	  ppV'       g   R# \         P                  R8X  dH   \        V4      ^8”  d8   \        4       pV Uu. uF  p\        V4      V9   g   K  VNK  	  ppV'       d   Tp\        VR R7      # u upi u uppi u upi u upi )uê   The unpacked Electron app executable under *release_dir* (live ``release`` or a staging dir).

*release_dir* is electron-builder's ``directories.output`` â€” the live ``apps/desktop/release`` or a
stage-and-swap staging dir (#86443).
r%   z%mac*/Hermes.app/Contents/MacOS/HermesÚwin32z
Hermes.exeNc                 ó6   € V P                  4       P                  # ©N)ÚstatÚst_mtime©Úps   &r   Ú<lambda>Ú1_desktop_packaged_executable_in.<locals>.<lambda>»   s   €  q§v¡v£x×'8Ò'8r   )Úkey)zwin-unpackedzwin-ia32-unpackedzwin-arm64-unpacked)zlinux-unpackedzlinux-arm64-unpacked)ÚhermesÚHermes)	r(   r)   ÚlistrV   r   ÚlenÚ_expected_windows_pe_machinesÚ_pe_machine_or_noneÚmax)rv   Ú
candidatesrR   Únr~   ÚexistingÚexpectedÚmatchings   &       r   rs   rs   ›   s$  € ô ‡|�|�xÔÜ˜+×*Ñ*Ð+RÓSÓT‰
Ü	�‰˜Ô	 á4oó
Ù4o¨q˜!�O˜l×*Ð*Ñ4oð 	ð 
ˆ
ñ
 *Tô
Ù)S AÓ]qÐXY˜!�O˜a×ÐÑ]qÑÑ)Sð 	ñ 
ñ &Ó4™:�a¯©¯—�™:€HÐ4ßÙÜ
‡|�|�wÔ¤3 x£=°1Ô#4ô 1Ó2ˆÙ'ÓN™x˜!Ô+>¸qÓ+AÀXÑ+M—A�A™xˆÐNßØˆHÜˆxÑ8Ô9Ð9ùò/
ùó
ùò 5ùò Os$   Á
D*Á*!D/ÂD5Â.D5Ã3D:Ä
D:z	.staging-z	.previousc                ó4   € V ^8„  d   QhR\         R\         RR/# ©r   ÚsrcÚdstr   Nr   )r   s   "r   r   r   Ð   s!   € ÷ ñ ¤dð ´ð ¸$ñ r   c                óx  € \        \        ^R7       F  w  r# \        P                  ! W4        R# 	  \        P                  ! W4       R#   \         dd   p\
        P                  RT P                  TP                  T\        \        4      ^,           Y44       \        P                  ! T4        Rp?K¢  Rp?ii ; i)zd``os.rename`` that retries a transient PermissionError with bounded backoff; re-raises the last one.)ÚstartNzXdesktop promotion rename %s -> %s hit a file lock (attempt %d/%d), retrying in %.1fs: %s)Ú	enumerateÚ#_DESKTOP_SWAP_RENAME_RETRY_DELAYS_SÚosÚrenameÚPermissionErrorÚloggerÚwarningÚnamer…   Ú	_time_modÚsleep)r�   r‘   ÚattemptÚdelayÚexcs   &&   r   Ú_rename_riding_out_file_lockr¡   Ð   s‹   € ä#Ô$GÈq×Q‰ˆð	#Ü�IŠI�cÔÚñ Rô ‡I‚IˆcÖøô ô 	#Ü�N‰NØjØ—‘˜#Ÿ(™( G¬SÔ1TÓ-UÐXYÕ-YÐ[`ôô �OŠO˜E×"Ò"ûð	#ús   ˜AÁB9ÁAB4Â4B9c                ó0   € V ^8„  d   QhR\         R\         /# r
   r   )r   s   "r   r   r   ß   s   € ÷ [ñ [¤dð [¬tñ [r   c                óö   € V P                  \         R24       F  p\        P                  ! VRR7       K  	  V \         \        P
                  ! 4        R\        \        P                  ! 4       4       2,          # )uÇ   Fresh staging dir ``apps/desktop/.staging-<pid>-<ts>``: a sibling of ``release/`` (same fs â†’ the
swap is a rename) but not inside it, so ``release/*-unpacked`` globs never see it. Sweeps leftovers.Ú*T©Úignore_errorsÚ-)	rV   Ú_DESKTOP_STAGING_PREFIXÚshutilÚrmtreer–   ÚgetpidÚintrœ   Útime)r   Ústales   & r   Ú_desktop_staging_dirr¯   ß   s`   € ð ×!Ñ!Ô%<Ð$=¸QÐ"?Ö@ˆÜ�Š�e¨4×0ñ AàÔ3Ð4´R·Y²Y³[°MÀÄ3ÄyÇ~Â~ÓGWÓCXÐBYÐZÕZÐZr   c                ó<   € V ^8„  d   QhR\         R\         R\         /# )r   Úexerv   r   r   )r   s   "r   r   r   ç   s!   € ÷ ñ ¤ð ´4ð ¼Dñ r   c                óŠ   € T pVP                   V8w  d0   VP                   V8X  d   \        V  RV 24      hVP                   pK@  V# )zeThe dir directly under *release_dir* holding *exe* (electron-builder's ``appOutDir``, swapped whole).z is not under )r*   Ú
ValueError)r±   rv   Úunpackeds   && r   Ú_desktop_unpacked_rootrµ   ç   sC   € à€HØ
�/‰/˜[Ô
(Ø�?‰?˜hÔ&Ü ˜u N°;°-Ð@ÓAÐAØ—?‘?ŠØ€Or   c                ó4   € V ^8„  d   QhR\         R\         RR/# )r   ÚliveÚasider   Nr   )r   s   "r   r   r   ñ   s!   € ÷ -ñ -¤Dð -´ð -¸$ñ -r   c                óB  € V P                  4       '       gA   VP                  4       '       d+    VP                  V 4       \        P	                  RV 4       R# \        P                  ! VRR7       R#   \
         d#   p\        P	                  RYT4        Rp?R# Rp?ii ; i)aJ  Finish a swap that died between its two renames before starting a new one: a missing
``live`` with its ``aside`` copy present means the previous app was moved out and nothing
moved in, so put it back; otherwise ``aside`` is leftover. Deleting ``aside`` first (as the
swappers used to) destroyed the only remaining copy of the app.z0restored %s from an interrupted desktop app swapNz could not restore %s from %s: %sTr¥   )r   rN   r—   r™   rš   r7   r©   rª   )r·   r¸   r    s   && r   Ú_recover_interrupted_swaprº   ñ   sr   € ð
 �;‰;�=Š=˜UŸ\™\Ÿ^š^ð	Ø�L‰L˜ÔÜ�N‰NÐMÈtÔTÙô ‡M‚M�% t×,øô ô 	Ü�N‰NÐ=¸tÈCÔPÝûð	ús   ®'A1 Á1BÁ<BÂBc                óR   € V ^8„  d   QhR\         R\         R\        \         ,          /# )r   r   Ústaging_dirr   r#   )r   s   "r   r   r     s%   € ÷ &;ñ &;¬$ð &;¼Tð &;ÄhÌtÅnñ &;r   c                ó„  € \        V4      pVf   \        P                  ! VRR7       R# V R,          p \        W!4      pW4P                  ,          pW4P                  \
        ,           ,          pVP                  RRR7       \        WV4       VP                  4       pV'       d7   \        V RR7      pV'       d   \        P                  RV4       \        WV4        \        WE4       T'       d   \        P                  ! TRR7       \        P                  ! TRR7       YRP!                  T4      ,          #   \         d    T'       d   \        Ye4       h i ; i  \        \        3 d:   p	\        P                  RT	4        Rp	?	\        P                  ! TRR7       R# Rp	?	ii ; i  \        P                  ! TRR7       i ; i)	uÉ   Promote a VERIFIED staged pack over ``release/`` by two renames (live â†’ ``.previous``, staged â†’
live); a failure between them rolls back. Returns the live exe or None (live app kept). Never raises.NTr¥   rr   )ÚparentsÚexist_ok)Ú
also_posixz9stopped desktop processes before staged app promotion: %sz0desktop stage-and-swap failed, live app kept: %s)rs   r©   rª   rµ   r›   Ú_DESKTOP_PREVIOUS_SUFFIXÚmkdirrº   r   Ú%_stop_desktop_processes_locking_buildr™   Úinfor¡   r7   r³   rš   Úrelative_to)
r   r¼   Ú
staged_exerv   Ústaged_rootÚ	live_rootÚpreviousÚmoved_asideÚstoppedr    s
   &&        r   Ú_swap_staged_desktop_apprÌ     s`  € ô 1°Ó=€JØÒÜ�Š�k°Õ6ÙØ 	Õ)€Kð7Ü,¨ZÓEˆØ×"2Ñ"2Õ2ˆ	Ø×"2Ñ"2Ô5MÕ"MÕNˆØ×Ñ $°ÐÔ6Ü! )Ô6Ø×&Ñ&Ó(ˆßô <¸KÐTXÔYˆGßÜ—‘ÐWÐY`ÔaÜ(¨Ô=ð	Ü(¨Ô@÷
 Ü�MŠM˜(°$Õ7ô
 	�Š�k°Õ6Ø×-Ñ-¨kÓ:Õ:Ð:øô ô 	ßÜ,¨XÔAØð	ûô ”ZÐ ô Ü�‰ÐIÈ3ÔOÛä�Š�k°×6ûð	ûô 	�Š�k°Ö6úsN   ´B&E ÃD5 Ã&E Ã.E Ä5EÅEÅE ÅF"Å)FÅ?F% ÆF"Æ"F% Æ%F?c                ó(   € V ^8„  d   QhR\         RR/# )r   r¼   r   Nr   )r   s   "r   r   r   *  s   € ÷ 3ñ 3¬$ð 3°4ñ 3r   c                 ó6   € \         P                  ! V R R7       R# )Tr¥   N)r©   rª   )r¼   s   &r   Ú_discard_desktop_stagingrÏ   *  s   € Ü
‡M‚M�+¨T×2r   iL  id†  idª  zx86 (32-bit)zx64 (AMD64)ÚARM64ÚAMD64ÚX86c                  ó0   € ^ RI p V P                  RRR7      # )é    NÚkernel32T)Úuse_last_error)ÚctypesÚWinDLL)r×   s    r   Ú	_kernel32rÙ   F  s   € ÛØ�=‰=˜°Dˆ=Ó9Ð9r   c                ó:   € V ^8„  d   QhR\         \        ,          /# ©r   r   )r   Úset)r   s   "r   r   r   K  s   € ÷ ñ ¬H´S­Mñ r   c                 óú  € ^ RI p ^ RI Hp \        4       pVP                  V P	                  V P
                  4      .VP                  n        V P                  VP                  n	        \        4       p\        \        \        3 Fl  pV P                  ^ 4      pVP                  W@P                  V4      4      '       d   K<  VP                  \         ,          '       g   K[  VP#                  V4       Kn  	  T;'       g    R# )zµPE machines this host runs in user mode via GetMachineTypeAttributes (the only API reporting
AMD64-on-ARM64 emulation); None when unavailable (pre-Win11 22000) so callers fall back.N)Úwintypes)r×   rÞ   rÙ   ÚUSHORTÚPOINTERÚc_intÚGetMachineTypeAttributesÚargtypesÚc_longÚrestyperÜ   Ú_PE_MACHINE_ARM64Ú_PE_MACHINE_AMD64Ú_PE_MACHINE_I386ÚbyrefÚvalueÚ_MACHINE_ATTRIBUTE_USER_ENABLEDÚadd)r×   rÞ   rÕ   ÚrunnableÚmachineÚ
attributess         r   Ú"_windows_user_runnable_pe_machinesrð   K  s½   € ó ÝÜ‹{€HØ2:·/±/À6Ç>Á>ÐRX×R^ÑR^ÓC_Ð1`€H×%Ñ%Ô.Ø06·±€H×%Ñ%Ô-ä‹u€HÜ%Ô'8Ô:JÓKˆØ—\‘\ !“_ˆ
à×,Ñ,¨W·l±lÀ:Ó6N×OÒOÙØ×ÑÔ=×=Ö=Ø�L‰L˜Ö!ñ Lð ×Ð�tÐr   c                ó$   € V ^8„  d   QhR\         /# rÛ   ©rn   )r   s   "r   r   r   _  s   € ÷ .ñ .¤ñ .r   c                 ó2  € \         P                  R8X  dW   RRRRRR/P                  \        P                  ! 4       \        P
                  ! 4       ;'       g    RP                  4       4      # \        P
                  ! 4       ;'       g    RP                  4       # )	zCReturn the native Windows machine name in upper-case PE vocabulary.rx   Úarm64rÐ   Úamd64rÑ   Úx86rÒ   Ú )r(   r)   rl   r   Únative_archrî   Úupper© r   r   Ú_windows_native_machinerû   _  sx   € ä
‡|�|�wÔØ˜ '¨7°E¸5ÐA×EÑEÜ×ÒÓ¤(×"2Ò"2Ó"4×":Ð":¸×!AÑ!AÓ!Có
ð 	
ô ×ÒÓ×$Ð$ "×+Ñ+Ó-Ð-r   c                ó$   € V ^8„  d   QhR\         /# rÛ   )rÜ   )r   s   "r   r   r   h  s   € ÷ Dñ D¤sñ Dr   c                 óV  € \         P                  R8X  d    \        4       p V '       d   V # \        4       P                  4       pVR9   d   \        \        0# VR9   d   \        \        0# VR9   d   \        0# \        \        \        0#   \        \        \
        \        3 d    Rp  L†i ; i)uÌ   PE machines this Windows host can load: ``GetMachineTypeAttributes``, else by name (AMD64 â†’ x64+x86,
ARM64 â†’ ARM64+x64, x86 â†’ x86). Unknown hosts get the full set so the gate can never brick launch.rx   N)rÑ   ÚX86_64ÚX64)rÐ   ÚAARCH64)rÒ   ÚI386ÚI486ÚI586ÚI686)r(   r)   rð   r7   ÚAttributeErrorÚ	TypeErrorr³   rû   rù   rç   rè   ræ   )rí   rî   s     r   r†   r†   h  s¢   € ô ‡|�|�wÔð	Ü9Ó;ˆH÷ ØˆOÜ%Ó'×-Ñ-Ó/€GØÐ,Ô,Ü!Ô#3Ð4Ð4ØÐ&Ô&Ü!Ô#4Ð5Ð5ØÐ9Ô9Ü Ð!Ð!ÜÔ0Ô2BÐCÐCøô œ¬´JÐ?ô 	ØŠHð	ús   —
B ÂB(Â'B(c                ó0   € V ^8„  d   QhR\         R\        /# ©r   Úpathr   )r   r¬   )r   s   "r   r   r   |  s   € ÷ %ñ %œDð %¤Sñ %r   c           	     ó8  € ^ RI p V P                  4       P                  pTR8  d   \	        RT R24      hT P                  R4      ;_uu_ 4       pTP                  ^@4      p\        T4      ^@8  g   TR,          R8w  d   \	        R	4      hTP                  R
T^<4      ^ ,          pT^ 8:  g   T^,           T8”  d   \	        R4      hTP                  T4       TP                  ^4      p\        T4      ^8  g   TR,          R8w  d   \	        R4      hTP                  RT^4      w  r‰TP                  RT^4      ^ ,          p
TP                  T^,           T
,           4       ^ p\        T	4       FV  pTP                  ^(4      p\        T4      ^(8  d   \	        R4      hTP                  RT^4      w  rï\        Y¿T,           4      pKX  	  Y+8  d   \	        RT RT R24      h RRR4       T#   \         d   p\	        RT 24      hRp?ii ; i  + '       g   i     X# ; i)zÁCOFF machine field of the PE at ``path``; ``ValueError`` with a readable reason when it is not a
structurally complete PE (bad magic, truncated header, section data past EOF). Header walk only.Nzunreadable: i   zfile is only u3    bytes â€” far too small to be a Windows executableÚrb:Nr   Ns   MZu^   missing MZ header â€” not a Windows executable (a truncated or non-binary file saved as .exe?)z<Iz<corrupt DOS header: PE header offset points past end of file:Né   Ns   PE  u2   missing PE signature â€” corrupt executable headerz<HHz<Hztruncated PE section tablez<IIztruncated executable: file is z% bytes but its PE sections extend to z bytes)Ústructr{   Úst_sizer7   r³   ÚopenÚreadr…   Úunpack_fromÚseekÚrangerˆ   )r	  r  Ú	file_sizer    ÚfhÚheadÚe_lfanewÚpe_headrî   Ú
n_sectionsÚsize_of_optionalÚmax_section_endÚ_ÚsectionÚsize_of_rawÚpointer_to_raws   &               r   Ú_parse_pe_machiner   |  s  € ó ð/Ø—I‘I“K×'Ñ'ˆ	ð �3„Ü˜=¨¨Ð3fÐgÓhÐhØ	�‰�4�Œ˜BØ�w‰w�r‹{ˆÜˆt‹9�rŒ>˜T "�X¨Ô.ÜØpóð ð ×%Ñ% d¨D°$Ó7¸Õ:ˆØ�qŒ=˜H r�M¨IÔ5ÜÐ[Ó\Ð\Ø
�‰�ÔØ—'‘'˜"“+ˆÜˆw‹<˜"Ô ¨¥¨}Ô <ÜÐQÓRÐRØ$×0Ñ0°¸ÀÓCÑˆØ!×-Ñ-¨d°G¸RÓ@ÀÕCÐØ
�‰�˜2•Ð 0Õ0Ô1ØˆÜ�zÖ"ˆAØ—g‘g˜b“kˆGÜ�7‹|˜bÔ Ü Ð!=Ó>Ð>Ø*0×*<Ñ*<¸UÀGÈRÓ*PÑ'ˆKÜ! /ÀKÕ3OÓPŠOñ #ð Ô&ÜØ0°°Ð;`ÐapÐ`qÐqwÐxóð ð '÷/ 
ð6 €Nøô? ô /Ü˜<¨ uÐ-Ó.Ð.ûð/ú÷ 
Žð6 €Nús$   †G' ÁFHÇ'HÇ2H È HÈH	c                óF   € V ^8„  d   QhR\         R\        \        ,          /# r  ©r   r   r¬   )r   s   "r   r   r   ¤  s   € ÷ ñ œdð ¤x´¥}ñ r   c                 ó>   €  \        V 4      #   \         d     R # i ; irz   )r   r³   ©r	  s   &r   r‡   r‡   ¤  s$   € ðÜ  Ó&Ð&øÜô Úðús   ‚
 �›c                óF   € V ^8„  d   QhR\         R\        \        ,          /# r  ©r   r   rn   )r   s   "r   r   r   «  s   € ÷ ñ ¤tð ´¼µñ r   c                óØ   €  \        V 4      pT\        4       9  d,   \        P                  TRTR 24      pRT R\        4        R2# R#   \         d   p\        T4      u Rp?# Rp?ii ; i)zVWhy ``path`` cannot run on this Windows host, or None when it parses as a loadable PE.Nzunknown machine 0xÚ04Xzarchitecture mismatch: built a z executable but this is a z Windows host)r   r³   rn   r†   Ú_PE_MACHINE_NAMESrl   rû   )r	  rî   r    Úgots   &   r   Ú_desktop_exe_integrity_errorr+  «  sz   € ðÜ# DÓ)ˆð Ô3Ó5Ô5Ü×#Ñ# GÐ/AÀ'È#ÀÐ-OÓPˆà-¨c¨UÐ2LÜ&Ó(Ð)¨ð8ð	
ñ øô ô Ü�3‹x�ûðús   ‚A	 Á	A)Á
A$ÁA)Á$A)c                ó0   € V ^8„  d   QhR\         R\         /# ©r   r\   r   r   )r   s   "r   r   r   º  s   € ÷ 6ñ 6¤ð 6¬ñ 6r   c                óŽ   € V R,          R,          R,          R,          pVP                  4       '       d   V# V R,          R,          # )z¸The installed Electron package dir: workspace-local ``apps/desktop/node_modules/electron`` (where
``electronDist`` points) when present, else the root hoist npm sometimes uses instead.Úappsr`   rH   Úelectronr   )r\   Údesktop_locals   & r   Ú_electron_dirr2  º  sB   € ð ! 6Õ)¨IÕ5¸ÕFÈÕS€MØ×Ñ×ÒØÐØ˜.Õ(¨:Õ5Ð5r   c                ó0   € V ^8„  d   QhR\         R\        /# ru   r   )r   s   "r   r   r   Ã  s   € ÷ ñ ¤$ð ¬4ñ r   c                ó�   €  V\        V P                  4       4      P                  4       P                  9   #   \         d     R# i ; i)zXTrue when *proc*'s executable lives inside *release_dir* (False when it cannot be read).F)r   r±   Úresolver¾   Ú	Exception)Úprocrv   s   &&r   Ú
_runs_fromr8  Ã  s>   € ðØœd 4§8¡8£:Ó.×6Ñ6Ó8×@Ñ@Ñ@Ð@øÜô Úðús   ‚36 ¶AÁAc                óF   € V ^8„  d   QhR\         R\        \        ,          /# r
   r"  )r   s   "r   r   r   Ë  s   € ÷ ñ ¤dð ¬x¼­}ñ r   c                ó:  €  ^ RI pV R,          P                  4       p\        VP                  \        P
                  ! 4       4      P                  4       4      pT F+  p\        YB4      '       g   K  \        TP                  4      u # 	  R#   \         d     R# i ; i)aT  PID of a Desktop from this build's ``release`` tree that is one of OUR ancestors, else None.

That Desktop is running this process (its backend's launch-time update tail, or a
`hermes update` it spawned). On Windows it holds the exe lock the promotion rename
needs, and it cannot be stopped without killing this process first. Never raises.Nrr   )Úpsutilr5  r„   ÚProcessr–   r«   r¾   r6  r8  r¬   Úpid)r   r;  rv   Ú	ancestorsr*   s   &    r   Ú_desktop_ancestor_inr?  Ë  s}   € ðÛØ" YÕ.×7Ñ7Ó9ˆÜ˜Ÿ™¬¯	ª	«Ó4×<Ñ<Ó>Ó?ˆ	ó ˆÜ�f×*Ô*Ü�v—z‘z“?Ò"ñ ñ øô ô Úðús   ‚AB ÂBÂBrÀ   Fc                óR   € V ^8„  d   QhR\         R\        R\        \        ,          /# )r   r   rÀ   r   )r   r   r„   r¬   )r   s   "r   r   r   Ý  s-   € ÷ Xñ X´tð XÌDð XÔ]aÔbeÕ]fñ Xr   c          
     ót  € \         P                  R8w  d   V'       g   . #  ^ RIpV R,          P                  4       pTP                  4       '       g   . # \        P                  ! 4       p\        4       p \        TP                  T4      P                  4       4      pT F„  pTP                  TP                  4       \        Ys4      '       g   K1  \        P                   ! \        4      ;_uu_ 4        TP#                  R TP%                  RR7       4       4       RRR4       K†  	  . p TP'                  RR.4      p	T	 Fˆ  p
 T
P(                  pTP+                  R4      pTP+                  R4      pT'       d   Te   YÄ8X  g   YÅ9   d   KL  \-        T4      P                  4       pY>P                  9   g   Kw  TP/                  T
4       KŠ  	  . pT F8  p
 T
P1                  4        TP/                  \3        T
P                  4      4       K:  	  T'       dŒ   \        P                   ! \        4      ;_uu_ 4        TP5                  T^R	7      w  pp. pT F%  p
 T
P7                  4        TP/                  T
4       K'  	  T'       d   TP5                  T^R	7       RRR4       T# T#   \         d    . u # i ; i  \         d    . p EL&i ; i  + '       g   i     EK:  ; i  \         d    . u # i ; i  \         d     EK¿  i ; i  \         d     EKB  i ; i  \         d     KÓ  i ; i  + '       g   i     T# ; i)
u  Terminate a running desktop app whose exe lives INSIDE this build's ``release`` tree.

Windows needs it everywhere: the exe lock makes the pack die with ``Access is denied``.
POSIX can rename a running app's files away, so the pack itself needs no stop â€” but a
renderer left alive through the stage-and-swap promotion keeps fetching its OLD hashed
chunks by path after the swap and dies on the next lazy import (#109643), so the swap
point passes ``also_posix=True``. Never raises; returns the PIDs asked to stop.rx   Nrr   c              3   ó8   "  € T F  qP                   x € K  	  R # 5irz   )r=  )rQ   Úchilds   & r   rS   Ú8_stop_desktop_processes_locking_build.<locals>.<genexpr>  s   é € ÐQÑ1P¨Ÿ)ž)Ó1Pùs   ‚T)Ú	recursiver=  r±   )Útimeout)r(   r)   r;  r5  r6  rN   r–   r«   rÜ   r„   r<  r¾   rì   r=  r8  Ú
contextlibÚsuppressÚupdateÚchildrenÚprocess_iterrÄ   rl   r   ÚappendÚ	terminater¬   Ú
wait_procsÚkill)r   rÀ   r;  rv   ÚmeÚsparedr>  r*   ÚvictimsÚ	proc_iterr7  rÄ   r=  r±   Úexe_pathrË   r  ÚaliveÚkilleds   &$                 r   rÃ   rÃ   Ý  s»  € ô ‡|�|�wÔ§zØˆ	ðÛØ" YÕ.×7Ñ7Ó9ˆð ×Ñ×ÒØˆ	ä	�Š‹€Bô& “u€FðÜ˜Ÿ™¨Ó+×3Ñ3Ó5Ó6ˆ	ó ˆØ�
‰
�6—:‘:Ôô ˜&×.Ò.ÙÜ× Ò ¤×+Õ+Ø�M‰MÑQ°·±È4°Ô1PÓQÔQ÷ ,Ñ+ñ ð €GðØ×'Ñ'¨°¨Ó7ˆ	ó ˆð	Ø—9‘9ˆDØ—(‘(˜5“/ˆCØ—(‘(˜5“/ˆCß˜#š+¨¬°c´mÙÜ˜C“y×(Ñ(Ó*ˆHð ×*Ñ*Ö*Ø�N‰N˜4Ö ñ ð €GÛˆð	Ø�N‰NÔØ�N‰Nœ3˜tŸx™x›=Ö)ñ ÷ ä× Ò ¤×+Õ+Ø×(Ñ(¨¸!Ð(Ó<‰HˆAˆuØˆFÛ�ðØ—I‘I”KØ—M‘M $Ö'ñ ÷ Ø×!Ñ! &°!Ð!Ô4÷ ,ð €Nˆ7€NøôW ô ØŠ	ðûô6 ô Ø‹	ðú÷ ,×+Ñ+ûô
 ô ØŠ	ðûô ô 	Ûð	ûô ô 	Ûð	ûô !ô Úðú÷ ,Ö+ð €Nús¢   ¡J Á4(J2 Ã1)KÄ)K ÅAK.Æ
K.Ç4LÈ4L&É!LÉ4L&Ê L&ÊJ/Ê.J/Ê2KËKËKËK+Ë*K+Ë.K>Ë=K>ÌLÌLÌL#	ÌL&Ì"L#	Ì#L&Ì&L7	c                óF   € V ^8„  d   QhR\         R\        \        ,          /# )r   Úbundler   r&  )r   s   "r   r   r   8  s   € ÷ )ñ )¤Tð )¬h´s­mñ )r   c                óì  € ^ RI pV R,          R,          pVP                  4       '       g\   V P                  R8X  dK   \        V P	                  R4      4      \        V P	                  R4      4      ,           pV'       d
   V^ ,          pVP                  4       '       g   R#  VP                  VP                  4       4      pTP                  R4      pT'       d   \        T4      # R#   \         d     R# i ; i)zEReturn a bundle/framework CFBundleIdentifier for local macOS signing.NÚContentsz
Info.plistú
.frameworkzVersions/*/Resources/Info.plistzResources/Info.plistÚCFBundleIdentifier)
Úplistlibr   Úsuffixr„   rV   ÚloadsÚ
read_bytesr6  rl   rn   )rX  r]  rÄ   r‰   ÚdataÚidents   &     r   Ú_desktop_macos_bundle_idrc  8  sÂ   € ãØ�JÕ Õ-€DØ�;‰;�=Š=˜VŸ]™]¨lÔ:Ü˜&Ÿ+™+Ð&GÓHÓIÌDØ�K‰KÐ.Ó/óM1õ 1ˆ
çØ˜a•=ˆDØ�;‰;�=Š=ÙðØ�~‰~˜dŸo™oÓ/Ó0ˆð �H‰HÐ)Ó*€EßŒ3ˆu‹:Ð( DÐ(øô ô Úðús   ÂC$ Ã$C3Ã2C3c                ó:   € V ^8„  d   QhR\         \        ,          /# rÛ   ©r   rn   )r   s   "r   r   r   K  s   € ÷ ñ ¬x¼­}ñ r   c                 ór  € \         P                  R8w  d   R#  ^ RIHp  V ! 4       P	                  R/ 4      p\        V\        4      '       g   R# VP	                  R4      p\        V\        4      '       g   R# VP                  4       ;'       g    R#   \         d   p\        RT R24        Rp?R# Rp?ii ; i)uº   ``desktop.macos_signing_identity`` â€” a persistent (even self-signed) code-signing cert anchors
the Designated Requirement and keeps TCC grants stable across rebuilds. Unset â†’ ad-hoc.r%   N©Úload_configr`   Úmacos_signing_identityz;  (warning: could not load desktop.macos_signing_identity: z!; falling back to ad-hoc signing))r(   r)   Úhermes_cli.configrh  rl   rm   Údictrn   Ústripr6  ra   )rh  r`   Úidentityr    s       r   Ú%_desktop_macos_local_signing_identityrn  K  s    € ô ‡|�|�xÔÙðÝ1Ù“-×#Ñ# I¨rÓ2ˆÜ˜'¤4×(Ò(ÙØ—;‘;Ð7Ó8ˆÜ˜(¤C×(Ò(ÙØ�~‰~Ó×'Ð' 4Ð'øÜô ÜØIØˆeÐ4ð6ô	
õ ûðús)   ™3B Á'B Á7B ÂB ÂB6ÂB1Â1B6c                óP   € V ^8„  d   QhR\         R\        R\        P                  /# ©r   ÚcodesignÚappr   )rn   r   Ú
subprocessÚCompletedProcess)r   s   "r   r   r   a  s,   € ÷ _ñ _œsð _¬ð _¼J×<WÑ<Wñ _r   c           	      óP   € \         P                  ! V R RR\        V4      .3RR/VB # )z--verifyú--deepz--strictÚcapture_outputT©rs  Úrunrn   )rq  rr  Úkwargss   &&,r   Ú_codesign_verifyr{  a  s9   € Ü�>Š>Ø	�:˜x¨´S¸³XÐ>ñ_ØOSð_ØW]ñ_ð _r   c                óR   € V ^8„  d   QhR\         R\        R\        \        ,          /# rp  )rn   r   r   rk  )r   s   "r   r   r   f  s%   € ÷ ñ ¤sð ´ð ¼(Ä4½.ñ r   c                óV  a€  \         P                  ! V R\        V4      .RRRRRR7      pTP                   RTP
                   2oTP                  ^ 8w  d   R# R	 T3R
 llpT! R4      pRTR9   d   RMTRT! R4      R\        YRR7      P                  ^ 8H  /#   \         d     R# i ; i)u‡  Best-effort signing identity of a ``.app`` bundle: ``{team, identifier, verified}``.

``None`` when the bundle has no readable signature (``codesign -dv`` fails â€” e.g. an
unsigned bundle). ``team``/``identifier`` are ``None`` when the signature lacks them
(ad-hoc signatures report ``TeamIdentifier=not set``); ``verified`` is the strict
``--verify --deep --strict`` result. Never raises.
ú-dvFTúutf-8r1   ©Úcheckrw  Útextr2   r3   NÚ
c                óF   € V ^8„  d   QhR\         R\        \         ,          /# ©r   r�   r   )rn   r   )r   s   "r   r   Ú._macos_signature_summary.<locals>.__annotate__x  s   € ÷ ñ ”3ð œ8¤C�=ñ r   c                 óÈ   <€ SP                  4        FL  pVP                  V  R 24      '       g   K  V\        V 4      ^,           R P                  4       ;'       g    Ru # 	  R# )Ú=N)Ú
splitlinesÚ
startswithr…   rl  )r�   ÚlineÚoutputs   & €r   ÚfieldÚ'_macos_signature_summary.<locals>.fieldx  sV   ø€ Ø×%Ñ%Ö'ˆDØ�‰ #  a˜y×)Ô)ØœC ›H q�L˜MÐ*×0Ñ0Ó2×:Ð:°dÒ:ñ (ñ r   ÚTeamIdentifierÚteamÚ
identifierÚ
IdentifierÚverified©r�  )Nznot set)rs  ry  rn   r6  ÚstdoutÚstderrÚ
returncoder{  )rq  rr  rÄ   r�  r�  rŒ  s   &&   @r   Ú_macos_signature_summaryr˜  f  s¾   ø€ ðÜ�~Š~Ø�uœc #›hÐ'¨uÀTØ °	ô;ˆð
 —‘ˆ}˜B˜tŸ{™{˜mÐ,€FØ‡�˜!ÔÙ÷ð ñ Ð!Ó"€Dà˜Ð 1Ô1‘°tØ‘e˜LÓ)ØÔ$ X¸%Ô@×KÑKÈqÑPðð øô ô Úðús   ƒ(B ÂB(Â'B(c                óh   € V ^8„  d   QhR\         R\        \         ,          R\        \        ,          /# )r   Ú	installedÚrebuiltr   )rk  r   rn   )r   s   "r   r   r   †  s,   € ÷ ñ ¬dð ¼XÄd½^ð ÔPXÔY\ÕP]ñ r   c                óz  € V R,          '       g   R# Ve   VR,          '       g   RV R,           R2# VR,          V R,          8w  d   RV R,           RVR,           R2# V R,          '       d>   VR,          '       d/   V R,          VR,          8w  d   R	V R,          : RVR,          : R
2# VR,          '       g   R# R# )uA  Reason to refuse swapping a publisher-signed installed app for ``rebuilt``, or None.

#123748: replacing a Developer ID (Team ID) installation with a locally signed or
ad-hoc rebuild â€” or any bundle whose signing identity or bundle identifier differs â€”
invalidates the code-hash-bound keychain ACLs the app's safeStorage credentials are
encrypted under and resets TCC grants. Ad-hoc-to-ad-hoc replacement (the local
development flow) is untouched. ``installed`` is a ``_macos_signature_summary`` dict;
``rebuilt`` is None when the rebuilt bundle has no readable signature.
r�  Nzpublisher-signed app (Team ID zÄ) would be replaced by a locally signed or unreadable build; kept the existing app. To update it, sign the rebuild with the publisher identity (CSC_LINK / APPLE_SIGNING_IDENTITY) and update again.zpublisher Team ID z does not match rebuilt zg; kept the existing app. Check the signing identity in desktop.macos_signing_identity and update again.r‘  zbundle identifier zN; kept the existing app. Align the build's bundle identifier and update again.r“  z‹rebuilt bundle failed strict signature verification; kept the existing app. Re-run the build; if it persists, inspect with `codesign -vvv`.rú   )rš  r›  s   &&r   Ú_macos_signing_downgrade_errorr�  †  sä   € ð �V×ÔÙØ‚˜g fŸoœoØ0°¸6Õ1BÐ0Cð D<ð <ð 	=ð ˆv…˜) FÕ+Ô+Ø$ Y¨vÕ%6Ð$7Ð7OØ˜6•?Ð#ð $FðGð 	Hð 	�,×Ô G¨L×$9Ô$9Ø˜,Õ'¨7°<Õ+@Ô@Ø$ Y¨|Õ%<Ñ$?Ð?WØ˜<Õ(Ñ+ð ,6ð7ð 	8ð �:×ÔñWár   c                ó0   € V ^8„  d   QhR\         R\        /# )r   rr  r   r   )r   s   "r   r   r   ¦  s   € ÷ ñ ´ð ¼$ñ r   c           	     ód  € \         P                  ! R4      pV'       g   R#  \        P                  ! VR\	        V 4      .RRRRRR7      pVP
                   RVP                   2pVP                  ^ 8w  g   R	V9  g   R
V9   d   R# \        WRR7      P                  ^ 8H  #   \         d     R# i ; i)u½   True when the bundle has an intact Team-ID signature, so the fixup never clobbers a notarized
build with ad-hoc (resets TCC). A STALE real signature fails --verify â†’ False â†’ repairable.rq  Fr~  Tr  r1   r€  rƒ  zTeamIdentifier=zTeamIdentifier=not setr”  )
r©   Úwhichrs  ry  rn   r•  r–  r—  r{  r6  )rr  rq  rÄ   rŒ  s   &   r   Ú'_desktop_macos_has_valid_real_signaturer¡  ¦  s©   € ô �|Š|˜JÓ'€HßÙðÜ�~Š~Ø�uœc #›hÐ'¨uÀTÐPTÐ_fÐoxôzˆà—K‘K�=  4§;¡; -Ð0ˆØ�?‰?˜aÔÐ#4¸FÔ#BÐF^ÐbhÔFhÙÜ °UÔ;×FÑFÈ!ÑKÐKøÜô Úðús   ¢A"B  ÂB  Â B/Â.B/rm  r§   c                óH   € V ^8„  d   QhR\         R\         R\        R\        /# )r   rr  r   rm  r   )r   rn   r   )r   s   "r   r   r   ·  s/   € ÷ Añ A¤tð A¼Tð AÌSð AÔ[_ñ Ar   c               ó¶  aa€ \         P                  ! R4      oS'       g   R# VR,          R,          pVR,          R,          pVP                  4       '       d   VP                  4       '       g   \        RVR,           24      hRRR	RR
R/R VV3R lllpV R,          p. p\        P
                  ! V4       F»  w  r‰p
\        V4      p\        ;QJ d5    R VP                  V 4      P                   4       F  '       g   K   RM*	  RM&! R VP                  V 4      P                   4       4      '       d   K  V
 F6  pW¼,          pVR9   g   VP                  R9   g   K%  VP                  V4       K8  	  K½  	  \        VR RR7       F  pV! VRR7       K  	  \        4       pVR,          pVP                  4       '       dP   \        P
                  ! V4       F5  w  r‰p\        V4      pVP                  R9   g   K$  VP                  V4       K7  	  \        VR RR7       F  pV! VV\        V4      R7       K  	  V! W\        V 4      R7       \!        SV RR7       R# )uO  Sign a local build inside-out (Mach-O files, nested frameworks/helpers, main bundle) with the
repo's entitlements and an identifier-pinned DR when ad-hoc â€” a plain ``--deep --sign -`` gives
a cdhash-only DR (TCC re-prompts every rebuild) and strips the JIT/mic entitlements.
Raises on signing failure; True after strict verification.rq  Fr0  zentitlements.mac.plistzentitlements.mac.inherit.plistz)desktop entitlement plists missing under ÚentitlementsNr‘  ÚruntimeTc          
      óx   € V ^8„  d   QhR\         R\        \         ,          R\        \        ,          R\        RR/# )r   r	  r¤  r‘  r¥  r   N)r   r   rn   r   )r   s   "r   r   Ú3_desktop_macos_local_codesign.<locals>.__annotate__È  s=   € ÷ >ñ >Üð>Ü%-¬d¥^ð>ÜHPÔQTÍð>äð>à!%ñ>r   c                ó:  <€ SR RSR.pV'       d   VRR.,          pVe+   VP                  4       '       d   VR\        V4      .,          pV'       d   SR8X  d   VRR	V R
2.,          pVP                  \        V 4      4       \        P                  ! VRRR7       R# )ú--forceú--signz--timestamp=nonez	--optionsr¥  Nz--entitlementsr§   z--requirementsz=designated => identifier "Ú"T©r�  rw  )r   rn   rL  rs  ry  )r	  r¤  r‘  r¥  Úargsrq  rm  s   &$$$ €€r   Ú	sign_pathÚ0_desktop_macos_local_codesign.<locals>.sign_pathÈ  s—   ø€ ð ˜) X¨xÐ9KÐLˆßØ�[ )Ð,Õ,ˆDØÒ#¨×(;Ñ(;×(=Ò(=ØÐ%¤s¨<Ó'8Ð9Õ9ˆDß˜( cœ/ð Ð%Ð)DÀZÀLÐPQÐ'RÐSÕSˆDØ�‰”C˜“IÔÜ�Š�t 4¸×=r   rZ  c              3   óB   "  € T F  qP                  R 4      x € K  	  R# 5i)ú.appN)Úendswith)rQ   Úparts   & r   rS   Ú0_desktop_macos_local_codesign.<locals>.<genexpr>Þ  s   é € ÐRÑ1Q¨�}‰}˜V×$Ð$Ó1Qùs   ‚c                 ó,   € \        V P                  4      # rz   ©r…   Úpartsr}   s   &r   r   Ú/_desktop_macos_local_codesign.<locals>.<lambda>ä  s   € ¬s°1·7±7¬|r   )r�   Úreverse)r¥  Ú
Frameworksc                 ó,   € \        V P                  4      # rz   r¶  r}   s   &r   r   r¸  ï  s   € ´°A·G±G´r   )r¤  r‘  r”  >   Úchrome_crashpad_handlerúspawn-helper>   ú.nodeú.dylib>   r±  r[  )r©   r   r   ÚFileNotFoundErrorr–   Úwalkr   rW   rÅ   r·  r^  rL  ÚsortedrÜ   rì   rc  r{  )rr  r   rm  Úent_mainÚent_inheritr®  ÚcontentsÚ
standalonerX   Ú_dirsÚfilesÚ	root_pathr›   ÚfpÚbundlesÚframeworks_dirÚ_filesr~   rX  rq  s   &$d                @r   Ú_desktop_macos_local_codesignrÎ  ·  s  ù€ ô
 �|Š|˜JÓ'€HßÙà˜ZÕ'Ð*BÕB€HØ 
Õ*Ð-MÕM€KØ�O‰O×Ò +×"4Ñ"4×"6Ò"6ô  Ð"KÈKÐZdÕLdÐKeÐ fÓgÐgð>Ø6:ð>ØX\ð>à÷>ó >ð$ �ZÕ€HØ€JÜ Ÿgšg hÖ/Ñˆ�UÜ˜“Jˆ	ß‹3ÑR°×1FÑ1FÀsÓ1K×1QÒ1QÓR�3�3Š3ÑR°×1FÑ1FÀsÓ1K×1QÒ1QÓR×RÒRÙÛˆDØÕ!ˆBØÐBÔBÀbÇiÁiÐSfÖFfØ×!Ñ! "Ö%ó ñ	 0ô �ZÑ%;ÀT×JˆÙ�"˜e×$ñ Kô ›€GØ Õ,€NØ×Ñ×ÒÜ#%§7¢7¨>Ö#:ÑˆD˜Ü�T“
ˆAØ�x‰xÐ1Ö1Ø—‘˜A–ñ $;ô ˜Ñ&<Àd×Kˆñ 	�& {Ô?WÐX^Ó?_×`ñ	 Lñ ˆcÔ5MÈcÓ5RÕSÜ�X˜s¨$Õ/Ùr   c                ó<   € V ^8„  d   QhR\         R\        R\        /# rp  )rn   r   r   )r   s   "r   r   r   û  s!   € ÷ ñ ¬ð ´4ð ¼Dñ r   c           
     ót  €  \         P                  ! V RRRR\        V4      .RRRRRR	7      pVP                  ^ 8w  d   \	        R
VP                   R24       R# \        WRRRRR7      P                  ^ 8w  d   \	        R4       R# \	        R4       R#   \         d   p\	        RT R24        Rp?R# Rp?ii ; i)uæ   Legacy deep ad-hoc re-sign; NEVER deletes the safeStorage keychain item (that would orphan every
credential under it, and there is no verified successor identity here â€” the "Always Allow"
prompt is recoverable, deletion is not).r©  rv  rª  r§   FTr  r1   r€  z/  (warning: legacy ad-hoc re-sign failed (exit z/); leaving safeStorage keychain item untouched))r�  r‚  r2   r3   zp  (warning: legacy ad-hoc re-sign did not pass strict verification; leaving safeStorage keychain item untouched)uW     â†’ macOS desktop re-signed (legacy ad-hoc); safeStorage keychain item left untouchedz*  (warning: macOS relaunch fixup skipped: Ú)N)rs  ry  rn   r—  ra   r{  r6  )rq  rr  Úresultr    s   &&  r   Ú_macos_legacy_adhoc_resignrÓ  û  sÛ   € ðCÜ—’Ø�y (¨H°c¼3¸s»8ÐDÈEÐbfÐmqð  }Dð  MVô
ˆð ×Ñ Ô!ÜØAÀ&×BSÑBSÐATð U?ð ?ôñ Ü˜H°¸TÈGÐ\eÔf×qÑqÐuvÔvÜð?ôñ ÜÐgÔhÙøÜô CÜÐ:¸3¸%¸qÐA×BÐBÙûðCús$   ‚AB Á*B ÂB ÂB7ÂB2Â2B7Úpublisher_signing_configuredrv   c                ót   € V ^8„  d   QhR\         R\        \        ,          R\        \         ,          R\        /# )r   r   rÔ  rv   r   )r   r   r   )r   s   "r   r   r     s:   € ÷ `5ñ `5Üð`5Ü8@Ä½ð`5äœ$•ð`5ä+/ñ`5r   c               ó˜  € \         P                  R8w  d   R# VfP   \        \        P                  P                  R4      ;'       g     \        P                  P                  R4      4      pV'       d   R# \        T;'       g
    V R,          4      pVf   R# VP                  ^,          p\        V4      P                  R4      '       d   VP                  4       '       g   R# \        P                  ! R4      pV'       g   R	# \        V4      '       d   R# \        P                  ! R
R\        V4      .R	R7       \!        4       pT;'       g    RpVf   TpMX V R,          VP#                  V4      ,          p\        V4      P                  R4      '       d   VP                  4       '       g   Rp \'        W@VR7      '       d   V'       d   RMRp	\)        RV	 R24       R#  \/        WT4      #   \$         d    Rp L„i ; i  \*         dÁ   p
T'       d    T'       d   \-        YX4      MRpT'       d0   TR,          '       d!   \)        RT: RTR,           R24        Rp
?
R	# \)        RT: RT
 R24        \'        Y@RR7      '       d   \)        R4        Rp
?
R# M  \*         d   pTp
 Rp?MRp?ii ; i\)        RT
 R24        Rp
?
LäRp
?
ii ; i)ux  Re-sign a locally-built macOS app so in-place self-update doesn't reset TCC grants.

A rebuilt ad-hoc bundle (new cdhash, no stable Designated Requirement) reports
"Hermes is damaged" and loses every grant. Clear quarantine xattrs, then sign
with ``desktop.macos_signing_identity`` or identifier-pinned ad-hoc, keeping
entitlements. When a configured identity fails (#121857): over a locally-signed
install, retry identifier-pinned ad-hoc before the cdhash-only legacy sign;
over a publisher-signed (Team ID) install, refuse â€” the weaker signature would
orphan the keychain ACLs and TCC grants the update was asked to preserve
(#123748). No-op with a publisher identity (CSC_LINK / APPLE_SIGNING_IDENTITY;
callers may pass the decision so a later dotenv load can't reverse it) or an
intact Developer ID signature. ``release_dir`` signs the STAGED bundle before
promotion. Never raises.
r%   TNÚCSC_LINKÚAPPLE_SIGNING_IDENTITYrr   r±  rq  FÚxattrz-crr”  r§   )r   rm  zkeychain identityzstable ad-hoc identityu      â†’ macOS desktop signed with z$; TCC grants persist across rebuildsr�  u     âœ— macOS signing identity zZ did not produce a verified signature, and the installed app is publisher-signed (Team ID z©); keeping it (no ad-hoc fallback). Fix the identity (e.g. `hermes desktop --setup-tcc-identity` or edit desktop.macos_signing_identity in config.yaml) and update again.z6  (warning: configured macOS signing identity failed: z (uœ   ); falling back to identifier-pinned ad-hoc â€” TCC grants may need one re-prompt; run the update from the logged-in session to keep the certificate anchor)uZ     â†’ macOS desktop signed with stable ad-hoc identity; TCC grants persist across rebuildsz)  (warning: stable macOS signing failed (z); using legacy ad-hoc sign))r(   r)   r   r–   Úenvironrl   rs   r¾   rn   r²  rN   r©   r   r¡  rs  ry  rn  rÅ   r³   rÎ  ra   r6  r˜  rÓ  )r   rÔ  rv   r±   rr  rq  Ú
configuredrm  ÚreplacesÚlabelr    Ú
target_sigÚ	adhoc_excs   &$$          r   Ú!_desktop_macos_relaunchable_fixuprà    sˆ  € ô" ‡|�|�xÔÙØ#Ò+Ü'+Ü�J‰J�N‰N˜:Ó&×RÐR¬"¯*©*¯.©.Ð9QÓ*Ró(TÐ$ç#Ùô *¨+×*RÐ*R¸+È	Õ:QÓ
S€CØ
‚{Ùà
�+‰+�a�.€CÜˆs‹8×Ñ˜V×$Ò$¨C¯J©J¯LªLÙÜ�|Š|˜JÓ'€HßÙÜ.¨s×3Ò3ÙÜ‡N‚N�G˜U¤C¨£HÐ-°UÕ;Ü6Ó8€JØ× Ð ˜S€Hð
 ÒØ‰ð	Ø" YÕ.°·±ÀÓ1MÕMˆHô �8‹}×%Ñ% f×-Ò-°X·_±_×5FÒ5FØˆHð)]Ü(¨ÐPX×YÓYß+5Ñ'Ð;SˆEÜÐ4°U°GÐ;_Ð`ÔaÙð ZôR & hÓ4Ð4øô] ô 	ØŠHð	ûô ô $]ßßIQÔ1°(ÔEÐW[ˆJß˜j¨×0Ô0ô
 Ø3°J±>ð BUà! &Õ)Ð*ð +WðWôõ ô ØHÈÉÐTVÐWZÐV[ð \&ð &ôð Ü0°ÐX[×\Ó\Üð=ôõ  ð ]øô ô  Ø•ûð úäÐ9¸#¸Ð>ZÐ[×\Ñ\ûðI$]úsr   ÅG+ Æ/G> Ç
G> Ç+G;Ç:G;Ç>K	È	KÈKÈ.KÈ=KÉKÉ1JÊKÊJ-Ê!J(Ê#KÊ(J-Ê-KËK	c                ó>   € V ^8„  d   QhR\         R\        R,          /# )r   Úapp_pathr   N)r   rn   )r   s   "r   r   r   y  s   € ÷ ñ œTð ¤c¨D¥jñ r   c                ó‚  a€ V R,          R,          R,          pVP                  4       '       g   R# \        P                  ! 4       p \        VR4      ;_uu_ 4       o\	        V3R lR4       F  pVP                  V4       K  	  RRR4       VP                  4       #   + '       g   i     L ; i  \         d     R# i ; i)zCReturn the SHA-256 hex digest of an app bundle's app.asar, or None.rZ  r&   zapp.asarNr  c                  ó&   <€ S P                  R 4      # )i   )r  ©Úfs   €r   r   Ú _app_asar_hash.<locals>.<lambda>�  s   ø€  a§f¡f¨U¤mr   r   )rU   ÚhashlibÚsha256r  ÚiterrI  Ú	hexdigestr7   )râ  ÚasarÚhÚchunkræ  s   &   @r   Ú_app_asar_hashrï  y  s‘   ø€ à�jÕ  ;Õ.°Õ;€DØ�<‰<�>Š>ÙÜ�ŠÓ€AðÜ�$˜×Ô ÜÔ3°SÖ9�Ø—‘˜–ñ :÷ ð �{‰{‹}Ð÷ ×ûô ô Úðús*   ÁB/ Á)BÂB/ ÂB,	Â'B/ Â/B>Â=B>c                ó@   € V ^8„  d   QhR\         R\         R\         RR/# )r   ÚtmpÚtargetÚoldr   Nr   )r   s   "r   r   r   ˆ  s(   € ÷ +ñ +¤4ð +´ð +¼Dð +ÀTñ +r   c                óô  € RpVP                  4       '       d    VP                  V4       Rp V P                  V4       \        P                  ! TRR7       R#   \         d    \        P                  ! T RR7       h i ; i  \         dl   pRpT'       d.    TP                  T4       M  \         d   pTp Rp?MRp?ii ; i\        P                  ! T RR7       Te   \        RT RT 24      Thh Rp?ii ; i)zDMove a staged macOS bundle into place without losing the old bundle.FTr¥   Nz<installing the staged bundle failed and rollback remains at z: )r   r—   r7   r©   rª   )rñ  rò  ró  Ú	moved_oldÚinstall_errorÚrollback_errorr    s   &&&    r   Ú_swap_in_new_macos_bundlerø  ˆ  sì   € à€IØ‡}�}‡‚ð	Ø�M‰M˜#Ôð ˆ	ðØ�
‰
�6Ôô  ‡M‚M�# T×*øô- ô 	Ü�MŠM˜#¨TÕ2Øð	ûô ô Ø)-ˆßð%Ø—
‘
˜6Õ"øÜô %Ø!$•ûð%úä�Š�c¨Õ.ØÒ%ÜØNÈsÈeÐSUØ!Ð"ð$óð !ð!ð 	ûðúsL   šA ®B Á%A>ÂC7Â
C2ÂB)Â(C2Â)C Â4B;Â6C2Â;C Ã 2C2Ã2C7c                ó:   € V ^8„  d   QhR\         \        ,          /# rÛ   )rÜ   r   )r   s   "r   r   r   §  s   € ÷ 
ñ 
¤C¬¥Iñ 
r   c                 óB  € ^ RI p \        4       pV P                  R.4       Fz  pVP                  P	                  R4      ;'       g    RpVP                  R4      '       g   KA  VP                  \        V4      P                  4       P                  ^,          4       K|  	  V# )a  ``.app`` bundles of every live Hermes Desktop process. A running bundle is never swapped
under: Electron loads ``app.asar`` chunks and helper apps lazily, so renaming its bundle away
and deleting the old tree crashes the live app (the detached updater waits for it to exit).Nr±   r÷   z/Contents/MacOS/Hermes)
r;  rÜ   rK  rÄ   rl   r²  rì   r   r5  r¾   )r;  rË  r7  r±   s       r   Ú_running_macos_app_bundlesrû  §  sz   € ó Ü›€GØ×#Ñ# U GÖ,ˆØ�i‰i�m‰m˜EÓ"×(Ð( bˆØ�<‰<Ð0×1Ô1Ø�K‰Kœ˜S›	×)Ñ)Ó+×3Ñ3°AÕ6Ö7ñ -ð €Nr   c                ó4   € V ^8„  d   QhR\         R\         RR/# r�   r   )r   s   "r   r   r   ´  s&   € ÷ \ñ \¤$ð \¬Tð \°dñ \r   c                ób   € \         P                  ! R\        V 4      \        V4      .RRR7       R# )z‰``ditto`` copies a bundle with its signature, xattrs and symlinks intact (``shutil`` drops
the resource-fork metadata codesign verifies).z/usr/bin/dittoTr¬  Nrx  )r�   r‘   s   &&r   Ú_stage_macos_bundle_copyrþ  ´  s%   € ô ‡N‚NÐ$¤c¨#£h´°C³Ð9ÀÐVZ×[r   c          	      ó    € V ^8„  d   QhR\         R\        \         ,          R\        \        \         ,          \        \        ,          3,          /# )r   r   r‰   r   )r   r„   Útuplern   )r   s   "r   r   r   º  sB   € ÷ Rñ R¬dð RÄÄTÅ
ð RÌuÔUYÔZ^ÕU_ÔaeÔfiÕajÐUjÕOkñ Rr   c                ó¨   € \         P                  R8w  d   . . 3# \        V 4      pVf   . . 3# \        VP                  ^,          V\        4       R7      # )a*  Copy the rebuilt macOS bundle into every stale or missing installed ``Hermes.app`` in
*candidates* (``_installed_desktop_apps()``) (#52339).

``hermes desktop --build-only`` (what ``hermes update`` runs) packages into
``apps/desktop/release/`` only. Finder, the Dock and Spotlight launch the copy in
``/Applications`` (or ``~/Applications``), so without this step every update leaves the
installed shell one build behind the backend it boots. The detached Desktop updater swaps
only the bundle it was launched from, so an app running from ``release/`` never refreshed
the installed copy either.

Returns ``(installed, problems)``: bundles that were (re)installed, and one user-facing line per
bundle that could not be (running, copy or swap failure). Both empty means every installed
copy was already current.
r%   )Úrunning)r(   r)   r'   Ú_install_rebuilt_macos_bundlesr¾   rû  )r   r‰   Úrebuilt_exes   && r   Ú_install_rebuilt_desktop_appr  º  sW   € ô ‡|�|�xÔØ�2ˆvˆÜ.¨{Ó;€KØÒØ�2ˆvˆä)Ø×Ñ˜AÕ 
Ô4NÓ4PôRð Rr   c                ó(   € V ^8„  d   QhR\         RR/# )r   r   r   Nr   )r   s   "r   r   r   Ó  s   € ÷ Kñ K´ð K¸$ñ Kr   c                óP  € \        4       '       g   R# \        4       pV Uu0 uF  q"P                  4       '       d   K  VkK  	  pp\        W4      w  rEV F(  pW#9   d   \	        RV R24       K  \	        RV 24       K*  	  V F  p\	        RV 24       K  	  ^ RIHp ^ RIHpH	p	 V Uu. uF  p\        V4      NK  	  p
pV	! V! 4       4      P                  R. 4      V
8X  d   R#  V! V! 4       RV
/4       R# u upi u upi   \         d   p\	        R	T R
24        Rp?R# Rp?ii ; i)zŠInstall the rebuilt bundle over stale or missing installed copies, report each outcome, and
record which copies this update keeps current.Nu%     âœ“ Reinstalled the Desktop app at zN: it had been removed, so Finder, the Dock and Spotlight could not find Hermesu+     âœ“ Installed the rebuilt Desktop app at u     âš  )Údesktop_install_record)Úatomic_json_writeÚread_json_or_emptyr/  u2     âš  Could not record the installed Desktop app (rÑ  )Ú_owns_installed_desktop_appsÚ_installed_desktop_appsr   r  ra   Úhermes_cli.gui_uninstallr  Úutilsr	  r
  rn   rl   r7   )r   Úownedrr  Úmissingrš  ÚproblemsÚproblemr  r	  r
  r/  r    s   &           r   Ú_refresh_installed_desktop_appsr  Ó  s%  € ô (×)Ò)ÙÜ#Ó%€EÙ#Ó8™e�s¯:©:¯<�sˆs™e€GÐ8Ü6°{ÓJÑ€IÛˆØŒ>ÜÐ9¸#¸ð ?Að Aö Bô Ð?À¸uÐEÖFñ ó ˆÜ��w�iÐ Ö!ñ å?ß;ñ !&Ó&¡˜ŒC�ŽH¡€DÐ&ÙÑ0Ó2Ó3×7Ñ7¸ÀÓCÀtÔKÙðKÙÑ0Ó2°V¸T°NÖCùò% 9ùò 'øô
 ô KÜÐBÀ3À%ÀqÐI×JÒJûðKús(   ¡C6½C6Â)C;Ã$D  Ä D%ÄD Ä D%c                ó\   € V ^8„  d   QhR\         \        ,          R\         \        ,          /# )r   r‰   r   ©r„   r   )r   s   "r   r   r   ð  s"   € ÷ ñ ¬D´­Jð ¼4Ä½:ñ r   c                óH  € . pV  F�  p \         P                  ! VR,          R,          R,          P                  RR7      4      p\        T\        4      '       g   KW  TP                  RR4      R8X  g   Kp  TP                  T4       Kƒ  	  V#   \        \        3 d     K›  i ; i)aÊ  The existing bundles in *candidates* that only ``hermes update`` keeps current (#52339).

Ownership comes from the bundle's own ``install-stamp.json``. ``updateMechanism: self`` is a
bootstrap build (a local pack or the bootstrap download), and stamps older than the field
predate every self-updating kind. Bundled/light releases update themselves and commit builds
are external, so a local build must never be copied over them. No readable stamp, no claim.
rZ  r&   zinstall-stamp.jsonr0   ©r2   ÚupdateMechanismÚself)	Újsonr_  r6   r7   r³   rm   rk  rl   rL  )r‰   r  rr  Ústamps   &   r   Ú_update_owned_macos_bundlesr  ð  s“   € ð €EÛˆð	Ü—J’J  jÕ 0°;Õ >ÐAUÕ U×`Ñ`ÐjuÐ`ÓvÓwˆEô �eœT×"Ô" u§y¡yÐ1BÀFÓ'KÈvÖ'UØ�L‰L˜Öñ ð €Løô	 œÐ$ô 	Úð	ús   ‰;BÂB!Â B!c                ó$   € V ^8„  d   QhR\         /# rÛ   ©r   )r   s   "r   r   r     s   € ÷ bñ b¤dñ br   c                 ó´   € \         P                  R8w  d   R# ^ RIHp  ^ RIHp \        V 4      P                  4       V! 4       R,          P                  4       8H  # )zÀA packaged app runs the checkout under the default Hermes home, so only that checkout (on
macOS) may build for it: a bundle from any other tree (a dev worktree) would split shell from
backend.r%   F©ÚPROJECT_ROOT)Úget_default_hermes_rootzhermes-agent)r(   r)   Úhermes_cli.mainr!  Úhermes_constantsr"  r   r5  )r!  r"  s     r   r  r    sD   € ô ‡|�|�xÔÙÝ,Ý8Ü�Ó×%Ñ%Ó'Ñ,CÓ,EÈÕ,V×+_Ñ+_Ó+aÑaÐar   c                ó:   € V ^8„  d   QhR\         \        ,          /# rÛ   r  )r   s   "r   r   r     s   € ÷ Tñ T¤¤d¥ñ Tr   c                 ód  € \        4       '       g   . # ^ RIHp Hp ^ RIHp V! 4       p\        V4      ;p'       d   V# V! V ! 4       4      P                  R4      p\        V\        4      '       g   . # V Uu. uF/  p\        V4      V9   g   K  VP                  4       '       d   K-  VNK1  	  up# u upi )a·  Installed macOS ``Hermes.app`` bundles this checkout's update owns.

When no owned copy is left, a recorded one that has gone missing still counts: its ownership
stamp left with the bundle, and without the record nothing would ever put it back (Finder, the
Dock and Spotlight lose Hermes for good). A copy moved to the other Applications folder keeps
its stamp, so it is found instead of doubled. Hermes' GUI uninstall deletes the record.
)r  Úpackaged_gui_app_paths)r
  r/  )r  r  r  r'  r  r
  r  rl   rm   r„   rn   r   )r  r'  r
  r‰   r  Úrecordedrr  s          r   r  r    s�   € ô (×)Ò)Øˆ	ßWÝ(Ù'Ó)€JÜ+¨JÓ7Ð7€uÖ7ØˆÙ!Ñ"8Ó":Ó;×?Ñ?ÀÓG€HÜ�h¤×%Ò%Øˆ	Ù%ÓS™:�C¬¨S«°XÑ)=ŒCÀcÇjÁjÇl�CˆC™:ÑSÐSùÒSs   Á5B-ÂB-Â$B-c                ó<   € V ^8„  d   QhR\         R\         R\         /# )r   r   Úpackaged_executabler   r   )r   s   "r   r   r   #  s"   € ÷ ñ ´$ð ÌTð ÔVZñ r   c                ó  € \         P                  R8w  d   V# \        V 4       \        VP                  ^,          4      p\        4        F2  pVf   K	  \        V4      V8X  g   K  VR,          R,          R,          u # 	  V# )aæ  The executable ``hermes desktop`` launches: the installed app once it IS the checkout build.

Finder, the Dock and Spotlight open the installed ``Hermes.app``; launching the ``release/``
bundle beside it ran the same app from a second path while the installed copy went stale
(#52339). Refresh the installed copies, then launch the first one that matches the checkout
build. The checkout bundle stays the fallback: nothing installed, or a copy that is running
or could not be replaced.
r%   rZ  ÚMacOSrƒ   )r(   r)   r  rï  r¾   r  )r   r*  Úrebuilt_hashrr  s   &&  r   Ú _installed_desktop_launch_targetr.  #  sp   € ô ‡|�|�xÔØ"Ð"Ü# KÔ0Ü!Ð"5×"=Ñ"=¸aÕ"@ÓA€LÜ&Ö(ˆØÔ#¬°sÓ(;¸|Ö(KØ˜Õ# gÕ-°Õ8Ò8ñ )ð Ðr   c                óÂ   € V ^8„  d   QhR\         R\        \         ,          R\        \         ,          R\        \        \         ,          \        \        ,          3,          /# )r   Úrebuilt_appr‰   r  r   )r   r„   rÜ   r   rn   )r   s   "r   r   r   6  sL   € ÷ .ñ .Üð.Ü'+¬D¥zð.Ü?BÄ4½yð.ÜMRÔSWÔX\ÕS]Ô_cÔdgÕ_hÐShÕMiñ.r   c          	     ó\  € \        V 4      pVf   . . 3# \        P                  ! R4      pV'       d   \        W@4      MRp. p. pV EFl  p\	        WˆP
                  VP                   R2,          4       \	        WˆP
                  VP                   R2,          4       VP                  4       '       d   \        V4      V8X  d   K~  VP                  4       V9   d   VP                  V R24       K©  V'       d;   \        WH4      p	V	e,   \        W•4      p
V
'       d   VP                  V RV
 24       Kë  VP
                  VP                   R2,          pVP
                  VP                   R2,          p\        P                  ! VRR	7        \        W4       \        W¸V4       TP                  T4       EKo  	  Wg3#   \        \        P                   3 dX   p\        P                  ! TRR	7       TP#                  4       '       d   R
MRpTP                  T RT RT 24        Rp?EKá  Rp?ii ; i)uÿ  Stage-and-swap ``rebuilt_app`` into each bundle path in ``candidates`` that is missing or
whose ``app.asar`` differs. The rebuilt bundle already carries the stable local signing identity and no
quarantine xattr (``_desktop_macos_relaunchable_fixup``); ``ditto`` preserves both, so nothing
is re-signed here and TCC grants survive. A publisher-signed (Team ID) installation is never
replaced by a locally signed build or a different signing/bundle identity â€” the swap is
refused and reported instead (#123748).Nrq  z.hermes-update-oldz.oldzt is running and was not refreshed; quit Hermes Desktop and run `hermes update` again (or update from inside the app)z not refreshed: z.hermes-update-newTr¥   z; the previous app was keptr÷   z could not be installed (rÑ  )rï  r©   r   r˜  rº   r*   r›   rN   r5  rL  r�  rª   rþ  rø  r7   rs  ÚCalledProcessErrorr   )r0  r‰   r  r-  rq  Úrebuilt_sigrš  r  rr  Úinstalled_sigÚ	downgraderñ  ró  r    Úkepts   &&$            r   r  r  6  sâ  € ô " +Ó.€LØÒØ�2ˆvˆÜ�|Š|˜JÓ'€HßEMÔ*¨8ÔAÐSW€KØ€IØ€HÜˆô 	" #§z¡z°s·x±x°jÐ@RÐ4SÕ'SÔTÜ! #§z¡z°s·x±x°jÀÐ4EÕ'EÔFØ�:‰:�<Š<œN¨3Ó/°<Ô?ÙØ�;‰;‹=˜GÔ#Ø�O‰OØ�%ð Hð HôIñ ßÜ4°XÓCˆMØÒ(Ü:¸=ÓV�	ßØ—O‘O s eÐ+;¸I¸;Ð$GÔHÙØ�j‰j˜cŸh™h˜ZÐ'9Ð:Õ:ˆØ�j‰j˜cŸh™h˜ZÐ'9Ð:Õ:ˆÜ�Š�c¨Õ.ð	Ü$ [Ô6Ü% c°Ô4ð 	×Ñ˜×ñ= ð> ÐÐøô œ×6Ñ6Ð7ô 	Ü�MŠM˜#¨TÕ2Ø47·J±J·L²LÑ0ÀbˆDØ�O‰O˜s˜eÐ#<¸S¸EÀÀ4À&ÐIÔJÞûð		ús   Æ	F9Æ9H+ÇAH&È&H+c                ó<   € V ^8„  d   QhR\         R\        R\        /# )r   Úenvr   r   )rk  r   )r   s   "r   r   r   g  s!   € ÷ 	ñ 	¤Dð 	¼$ð 	Ä4ñ 	r   c               ó¼   € \         P                  R8w  g	   V'       d   R# V P                  R4      '       g   V P                  R4      '       g   RV 9   d   R# RV R&   R# )a  Force ad-hoc signing for the local packaged rebuild: with ``CSC_IDENTITY_AUTO_DISCOVERY`` on,
electron-builder grabs any personal keychain cert and stalls the sign step or clobbers a
notarized signature. No-op for source runs, off-macOS, with a real identity, or when pinned.r%   Fr×  rØ  ÚCSC_IDENTITY_AUTO_DISCOVERYÚfalseT)r(   r)   rl   )r8  r   s   &$r   Ú_force_adhoc_macos_signingr<  g  sM   € ô ‡|�|�xÔ§;ÙØ
‡w�wˆz×Ò˜cŸg™gÐ&>×?Ò?ÐC`ÐdgÔCgÙØ)0€CÐ%Ñ&Ùr   c                ó$   € V ^8„  d   QhR\         /# rÛ   r  )r   s   "r   r   r   s  s   € ÷ ñ ¬ñ r   c                 ó²  € \         P                  P                  R^ 4      R8X  d   R# \        P                  R8w  d   R# \        \         R4      '       d   \         P                  ! 4       ^ 8X  d   R#  \        RRR	7      ;_uu_ 4       p V P                  4       P                  4       R8H  uuR
R
R
4       #   + '       g   i     R
# ; i  \         d     R# i ; i)u  True when Electron should run ``--no-sandbox``: Ubuntu 23.10+ ``apparmor_restrict_unprivileged_userns``
breaks the userns sandbox without a root-owned 4755 helper. Deliberately NOT True for root â€”
Electron as root without a sandbox must stay an explicit choice.ÚELECTRON_DISABLE_SANDBOXÚ1TÚlinuxFÚgeteuidz6/proc/sys/kernel/apparmor_restrict_unprivileged_usernsr  r  N)r–   rÚ  rl   r(   r)   ÚhasattrrB  r  r  rl  r7   rå  s    r   Ú_desktop_linux_needs_no_sandboxrD  s  s˜   € ô 
‡z�z‡~�~Ð0°!Ó4¸Ô;Ùä
‡|�|�wÔÙÜŒr�9×Ò¤"§*¢*£,°!Ô"3ÙðÜÐJÐU\×]Õ]ÐabØ—6‘6“8—>‘>Ó# sÑ*÷ ^×]×]Ó]ûäô Úðús0   Á2C Â!B3Â(
C Â3C	Â>C ÃC ÃCÃCc                ó$   € V ^8„  d   QhR\         /# rÛ   r  )r   s   "r   r   r   …  s   € ÷ ñ ´ñ r   c                 óF  € \         P                  R8w  d   R# \        P                  ! R4      p V '       g   R#  \        P
                  ! V RRR.\        P                  \        P                  ^RR7      P                  ^ 8H  #   \        \        P                  3 d     R# i ; i)u¶   True when the unprivileged userns sandbox works (probed with ``unshare``, fails closed) â€” then
the setuid ``chrome-sandbox`` helper is never consulted and no sudo prompt is needed.rA  FÚunsharez--userz--map-root-userÚtrue)r•  r–  rF  r�  )
r(   r)   r©   r   rs  ry  ÚDEVNULLr—  r7   ÚTimeoutExpired)rG  s    r   Ú'_desktop_linux_userns_sandbox_availablerK  …  sŽ   € ô ‡|�|�wÔÙÜ�lŠl˜9Ó%€GßÙðä�NŠNØ˜(Ð$5°vÐ>Ü!×)Ñ)´*×2DÑ2DÈaÐW\ô÷ ‰jØñ	ð	øô ”Z×.Ñ.Ð/ô Úðús   ¹AB ÂB ÂB c                ó|   € V ^8„  d   QhR\         R\        \         \        \        P                  ,          3,          /# ©r   r*  r   )r   r   r   r–   Ústat_result)r   s   "r   r   r   ˜  s-   € ÷ ñ ¬tð ¼¼dÄHÌRÏ^É^ÕD\Ð>\Õ8]ñ r   c                óv   € V P                   R,          p WP                  4       3#   \         d    TR3u # i ; i)u[   ``(chrome-sandbox path, lstat or None)`` â€” lstat so a symlink is inspected, not followed.zchrome-sandboxN)r*   Úlstatr7   )r*  Úsandboxs   & r   Ú_sandbox_helper_lstatrR  ˜  s@   € à!×(Ñ(Ð+;Õ;€GðØŸ™›Ð'Ð'øÜô Ø˜ˆ}Òðús   •& ¦8·8c                óD   € V ^8„  d   QhR\         P                  R\        /# )r   Ústr   )r–   rN  r   )r   s   "r   r   r   ¡  s"   € ÷ Añ A¤r§~¡~ð A¼$ñ Ar   c                 óv   € V P                   ^ 8H  ;'       d$    \        P                  ! V P                  4      R8H  # )rÔ   ií	  )Úst_uidr{   ÚS_IMODEÚst_mode)rT  s   &r   Ú_sandbox_helper_is_setuid_rootrY  ¡  s*   € Ø�9‰9˜‰>×@Ð@œdŸlšl¨2¯:©:Ó6¸&Ñ@Ð@r   c                ó0   € V ^8„  d   QhR\         R\        /# rM  r   )r   s   "r   r   r   ¥  s   € ÷ 7ñ 7Ätð 7ÔPTñ 7r   c                ó¢   € \         P                  R8w  d   R# \        V 4      w  rVRJ;'       d!    \        P                  ! VP
                  4      # )z=Return True when ``chrome-sandbox`` exists as a regular file.rA  FN)r(   r)   rR  r{   ÚS_ISREGrX  ©r*  Ú_sandboxrT  s   &  r   Ú-_desktop_linux_sandbox_helper_is_regular_filer_  ¥  s=   € ä
‡|�|�wÔÙÜ(Ð)<Ó=�L€HØ�Tˆ>×6Ð6œdŸlšl¨2¯:©:Ó6Ð6r   c                ó0   € V ^8„  d   QhR\         R\        /# rM  r   )r   s   "r   r   r   ­  s   € ÷ 9ñ 9´dð 9¼tñ 9r   c                ó*  € \         P                  R8w  d   R# \        V 4      w  rVP                  4       '       g   \	        RV 24       R# Vf   \	        RV 24       R# \
        P                  ! VP                  4      '       g   \	        RV 24       R# \        V4      '       d   R# \        4       '       d   \	        R4       R# \        P                  ! R	4      pV'       g   \	        R
4       R# \	        R4        \         P                  RJ ;'       g$    \         P                  P                  4       '       * pVRR\        V4      .VRR\        V4      .3 F‚  pV'       d   VP!                  ^R4        \"        P$                  ! TV'       d   \"        P&                  MRV'       d   ^<MRRR7      pVP(                  ^ 8H  pV'       d   Ks  \	        RV 24        R# 	  R#   \         d    Rp Lµi ; i  \*        \"        P,                  3 d    Rp LQi ; i)z=Configure Electron's Linux SUID sandbox helper when required.rA  Tu?   âœ— Hermes Desktop is missing Electron's Linux sandbox helper: FNu1   âœ— Cannot stat Electron's Linux sandbox helper: u;   âœ— Electron's Linux sandbox helper is not a regular file: uG   âœ“ Using Chromium's user-namespace sandbox (setuid helper not needed).ÚsudouN   âœ— Hermes Desktop requires sudo to configure Electron's Linux sandbox helper.u@   â†’ Configuring Electron Linux sandbox helper (sudo required)...Úchownz	root:rootÚchmodÚ4755z-n)ÚstdinrF  r�  u9   âœ— Failed to configure Electron's Linux sandbox helper: )r(   r)   rR  r   ra   r{   r\  rX  rY  rK  r©   r   rf  Úisattyr³   rn   Úinsertrs  ry  rI  r—  r7   ÚSubprocessError)r*  rQ  rT  rb  Únon_interactiveÚcommandÚ	completedÚoks   &       r   Ú_desktop_linux_sandbox_fixuprn  ­  sÆ  € ä
‡|�|�wÔÙä'Ð(;Ó<�K€GØ�>‰>×ÒÜÐOÐPWÈyÐYÔZÙà	‚zÜÐAÀ'ÀÐKÔLÙÜ�<Š<˜Ÿ
™
×#Ò#ÜÐKÈGÈ9ÐUÔVÙä% b×)Ò)Ùä.×0Ò0ÜÐWÔXÙä�<Š<˜Ó€DßÜÐ^Ô_Ùä	Ð
LÔMðÜŸ)™) tÐ+×EÐE´3·9±9×3CÑ3CÓ3EÔ/Eˆð ˜7 K´°W³Ð>ÀÀwÐPVÔX[Ð\cÓXdÐ@eÓfˆßØ�N‰N˜1˜dÔ#ð		Ü"ŸšØß,;”j×(Ò(Àß-™°4Øô	ˆIð ×%Ñ%¨Ñ*ˆB÷ ‰rÜÐMÈgÈYÐWÔXÚñ gñ  øô% ô ØŠðûô œ×3Ñ3Ð4ô 	ØŠBð	ús6   Ã<G Ä$G Å5G2ÆG2Æ'G2ÇG/Ç.G/Ç2HÈHc                ó0   € V ^8„  d   QhR\         R\        /# rM  r   )r   s   "r   r   r   é  s   € ÷ bñ bÄTð bÌdñ br   c                óÒ   € \         P                  R8w  d   R# \        V 4      w  rVRJ;'       d9    \        P                  ! VP
                  4      ;'       d    \        V4      '       * # )z°True when a present, non-setuid ``chrome-sandbox`` would make Chromium abort with
``setuid_sandbox_host`` despite a working userns sandbox (call after the fixup's userns path).rA  FN)r(   r)   rR  r{   r\  rX  rY  r]  s   &  r   Ú+_desktop_linux_needs_disable_setuid_sandboxrq  é  sQ   € ô ‡|�|�wÔÙÜ(Ð)<Ó=�L€HØ�Tˆ>×aÐaœdŸlšl¨2¯:©:Ó6×aÐaÔ?]Ð^`Ó?aÔ;aÐar   r@  Ú0c                ó2   € V ^8„  d   QhR\         R,          /# )r   r   Nrò   )r   s   "r   r   r   ÷  s   € ÷ ñ ¤c¨D¥jñ r   c            	     ó*  € \         P                  P                  RR4      P                  4       p V '       d   RRRR/P                  V R4      # \         P                  P                  R4      '       d   R# \         P                  P                  R	4      '       d   R
# \        P
                  ! \        4      ;_uu_ 4        \        P                  ! . ROR^RR7      pVP                  ^ 8X  d    RRR4       R
#  RRR4       R#   + '       g   i     R# ; i)uù   Chromium password-store backend for this Linux session (KDE env â†’ GNOME Keyring socket â†’ D-Bus
ping of org.freedesktop.secrets), or None. Chromium's own detection fails under the launcher
env, and safeStorage then reports encryption unavailable.ÚKDE_SESSION_VERSIONr÷   Ú6Úkwallet6Ú5Úkwallet5ÚkwalletÚKDE_FULL_SESSIONÚGNOME_KEYRING_CONTROLúgnome-libsecretTF)rw  rF  r�  N)z	dbus-sendz	--sessionz--print-replyz--reply-timeout=2000z--dest=org.freedesktop.secretsz/org/freedesktop/secretszorg.freedesktop.DBus.Peer.Ping)
r–   rÚ  rl   rl  rG  rH  r6  rs  ry  r—  )Úkde_versionrÒ  s     r   Ú_detect_linux_password_storer  ÷  sÕ   € ô —*‘*—.‘.Ð!6¸Ó;×AÑAÓC€KßØ�Z  jÐ1×5Ñ5°kÀ9ÓMÐMÜ	‡z�z‡~�~Ð(×)Ò)ÙÜ	‡z�z‡~�~Ð-×.Ò.Ù Ü	×	Ò	œY×	'Õ	'Ü—’òð  Ø˜Uô$ˆð ×Ñ Ô!Ø$÷ 
(Ñ	'ð "÷ 
(ñ ÷ 
(Ö	'ñ ús   Â=/DÄD	c                óz   € V ^8„  d   QhR\         \        \        ,          \        \        \        \        3,          /# rÛ   )r   r„   rn   r   )r   s   "r   r   r     s*   € ÷ )Rñ )R¤¤t¬C¥y´#´s¼CÄÐ'EÕ!Fñ )Rr   c                 ó\  a€ . p R;p;r#Rp ^ RI Hp V! 4       ;'       g    / P                  R4      ;'       g    / oSP                  R4      p\	        T\
        4      '       d+   \        P                  ! T\        P                  R8g  R7      p MW\	        T\        \        34      '       d<   T Uu. uF/  p\        T4      P                  4       '       g   K$  \        T4      NK1  	  p pR T3R	 llpSP                  R
R4      p	\	        T	\        4      '       d   T	'       d   RMRpMH\	        T	\
        4      '       d3   \        P                  T	P                  4       P                  4       R4      pT! R\         4      pT! RR4      pSP                  RR4      p
\	        T
\        4      '       d   T
pMc\	        T
\"        \$        34      '       d   \        T
4      pM;\	        T
\
        4      '       d&   T
P                  4       P                  4       \&        9  pYY#T3#   \         d	    YY#T3u # i ; iu upi )a  ``desktop.*`` launch options: ``(electron_flags, disable_gpu "auto"/"1"/"0", password_store,
ozone_hint "auto"/"x11"/"wayland", renderer_accessibility bool)``; unknown values and config
errors yield "auto"/[]/True so a malformed config never blocks the launch.ÚautoTrg  r`   Úelectron_flagsÚnt)Úposixc                ó0   € V ^8„  d   QhR\         R\         /# r…  rò   )r   s   "r   r   Ú-_desktop_launch_options.<locals>.__annotate__'  s   € ÷ 1ñ 1”Sð 1¤cñ 1r   c                 ó¨   <€ SP                  V R 4      p\        V\        4      '       d   VP                  4       P	                  4       MRpW19   d   V# R # )r‚  r÷   )rl   rm   rn   rl  Úlower)r�   ÚallowedÚrawÚlowÚdesktop_cfgs   &&  €r   Ú_choiceÚ(_desktop_launch_options.<locals>._choice'  sD   ø€ Ø�o‰o˜c 6Ó*ˆÜ%/°´S×%9Ò%9ˆc�i‰i‹k×ÑÔ!¸rˆØ”nˆsÐ0¨&Ð0r   Údisable_gpur@  rr  Úpassword_storeÚozone_platform_hintÚrenderer_accessibility)r‚  Úx11Úwayland)rj  rh  rl   r6  rm   rn   Úshlexr@   r–   r›   r„   r   rl  r   Ú_GPU_FLAG_WORDSr‰  Ú_LINUX_PASSWORD_STORESr¬   ÚfloatÚ_A11Y_OFF_WORDS)Úflagsr�  r‘  Ú
ozone_hintr“  rh  Ú	raw_flagsræ  rŽ  Úraw_gpuÚraw_a11yr�  s              @r   Ú_desktop_launch_optionsr     sÍ  ø€ ð €EØ06Ð6€KÐ6�.Ø!ÐðVÝ1Ù"“}×*Ð*¨×/Ñ/°	Ó:×@Ð@¸bˆð —‘Ð 0Ó1€IÜ�)œS×!Ò!Ü—’˜I¬b¯g©g¸©oÔ?‰Ü	�I¤¤e˜}×	-Ò	-Ù!*Ó=¡˜A¬c°!«f¯l©l¯n””�Q–¡ˆÐ=÷1ð 1ð
 �o‰o˜m¨VÓ4€GÜ�'œ4× Ò ß$‘c¨#‰Ü	�GœS×	!Ò	!Ü%×)Ñ)¨'¯-©-«/×*?Ñ*?Ó*AÀ6ÓJˆÙÐ-Ô/EÓF€NÙÐ.Ð0JÓK€JØ�‰Ð7¸Ó>€HÜ�(œD×!Ò!Ø!)ÑÜ	�Hœs¤E˜l×	+Ò	+ô "& h£ÑÜ	�Hœc×	"Ò	"Ø!)§¡Ó!1×!7Ñ!7Ó!9ÄÑ!PÐØ˜~Ð;QÐQÐQøô? ô VØ >Ð?UÐUÒUðVüò >s'   ŒH  H ¹H Â-!H)ÃH)ÈH&È%H&c                ó$   € V ^8„  d   QhR\         /# )r   Údeferr  )r   s   "r   r   r   @  s   € ÷ ñ ¬ñ r   c                ó  € ^ RI Hp  ^ RIHpHpHp V! 4       '       g   R# V '       d   V! V4      pVP                  4        V# V! V4      pV'       d   \        RV 24       R#   \         d   p\        RT 24        Rp?R# Rp?ii ; i)aÃ  Install the XDG desktop entry for Hermes Desktop (Linux only, best-effort).

``Exec`` and ``Icon`` are absolute so the entry works outside a login shell.
``hermes uninstall --gui`` removes it.

``defer=True`` (app-grid launch) returns a ``DeferredDesktopEntryInstall`` that writes the
entry only once the Electron window is on screen (#111906); ``None`` when nothing is
pending. Terminal, detached and ``--build-only`` launches install synchronously.
r   )ÚDeferredDesktopEntryInstallÚinstall_desktop_entryÚis_supportedNu&   âœ“ Desktop launcher entry installed: u2   âš  Could not install the desktop launcher entry: )	r#  r!  Úhermes_cli.linux_desktop_entryr¤  r¥  r¦  r“   ra   r6  )r¢  r!  r¤  r¥  r¦  ÚdeferredÚentryr    s   &       r   Ú_register_linux_desktop_entryrª  @  s…   € õ -ðJßsÑsÙ�~Š~ÙßÙ2°<Ó@ˆHØ�N‰NÔØˆOÙ% lÓ3ˆßÜÐ:¸5¸'ÐBÔCñ øô ô JÜÐBÀ3À%ÐH×IÐIÙûðJús-   ˆA# ¡A# ©A# ÁA# ÁA# Á#BÁ.BÂBÚintegrity_checkc          
      ó˜   € V ^8„  d   QhR\         R\         R\        \        \         .\        \        ,          3,          ,          R\         /# )r   r   r¼   r«  r   )r   r   r   rn   )r   s   "r   r   r   [  sC   € ÷ 'ñ 'Üð'Ü$(ð'äœh¬ v¬x¼­}Ð'<Õ=Õ>ð'ô 
ñ'r   c               ó
  € \        V4      p\        WR7      '       g)   \        V4       \        R4       \	        R\
         24      hVf   \        P                  R8X  d   \        pVe   Ve	   V! V4      MRpVe   VeO   \        V4       Vf   \        RV 24       M\        RVP                   RV R	V 24       \	        R
\
         24      h\        W4      pVf(   \        RV R,           24       \	        R\
         24      hV# )zVSign and verify before swapping; the default integrity check is Windows PE validation.)rv   uY   âœ— The rebuilt desktop app could not be signed with a stable identity; not promoting it.z*Desktop signing refused the staged build. Nrx   u0   âœ— Desktop build produced no launchable app in u   âœ— The built z failed its integrity check: z	
    at: z*Desktop build produced no launchable app. u3   âœ— Could not install the rebuilt desktop app into rr   z%Could not publish the desktop build. )rs   rà  rÏ   ra   ÚRuntimeErrorÚ_PREVIOUS_APP_KEPTr(   r)   r+  r›   rÌ   )r   r¼   r«  Ústaged_executableÚerrorr*  s   &&$   r   Ú_promote_staged_desktop_appr²  [  s3  € ô
 8¸ÓDÐô -¨[×RÓRô
 	! Ô-Üð "ô 	#äÐGÔHZÐG[Ð\Ó]Ð]ð Ò¤3§<¡<°7Ô#:Ü6ˆð Ò(¨_Ò-Hñ 	Ð)Ô*ØNRð 
ð Ò  EÒ$5Ü  Ô-ØÒ$ÜÐDÀ[ÀMÐRÕSä�NÐ#4×#9Ñ#9Ð":Ð:WÐX]ÐW^ð _Ø.Ð/ð1ô 2äÐGÔHZÐG[Ð\Ó]Ð]Ü2°;ÓLÐØÒ"ÜÐCÀKÐR[ÕD[ÐC\Ð]Ô^ÜÐBÔCUÐBVÐWÓXÐXØÐr   c                ó>   € V ^8„  d   QhR\         \        ,          RR/# )r   rŒ  r   Nre  )r   s   "r   r   r   …  s"   € ÷ gñ g¬X´c­]ð g¸tñ gr   c                óÐ   € T ;'       g    RpRV9   d   RV9   g
   RV9  d   R# \        R4       \        R4       \        R4       \        R	4       \        R
4       \        R4       R# )u%  Print an actionable hint when a desktop build failed because esbuild's platform
binary was never staged (`ignore-scripts=true` skips esbuild's postinstall, so the
``@esbuild/<platform>`` optional dependency is absent) â€” #53082. Best-effort: only
adds context, never masks the original error.r÷   z	@esbuild/zcould not be foundzignore-scriptsNuO     âš  This looks like esbuild's native binary is missing â€” commonly caused byzO    `ignore-scripts=true` in your npm config, which skips esbuild's postinstallz0    that stages the @esbuild/<platform> package.uP       Fix: run `npm config get ignore-scripts` â€” if true, either set it to falsezW    (`npm config set ignore-scripts false`), then reinstall: `npm ci` in the repo root,zY    or stage the binary directly: `node node_modules/esbuild/install.js` in apps/desktop.)ra   )rŒ  r‚  s   & r   Ú _diagnose_esbuild_ignore_scriptsrµ  …  sa   € ð
 �<ˆ<�R€DØ˜4ÔÐ$8¸DÔ$@ÐFVÐ^bÔFbÙÜ	Ð
[Ô\Ü	Ð
[Ô\Ü	Ð
<Ô=Ü	Ð
\Ô]Ü	Ð
cÔdÜ	Ð
eÖfr   Úiconsc                ó„   € V ^8„  d   QhR\         R\        R\        R\        R\         R,          R\        \         ,          /# )r   r   r   Únpmr8  r¶  Nr   )r   r   rn   rk  r   )r   s   "r   r   r   •  sA   € ÷ 32ñ 32¬ð 32¼dð 32Ìð 32ÔSWð 32Ü"&¨¥+ð32Ü9AÄ$½ñ32r   c               óî  € ^ RI Hp V'       gP   \        P                  R8X  d;   \	        V 4      ;p'       d(   \        RV R24       \        R4       \        R4       R# V'       d   RMR	p\        V4      p\        P                  R8X  d"   ^ RIp	V	P                  R
VR7      P                  p\        W�R7      '       d   \        R4       V'       d   R\        V4      .M. p
VRRR.V
OpV'       d   RM
\        V 4      pVe@   \        V 4      pV'       d-   \        RRP                  \        \        V4      4       R24        V! V P                   ^,          VRV 2WR7       Ve)   V! V P                   ^,          VRRRRRRRV 2.RWR7       Ve   \#        W4      MRpTVe   \%        V4       # #   \&        P(                   d   p\+        TP,                  4       h Rp?ii ; i  Te   \%        T4       i i ; i)zEBuild prepared desktop sources, then publish the verified staged app.)Úrun_in_custodyrx   uP     âš  Skipped rebuilding the desktop app: this update is running inside it (pid z),zY    and Windows locks a running app's files. Quit Hermes Desktop and run `hermes desktop`uW       from a terminal, or use Update now in Settings â†’ About, to rebuild and reopen it.Núsource buildúpackaged appÚgit)Úbase_envr^   ug     â†’ No Developer ID configured; ad-hoc signing this local rebuild (CSC_IDENTITY_AUTO_DISCOVERY=false)z--iconsry  rJ   z--u@     âš  Stopped running desktop app to free the build output (pid ú, rÑ  zBuilding desktop )Úcwdr8  Úbuilderz--dirz	--publishÚneverz-c.directories.output=zPackaging the desktop app)rb   rº  r(   r)   r?  ra   rk  ÚpmÚensurer8  r<  rn   r¯   rÃ   ÚjoinÚmapr¾   r²  rÏ   rs  r2  rµ  rŒ  )r   r   r¸  r8  r¶  rº  ÚancestorÚbuild_labelÚ	build_envrÃ  Ú
build_argsÚ	build_cmdr¼   rË   r*  r    s   &$$$$           r   Úbuild_prepared_desktoprÌ  •  sò  € õ 7çœ3Ÿ<™<¨7Ô2ÔDXÐYdÓDeÐ8e¸Ö8eô 	Ð`ÐaiÐ`jÐjlÐmÔnÜÐiÔjÜÐgÔhÙß$/‘.°^€KÜ�S“	€IÜ
‡|�|�wÔó 	Ø—I‘I˜e¨i�IÓ8×<Ñ<ˆ	Ü! )×EÓEÜð 4ô 	5ç,1�)œS ›ZÑ(°r€JØ�e˜W dÐ8¨ZÐ8€Iß%‘$Ô+?ÀÓ+L€KØÒô 8¸ÓDˆßÜÐTÐUY×U^ÑU^Ô_bÔcfÐhoÓ_pÓUqÐTrÐrsÐtÔuð2Ù�{×*Ñ*¨1Õ-¨yÐ<MÈkÈ]Ð:[ÐalÕ|ØÒ"Ù˜;×.Ñ.¨qÕ1°C¸À	È4ÐQXÐZeÐgnØ3°K°=ÐAð4CØD_Ø*õ;ð FQÒE\Ô'¨ÔAÐbfð 	ð #ð
 Ò"Ü$ [Õ1ð #øô	 ×(Ñ(ô Ü(¨¯©Ô4Øûðûð Ò"Ü$ [Õ1ð #ús%   Å AF/ Æ/GÇGÇGÇG" Ç"G4z/dev/dxgz*/usr/lib/x86_64-linux-gnu/dri/d3d12_dri.soz+/usr/lib/aarch64-linux-gnu/dri/d3d12_dri.soz/usr/lib64/dri/d3d12_dri.soz/usr/lib/dri/d3d12_dri.soc                ó(   € V ^8„  d   QhR\         RR/# )r   r8  r   N)rk  )r   s   "r   r   r   Õ  s   € ÷ 	(ñ 	(œ4ð 	( Dñ 	(r   c                ó�  a € ^ RI Hp \        ;QJ d#    V 3R l\         4       F  '       g   K   RM	  RM! V 3R l\         4       4      '       d   R# V! 4       '       dh   \        P                  4       '       dL   \        ;QJ d     R \         4       F  '       g   K   RM	  RM! R \         4       4      '       d   RS R&   R# R# R# R# )	a!  Under WSLg, /dev/dxg alone does not make Mesa pick the GPU: Chromium still lands on
llvmpipe unless GALLIUM_DRIVER selects d3d12, and it must be set before Electron spawns
its GPU process (setting it from JS is too late). Explicit Mesa choices win; hosts without
the driver are left alone.)Úis_wslc              3   ó,   <"  € T F	  qS9   x € K  	  R # 5irz   rú   )rQ   r�   r8  s   & €r   rS   Ú$_prefer_wsl_d3d12.<locals>.<genexpr>Û  s   øé € Ð
8Ñ!7˜#�#Ž:Ó!7ùs   ƒTFNc              3   ó@   "  € T F  qP                  4       x € K  	  R # 5irz   )rU   )rQ   Údrivers   & r   rS   rÑ  Ý  s   é € Ð4gÑTfÈ&·^±^×5EÐ5EÓTfùs   ‚Úd3d12ÚGALLIUM_DRIVER)r$  rÏ  rW   Ú_MESA_DRIVER_OVERRIDESÚ_WSL_DXG_DEVICEr   Ú_WSL_D3D12_DRIVERS)r8  rÏ  s   f r   Ú_prefer_wsl_d3d12rÙ  Õ  s{   ø€ õ
 (ß
ƒsÔ
8Õ!7Ó
8‡s‡s‚sÔ
8Õ!7Ó
8×8Ò8ÙÙ‡x‚x”O×*Ñ*×,Ò,·³Ñ4gÕTfÓ4g··²Ñ4gÕTfÓ4g×1gÒ1gØ 'ˆÐÓñ 2hÑ,�xr   z!/scoped_dirXXXXXX/SingletonSocketÚHERMES_DESKTOP_TMPDIRc                ó|   € V ^8„  d   QhR\         P                  R\        \        \        \
        ,          3,          /# )r   r­  r   )ÚargparseÚ	Namespacer   rk  r„   rn   )r   s   "r   r   r   ç  s-   € ÷ +&ñ +&œh×0Ñ0ð +&´U¼4ÄÄcÅ¸?Õ5Kñ +&r   c                ó  € ^ RI HpHp V! 4       pVP                  RR4      p\        P
                  R8X  d;   \        \        P                  ! V4      4      \        8”  d   WC\        &   V! 4       VR&   \        V4       R F  w  rV\        WR4      '       g   K  RW6&   K  	  \        V RR4      '       d>   \        \        V P                  4      P!                  4       P#                  4       4      VR	&   \        V R
R4      pV'       d1   \        \        V4      P!                  4       P#                  4       4      M\        P$                  ! 4       VR&   \'        4       w  r‰r«pV	R8w  d   R\        P(                  9  d   W“R&   VR8w  d   R\        P(                  9  d   W³R&   V'       g   R\        P(                  9  d   RVR&   \        P
                  R8X  d5   R\        P(                  9  d    V
R8w  d   T
M	\+        4       pV'       d   WÓR&   W83# )z¹Electron child env + config-supplied extra flags. ``desktop.*`` config is bridged to env vars
Electron already reads; an explicit env var wins over config (and over keychain detection).)Úsocket_safe_tmpdirÚwith_hermes_node_pathÚTMPDIRr÷   rA  Fr@  Úhermes_rootNÚHERMES_DESKTOP_HERMES_ROOTrÀ  ÚHERMES_DESKTOP_CWDr‚  ÚHERMES_DESKTOP_DISABLE_GPUÚELECTRON_OZONE_PLATFORM_HINTÚ%HERMES_DESKTOP_RENDERER_ACCESSIBILITYrr  ÚHERMES_DESKTOP_PASSWORD_STORE))Ú	fake_bootÚHERMES_DESKTOP_BOOT_FAKE)Úignore_existingÚHERMES_DESKTOP_IGNORE_EXISTING)r$  rß  rà  rl   r(   r)   r…   r–   ÚfsencodeÚ_ELECTRON_TMPDIR_MAX_BYTESÚ_DESKTOP_TMPDIR_ENVrÙ  Úgetattrrn   r   râ  Ú
expanduserr5  Úgetcwdr   rÚ  r  )r­  rß  rà  r8  ÚtmpdirÚattrr�   rÀ  Úconfig_electron_flagsÚconfig_disable_gpuÚconfig_password_storeÚconfig_ozone_hintÚconfig_renderer_a11yr‘  s   &             r   Ú_desktop_launch_envrú  ç  s¼  € ÷ Ká
Ó
!€CØ�W‰W�X˜rÓ"€FÜ
‡|�|�wÔ¤3¤r§{¢{°6Ó':Ó#;Ô>XÔ#Xð $*ÔÑ Ù*Ó,ˆˆH‰Ü�cÔój‰	ˆä�4˜u×%Ô%ØˆC‹Hñjô ˆt�] D×)Ò)Ü,/´°T×5EÑ5EÓ0F×0QÑ0QÓ0S×0[Ñ0[Ó0]Ó,^ˆÐ(Ñ)Ü
�$˜˜tÓ
$€CßIL¤¤D¨£I×$8Ñ$8Ó$:×$BÑ$BÓ$DÔ EÔRT×R[ÒR[ÓR]€CÐÑô 	 Ó!ñ nÐÐ/DÐYmà˜VÔ#Ð(DÌBÏJÉJÔ(VØ,>Ð(Ñ)Ø˜FÔ"Ð'EÌRÏZÉZÔ'WØ.?Ð*Ñ+÷
  Ð$KÔSU×S]ÑS]Ô$]Ø7:ˆÐ3Ñ4ô ‡|�|�wÔÐ#BÌ"Ï*É*Ô#Tà%:¸fÔ%DÑ!ÔJfÓJhð 	÷ Ø3AÐ/Ñ0ØÐ%Ð%r   c          
      ób   € V ^8„  d   QhR\         R\         R\        R\        \         ,          RR/# )r   r   r\   r   r*  r   Nr   )r   s   "r   r   r     sA   € ÷ qñ qÜðqÜ%)ðqÜ;?ðqÜV^Ô_cÕVdðqà	ñqr   c               óT  € V'       dË   \        V 4      '       gB   \        RV R,           24       \        R4       \        R4       \        P                  ! ^4       \	        V4      R,          P                  4       '       g<   \        R4       \        RV R24       \        R4       \        P                  ! ^4       \        R	V R,           24       R
# VfD   \        RV R,           24       \        R4       \        R4       \        P                  ! ^4       R
# \        RV 24       R
# )z^Validate the pre-built artifact ``--skip-build`` promised; exit with a hint when it's missing.uC   âœ— --skip-build --source was passed but no desktop dist found at: r   z4  Pre-build first:  cd apps/desktop && npm run buildzG  Or drop --skip-build to install dependencies and build automatically.rI   uK   âœ— --skip-build --source requires existing desktop workspace dependencies.z  Install first:  cd z
 && npm ciuI   â†’ Skipping desktop source build (--skip-build --source); using dist at NuF   âœ— --skip-build was passed but no packaged desktop app was found at: rr   z3  Pre-build first:  cd apps/desktop && npm run packz0  Or drop --skip-build to package automatically.u9   â†’ Skipping desktop package build (--skip-build); using )r   ra   r(   Úexitr2  r   r   )r   r\   r   r*  s   &&$$r   Ú_check_desktop_skip_buildrþ    sô   € ÷ Ü# K×0Ò0ÜÐWÐXcÐflÕXlÐWmÐnÔoÜÐHÔIÜÐ[Ô\Ü�HŠH�QŒKÜ˜lÓ+¨nÕ<×DÑD×FÒFÜÐ_Ô`ÜÐ)¨,¨°zÐBÔCÜÐ[Ô\Ü�HŠH�QŒKÜÐYÐZeÐhnÕZnÐYoÐpÖqØ	Ò	$ÜÐVÐWbÐenÕWnÐVoÐpÔqÜÐCÔDÜÐ@ÔAÜ�Š�ŽäÐ YÐZmÐYnÐoÖpr   c                óF   € V ^8„  d   QhR\         R\        \        ,          /# rM  )r   r„   rn   )r   s   "r   r   r   .  s   € ÷ ñ ¼$ð Ä4ÌÅ9ñ r   c                ó4  € \        V 4      .p\        V 4      '       gY   \        4       '       d0   \        V 4      '       d   \	        R4       VP                  R4       V# \        P                  ! ^4        V# \        V 4      '       d   VP                  R4       V# )zd``[exe, *sandbox flags]`` after the Linux sandbox fixup; exits when the sandbox can't be configured.õ˜   âš  Falling back to --no-sandbox because this Linux host restricts unprivileged user namespaces and the Electron sandbox helper could not be configured.ú--no-sandboxz--disable-setuid-sandbox)	rn   rn  rD  r_  ra   rL  r(   rý  rq  )r*  Úlaunch_commands   & r   Ú _packaged_desktop_launch_commandr  .  sŽ   € äÐ-Ó.Ð/€NÜ'Ð(;×<Ò<Ü*×,Ò,Ô1^Ð_r×1sÒ1sÜð  mô  nØ×!Ñ! .Ô1ð
 Ðô �HŠH�Q�Kð Ðô 
5Ð5H×	IÒ	IØ×ÑÐ8Ô9ØÐr   c                óF   € V ^8„  d   QhR\         R\        \        ,          /# r-  r&  )r   s   "r   r   r   <  s   € ÷ ñ ¬dð ´xÄµ}ñ r   c                ób   € \        V 4      P                  pRV9   g   RV9   d   RV9   d   R# R# R# )uÏ  The package manager owning a non-editable install at *project_root*, or None.

A package-manager install (Homebrew, pip, distro packaging) places this
code in a ``site-packages``/``dist-packages`` tree. Such a tree ships no
``apps/desktop`` source, so the build ladder below can never run â€” the
caller must not treat it like a broken checkout. A Homebrew formula lives
under a ``Cellar`` directory; any other site-packages owner is reported
generically as pip.
zsite-packageszdist-packagesÚCellarÚhomebrewÚpipN)r   r·  )r\   r·  s   & r   Ú_site_packages_install_kindr
  <  s8   € ô �Ó×$Ñ$€EØ˜%Ô ?°eÔ#;Ø%¨Ô.ˆzÐ9°EÐ9Ùr   c                ó$   € V ^8„  d   QhR\         /# rÛ   r  )r   s   "r   r   r   L  s   € ÷ ñ ¬Tñ r   c                 óæ   € \         P                  R8w  d   R# \        R4      p V P                  4       '       g   R# ^ RIHp V! \        V 4      .V P                  R7      p\        RV  RV R24       R	# )
uÕ   Launch a separately installed ``/Applications/Hermes.app``, if present.

Returns True only when the app bundle exists and a detached launch was
started â€” the caller then exits without touching the build ladder.
r%   Fz./Applications/Hermes.app/Contents/MacOS/Hermes)Úlaunch_detached)rÀ  u/   â†’ Launched the installed Hermes Desktop app: ú (pid rÑ  T)	r(   r)   r   rU   Úhermes_cli.bundled_appr  rn   r*   ra   )r+   r  r=  s      r   Ú#_launch_installed_macos_desktop_appr  L  sh   € ô ‡|�|�xÔÙÜÐFÓG€JØ×Ñ×ÒÙÝ6á
œ3˜z›?Ð+°×1BÑ1BÔ
C€CÜ	Ð;¸J¸<ÀvÈcÈUÐRSÐ
TÔUÙr   c                ó8   € V ^8„  d   QhR\         P                  /# )r   r­  )rÜ  rÝ  )r   s   "r   r   r   ^  s   € ÷ e'ñ e'”(×$Ñ$ñ e'r   c                ó„  € ^ RI Hp ^ RIHpHp VR,          R,          p^ RIHp V! V4      pV'       g‰   VR,          P                  4       '       gl   \        V4      pVe'   \        4       '       d   \        P                  ! ^ 4       \        RV 24       VR	8X  d   \        R
4       \        P                  ! ^4       \        P                  ! \        4      ;_uu_ 4        ^ RIHp V! RR7       RRR4       \%        V 4      w  rš\'        V RR4      p\'        V RR4      p\'        V RR4      p\'        V RR4      '       dD   ^ RIHp \'        V RR4      ;'       g    Rp\        P                  ! V! V4      '       d   ^ M^4       V'       d   \-        W	V
4       \/        V4      p^ RIHp RpV'       gV   V'       gN   V! V4      p VP5                  4       pX'       g-   \        R4       \        R4       \        P                  ! ^4       V'       * ;'       d    T;'       g    \9        WAVR7      pRp V'       dJ   T! Y�;'       g    \'        V RR4      R7      p\:        P<                  ! RVR,          R 7      pVR,          V	R&   V'       d   \?        WAVVR!7       MjV'       dE   T! TRMXT;'       g    \'        V RR4      R"7       \A        WKVVR#7      pV'       g   T;'       g    TpMV'       d   R$MR%p\C        R&V R'2VR7        ^ R)I'H(p \S        \'        V RR4      4      p\U        V! 4       ;'       d    V'       * R*7      pV'       d¼   V'       dT   \W        V4      '       g,   \        R+VR,,           24       \        P                  ! ^4       \        R-VR,,           R.24       MJVf8   \        R/VR0,           24       \        R14       \        P                  ! ^4       M\        R2V R.24       Ve   VPK                  4        R# V'       d}   \        R34       \Y        V4      p VR,,          VR4,          P[                  R5R67      P]                  4       ,          pVP_                  4       '       g   \a        V4      h \c        T4      R9.pM`Vf7   \        R:VR0,           24       \        R14       \        P                  ! ^4       \e        \g        VV4      4      pVPi                  V
4       \'        V R;R4      '       d   VPk                  R<4       \'        V R=R4      '       d   VPk                  R>4       VPi                  \m        4       4       V'       g   \C        R?R@Po                  V4       24       Ve   VPK                  4        RNp Ve   VPq                  V	4      p	VPr                  p V'       g­   \        Pt                  RA8X  d˜   ^ RBI;H<p!H=p" \}        VV	\D        P~                  \D        P~                  \D        P~                  RCRD7      p# \D        P€                  ! V3REV!! 4       /V#B  Ve   VPƒ                  4        \C        RG4       \        P                  ! ^ 4       \…        VR7      ;_uu_ 4       p$ \D        P†                  ! V3RHVRIV	RJRRKV /V$B p%RRR4       Ve   VPƒ                  4        \        P                  ! X%PŠ                  4       R#   + '       g   i     ELá; i  \6         d;   p\        RT 24       \        R4       \        P                  ! ^4        Rp?ELJRp?ii ; i  \6        \D        PF                  \H        3 d4   p\        R(T 24       Te   TPK                  4        \M        ^4      ThRp?ii ; i  \6         d+   p\        R7T 24       \        R84       \M        ^4      ThRp?ii ; i  \6         d=   p\'        TRFR4      ^8w  d   h \D        P€                  ! T3RET"! 4       /T#B   Rp?ELÔRp?ii ; i  \ˆ         d&    \        RL4       \        P                  ! ^ 4        EL¡i ; i  + '       g   i     EL®; i)Oz1Build and launch the native Electron desktop GUI.r   )Úprepare_source_dependenciesÚsource_build_envr/  r`   )Úis_bundled_payloadrI   Nz!Desktop GUI source not found at: r  z÷  This Hermes came from Homebrew, which does not ship the desktop app's
  source tree, so it cannot be built from this install.
  Install the desktop app from https://hermes-agent.nousresearch.com,
  or run `hermes desktop` from a source checkout.)Úsetup_loggingÚgui)ÚmodeÚsourceFÚ
skip_buildÚforce_buildÚsetup_tcc_identity)Ú!_desktop_macos_setup_tcc_identityrm  zHermes Local Signing)ÚDesktopBuildLocku-   âœ— Could not create the desktop build lock: zV  Refusing to run npm without serialization; check the checkout permissions and retry.uV   âœ— A Hermes update or another desktop dependency install or build is already running.z$  Wait for it to finish, then retry.r^   Ú
build_only)Úexplicitr¸  ÚPATHr$  )r   r*  )r8  r   )r   r¸  r8  r»  r¼  u   âœ“ Desktop z& is up to date (content stamp matches)u   âœ— Desktop GUI build failed: )Úlaunched_from_shell)r¢  u/   âœ— --build-only --source produced no dist at: r   u"   âœ“ Desktop source build ready at z (not launching; --build-only)u0   âœ— --build-only produced no launchable app at: rr   z7  Expected an unpacked Electron app for the current OS.u    âœ“ Desktop packaged app ready: u1   â†’ Launching Hermes Desktop from source build...zpath.txtr0   r  u*   âœ— Prepared Electron runtime is missing: zP  From the project root, run: node scripts/build/electron-runtime.mjs --source .Ú.uH   âœ— Desktop package build completed but no launchable app was found at: Úlocalz--localÚclose_previewz--close-previewu'   â†’ Launching packaged Hermes Desktop: Ú rx   )Úwindows_detach_flagsÚ&windows_detach_flags_without_breakawayT)rÀ  r8  rf  r•  r–  Ú	close_fdsÚcreationflagsÚwinerroruK   âœ“ Hermes Desktop launched in a detached window; you can close this shell.rÀ  r8  r�  Úpass_fdsu   
âœ“ Hermes Desktop closed.)zui-tuiÚwebzapps/desktoprú   )Fr#  r!  rb   r  r  rj   r  r   r
  r  r(   rý  ra   rG  rH  r6  Úhermes_loggingr  rú  rð  Úhermes_cli.main_desktop_tccr  Ú_launch_bundled_desktopr'   Úhermes_cli.desktop_build_lockr  Úacquirer7   rc   r©   r   rþ  rÌ  r   rs  ri  r®  rr   Ú
SystemExitr§  r"  r   rª  r   r2  r6   rl  rU   rÀ  rn   r  r.  ÚextendrL  Ú_explicit_profile_argsrÅ  Ú	child_envr,  r)   Úhermes_cli._subprocess_compatr'  r(  rk  rI  ÚPopenÚfinishr   ry  ÚKeyboardInterruptr—  )&r­  r!  r  r  r   r  ÚbundledÚinstall_kindÚ_setup_logging_guir8  rõ  r   r  r  r  rm  r*  r  Ú
build_lockÚacquiredr    Úneeds_buildr¸  rÉ  ÚbuiltrÈ  r"  r  Údeferred_entryr0  r+   r  r,  r'  r(  Úpopen_kwargsÚstreamsÚlaunch_results&   &                                     r   Úcmd_guirF  ^  s4  € å,ßUØ Õ'¨)Õ3€Kõ
 6á  Ó.€Gß˜K¨.Õ8×@Ñ@×BÒBô
 3°<Ó@ˆØÒ#Ô(K×(MÒ(MÜ�HŠH�QŒKÜÐ1°+°Ð?Ô@Ø˜:Ô%ÜðDôô 	�Š�Œä	×	Ò	œY×	'Õ	'ÝFÙ Õ&÷ 
(ô "5°TÓ!:Ñ€Cä˜$ ¨%Ó0€KÜ˜˜|¨UÓ3€JÜ˜$ ¨uÓ5€Kô ˆtÐ)¨5×1Ò1ÝQÜ˜4 ¨TÓ2×LÐLÐ6LˆÜ�ŠÑ7¸×AÒA‘ÀqÔIçÜ Ð+@ÔAä6°{ÓCÐõ ?à*.€JßŸ:Ù% lÓ3ˆ
ð	Ø!×)Ñ)Ó+ˆH÷
 ÜÐjÔkÜÐ8Ô9Ü�HŠH�QŒKà ”.÷ ð Ø×`Ð`Ô,¨[ÐT_Ô`ð ð €Cð%ßÙ(¨×7hÐ7hÄgÈdÐT`ÐbgÓFhÔiˆIÜ—,’,˜u¨9°VÕ+<Ô=ˆCØ# FÕ+ˆC�‰KßÜ%Ø°{ÐXkö÷ Ù'¨Ð6WÐ]fØ1<×1bÐ1bÄÈÈlÐ\aÓ@bõdä*¨;ÐUXÐ^gÔhˆEßà&+×&BÐ&BÐ/BÐ#øç,7™.¸^ˆKÜ! L°°Ð=cÐ"dÐr}Ö~õ CÜ”g˜d L°%Ó8Ó9€JÜ2Ñ9LÓ9N×9aÐ9aÐWaÔSaÔb€N÷ ßÜ'¨×4Ò4ÜÐGÈÐV\ÕH\ÐG]Ð^Ô_Ü—’˜”ÜÐ6°{ÀVÕ7KÐ6LÐLjÐkÕlØ Ò(ÜÐDÀ[ÐS\ÕE\ÐD]Ð^Ô_ÜÐKÔLÜ�HŠH�Q�KäÐ4Ð5HÐ4IÐIgÐhÔiØÒ!Ø×ÑÔ ÙçÜÐAÔBô ! Ó.ˆð	)Ø! FÕ*¨h¸Õ.C×-NÑ-NÐXcÐ-NÓ-d×-jÑ-jÓ-lÕlˆJØ×%Ñ%×'Ò'Ü'¨
Ó3Ð3ð (ô ˜j›/¨3Ð/‰àÒ&ÜÐ\Ð]hÐktÕ]tÐ\uÐvÔwÜÐKÔLÜ�HŠH�QŒKÜ9Ü,¨[Ð:MÓNóPˆà×ÑÐ3Ô4Üˆt�W˜e×$Ò$Ø×Ñ˜iÔ(ô
 ˆt�_ e×,Ò,Ø×ÑÐ/Ô0Ø×ÑÔ0Ó2Ô3ßÜÐ GÈÏÉÐQ_ÓH`ÐGaÐbÔcð ÒØ×ÑÔØ "€HØÒ!Ø×&Ñ& sÓ+ˆØ!×*Ñ*ˆßœ3Ÿ<™<¨7Ô2÷	
ô
 ØØÜ×$Ñ$Ü×%Ñ%Ü×%Ñ%Øô
ˆð	Ü×Ò˜^ÑbÑ;OÓ;QÐbÐUaÒbð Ò%Ø×!Ñ!Ô#ÜÐkÔlÜ�Š�ŒÜ	¨K×	8Õ	8¸Gð
	Ü&ŸNšNØñØ$/ðØ58ðØ@EðØPXðØ\cñˆM÷ 
9ð Ò!Ø×ÑÔÜ‡H‚Hˆ]×%Ñ%Ö&÷O 
(×	'Ð	'ûôD ô 	ÜÐAÀ#ÀÐGÔHÜÐjÔkÜ�HŠH�Q�KŠKûð	ûô@ ”Z×/Ñ/´Ð>ô %ÜÐ.¨s¨eÐ4Ô5ØÒ!Ø×ÑÔ Ü˜‹m Ð$ûð	%ûôX ô 	)ÜÐ>¸s¸eÐDÔEÜÐdÔeÜ˜Q“- SÐ(ûð	)ûôt ô 	ô �s˜J¨Ó-°Ô2ØÜ×ÒØñáDÓFðð ÷ð ûð	ûô, !ô 	ô
 Ð0Ô1Ü�HŠH�Q�Kð	ú÷ 
9×	8Ð	8úsÈ   Ã[Ç[ È.\# È6
\# ÉA\# Ê\# Ê\# Ê?\# Ë\# Ë"\# Ë*\# ÐA]9 Ø^1 Ù(`.Ù*_;Û[	Û\ Û&/\Ü\ Ü# ]6Ý.]1Ý1]6Ý9^.Þ%^)Þ)^.Þ1_8Þ<1_3ß3_8ß;,`+à'`.à*`+à+`.à.`?	c                ó:   € V ^8„  d   QhR\         \        ,          /# rÛ   )r„   rn   )r   s   "r   r   r   F  s   € ÷ 	5ñ 	5¤¤S¥	ñ 	5r   c                 ó8   € ^ RI Hp  V ! 4       pV'       d   RV.# . # )uÙ   ``--profile <name>`` for Electron when ``-p``/``--profile`` was on argv.

Explicit flag only. A bare `hermes desktop` must not forward the sticky CLI
profile â€” Electron would persist it over the stored desktop one.
)Úexplicit_cli_profilez	--profile)r#  rI  )rI  Úprofiles     r   r5  r5  F  s!   € õ 5á"Ó$€Gß%,ˆK˜Ð!Ð4°"Ð4r   c                ój   € V ^8„  d   QhR\         P                  R\        R\        \        ,          RR/# )r   r­  r8  rƒ  r   N)rÜ  rÝ  rk  r„   rn   )r   s   "r   r   r   R  s6   € ÷ :ñ :Ü
×
Ñ
ð:Ü#'ð:Ü9=¼c½ð:à	ñ:r   c           	     óF  € ^ RI HpHpHp ^ RIHp R UUu. uF  w  rx\        WR4      '       g   K  VNK  	  p	ppV	'       d@   \        RRP                  V	4       R24       \        R4       \        P                  ! ^4        V! V4      p
X
P                  f;   \        RV
P                   R	24       \        R
4       \        P                  ! ^4       \        V
P                  4      .p\        V
P                  4      '       g_   \        4       '       d9   \!        V
P                  4      '       d   \        R4       VP#                  R4       M\        P                  ! ^4       VP%                  V4       VP%                  \'        4       4       V! WÁV
P                  R7      p\        RRP                  V4       RV R24       \        P                  ! ^ 4       R# u uppi   T d<   p\        RT R	24       \        R
4       \        P                  ! ^4        Rp?EL‘Rp?ii ; i)uÑ  Start the desktop app this CLI ships inside, then exit.

A bundled install has no source tree to build: the app is a signed,
read-only artifact and this Python is a passenger in its resources.
So the whole build ladder below is skipped and the launcher is started
DETACHED â€” the user ran a CLI command, and the app must outlive the
terminal it was typed into. The app's own single-instance lock turns a
second run into "focus the running window".

Never returns.
)ÚNotBundledAppr  Úresolve_bundle_layoutr   Fu   âœ— r¿  z* cannot apply to a bundled Hermes install.zB  This app ships prebuilt and has no desktop source tree to build.u=   âœ— This Hermes is stamped as a bundled desktop install, but r#  u?     The install is damaged â€” reinstall Hermes from the website.Nu(   âœ— Found no Hermes Desktop launcher in r  r  )r8  rÀ  u   â†’ Launched Hermes Desktop: r&  r  rÑ  ))z--sourcer  )z--build-onlyr  )z--force-buildr  )r  rM  r  rN  r#  r!  rð  ra   rÅ  r(   rý  ÚlauncherÚapp_rootrn   rn  rD  r_  rL  r4  r5  )r­  r8  rƒ  rM  r  rN  r!  Úflagr›   ÚrefusedÚlayoutr    r  r=  s   &&&           r   r0  r0  R  sÂ  € ÷ ]Ñ\Ý,ñ
ôñ
‰JˆDô
 �4˜u×%÷ 	ˆñ
ð ñ ÷ Ü��T—Y‘Y˜wÓ'Ð(Ð(RÐSÔTÜÐRÔSÜ�Š�ŒðÙ& |Ó4ˆð ‡�ÒÜÐ8¸¿¹Ð8IÈÐKÔLÜÐOÔPÜ�Š�Œä˜&Ÿ/™/Ó*Ð+€NÜ'¨¯©×8Ò8Ü*×,Ò,Ô1^Ð_e×_nÑ_n×1oÒ1oÜð  mô  nØ×!Ñ! .Õ1ä�HŠH�QŒKà×Ñ˜.Ô)Ø×ÑÔ0Ó2Ô3Ù
˜.°v·±Ô
G€CÜ	Ð)¨#¯(©(°>Ó*BÐ)CÀ6È#ÈÈaÐ
PÔQÜ‡H‚HˆQ†KùóSøð  ô ô 	ÐMÈcÈUÐRSÐTÔUÜÐOÔPÜ�Š��Šûðús"   –G±GÂG ÇH Ç%0HÈH )g      à?ç      ð?rT  rT  >   Úbasicrz  ry  rw  r}  )r@  rH  ÚyesÚon)rr  r;  ÚnoÚoff)rr  r;  rX  rY  Údisabled)F)rÕ  ÚMESA_LOADER_DRIVER_OVERRIDEÚLIBGL_ALWAYS_SOFTWAREÚLIBGL_DRIVERS_PATH){Ú__doc__ÚloggingrG  rÜ  rè  r  r–   r)   r=   r–  r©   r{   rs  r(   r­   rœ   Úpathlibr   Útypingr   r   Úhermes_cli.desktop_consoler   r   Úhermes_platform.hostr   Ú	getLoggerr™   r¯  r   r!   r   Úcompiler?   r8   r;   rE   rZ   rc   ro   r'   rs   r¨   rÁ   r•   r¡   r¯   rµ   rº   rÌ   rÏ   rè   rç   ræ   r)  Ú_PE_MACHINE_TO_NAMErë   rÙ   rð   rû   r†   r   r‡   r+  r2  r8  r?  rÃ   rc  rn  r{  r˜  r�  r¡  rÎ  rÓ  rà  rï  rø  rû  rþ  r  r  r  r  r  r.  r  r<  rD  rK  rR  rY  r_  rn  rq  Ú	frozensetr˜  rk  Úfromkeysr—  r  rš  r   rª  r²  rµ  rÌ  r×  rØ  rÖ  rÙ  r…   rî  rï  rú  rþ  r  r
  r  rF  r5  r0  rú   r   r   Ú<module>ri     sB  ðñó Û Û Û Û Û 	Û Û 	Û Û Û Û Û 
Û å ß %ß TÝ &ð 
×	Ò	Ð,Ó	-€àYÐ õ:õ
Sõsð —Z’ZÐ cÐeg×erÑerÓsÐ à�jŠjÐQÐSU×S`ÑS`Óa€õõ2Uõ ]õ0Sõ*Dõ
 :ðT &Ð à&Ð ð ';Ð #õõ[õõ-õ &;õR3ð Ð ØÐ ØÐ ð �nÐ&7¸ÐHYÐ[bðÐ ð )¨'Ð3DÀgÐO_ÐafÐgÐ ð #-Ð ò:õ
õ(.õDõ(%õPõõ6õõð$XÐSX÷ Xõv)õ&õ,_õ
õ@õ@ð"AÐSV÷ AõHð6`5ØIMð`5à"&÷`5õFõ+õ>
õ\õRõ2Kõ:õ&bõTõ*õ&.õb	õõ$õ&õAõ7õ9õxbñ #Ò#bÓcÐ àw�T—]‘]Ð#=¸sÓCÐwÀtÇ}Á}ÐUpÐruÓGvÐw€õñ4 ÐCÓD€õ)R÷Xð6'àAE÷'õTgð 32Ø04÷32ñl �zÓ"€áÐ	5Ó6ÙÐ	6Ó7ÙÐ	&Ó'ÙÐ	$Ó%ð	Ð ð zÐ õ	(ð !¡3Ð'JÓ#KÕKÐ Ø-Ð õ+&õ\qõ2õõ õ$e'õP	5÷:r   