Ë
    âß²j@  ã                   ó´   — d Z ddlmZ  G d„ de«      Zdededefd„Zdefd	„Zdefd
„Z	defd„Z
ddefd„Zddefd„Zdddœdefd„Zdddœdefd„Zddefd„Zy)zMDelivery policy for engine diagnostics, never assistant or command responses.é    )Úresolve_display_settingc                   ó   — e Zd ZdZy)ÚDiagnosticTextzóProducer-owned classification on the legacy two-argument status callback.

    String behavior and event kind stay unchanged for existing plugin renderers.
    Durable carriers must serialize their own category, not this in-memory marker.
    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    úB/home/ubuntu/.hermes/hermes-agent/gateway/warning_notifications.pyr   r      s   „ òr   r   Ú
event_typeÚmessageÚreturnc                 ó0   — | dk(  xs t        |t        «      S )NÚwarn)Ú
isinstancer   )r   r   s     r   Úis_warning_statusr      s   € Ø˜ÑÒF¤:¨g´~Ó#FÐFr   c                 óv   — t        | dd«      dv xs) t        t        | dd«      xs d«      j                  d«      S )a  Out-of-band ``AgentNotice`` classification shared by the gateway, TUI and CLI sinks.

    Credit-service notices are automatic diagnostics at every level (usage bands are ``info``,
    ``credits.restored`` is ``success``); everything else is diagnostic only when it warns.
    ÚlevelN>   r   ÚerrorÚkeyÚ zcredits.)ÚgetattrÚstrÚ
startswith)Únotices    r   Úis_diagnostic_noticer      sC   € ô �F˜G TÓ*Ð.?Ð?ò LÜ”7˜6 5¨"Ó-Ò3°Ó4×?Ñ?À
ÓKðMr   c                 ón   — t        | dd«      r't        | dd«      xs i j                  d«      dk(  rddiS i S )z©``{"notification_category": "diagnostic"}`` for a trusted diagnostic-only wake, else ``{}``.

    Only internal wakes may classify a turn; human content never does.
    ÚinternalFÚmetadataNÚnotification_categoryÚ
diagnostic)r   Úget)Úevents    r   Údiagnostic_metadatar%      sG   € ô
 ˆu�j %Ô(¬g°e¸ZÈÓ.NÒ.TÐRT×-YÑ-YØ#ó.%Ø(4ò.5à'¨Ð6Ð6Ø€Ir   c                  óh   — ddl m}  	  | «       }t        |t        «      r|S i S # t        $ r i cY S w xY w)zbThe active profile's effective config, or ``{}`` when it cannot be read (presentation fails open).r   )Úload_user_config_effective)Úhermes_cli.config_effectiver'   Ú	Exceptionr   Údict)r'   Úconfigs     r   Úeffective_user_configr,   '   s>   € åFðÙ+Ó-ˆô   ¬Ô-ˆ6Ð5°2Ð5øô ò ØŠ	ðús   ˆ# £1°1Nc                 óP   — | xs i j                  d«      dk(  xr t        ||«       S )z¬One admission rule for every surface: a diagnostic-category wake mutes its turn's
    presentation only when the owning policy hides diagnostics. Human content never mutes.r!   r"   )r#   Úwarning_notifications_enabled)Údisplay_metadataÚplatformÚuser_configs      r   Údiagnostic_turn_mutedr2   1   s6   € ð Ò# ×(Ñ(Ð)@ÓAÀ\ÑQò IÜ1°(¸KÓHÐHðJr   c                 óÈ   — t        | dd«      }t        |t        «      r|S t        t        | dd«      «      xr, t        t        | dd«      | j                  j
                  |«      S )zHOnly trusted diagnostic-only wakes can mute a turn, never human content.Ú_notification_reply_mutedNr   Fr    )r   r   Úboolr2   Úsourcer0   )r$   r1   Úsnapshots      r   Údiagnostic_wake_mutedr8   8   s`   € ä�uÐ9¸4Ó@€HÜ�(œDÔ!ØˆÜ”˜˜z¨5Ó1Ó2ò NÔ7LÜ��z 4Ó(¨%¯,©,×*?Ñ*?Àó8Nð Nr   T)r"   r1   c                ó0   — |rt        ||«      sy | «        y)aP  Invoke a synchronous UI renderer only when its classified content is visible.

    Return whether the renderer ran, not whether a transport delivered anything.
    Call only at a presentation sink, never around producer callbacks or persistence.
    The caller supplies the owning scope/turn snapshot; exceptions remain its policy.
    FT©r.   )Úrenderr0   r"   r1   s       r   Úrender_notificationr<   A   s   € ñ Ô7¸À+ÔNØÙ
„HØr   c             ƒ   óL   K  — |rt        ||«      sy | «       ƒ d{  –—†  y7 Œ­w)a  Async twin of :func:`render_notification` for lifecycle emitters that await a send.

    Return whether the presenter ran; its own receipt/exception is the caller's to interpret.
    The caller binds the owning profile scope BEFORE calling (watchers/shutdown fan-outs).
    FNTr:   )Úpresentr0   r"   r1   s       r   Úpresent_notificationr?   N   s)   è ø€ ñ Ô7¸À+ÔNØÙ
‹)‡O€OØð ús   ‚$œ"�$c                 óx   — |€t        «       }nt        |t        «      si }t        | d| «      }t	        ||dd«       S )zûUse the turn snapshot when supplied, otherwise the active profile's effective config.

    No surface exemption: direct command/API outcomes are not notifications.
    Unknown values never opt in; null inherits via the canonical display resolver.
    ÚvalueÚsuppress_warning_notificationsF)r,   r   r*   r   r   )r0   r1   Úplatform_keys      r   r.   r.   Z   sE   € ð ÐÜ+Ó-‰Ü˜¤TÔ*ØˆÜ˜8 W¨hÓ7€LÜ& {°LÐBbÐdiÓjÐjÐjr   )N)r	   Úgateway.display_configr   r   r   r5   r   r   r*   r%   r,   r2   r8   r<   r?   r.   r
   r   r   ú<module>rE      s°   ðÙ Så :ô�Sô ðG #ð G°ð G¸ó GðM Dó Mð $ó ð6˜tó 6ñJÈ4ó JñN°dó Nð 9=È$ò 
ÐSWó 
ð AEÐRVò 	Ð[_ó 	ñkÀô kr   