+
    jHàj8  ã                   ó�   a € R t0 t R t^ RIHt ^ RIHt ^ RIHt RtRt	Rt
]! RRR7      t] ^ k R	 tR
 tR t]R 4       tR tR tR# )ap  Per-turn client presentation (hidden widget intents, large-paste title preview) through canonical admission.

The Desktop composer types some sends ``display_kind="hidden"`` (goal control, inline-preview decisions,
first-run kickoffs): model-facing text no client may render as a user bubble. A large paste carries a
``title_preview`` that only the session titler reads. Both are facts about ONE admitted turn, committed with
the admission row as ``display_v1`` so a retry, a queued drain or a managed child applies exactly what
was admitted, and bound to that admission's own event, never to a later turn on the same task.
)Úcontextmanager)Ú
ContextVar)ÚRuntimeStoreErrorÚhiddeniè  Údisplay_turnN)Údefaultc                óV   € \          Uu/ uF  qV 9   g   K  WV,          bK  	  up# u upi )z\The raw per-turn presentation fields of a ``prompt.submit`` request, forwarded to admission.)Ú_SUBMIT_FIELDS)ÚparamsÚkeys   & Ú</home/ubuntu/.hermes/hermes-agent/gateway/session_display.pyÚsubmit_display_fieldsr      s(   € å(6ÓH© À¹-ÔˆC˜•Ò©ÑHÐHùÒHs   ‰&–&c                óX  € V P                  R4      V P                  R4      r!Ve   V\        8w  d   \        R4      hVe"   \        V\        4      '       g   \        R4      h/ pV'       d
   \        VR&   V'       d#   VP                  4       '       d   VR\         VR&   V'       d   RV/# / # )z÷Wire ``display_kind`` / ``title_preview`` -> committed ``display_v1`` (``{}`` when absent).

Only ``hidden`` is a client-authorable kind; anything else is refused rather than rendered,
so a typo can never turn machine text into a visible user row.Údisplay_kindÚtitle_previewNÚinvalid_paramsÚkindÚ
display_v1)ÚgetÚHIDDENr   Ú
isinstanceÚstrÚstripÚ_TITLE_PREVIEW_LIMIT)r
   r   ÚpreviewÚ	committeds   &   r   Úadmit_displayr      s—   € ð
 —J‘J˜~Ó.°·
±
¸?Ó0Kˆ'ØÒ˜D¤FœNÜÐ 0Ó1Ð1ØÒ¤:¨g´s×#;Ò#;ÜÐ 0Ó1Ð1Ø€IßÜ"ˆ	�&Ñß�7—=‘=—?’?Ø%,Ð-BÔ.BÐ%Cˆ	�/Ñ"ß(1ˆL˜)Ð$Ð9°rÐ9ó    c                ó(  € \        V \        4      '       d#   V '       d   \        V 4      RR0,
          '       d   \        R4      hRV P	                  R4      RV P	                  R4      /p\        V4      P	                  R4      V 8w  d   \        R4      hV # )z¸A committed ``display_v1`` arriving across a process boundary (managed worker), re-checked by the
admission validator: only an object admission itself could have committed is accepted.r   r   r   r   r   )r   ÚdictÚsetr   r   r   )r   Úwires   & r   Úrestore_displayr"   +   s~   € ô �i¤×&Ò&¯i¼3¸y»>ÈVÐUdÐLe×;eÔ;eÜÐ 0Ó1Ð1Ø˜IŸM™M¨&Ó1°?ÀIÇMÁMÐRaÓDbÐc€DÜ�TÓ×Ñ˜|Ó,°	Ô9ÜÐ 0Ó1Ð1ØÐr   c              #   ó¶   "  € \         P                  V'       d   W3MR 4      p R x € \         P                  V4       R #   \         P                  T4       i ; i5i)N)Ú_display_turnr    Úreset)Úadmission_idr   Útokens   && r   Údisplay_turn_scoper(   6   s@   é € ä×Ñ¿9˜|Ñ7È$ÓO€Eð#Ûä×Ñ˜EÖ"øŒ×Ñ˜EÕ"üs   ‚!A¤? ¨A¿AÁAc                ó‚   € \         P                  4       pVe   V e   \        V RR4      V^ ,          8w  d   / # V^,          # )z´The committed presentation of the admission ``event`` executes (its ``message_id`` is the
admission id), ``{}`` for any other event: a follow-up on the same task never inherits it.NÚ
message_id)r$   r   Úgetattr)ÚeventÚbounds   & r   Úadmission_displayr.   ?   s>   € ô ×ÑÓ€EØ‚}˜š¬°¸ÀdÓ)KÈuÐUVÍxÔ)WØˆ	Ø��8€Or   c                 óâ   € \         P                  4       p V e
   V ^,          M/ p/ VP                  R4      \        8X  d	   R\        /M/ CVP                  R4      '       d   RRVR,          //C# / C# )zT``run_conversation`` persistence kwargs of the managed child's single admitted turn.r   Úpersist_user_display_kindr   Úpersist_user_display_metadata)r$   r   r   )r-   r   s     r   Úworker_display_kwargsr2   H   s€   € ä×ÑÓ€EØ!Ò-��a–°2€Ið;¸	¿¹ÀfÓ8MÔQWÔ8WÐ+¬VÑ4Ð]_ð ;à—-‘- ×0Ò0ð 0°/À9È_ÕC]Ð1^Ð_ð;ð ;à68ð;ð ;r   c                ód   € V ^8„  d   Qh/ ^ \         9   d   \        \        R,          ,          ;R&   # )é   Nr$   )Ú__conditional_annotations__r   Útuple)Úformats   "r   Ú__annotate__r8      s(   € ÷ ñ ÷  SÒ RŒzœ% $�,Õ'Ñ Rò!r   )r   r   )r5   Ú__doc__Ú
contextlibr   Úcontextvarsr   Úhermes_state_runtimer   r   r   r	   r$   r   r   r"   r(   r.   r2   r8   )r5   s   @r   Ú<module>r=      sc   øðöõ &Ý "å 2à	€ØÐ Ø2€Ù*4°^ÈTÔ*R€Ó RòIò
:ò$ð ñ#ó ð#òô;r   