+
    lHàj³0  ã                  ó€  € R t ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^RI	H
t
HtHtHtHt ^RIHtHt  ! R R]4      t ! R	 R
]4      t ! R R]4      t ! R R]4      t ! R R]4      t]! R]]RR7        ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R  R!]4      t ! R" R#]4      t ! R$ R%]4      t ! R& R']4      t  ! R( R)]4      t! ! R* R+]4      t" ! R, R-]4      t# ! R. R/]4      t$ ! R0 R1]4      t% ! R2 R3]4      t&]! R4]]&R5R7        ! R6 R7]4      t' ! R8 R9]4      t( ! R: R;]4      t)]! R<](])R=R7        ! R> R?]4      t* ! R@ RA]4      t+]! RB]+]RCR7        ! RD RE]4      t,]! RF],]RGR7        ! RH RI]4      t-]! RJ]-]RKR7        ! RL RM]4      t.]! RN].]ROR7        ! RP RQ]4      t/]! RR]/]RSR7        ! RT RU]4      t0]! RV]0]RWR7       ]! RX]0]RYR7       ]! RZ]*]R[R7        ! R\ R]]4      t1]! R^]1]R_R7        ! R` Ra]4      t2 ! Rb Rc]4      t3]! Rd]3]ReR7        ! Rf Rg]4      t4 ! Rh Ri]4      t5 ! Rj Rk]4      t6 ! Rl Rm]4      t7 ! Rn Ro]4      t8 ! Rp Rq]4      t9]! Rr]6]RsR7       ]! Rt]7]9RuR7        ! Rv Rw]4      t: ! Rx Ry]4      t;]! Rz];R{R|7       R}# )~ug  Serverâ†’client requests: the backend asks the renderer a question (``server_requests.send``).

Every entry is one request method: the ``params`` the frame carries (``session_id`` is added by
the transport and declared on the shared base) and the ``result`` the client answers with. The
``request.cancel`` event that withdraws an open request lives here too.
)Úannotations)ÚLiteral)ÚField)Ú
TourPreset)Ú	JsonValueÚParamsÚPayloadÚResultÚWireEnum)ÚeventÚserver_requestc                  ó&   € ] tR t^t$ RtR]R&   RtR# )ÚServerRequestParamszLEvery request frame's params start with the session the question belongs to.ÚstrÚ
session_id© N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotations__Ú__static_attributes__r   ó    ÚJ/home/ubuntu/.hermes/hermes-agent/tui_gateway/contracts/server_requests.pyr   r      s
   ‡ ÙVà‡Or   r   c                  ó&   € ] tR t^t$ RtR]R&   RtR# )ÚValueResultztThe answer to any one-string prompt (sudo, secret, vault prompts, desktop bridges):
``''`` means skipped / declined.r   Úvaluer   Nr   r   r   r   r   r      s   ‡ ñ(ð ‡Jr   r   c                  óH   € ] tR t^$t$ R]R&   R]R&   RtR]R&   RtR]R	&   R
tR# )ÚClarifyQuestionr   ÚqidÚquestionNzlist[str] | NoneÚchoicesFÚboolÚmulti_selectr   )r   r   r   r   r   r#   r%   r   r   r   r   r    r    $   s!   ‡ Ø	ƒHØƒMØ $€GÐÓ$Ø€L�$×r   r    c                  ó4   € ] tR t^+t$ RtR]R&   RtR]R&   RtR# )ÚClarifyRequestParamsza``answers`` rides only on a reconnect replay (locks the server already accepted; null = skipped).zlist[ClarifyQuestion]Ú	questionsNúdict[str, str | None] | NoneÚanswersr   )r   r   r   r   r   r   r*   r   r   r   r   r'   r'   +   s   ‡ Ùkà$Ó$Ø,0€GÐ)×0r   r'   c                  ó8   € ] tR t^2t$ RtRtR]R&   RtR]R&   RtR# )ÚClarifyResulta  ``{answers}`` for the whole set (early locks go through the ``clarify.lock`` RPC); a response
without ``answers`` is cancel-all. ``outcome`` (optional): how the viewer's own panel ended, as
main's classic CLI reports it (``timed_out`` keeps the answers locked before its deadline).Nr)   r*   z5Literal['submitted', 'timed_out', 'cancelled'] | NoneÚoutcomer   )	r   r   r   r   r   r*   r   r-   r   r   r   r   r,   r,   2   s    ‡ ñcð -1€GÐ)Ó0ØEI€GÐB×Ir   r,   Úclarifyz-The clarify tool: ask the user 1-5 questions.)ÚparamsÚresultÚdocc                  ó2   € ] tR t^CtRtRtRtRtRtRt	Rt
RtR	# )
Ú	SetupBeatÚnameÚthemeÚlayoutÚ
connectorsÚpluginsÚtourÚbuildr   N)r   r   r   r   r4   r5   r6   r7   r8   r9   r:   r   r   r   r   r3   r3   C   s%   † Ø€DØ€EØ€FØ€JØ€GØ€DØ„Er   r3   c                  ó,   € ] tR t^Mt$ R]R&   R]R&   RtR# )ÚSetupOptionr   ÚidÚlabelr   N©r   r   r   r   r   r   r   r   r   r<   r<   M   s   ‡ ØƒGØ‡Jr   r<   c                  ó&   € ] tR t^Rt$ RtR]R&   RtR# )ÚSetupNameCardNú
str | NoneÚ	suggestedr   )r   r   r   r   rC   r   r   r   r   r   rA   rA   R   s   ‡ Ø €Iˆz× r   rA   c                  ó"   € ] tR t^Vt$ R]R&   RtR# )ÚSetupThemeCardr   Úpickerr   Nr?   r   r   r   rE   rE   V   ó   ‡ Ø‡Kr   rE   c                  ó"   € ] tR t^Zt$ R]R&   RtR# )ÚSetupOptionsCardzlist[SetupOption]Úoptionsr   Nr?   r   r   r   rI   rI   Z   s   ‡ Ø×r   rI   c                  ó"   € ] tR t^^t$ R]R&   RtR# )ÚSetupConnectorsCardú	list[str]rC   r   Nr?   r   r   r   rL   rL   ^   s   ‡ Ø×r   rL   c                  ó"   € ] tR t^bt$ R]R&   RtR# )ÚSetupPluginsCardrM   r8   r   Nr?   r   r   r   rO   rO   b   s   ‡ Ø×r   rO   c                  óL   € ] tR t^ft$ RtR]R&   RtR]R&   RtR]R&   R]R	&   R
tR# )ÚSetupBeatRequestParamsa  ``card`` is the beat's data (``agent/onboarding_flow.py::BEATS``): name, theme, connectors and
plugins have their own shape; layout, tour and build carry ``options``. ``tool_call_id`` is the
setup_beat call the card belongs to: only that transcript row draws it.r3   ÚbeatNrB   r"   Útool_call_idzZSetupNameCard | SetupThemeCard | SetupOptionsCard | SetupConnectorsCard | SetupPluginsCardÚcardr   )	r   r   r   r   r   r   r"   rS   r   r   r   r   rQ   rQ   f   s)   ‡ ñOð ƒOØ€HˆjÓØ#€L�*Ó#Ø
d×dr   rQ   c                  ó"   € ] tR t^qt$ R]R&   RtR# )ÚSetupNameAnswerr   r4   r   Nr?   r   r   r   rV   rV   q   s   ‡ Ø
‡Ir   rV   c                  ó4   € ] tR t^ut$ RtR]R&   RtR]R&   RtR# )ÚSetupThemeAnswerNrB   ÚaccentÚmoder   )r   r   r   r   rY   r   rZ   r   r   r   r   rX   rX   u   s   ‡ Ø€FˆJÓØ€Dˆ*×r   rX   c                  ó"   € ] tR t^zt$ R]R&   RtR# )ÚSetupLayoutAnswerr   r6   r   Nr?   r   r   r   r\   r\   z   rG   r   r\   c                  ó>   € ] tR t^~t$ R]R&   ]! ]R7      tR]R&   RtR# )ÚSetupConnectorsAnswerrM   Ú	connected©Údefault_factoryÚnewly_connectedr   N)	r   r   r   r   r   r   Úlistrb   r   r   r   r   r^   r^   ~   s   ‡ ØÓÙ!&°tÔ!<€O�Y×<r   r^   c                  ó0   € ] tR t^ƒt$ R]R&   RtR]R&   RtR# )ÚSetupPluginsAnswerrM   Ú	installedNrB   r>   r   ©r   r   r   r   r   r>   r   r   r   r   re   re   ƒ   s   ‡ ØÓØ€Eˆ:×r   re   c                  ó0   € ] tR t^ˆt$ R]R&   RtR]R&   RtR# )ÚSetupTourAnswerr   r9   NrB   r>   r   rg   r   r   r   ri   ri   ˆ   s   ‡ Ø
ƒIØ€Eˆ:×r   ri   c                  ó0   € ] tR t^�t$ R]R&   RtR]R&   RtR# )ÚSetupBuildAnswerr   r:   NrB   r>   r   rg   r   r   r   rk   rk   �   s   ‡ ØƒJØ€Eˆ:×r   rk   c                  óF   € ] tR t^’t$ RtRtR]R&   RtR]R&   RtR]R	&   R
t	R# )ÚSetupBeatResulta›  ``answer`` holds the shown beat's picks; ids must be one of the card's options (the backend
rejects any other answer). ``said`` is composer text typed while the name card waited: the name.
``wrote_instead``: the user sent a message instead of answering; the backend ends the turn and the
client sends that message as the next one. A response with none of these, or none within 300 s,
closes the card unanswered.Nz�SetupNameAnswer | SetupThemeAnswer | SetupLayoutAnswer | SetupConnectorsAnswer | SetupPluginsAnswer | SetupTourAnswer | SetupBuildAnswer | NoneÚanswerrB   ÚsaidFr$   Úwrote_insteadr   )
r   r   r   r   r   rn   r   ro   rp   r   r   r   r   rm   rm   ’   s1   ‡ ñ#ð =Að ð 9ó Aà€Dˆ*ÓØ€M�4×r   rm   Ú
setup_beatzRThe onboarding chat's card for one beat; blocks setup_beat until answered (300 s).c                  ó&   € ] tR t^¦tRtRtRtRtRtR# )ÚApprovalChoiceÚonceÚsessionÚalwaysÚdenyr   N)	r   r   r   r   rt   ru   rv   rw   r   r   r   r   rs   rs   ¦   s   † Ø€DØ€GØ€FØ„Dr   rs   c                  óÞ   € ] tR t^­t$ RtR]R&   RtR]R&   RtR]R&   ]! ]	R7      t
R]R	&   R
tR]R&   R
tR]R&   R
tR]R&   R
tR]R&   ]! R
RR7      tR]R&   ]P"                  RR/,          tRtR
# )ÚApprovalRequestParamsu]   ``tui_gateway/server.py::_approval_request_payload`` â€” the command is redacted server-side.r   Ú
request_idÚ ÚcommandÚdescriptionr`   zlist[ApprovalChoice]r#   Núbool | NoneÚallow_permanentÚallow_sessionÚsmart_deniedrB   Ú	tool_nameÚgateway_session_id)ÚdefaultÚaliasÚsession_id_hintÚextraÚallowr   )r   r   r   r   r   r   r|   r}   r   rc   r#   r   r€   r�   r‚   r†   r   Úmodel_configr   r   r   r   ry   ry   ­   s   ‡ ÙgàƒOØ€GˆSÓØ€K�ÓÙ$)¸$Ô$?€GÐ!Ó?Ø#'€O�[Ó'Ø!%€M�;Ó%Ø $€L�+Ó$Ø €IˆzÓ Ù"'°Ð<PÔ"Q€O�ZÓQð ×&Ñ&¨'°7Ð);Õ;„Lr   ry   c                  ó0   € ] tR t^¾t$ R]R&   RtR]R&   RtR# )ÚApprovalResultrs   ÚchoiceNr~   Úallr   )r   r   r   r   r   r�   r   r   r   r   r‹   r‹   ¾   s   ‡ ØÓØ€Cˆ×r   r‹   Úapprovalz/A dangerous command awaits the user's decision.c                  ó   € ] tR t^ÊtRtR# )ÚEmptyRequestParamsr   N)r   r   r   r   r   r   r   r   r�   r�   Ê   s   † Ûr   r�   c                  ó*   € ] tR t^Ît$ RtRtR]R&   RtR# )ÚSudoRequestParamszMOriginal command, redacted server-side before any password-injection rewrite.r{   r   r|   r   N)r   r   r   r   r   r|   r   r   r   r   r   r’   r’   Î   s   ‡ ÙWà€GˆS×r   r’   Úsudoz+Masked sudo password for the terminal tool.c                  ó:   € ] tR t^Øt$ R]R&   R]R&   RtR]R&   RtR# )ÚSecretRequestParamsr   Úenv_varÚpromptNzdict[str, JsonValue] | NoneÚmetadatar   )r   r   r   r   r   r˜   r   r   r   r   r•   r•   Ø   s   ‡ ØƒLØƒKØ,0€HÐ)×0r   r•   Úsecretz8Masked value for a named env var (skills / setup flows).c                  ó,   € ] tR t^ât$ R]R&   R]R&   RtR# )ÚVaultUnlockRequestParamsr   ÚbackendÚdisplay_namer   Nr?   r   r   r   r›   r›   â   s   ‡ ØƒLØ×r   r›   zvault.unlock_promptzHMaster password to unlock an external password manager for this session.c                  ó,   € ] tR t^ët$ R]R&   R]R&   RtR# )ÚVaultSaveLoginRequestParamsr   ÚoriginÚsiter   Nr?   r   r   r   rŸ   rŸ   ë   s   ‡ ØƒKØ
‡Ir   rŸ   zvault.save_loginz^Save a login for a site the agent is about to fill; the answer is JSON {identifier, password}.c                  ó4   € ] tR t^ôt$ RtR]R&   RtR]R&   RtR# )ÚVaultCodeRequestParamsNrB   r¡   Úhintr   )r   r   r   r   r¡   r   r¤   r   r   r   r   r£   r£   ô   s   ‡ Ø€Dˆ*ÓØ€Dˆ*×r   r£   z
vault.codez7A one-time / 2FA code the user reads from their device.c                  ó4   € ] tR tRt$ RtR]R&   RtR]R&   RtR# )ÚReadRangeRequestParamsé   Nú
int | NoneÚstartÚcountr   )r   r   r   r   r©   r   rª   r   r   r   r   r¦   r¦      s   ‡ Ø€Eˆ:ÓØ€Eˆ:×r   r¦   zterminal.readz;Read the visible in-app terminal buffer (JSON text answer).zpreview.readz:Read the in-app browser preview's text (JSON text answer).zwindow.readz=Enumerate the native window below the app (JSON text answer).c                  ó²   € ] tR tRt$ RtR]R&   RtR]R&   RtR]R&   RtR]R	&   Rt	R]R
&   Rt
R]R&   RtR]R&   RtR]R&   RtR]R&   RtR]R&   RtR]R&   RtR# )ÚPreviewActRequestParamsi  zR``tools/drive_preview_tool.py`` and ``tools/annotate_preview_tool.py`` field sets.r   ÚactionNrB   ÚrefÚselectorÚtextÚkeyr~   ÚsubmitÚfullÚtor¨   ÚamountÚmaxÚallow_shortcutr   )r   r   r   r   r   r   r®   r¯   r°   r±   r²   r³   r´   rµ   r¶   r·   r   r   r   r   r¬   r¬     sn   ‡ Ù\àƒKØ€CˆÓØ€HˆjÓØ€Dˆ*ÓØ€CˆÓØ€FˆKÓØ€Dˆ+ÓØ€Bˆ
ÓØ€FˆJÓØ€CˆÓØ"&€N�K×&r   r¬   zpreview.actzCClick / type / scroll / annotate inside the in-app browser preview.c                  óz   € ] tR tRt$ RtR]R&   RtR]R&   RtR]R&   RtR]R&   ]	P                  RR	/,          t
R
tR# )ÚTourStepi!  NrB   r¯   Útitler°   Úsider‡   rˆ   r   )r   r   r   r   r¯   r   rº   r°   r»   r   r‰   r   r   r   r   r¹   r¹   !  s?   ‡ Ø€HˆjÓØ€Eˆ:ÓØ€Dˆ*ÓØ€Dˆ*ÓØ×&Ñ&¨'°7Ð);Õ;„Lr   r¹   c                  ó–   € ] tR tRt$ RtR]R&   RtR]R&   RtR]R&   RtR]R	&   Rt	R]R
&   Rt
R]R&   RtR]R&   RtR]R&   RtR]R&   RtR# )ÚTourRequestParamsi)  z!``tools/tour_tool.py`` field set.r   r­   NrB   Úsurfacer¯   rº   r°   r»   zlist[TourStep] | NoneÚstepsr¨   Ú
step_indexzTourPreset | NoneÚpresetr   )r   r   r   r   r   r   r¾   r¯   rº   r°   r»   r¿   rÀ   rÁ   r   r   r   r   r½   r½   )  s\   ‡ Ù+àƒKØ€GˆZÓØ€HˆjÓØ€Eˆ:ÓØ€Dˆ*ÓØ€Dˆ*ÓØ#'€EÐ Ó'Ø!€J�
Ó!Ø $€FÐ×$r   r½   r9   z6Drive a guided tour highlight in the desktop renderer.c                  ó"   € ] tR tRtRtRtRtRtR# )Ú	ThemeModei;  ÚlightÚdarkÚsystemr   N)r   r   r   r   rÄ   rÅ   rÆ   r   r   r   r   rÃ   rÃ   ;  s   † Ø€EØ€DØ„Fr   rÃ   c                  ó   € ] tR tRtRtRtRtR# )ÚThemePickeriA  rY   r6   r   N)r   r   r   r   rY   r6   r   r   r   r   rÈ   rÈ   A  s   † Ø€FØ„Fr   rÈ   c                  óF   € ] tR tRt$ RtRtR]R&   RtR]R&   RtR]R&   R	t	R# )
ÚThemeApplyRequestParamsiF  zT``tools/set_theme_tool.py`` values; accent is a swatch id, ``theme`` or ``#rrggbb``.NrB   rY   úThemeMode | NonerZ   r6   r   ©
r   r   r   r   r   rY   r   rZ   r6   r   r   r   r   rÊ   rÊ   F  s$   ‡ Ù^à€FˆJÓØ!€DÐ
Ó!Ø€FˆJ×r   rÊ   c                  ó"   € ] tR tRt$ R]R&   RtR# )ÚThemePickRequestParamsiN  rÈ   rF   r   Nr?   r   r   r   rÎ   rÎ   N  s   ‡ Ø×r   rÎ   c                  óF   € ] tR tRt$ RtRtR]R&   RtR]R&   RtR]R&   R	t	R# )
ÚThemeValuesiR  zfWhat the renderer applied. ``accent`` is a swatch id, ``custom:#rrggbb``, or null for the theme's own.NrB   rY   rË   rZ   r6   r   rÌ   r   r   r   rÐ   rÐ   R  s$   ‡ Ùpà€FˆJÓØ!€DÐ
Ó!Ø€FˆJ×r   rÐ   c                  óF   € ] tR tRt$ RtRtR]R&   RtR]R&   RtR]R	&   R
t	R# )ÚThemePickResultiZ  z�``picked`` once the user chose (already applied); ``cancelled`` when the card was dismissed. A response
with neither is a cancel.NzThemeValues | NoneÚpickedrB   ro   r~   Ú	cancelledr   )
r   r   r   r   r   rÓ   r   ro   rÔ   r   r   r   r   rÒ   rÒ   Z  s(   ‡ ñ!ð "&€FÐÓ%Ø€Dˆ*ÓØ!€Iˆ{×!r   rÒ   ztheme.applyzLApply set_theme values in the window showing the session (JSON text answer).z
theme.pickzGShow an accent or layout picker card in the chat and wait for the pick.c                  ó*   € ] tR tRtRtRtRtRtRtRt	R# )	ÚRequestCancelReasonil  ÚtimeoutÚinterruptedÚshutdownÚresolvedÚsession_closedr   N)
r   r   r   r   r×   rØ   rÙ   rÚ   rÛ   r   r   r   r   rÖ   rÖ   l  s   † Ø€GØ€KØ€HØ€HØ%„Nr   rÖ   c                  ó6   € ] tR tRt$ R]R&   R]R&   R]R&   RtR# )ÚRequestCancelPayloadit  r   r=   ÚmethodÚreasonr   Nr?   r   r   r   rÝ   rÝ   t  s   ‡ ØƒGØƒKØ‡Kr   rÝ   zrequest.canceluS   The backend withdrew an open serverâ†’client request; clear the matching card only.)r1   N)<r   Ú
__future__r   Útypingr   Úpydanticr   Útools.tour_presetsr   Úbaser   r   r   r	   r
   Úregistryr   r   r   r   r    r'   r,   r3   r<   rA   rE   rI   rL   rO   rQ   rV   rX   r\   r^   re   ri   rk   rm   rs   ry   r‹   r�   r’   r•   r›   rŸ   r£   r¦   r¬   r¹   r½   rÃ   rÈ   rÊ   rÎ   rÐ   rÒ   rÖ   rÝ   r   r   r   Ú<module>ræ      sv  ðñõ #å å å )ç >Õ >ß +ô˜&ô ô�&ô ô�fô ô1Ð.ô 1ôJ�Fô Jñ ˆyÐ!5¸mØBõDô�ô ô�&ô ô
!�Fô !ô�Vô ô�vô ô˜&ô ô�vô ôeÐ0ô eô�fô ô�vô ô
˜ô ô=˜Fô =ô
˜ô ô
�fô ô
�vô ô

 �fô 
 ñ ˆ|Ð$:À?Øgõiô�Xô ô<Ð/ô <ô"�Vô ñ
 ˆzÐ"7ÀØDõFô	Ð,ô 	ôÐ+ô ñ ˆvÐ/¸Ø@õBô1Ð-ô 1ñ ˆxÐ 3¸KØMõOôÐ2ô ñ
 Ð$Ð-EÈkØ]õ_ôÐ"5ô ñ
 Ð!Ð*EÈkØsõuôÐ0ô ñ
 ˆ|Ð$:À;ØLõNôÐ0ô ñ
 ˆÐ'=ÀkØPõRá ˆ~Ð&<À[ØOõQá ˆ}Ð%7ÀØRõTô'Ð1ô 'ñ  ˆ}Ð%<À[ØXõZô<ˆvô <ô%Ð+ô %ñ ˆvÐ/¸ØKõMô�ô ô�(ô ô
Ð1ô ôÐ0ô ô�&ô ô"�fô "ñ ˆ}Ð%<À[Øaõcá ˆ|Ð$:À?Ø\õ^ô&˜(ô &ô˜7ô ñ ÐÐ,Ø
_÷ar   