+
    kHàj{  ã                  óp   € R t ^ RIHt ^ RIt^ RIHtHt ^ RIHtH	t	 Rt
R R ltR R	 lt ! R
 R]4      tR# )u›  OpenAI native web search â€” declares the Responses API server-side ``web_search`` built-in.

Config: ``web.search_backend: openai-native`` (or ``web.backend``).
Auth: openai-codex OAuth (``hermes auth add openai-codex``); no API key of its own.

Unlike every other provider here, this one never executes a search itself. Selecting it
tells the Codex Responses transport to declare the provider-executed ``web_search`` tool
(``{"type": "web_search"}``) in place of the client-side ``web_search`` function, so the
model drives search server-side. The transport performs that swap; this class exists so
``web.search_backend`` has a real provider name to point at.

Auth gating lives here rather than in the transport because the transport must stay
reachable for a user who configured this backend but has not signed in yet â€” they get the
clear "sign in" error from :meth:`search` rather than a silently different backend.
)ÚannotationsN)ÚAnyÚDict)ÚBaseWebSearchProviderÚsearch_failzéopenai-native declares OpenAI's server-side web_search tool; it cannot run as a client-side search and requires the Codex Responses transport (provider openai-codex). For client-side search use firecrawl (default) or another backend.c               ó$   € V ^8„  d   QhRRRRRR/# )é   Úobjr   ÚkeyÚstrÚreturn© )Úformats   "ÚG/home/ubuntu/.hermes/hermes-agent/plugins/web/openai_native/provider.pyÚ__annotate__r      s!   € ÷ ;ñ ;ˆsð ;˜ð ; ñ ;ó    c                óT   € \        V \        4      '       d   V P                  V4      # R # ©N)Ú
isinstanceÚdictÚget)r	   r
   s   &&r   Ú_dgetr      s!   € Ü% c¬4×0Ò0ˆ3�7‰7�3‹<Ð:°dÐ:r   c               ó   € V ^8„  d   QhRR/# ©r   r   Úboolr   )r   s   "r   r   r   #   s   € ÷ ñ ˜tñ r   c                 ó:  €  ^ RI Hp  V ! 4       R,          pVP                  4       '       g   R# \        P                  ! VP                  RR7      4      p\        \        \        VR4      R4      R4      p\        \        VR	4      ;'       g    R
4      P                  4       '       d   R# \        \        VR4      R4      p\        V\        4      ;'       d5    \        ;QJ d    R V 4       F  '       g   K   R# 	  R# ! R V 4       4      #   \         d     R# i ; i)uX  Cheap probe: True when openai-codex OAuth tokens are *likely* usable.

Mirrors ``tools/xai_http.has_xai_credentials`` â€” deliberately avoids
``resolve_codex_runtime_credentials`` (disk locks, OAuth network refresh), because
this runs on every ``hermes tools`` repaint. Checks, fast-to-slow:
``providers.openai-codex.tokens.access_token`` in ``auth.json``, then any
``credential_pool.openai-codex`` entry carrying an ``access_token`` (pool-only
multi-account grants never write the providers singleton). Returns False on any
exception so a corrupted auth store cannot block other availability scans.
)Úget_hermes_homez	auth.jsonFz	utf-8-sig)ÚencodingÚ	providerszopenai-codexÚtokensÚaccess_tokenÚ TÚcredential_poolc              3  ó¸   "  € T FP  p\        V\        4      ;'       d4    \        VP                  R R4      ;'       g    R4      P	                  4       x € KR  	  R# 5i)r    r!   N)r   r   r   r   Ústrip)Ú.0Úes   & r   Ú	<genexpr>Ú(has_codex_credentials.<locals>.<genexpr>9   sH   é € ð 1
ÙZaÐUVŒJ�qœ$Ó×PÐP¤C¨¯©¨n¸bÓ(A×(GÐ(GÀRÓ$H×$NÑ$NÓ$PÔPÓZaùs   ‚AžA½A)Úhermes_constantsr   ÚexistsÚjsonÚloadsÚ	read_textr   r   r$   r   ÚlistÚanyÚ	Exception)r   Ú	auth_pathÚstorer   Úentriess        r   Úhas_codex_credentialsr4   #   sû   € ðÝ4á#Ó%¨Õ3ˆ	Ø×Ñ×!Ò!ÙÜ—
’
˜9×.Ñ.¸Ð.ÓDÓEˆÜ”uœU 5¨+Ó6¸ÓGÈÓRˆÜŒu�V˜^Ó,×2Ð2°Ó3×9Ñ9×;Ò;ÙÜœ˜eÐ%6Ó7¸ÓHˆÜ˜'¤4Ó(÷ 
ð 
¯S«Sñ 1
ÙZaó1
¯S¬Sð 	
ªSð 	
¨Sñ 1
ÙZaó1
ó .
ð 	
øô ô Úðús5   ‚)D ®A8D Â)8D Ã"D Ã6D Ã9D Ã=D ÄDÄDc                  óJ   € ] tR t^@tRtRtRtR R ltRR R lltR R	 lt	R
t
R# )ÚOpenAINativeWebSearchProviderz•Marker provider: the Codex Responses transport swaps the client ``web_search``
function for the server-executed built-in when this backend is active.zopenai-nativez*OpenAI Native Web Search (Codex Responses)c               ó   € V ^8„  d   QhRR/# r   r   )r   s   "r   r   Ú*OpenAINativeWebSearchProvider.__annotate__G   s   € ÷ 'ñ '˜dñ 'r   c                	ó   € \        4       # r   )r4   )Úselfs   &r   Úis_availableÚ*OpenAINativeWebSearchProvider.is_availableG   s   € Ü$Ó&Ð&r   c               ó$   € V ^8„  d   QhRRRRRR/# )r   Úqueryr   ÚlimitÚintr   údict[str, Any]r   )r   s   "r   r   r8   J   s!   € ÷ -ñ -˜Cð -¨ð -°Nñ -r   c                ó    € \        \        4      # )uã   Never called on a successful native turn â€” the transport replaces the tool
before the request goes out. Reached only when the active transport cannot host
the built-in, so fail loudly instead of returning an empty result set.)r   Ú_UNSUPPORTED_MSG)r:   r>   r?   s   &&&r   ÚsearchÚ$OpenAINativeWebSearchProvider.searchJ   s   € ô Ô+Ó,Ð,r   c               ó   € V ^8„  d   QhRR/# )r   r   rA   r   )r   s   "r   r   r8   P   s   € ÷ 
ñ 
 .ñ 
r   c                	ó8   € ^ RI Hp V! V P                  RRR4      # )é    )Úsetup_schemaÚnativez’Search runs on the provider side (needs the Codex Responses transport + an openai-codex login); search only, extraction still uses another backendr!   )Úplugins.web._commonrI   ÚDISPLAY_NAME)r:   rI   s   & r   Úget_setup_schemaÚ.OpenAINativeWebSearchProvider.get_setup_schemaP   s'   € Ý4áØ×ÑØð aØó	
ð 	
r   r   N)é   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__ÚNAMErL   r;   rD   rM   Ú__static_attributes__r   r   r   r6   r6   @   s(   † ñNð €DØ?€Lõ'÷-÷
ñ 
r   r6   )rT   Ú
__future__r   r+   Útypingr   r   rK   r   r   rC   r   r4   r6   r   r   r   Ú<module>rY      s:   ðñõ  #ã ß ç BðXð õ;õô:
Ð$9ö 
r   