§
    øžyj³C  ã                  óâ  — U d Z ddlmZ ddlmZmZ ddd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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d0dœ“d1d d!did"d"d2d$œ“d3d d!did"d"d4d$œ“d5dg d6¢d7dœ“d8dd9dœ“d:dd;dœ“i d<dd=dœ“d>dd?dœ“d@dAdBdœ“dCdDdEdœ“dFddGdHgdIdœ“dJdDdKdœ“dLddMdœ“dNddOdœ“dPddQdœ“dRddSdœ“dTddUdVgdWdœ“dXddYdZgd[dœ“d\dd]dœ“d^dd_dœ“d`ddadœ“dbdg dc¢dddœ“deddfdœ“¥dDdgdœdg dh¢didœdg dj¢dkdœddldmgdndœddodœddpdœd d!didqd,œddrdœdAdsdœdAdtdœdAdudœdAdvdœdAdwdœdAdxdœdDdydœdzœ¥dgd{œd|œZd}ed~<   d‚d€„Zd�S )ƒuN  Schema for the generic `computer_use` tool.

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. Pixel coordinates remain supported for
models that were trained on them (e.g. Claude's computer-use RL).
é    )Úannotations)ÚAnyÚDictÚcomputer_useuò  Drive the desktop in the background via cua-driver â€” screenshots, mouse, keyboard, scroll, drag â€” without stealing the user's cursor or keyboard focus. Supported on macOS, Windows, and Linux. Preferred workflow: call with action='capture' (mode='som' gives numbered element overlays), then click by `element` index for reliability. Pixel coordinates are supported for models trained on them. Works on any window â€” hidden, minimized, or behind another app. Requires cua-driver to be installed.ÚobjectÚactionÚstring)ÚcaptureÚclickÚdouble_clickÚright_clickÚmiddle_clickÚdragÚscrollÚtypeÚkeyÚ	set_valueÚwaitÚ	list_appsÚlist_windowsÚ	focus_appÚcua_browser_stateÚcua_browser_prepareÚcua_browser_navigateÚcua_browser_clickÚcua_browser_typeÚcua_browser_pointerÚcua_browser_dialogÚcua_browser_set_input_filesÚcua_browser_downloadu
  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).Úappu¬  Optional. Limit capture/action to a specific app (by name, e.g. 'Safari', or bundle ID, 'com.apple.Safari'). If omitted, operates on the frontmost app's window. Pass app='screen' (or 'desktop') to capture the OS desktop/shell surface â€” e.g. to see the wallpaper or click the taskbar. Note: capture is per-window; a single image cannot span multiple monitors, so on a multi-screen setup capture one window or display at a time.)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.Úmax_elementsu“  Optional cap on the AX `elements` array returned by `action='capture'`. Default 100, hard maximum 1000. Dense UIs (Electron apps such as Obsidian or VS Code, JetBrains IDEs) can publish 500+ AX nodes â€” capping prevents a single capture from blowing session context. When the cap trims the response, `total_elements` and `truncated_elements` are surfaced in the result so you can re-call with `app=` to narrow scope or raise `max_elements` when the full tree is required. Has no effect on `mode='som'` / `mode='vision'` when a screenshot is included in the response; only the rare image-missing fallback returns an `elements` array and is subject to the cap.éd   é   iè  )r   r"   ÚdefaultÚminimumÚmaximumÚ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   r5   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Údownr9   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).ÚkeyszUKey combo, e.g. 'cmd+s', 'ctrl+alt+t', 'return', 'escape', 'tab'. Use '+' to combine.ÚsecondsÚnumberzSeconds to wait. Max 30.Úraise_windowÚ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.Údelivery_modeÚ
backgroundÚ
foregroundud  How input is delivered, for the input actions (click, double_click, right_click, drag, scroll, type, key). `background` (DEFAULT) routes input to the target without raising it or stealing focus â€” the co-work model. `foreground` briefly fronts the window, acts, then restores the prior frontmost app. A `confirmed` effect is done. For `unverifiable`, inspect fresh state before any retry even if escalation is recommended. Escalate only after `suspected_noop` or a structured refusal. Do not predict the rung from the app being Electron/Chromium. Foreground is a visible focus change and needs its own approval.Úbring_to_frontzý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.Útab_idz4Opaque tab capability returned by cua_browser_state.Úrefz@Current semantic ref from the latest cua_browser_state snapshot.Údestination_refz3Current destination ref for a typed pointer action.ÚurlzURL for cua_browser_navigate.Úinput_routeÚtrustedÚ	dom_eventzrTyped-browser trust class. Defaults to trusted. dom_event is an explicit downgrade and is never selected silently.Úsnapshot_formatÚsemantic_v2Údom_refs_v1z:Typed-browser snapshot format; semantic_v2 is the default.ÚqueryzOptional browser-state query.Ú	scope_refz)Optional current ref to scope a snapshot.Úcontinuationz,Continuation minted by the current snapshot.Úprofile_mode)Úisolated_newÚisolated_namedÚexisting_profilezÇBrowser preparation mode. existing_profile is decided by cua-driver's immutable permission mode: standard requires a certified protected host; explicit Hermes YOLO uses a private unrestricted daemon.Úprofile_namezName for isolated_named setup.z;Explicitly allow launch of a driver-owned isolated browser.)Úhoverr   r   r   r   z"Operation for cua_browser_pointer.)ÚinspectÚacceptÚdismisszHPage JavaScript dialog action; native prompts stay on the native ladder.Úinsert_textÚ
keystrokesz<Delivery form for cua_browser_type; defaults to insert_text.zOpaque page-dialog capability.z'Optional text for a page prompt dialog.z/Explicit paths for cua_browser_set_input_files.z3Approved destination root for cua_browser_download.zTyped pointer horizontal delta.zTyped pointer vertical delta.z$Typed browser viewport x coordinate.z$Typed browser viewport y coordinate.z!Typed browser drag destination x.z!Typed browser drag destination y.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.)Úallow_launchÚbrowser_pointer_actionÚbrowser_dialog_actionÚbrowser_type_modeÚ	dialog_idÚprompt_textÚfilesÚdestination_rootÚdelta_xÚdelta_yÚxÚyÚto_xÚto_yÚcapture_after)r   Ú
propertiesÚrequired)Únamer"   Ú
parametersúDict[str, Any]ÚCOMPUTER_USE_SCHEMAÚreturnc                 ó   — t           S )z2Return the generic OpenAI function-calling schema.)r†   © ó    ú?/home/ragecks/.hermes/hermes-agent/tools/computer_use/schema.pyÚget_computer_use_schemarŒ   _  s   € åÐrŠ   N)r‡   r…   )	Ú__doc__Ú
__future__r   Útypingr   r   r†   Ú__annotations__rŒ   r‰   rŠ   r‹   ú<module>r‘      sT  ððð ð ð #Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ð Ð Ð Ð ð ð	ð ðz
ØØ ðð ð ð4Hð9"ð "ðz
ðJ Ø Ø/Ð/Ð/ð-ð	ð ðKz
ðb Ø ð7ðð ðcz
ð~ Ø!ðOðð ðz
ðL Ø!ð@ðð ðMz
ð\ Ø!ð*ð ØØð)ð ð]z
ðJ Ø!ð'ðð ðKz
ðZ ØØ  )Ð,ØØð*ð
ð 
ð[z
ðp Ø Ø3Ð3Ð3Ø@ðð ðqz
ðz Øà$ðð ð ðð ð  Gð
ð 
ð{z
ðR  YØ-KðMð MðSz
ðV  9Ø+IðKð KðWz
ðZ ØØ  )Ð,Ø¨1ØTð	 ð  ð[z
ðf ØØ  )Ð,Ø¨1ØTð	ð ðgz
ðt Ø Ø7Ð7Ð7Ø2ðð ðuz
ð~ Ø!Ø?ðð ðz
ðH Ø ðSðð ðIz
ð z
ð\ Ø ØLðð ð]z
ðd Ø ð;ðð ðez
ðr Ø Ø9ðð ðsz
ð| Ø!ð=ðð ð}z
ðP Ø Ø% |Ð4ð ð	ð ðQz
ðt Ø!ð5ð	ð 	ðuz
ðJ Ø ØUðð ðKz
ðR Ø Øaðð ðSz
ðZ Ø ØTð ð  ð[z
ðb ˜HÐ5TÐUÐUðcz
ðd Ø Ø" KÐ0ðOð	ð ðez
ðt Ø Ø&¨Ð6Ø[ð ð  ðuz
ð~ ˜hÐ7VÐWÐWðz
ð@  (Ð;fÐgÐgðAz
ðB  XÐ>lÐmÐmðCz
ðD Ø ØNÐNÐNð+ð		ð 	ðEz
ðX  XÐ>^Ð_Ð_ðYz
ð z
ð\ "Ø\ðð ð
 !ØRÐRÐRØCð'ð 'ð !Ø8Ð8Ð8Øið&ð &ð !Ø&¨Ð5Ø]ð"ð "ð
 #+Ð;[Ð\Ð\Ø$,Ð=fÐgÐgàØ  (Ð+ØPðð ð !ØTð!ð !ð !)Ð9ZÐ[Ð[Ø (Ð9XÐYÐYØ"Ð3YÐZÐZØ"Ð3YÐZÐZØ%Ð6YÐZÐZØ%Ð6YÐZÐZð "ðBðð ðe	z
ð z
ð z
ðv	 �Jð{	~ð ~ðL'ð L'Ð ð Lð Lð Lñ Lð^
ð ð ð ð ð rŠ   