Ë
    ãß²j×!  ã            	      ó¦  — U d Z ddlmZ ddlmZmZ i ddg d¢ddœ“d	dg d
¢ddœ“ddddœ“ddddœ“ddddœ“ddddœ“ddddiddddœ“ddg d¢ddœ“dddg d ¢d!œd"d#œ“d$dd%dœ“d&dd'dœ“d(dddiddd)dœ“d*dddiddd+dœ“d,dg d-¢d.dœ“d/dd0dœ“d1dd2dœ“d3dd4dœ“dd5dœd6d7dœd8d9dœdd:d;gd<dœd8d=dœd8d>dœd?œ¥Zd@edA<   dBdCdDedgdEœdFœZd@edG<   dJdH„Z	yI)Ku�  Schema for the generic `computer_use` tool (model-facing; value is byte-frozen â€”
the schema goes to the model every turn, so prompt-cache parity depends on it).

Model-agnostic: any tool-calling model can drive this. Vision-capable models
should prefer `capture(mode='som')` then `click(element=N)` â€” much more reliable
than pixel coordinates, which remain supported for models trained on them.
é    )Úannotations)ÚAnyÚDictÚactionÚstring)ÚcaptureÚclickÚdouble_clickÚright_clickÚmiddle_clickÚdragÚscrollÚtypeÚkeyÚ	set_valueÚwaitÚ	list_appsÚlist_windowsÚ	focus_appu
  Which action to perform. `capture` is free (no side effects). All other actions require approval unless auto-approved. Use `set_value` for select/popup elements and sliders â€” it selects the matching option directly without opening the native menu (no focus steal).)r   ÚenumÚdescriptionÚmode)ÚsomÚvisionÚaxu  Capture mode. `som` (default) is a screenshot with numbered overlays on every interactable element plus the AX tree â€” best for vision models, lets you click by element index. `vision` is a plain screenshot. `ax` is the accessibility tree only (no image; useful for text-only models).Úappa  Optional. Limit capture/action to one app (name e.g. 'Safari', or bundle ID). Omitted = frontmost window. app='screen' = composited full-screen grab (image only, no clickable elements); app='desktop' = the OS desktop/shell surface (wallpaper, icons, taskbar) with its elements.)r   r   ÚpidÚintegerzqOptional exact process target for action='capture'. Pair with window_id when discovery cannot resolve an X11 app.Ú	window_idzšOptional exact native window target for action='capture'. Pair with pid when an external cua-driver list_windows lookup has already identified the window.ÚelementzoThe 1-based SOM index returned by the last `capture(mode='som')` call. Strongly preferred over raw coordinates.Ú
coordinateÚarrayr   é   z†Pixel coordinates [x, y] relative to the captured window screenshot (top-left origin). Only use this if no element index is available.)r   ÚitemsÚminItemsÚmaxItemsr   Úbutton)ÚleftÚrightÚmiddlezMouse button. Defaults to left.Ú	modifiers)
ÚcmdÚshiftÚoptionÚaltÚctrlÚfnÚwinÚwindowsÚsuperÚmeta)r   r   z%Modifier keys held during the action.)r   r$   r   Úfrom_elementzSource element index (drag).Ú
to_elementzTarget element index (drag).Úfrom_coordinatez3Source [x,y] (drag; use when no element available).Úto_coordinatez3Target [x,y] (drag; use when no element available).Ú	direction)ÚupÚdownr(   r)   zScroll direction.ÚamountzScroll wheel ticks. Default 3.ÚvaluezàFor action='set_value': the value to set on the element. For AXPopUpButton / select dropdowns, pass the option's display label (e.g. 'Blue'). For sliders and other AXValue-settable elements, pass the numeric or string value.Útextz+Text to type (respects the current layout).zUKey combo, e.g. 'cmd+s', 'ctrl+alt+t', 'return', 'escape', 'tab'. Use '+' to combine.ÚnumberzSeconds to wait. Max 30.Úbooleanuº   Only for action='focus_app'. If true, brings the window to front (DISRUPTS the user). Default false â€” input is routed to the app without raising, matching the background co-work model.Ú
backgroundÚ
foregroundu{  For input actions (click, type, key, drag, scroll). `background` (DEFAULT) delivers without raising the window or stealing focus. `foreground` briefly fronts the window then restores focus â€” a visible change needing its own approval; use it only when a result's verdict tells you to escalate there. Each result's `verdict` carries the next step; follow it rather than guessing.zýOptional and only valid with delivery_mode='foreground'. Explicitly invokes cua-driver's standalone bring_to_front tool before the input; it is never passed as an input property. This persistent focus change has a separate approval scope. Default false.z‘If true, take a follow-up capture after the action and include it in the response. Saves a round-trip when you need to verify an action's effect.)ÚkeysÚsecondsÚraise_windowÚdelivery_modeÚbring_to_frontÚcapture_afterúDict[str, Any]Ú_PROPERTIESÚcomputer_useu¼  Drive the desktop via cua-driver â€” screenshots, mouse, keyboard, scroll, drag â€” on macOS, Windows, and Linux. Input is background-FIRST, not background-only: the default delivery routes to the target window without stealing the user's cursor or focus (works even on hidden/minimized windows), and when a result's `verdict` says to escalate you climb â€” pixel coordinates, or delivery_mode='foreground' (briefly fronts the window; separate approval). Each result carries a `verdict` with the next step; follow it â€” never repeat confirmed input, and re-capture to verify an unverifiable one before retrying. Workflow: action='capture' (mode='som' gives numbered element overlays), then click by `element` index; re-capture after state-changing actions (or pass capture_after=true). Image captures include a shareable `screenshot_path`; deliver it via the platform's MEDIA syntax when the user asks to see it â€” not for captures used only for control.Úobject)r   Ú
propertiesÚrequired)Únamer   Ú
parametersÚCOMPUTER_USE_SCHEMAc                 ó   — t         S )z2Return the generic OpenAI function-calling schema.)rR   © ó    ú>/home/ubuntu/.hermes/hermes-agent/tools/computer_use/schema.pyÚget_computer_use_schemarW   Î   s   € äÐrU   N)ÚreturnrJ   )
Ú__doc__Ú
__future__r   Útypingr   r   rK   Ú__annotations__rR   rW   rT   rU   rV   ú<module>r]      s�  ðòõ #ç ðiØØò
ð"ñ'ðið4 ØÚ'ð7ñ		ð5iðH 
Øð*ñðIiðZ 
Øð3ñð[iðh ØðYñðiiðv Øð.ñðwiðD ØØ˜)Ð$ØØðGñ	ðEiðX ØÚ+Ø8ñðYiðb Øàòñ
ð ?ñ#ðciðH ˜YÐ7UÑVðIiðJ ˜9Ð5SÑTðKiðL ØØ˜)Ð$ØØØLñðMiðZ ØØ˜)Ð$ØØØLñð[iðh ˜(Ò,KÐ\oÑpðiiðj �yÐ1QÑRðkiðl ØðKñðmið| �XÐ.[Ñ\ð}ið@ àcñð !Ð1KÑLàðñð Ø˜|Ð,ð9ñ	
ð ðñð ðMñòEi€ˆ^ó iðX ð
	Zð $°;ÈXÈJÑWñ'Ð �^ó ô$rU   