+
    „WÝjO)  ã                  ó†   € R t ^ RIHt ^ RIt^ RIHt RR/R R ll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# )z*``hermes computer-use`` subcommand parser.)ÚannotationsN)Úadd_json_flagÚdoctorFc               ó    € V ^8„  d   QhRRRR/# )é   r   ÚboolÚreturnÚNone© )Úformats   "ÚWC:\Users\johnn\AppData\Local\hermes\hermes-agent\hermes_cli\subcommands\computer_use.pyÚ__annotate__r   
   s   € ÷ ñ  tð ¸ñ ó    c           	     óô  € ^ RI HpHpHp V! 4       V8X  d   R#  V! 4       pV '       d+   XP                  4       ;pe   \        P                  ! V4       XP                  4       p\        RVP                   RVP                   RV'       d   RMR R	24       \        P                  ! V'       d	   ^ 4       R# ^4       R#   \         d/   p\        RT 24       \        P                  ! ^4        Rp?LÑRp?ii ; i)
z½cua-driver checks do not apply when ``computer_use.backend`` selects another backend: report it
(running its own ``doctor()`` when asked and it ships one) and exit; return for the built-in.)ÚDEFAULT_BACKENDÚconfigured_backend_nameÚget_active_providerNzComputer Use: zComputer Use backend: ú (u   ) â€” Ú	availableznot availablez1. cua-driver checks do not apply to this backend.)Úplugins.computer_user   r   r   ÚLookupErrorÚprintÚsysÚexitr   Úis_availableÚnameÚdisplay_name)r   r   r   r   ÚproviderÚeÚrcÚoks   $       r   Ú_exit_if_plugin_backendr!   
   sÌ   € ÷ cÑbÙÓ  OÔ3ÙðÙ&Ó(ˆ÷ ˜Ÿ™Ó*Ð*�2Ò7Ü�Š�ŒØ	×	Ñ	Ó	 €BÜ	Ð" 8§=¡= /°°H×4IÑ4IÐ3JÈ&ß‰[ OÐ4Ð4eðgô hä‡H‚H—"ˆQÖ˜!Öøô ô Ü�˜q˜cÐ"Ô#Ü�Š��‰ûðús   šB> Â>C7Ã	$C2Ã2C7c               ó   € V ^8„  d   QhRR/# ©r   r   Úintr
   )r   s   "r   r   r      s   € ÷ Yñ Y˜ñ Yr   c           	     ó\   € ^ RI Hp V! \        \        V RR4      4      R7      '       d   ^ # ^# )é    )Úinstall_cua_driverÚupgradeF)r(   )Úhermes_cli.tools_config_cuar'   r   Úgetattr)Úargsr'   s   & r   Ú_cu_installr,      s)   € Ý>Ù"¬4´¸¸iÈÓ0OÓ+P×QÓQˆ1ÐXÐWXÐXr   c               ó   € V ^8„  d   QhRR/# r#   r
   )r   s   "r   r   r   "   s   € ÷ 'ñ '˜ñ 'r   c                óˆ  € \        4        ^ RIp^ RIHpHp ^ RIHp V! 4       pVP                  P                  RR4      P                  4       pV'       g   \        R4       \        R4       ^# V! V4      pT! VP                  R4      ;'       g    R4      pV'       d   R	MRp	\        R
V V	 2V'       d   RV R2MR,           4       VP                  R4      '       gN   \        RVP                  R4      ;'       g    R,           4       V'       d   \        R4       ^# \        R4       ^# ^ p
\        P                  R8X  de   ^ RIHp ^ RIHp V! 4        FM  w  rÞpppV'       g   K  V! VV4      RJ g   K!  \        RT RT;'       g    R 24       \        RV R24       ^p
KO  	  \        V'       d	   R4       V
# R4       V
# )r&   N)Ú_cua_driver_contract_statusÚ_cua_version_summary)Úresolve_cua_driver_cmdÚHERMES_CUA_DRIVER_CMDÚ zcua-driver: not installedz"  Run: hermes computer-use installÚversionz+ [custom binary from HERMES_CUA_DRIVER_CMD]zcua-driver: installed at r   Ú)Úreadyu     âš  Repair required: Úreasonzruntime contract is incompletez}    Update the binary selected by HERMES_CUA_DRIVER_CMD, or unset the override and run: hermes computer-use install --upgradez$    Run: hermes computer-use installÚlinux)Úcua_daemon_listening)Úcua_daemon_unitsFu     âœ— Daemon unit z(: no `cua-driver serve` is listening on zthe default socketz#    Check: systemctl --user status z-  (reinstalling the driver does not start it)u2     âœ“ Runtime contract ready (externally managed).u-     âœ“ Runtime contract ready (Hermes PM pin).)r!   Úosr)   r/   r0   Ú%tools.computer_use.cua_backend_driverr1   ÚenvironÚgetÚstripr   r   ÚplatformÚtools.computer_use.cua_backendr9   Útools.computer_use.doctorr:   )r+   Ú_osr/   r0   r1   ÚpathÚoverrideÚcontractr4   Úoriginr   r9   r:   Ú_kindÚunitÚ_targetÚserveÚsockets   &                 r   Ú
_cu_statusrM   "   sœ  € ÜÔÛß]ÝLá!Ó#€DØ�{‰{�‰Ð6¸Ó;×AÑAÓC€HßÜÐ)Ô*ÜÐ2Ô3ÙÙ*¨4Ó0€HÙ" 8§<¡<°	Ó#:×#@Ð#@¸bÓA€G÷ ?GÑ:ÈB€FÜ	Ð% d V¨F¨8Ð
4Ï7¸"¸W¸IÀQ¹ÐXZÕ
[Ô\Ø�<‰<˜× Ò ÜÐ'¨8¯<©<¸Ó+A×+eÐ+eÐEeÕfÔgßÜðNôOñ
 ô Ð8Ô9ÙØ	
€BÜ
‡|�|�wÔÝGÝ>Ù3CÖ3EÑ/ˆE˜ %¨ß‰uÑ-¨d°FÓ;¸uÕDÜÐ*¨4¨&Ð0XÐY_×YwÐYwÐcwÐXxÐyÔzÜÐ;¸D¸6ÐAnÐoÔpØ’ñ	 4Fô
 
Ç(Ð
>ô @à€Ið ?ô@à€Ir   c               ó   € V ^8„  d   QhRR/# ©r   r   r	   r
   )r   s   "r   r   r   L   s   € ÷ 9ñ 9˜ñ 9r   c                ó  € \        R R7       ^ RIHp \        P                  ! T! \        \        V R. 4      ;'       g    . 4      \        \        V R. 4      ;'       g    . 4      \        \        V RR4      4      R7      4       R# )	T)r   )Ú
run_doctorÚincludeÚskipÚjsonF)rR   rS   Újson_outputN)r!   rB   rQ   r   r   Úlistr*   r   )r+   rQ   s   & r   Ú
_cu_doctorrW   L   sc   € Ü 4Õ(Ý4Ü‡H‚H‰ZÜ”W˜T 9¨bÓ1×7Ð7°RÓ8Ü”'˜$ ¨Ó+×1Ð1¨rÓ2Üœ  v¨uÓ5Ó6ô8ö 9r   c               ó   € V ^8„  d   QhRR/# rO   r
   )r   s   "r   r   r   U   s   € ÷ &ñ &˜dñ &r   c                óØ  a€ \        V R R4      '       g   \        4        ^ RIp^ RIHpHpHp V! 4       o\        \        V R R4      4      '       dE   \        VP                  S^RR7      4       \        P                  ! SR,          '       d   ^ M^4       SR,          '       g-   \        RSR	,           R
24       \        P                  ! ^4       SR,          '       g"   \        R4       \        P                  ! ^4       R p\        RSR,          ;'       g    R RSR	,           R24       SR,          '       dz   \        RV! SR,          4       R24       \        RV! SR,          4       R24       SR,          '       g2   \        R4       V! V3R lV 4       !  ;p'       d   \        RV 24       M&\        RV! SR,          4       RSR	,           R24       SR,           F2  pVR,          R8w  g   K  \        RVR,           R VR!,           24       K4  	  SR",          '       d   \        RSR",           24       \        P                  ! SR,          '       d	   ^ 4       R# ^4       R# )#rT   FN)Ú
TCC_FIELDSÚcomputer_use_statusÚstale_tcc_grant_hintT)ÚindentÚ	sort_keysr6   Úplatform_supportedz!Computer Use is not supported on r@   Ú.Ú	installedz;cua-driver: not installed. Run: hermes computer-use installc                ó&   € V R J d   R# V RJ d   R# R# )Tu   âœ…Fu   â�Œu   â€¢r
   )Úvs   &r   Ú<lambda>Ú"_cu_perms_status.<locals>.<lambda>d   s   € ˜q D›y�eÐN¸¸U»
¨uÐNÈÐNr   zcua-driver: r4   r   r5   Ú	can_grantz  Úaccessibilityz AccessibilityÚscreen_recordingz Screen Recordingz.  Grant: hermes computer-use permissions grantc              3  óF   <"  € T F  pSV,          R J g   K  Vx € K  	  R# 5i)FNr
   )Ú.0ÚfÚsts   & €r   Ú	<genexpr>Ú#_cu_perms_status.<locals>.<genexpr>k   s   øé € Ð-V¹°AÀrÈ!ÅuÐPUÀ~¯aªa»ùs   ƒ!—
!z) driver health (no permission toggles on ÚchecksÚstatusr    u     âš  Úlabelz: ÚmessageÚerror)r*   r!   rT   Útools.computer_use.permissionsrZ   r[   r\   r   r   Údumpsr   r   )	r+   Ú_jsonrZ   r[   r\   ÚglyphÚhintÚcrl   s	   &       @r   Ú_cu_perms_statusrz   U   sø  ø€ Ü�4˜ ×'Ò'ÜÔ!ÛßdÑdÙ	Ó	€BÜŒG�D˜& %Ó(×)Ò)Üˆe�k‰k˜" Q°$ˆkÓ7Ô8Ü�Š�b˜—k”k‘ qÔ)ØÐ"×#Ô#ÜÐ1°"°Zµ.Ð1AÀÐCÔDÜ�Š�ŒØˆk�?Œ?ÜÐKÔLÜ�Š�ŒÙN€EÜ	ˆL˜˜I�×5Ð5¨+Ð6°b¸¸J½Ð8HÈÐ
JÔKØ	ˆ+‡„Ü�‘5˜˜OÕ,Ó-Ð.¨nÐ=Ô>Ü�‘5˜Ð.Õ/Ó0Ð1Ð1BÐCÔDØ�'�{Œ{ÜÐBÔCÙ+Ô-V¹Ó-VÑWÐWˆtÖWÜ˜˜4˜&�kÔ"øä�‘5˜˜G�Ó%Ð&Ð&OÐPRÐS]ÕP^ÐO_Ð_`ÐaÔbØ��\ˆ\ˆØˆX�;˜$ÖÜ�F˜1˜W�:˜, b¨¨9­¨Ð7Ö8ñ ð 
ˆ'‡{„{Ü��r˜'•{�mÐ$Ô%Ü‡H‚H�"�W—+”+ˆQÖ% 1Ö%r   c               ó   € V ^8„  d   QhRR/# rO   r
   )r   s   "r   r   r   w   s   € ÷ *ñ *˜Tñ *r   c                ó\   € \        4        ^ RIHp \        P                  ! V! 4       4       R# )r&   )Úrequest_permissions_grantN)r!   rt   r}   r   r   )r+   r}   s   & r   Ú_cu_perms_grantr~   w   s   € ÜÔÝHÜ‡H‚HÑ&Ó(Ö)r   c               ó   € V ^8„  d   QhRR/# rO   r
   )r   s   "r   r   r   }   s   € ÷ P<ñ P<¨Tñ P<r   c           
     óÎ  a
aaa€ V P                  RRRR7      oSP                  RR7      pVP                  RRR	7      pVP                  R
RRR7       VP                  RRR	7       VP                  RRRR7      pVP                  RR. RRR7       VP                  RR. RRR7       \        VR4       VP                  RRRR7      oSP                  RR7      pVP                  RRR	7      p\        VR 4       VP                  R!R"R	7       R!\        R\
        /o^ R#IHp V! V\        4       R$ pVV3R% lpR\        R\        R\        RVR&V/o
V
V3R' lp	SP                  V	R(7       R)# )*z9Attach the ``computer-use`` subcommand to ``subparsers``.zcomputer-usezBManage the Computer Use (cua-driver) backend (macOS/Windows/Linux)a‚  Install or check the cua-driver binary used by the
`computer_use` toolset. Supported on macOS, Windows, and
Linux.

Use `hermes computer-use install` to prepare the pinned
cua-driver package and host integration. This is equivalent to the
post-setup hook that `hermes tools` runs when you first
enable the Computer Use toolset, and is a stable target
for re-running the install if it didn't fire (e.g. when
toggling the toolset on a returning-user setup).

Use `hermes computer-use doctor` to run cua-driver's
`health_report` MCP tool and surface its check matrix
(TCC, bundle identity, version, platform support, ...)
in human-readable form.)ÚhelpÚdescriptionÚcomputer_use_action)ÚdestÚinstallz=Install or repair the cua-driver binary (macOS/Windows/Linux))r�   z	--upgradeÚ
store_truezJReconcile cua-driver with Hermes' pinned PM package and repair host setup.)Úactionr�   rp   z6Check the selected cua-driver and its runtime contractr   z;Run cua-driver `health_report` and surface the check matrixu•  Drive cua-driver's stable `health_report` MCP tool and render
its check matrix (TCC permissions, bundle identity, version,
platform support, screenshot probe, â€¦) as human-readable
output. cua-driver owns the health model; this command stays
thin so new checks added upstream surface here without code
changes. Exits 0 when overall=ok, 1 when degraded/failed, 2
when the binary is missing or unreachable.z	--includeÚappendÚCHECKz—Run only the listed checks. Repeat for multiple (e.g. --include tcc_accessibility --include bundle_identity). Unknown names are reported by cua-driver.)r‡   ÚdefaultÚmetavarr�   z--skipzASkip the listed checks. Repeat for multiple. Wins over --include.zEEmit the raw structured payload as JSON (same shape as `tools/call`).Úpermissionsz=Check or grant macOS Accessibility + Screen Recording (macOS)uI  Computer Use drives the Mac through cua-driver, whose TCC grants
attach to cua-driver's own identity (com.trycua.driver) â€” not the
terminal or the Hermes app. `status` reports the driver's grant
state; `grant` launches CuaDriver via LaunchServices so the macOS
permission dialog is attributed to the process that does the work.Úcomputer_use_perms_actionz?Report Accessibility + Screen Recording grant state (read-only)z/Emit the normalized permission payload as JSON.Úgrantz=Request the grants (opens the dialog attributed to CuaDriver))Úbuild_screen_parserc                ó$   € V P                  V 4      # )N)Úscreen_func)r+   s   &r   Ú
_cu_screenÚ-build_computer_use_parser.<locals>._cu_screen»   s   € Ø×Ñ Ó%Ð%r   c                óx   <€ SP                  \        V R R4      4      pVe	   V! V 4      # SP                  4        R# )r�   N©r>   r*   Ú
print_help)r+   ÚhandlerÚ_perms_actionsÚcomputer_use_permss   & €€r   Ú_cu_permissionsÚ2build_computer_use_parser.<locals>._cu_permissions¾   s:   ø€ Ø ×$Ñ$¤W¨TÐ3NÐPTÓ%UÓVˆØÒÙ˜4“=Ð Ø×%Ñ%Ö'r   Úscreenc                óx   <€ SP                  \        V R R4      4      pVe	   V! V 4      # SP                  4        R# )rƒ   Nr•   )r+   r—   Ú_actionsÚcomputer_use_parsers   & €€r   Úcmd_computer_useÚ3build_computer_use_parser.<locals>.cmd_computer_useÇ   s7   ø€ Ø—,‘,œw tÐ-BÀDÓIÓJˆØÒÙ˜4“=Ð Ø×&Ñ&Ö(r   )ÚfuncN)Ú
add_parserÚadd_subparsersÚadd_argumentr   r~   rz   Ú*hermes_cli.subcommands.computer_use_screenr�   r,   rM   rW   Úset_defaults)Ú
subparsersÚcomputer_use_subÚcomputer_use_installÚcomputer_use_doctorÚcomputer_use_perms_subÚcomputer_use_perms_statusr�   r’   rš   r    rž   r˜   rŸ   r™   s   &         @@@@r   Úbuild_computer_use_parserr®   }   sß  û€ à$×/Ñ/ØÐað&ð 0ó 'Ðð +×9Ñ9Ð?TÐ9ÓUÐà+×6Ñ6ØÐWð 7ó YÐà×%Ñ%Ø˜LØYð &ô [ð ×Ñ Ð/gÐÔhØ*×5Ñ5ØÐTð9ð 6ó :Ðð ×$Ñ$Ø˜H¨b¸'ð8ð %ô 9ð
 ×$Ñ$Ø˜¨2°wØPð %ô Rô Ð%ØYô[à)×4Ñ4ØÐ[ðQð 5ó RÐð 0×>Ñ>ÐD_Ð>Ó`ÐØ 6× AÑ AØÐXð !Bó !ZÐäÐ+Ð-^Ô_Ø×%Ñ%ØÐUð &ô Wàœ°Ô:JÐK€NåNÙÐ(¬-Ô8ò&ö(ð œ;¨´*¸hÌ
Ø˜°¸*ðF€Hö)ð ×$Ñ$Ð*:Ð$Ö;r   )Ú__doc__Ú
__future__r   r   Úhermes_cli.subcommands._sharedr   r!   r,   rM   rW   rz   r~   r®   r
   r   r   Ú<module>r²      s?   ðÙ 0å "ã 
å 8ð¨e÷ õ&Yõ
'õT9õ&õD*÷P<r   