+
    lHàjZ&  ã                  ó   € R t ^ RIHt ^ RIHtHt ^ RIHt ^RIH	t	H
t
Ht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]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t]! ]P4                  ]P6                  ]P8                  ]P:                  ]P<                  0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(7      3,          t& ! R) R*]4      t' ! R+ R,]4      t( ! R- R.]4      t) ! R/ R0]4      t* ! R1 R2]4      t+ ! R3 R4]4      t,. R6Ot-R5# )7zWValue shapes shared by several methods and events (declared once, imported everywhere).)Úannotations)Ú	AnnotatedÚLiteral)ÚField)Ú	JsonValueÚParamsÚPayloadÚResultÚWireEnumc                  óD   € ] tR t^tRt]P                  RR/,          tRtR# )Ú	OpenModelz¡A result/payload row whose known fields are typed but which the producer may extend
(the closed set is owned elsewhere: hermes_state rows, provider inventories).ÚextraÚallow© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r	   Úmodel_configÚ__static_attributes__r   ó    ÚA/home/ubuntu/.hermes/hermes-agent/tui_gateway/contracts/common.pyr   r      s   † ñUð ×&Ñ&¨'°7Ð);Õ;„Lr   r   c                  óH   € ] tR t^t$ RtR]R&   R]R&   R]R&   RtR]R	&   R
tR# )Ú	PlanGaugezW``gateway/session_usage.py::plan_gauge``: a window plan's allowance for the status bar.ÚstrÚidÚlabelÚintÚused_bpNú
int | NoneÚresets_at_msr   )r   r   r   r   r   Ú__annotations__r!   r   r   r   r   r   r      s   ‡ ÙaàƒGØƒJØƒLØ#€L�*×#r   r   c                  ól  € ] tR t^t$ RtRtR]R&   ^ tR]R&   ^ tR]R&   ^ t	R]R&   ^ t
R]R	&   ^ tR]R
&   ^ t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]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# )$ÚUsagez]``tui_gateway/server.py::_get_usage`` + ``agent/context_breakdown.py::context_usage_fields``.Ú r   Úmodelr   ÚinputÚoutputÚ	reasoningÚpromptÚ
completionÚtotalÚcallsNr    ÚcompressionsÚcontext_usedÚcontext_maxÚcontext_percentú
str | NoneÚcontext_sourceúbool | NoneÚcontext_estimatedÚcache_hit_pctÚ
cache_readÚcache_writeúfloat | NoneÚavg_latency_sÚavg_tpsÚactive_subagentsÚdev_credits_spent_microsÚcost_usdÚcost_statuszPlanGauge | NoneÚ
plan_gauger   )r   r   r   r   r   r&   r"   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r3   r5   r6   r7   r8   r:   r;   r<   r=   r>   r?   r@   r   r   r   r   r$   r$      só   ‡ Ùgà€Eˆ3ƒOØ€Eˆ3ƒNØ€FˆCƒOØ€IˆsÓØ€FˆCƒOØ€J�ÓØ€Eˆ3ƒNØ€Eˆ3ƒNØ#€L�*Ó#Ø#€L�*Ó#Ø"€K�Ó"Ø"&€O�ZÓ&Ø!%€N�JÓ%Ø%)Ð�{Ó)Ø $€M�:Ó$Ø!€J�
Ó!Ø"€K�Ó"Ø"&€M�<Ó&Ø €Gˆ\Ó Ø#'Ð�jÓ'Ø+/Ð˜jÓ/Ø!€HˆlÓ!Ø"€K�Ó"Ø#'€JÐ ×'r   r$   c                  óH   € ] tR t^9t$ RtR]R&   R]R&   R]R&   RtR]R&   R	tR# )
Ú
ProjectRefz1``tui_gateway/server.py::_project_info_for_cwd``.r   r   ÚslugÚnameNr2   Úprimary_pathr   )r   r   r   r   r   r"   rE   r   r   r   r   rB   rB   9   s   ‡ Ù;àƒGØ
ƒIØ
ƒIØ#€L�*×#r   rB   c                  óP   € ] tR t^Bt$ RtR]R&   RtR]R&   RtR]R&   RtR]R	&   R
t	R# )ÚMcpServerStatusr%   r   rD   Nr2   Ústatusr    Ú
tool_countÚerrorr   )
r   r   r   r   rD   r"   rH   rI   rJ   r   r   r   r   rG   rG   B   s)   ‡ Ø€Dˆ#ƒNØ€FˆJÓØ!€J�
Ó!Ø€Eˆ:×r   rG   c                  óê  € ] tR t^It$ 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7      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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]R)&   ]! ]"R7      t#R*]R+&   Rt$R]R,&   Rt%R]R-&   Rt&R.]R/&   R0t'R# )1ÚSessionLiveInfou©   ``tui_gateway/server.py::_session_info`` â€” the ``session.info`` event and the ``info`` field of
``session.create`` / ``session.resume`` / ``session.activate`` results.r%   r   r&   ÚproviderÚreasoning_effortÚreasoning_effort_wireÚservice_tierFÚboolÚfastÚyoloÚmanualÚapproval_mode©Údefault_factoryzdict[str, list[str]]ÚtoolsÚskillsÚcwdNr2   ÚbranchzProjectRef | NoneÚprojectÚterminal_backendÚpersonalityÚrunningr9   Úturn_started_atÚtitleÚstored_session_idzint | str | NoneÚdesktop_contractÚversionÚrelease_dateúJsonValue | NoneÚupdate_behindÚupdate_commandzUsage | NoneÚusageÚprofile_namezlist[McpServerStatus]Úmcp_serversÚsystem_promptÚcredential_warningr4   Úlazyr   )(r   r   r   r   r   r&   r"   rM   rN   rO   rP   rR   rS   rU   r   ÚdictrX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rg   rh   ri   rj   Úlistrk   rl   rm   rn   r   r   r   r   rL   rL   I   sP  ‡ ñOð €Eˆ3ƒOØ€HˆcÓØÐ�cÓð "$Ð˜3Ó#Ø€L�#ÓØ€Dˆ$ÓØ€Dˆ$ÓØ!€M�3Ó!Ù"'¸Ô"=€EÐÓ=Ù#(¸Ô#>€FÐ Ó>Ø€CˆƒMØ€FˆJÓØ!%€GÐÓ%ØÐ�cÓØ€K�ÓØ€GˆTÓØ$(€O�\Ó(Ø€Eˆ3ƒOØÐ�sÓØ)-ÐÐ&Ó-Ø€GˆSÓØ€L�#ÓØ&*€MÐ#Ó*Ø€N�CÓØ€Eˆ<ÓØ#€L�*Ó#Ù).¸tÔ)D€KÐ&ÓDØ $€M�:Ó$Ø%)Ð˜
Ó)Ø€Dˆ+×r   rL   c                  ó²  € ] tR t^ot$ 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&   ^ tR]R&   ^ tR]R&   ^ t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
]R&   RtR]R &   RtR]R!&   ]! RR"R#7      tR]R$&   ]! RR%R#7      tR&]R'&   Rt R]R(&   R)t!R# )*ÚStoredSessionRowztOne ``sessions`` row as ``hermes_state`` lists it (``session.list`` / ``session.info`` rows /
``sessions.changed``).r   r   Nr2   ra   ÚpreviewÚsourcer&   r9   Ú
started_atÚended_atÚlast_activer   Úmessage_countÚtool_call_countÚinput_tokensÚoutput_tokensFrQ   Ú	is_activerZ   Ú
git_branchÚgit_repo_rootÚparent_session_idr4   ÚpinnedÚunreadÚarchivedÚactual_cost_usdÚestimated_cost_usdÚhandoff_platformÚhandoff_stateÚ_lineage_root_id)ÚdefaultÚaliasÚlineage_root_idÚ_lineage_idsúlist[str] | NoneÚlineage_idsÚcontinuation_kindr   )"r   r   r   r   r   r"   ra   rs   rt   r&   ru   rv   rw   rx   ry   rz   r{   r|   rZ   r}   r~   r   r€   r�   r‚   rƒ   r„   r…   r†   r   rŠ   r�   rŽ   r   r   r   r   rr   rr   o   s(  ‡ ñð 	ƒGØ€Eˆ:ÓØ€GˆZÓØ€FˆJÓØ€Eˆ:ÓØ#€J�Ó#Ø!€HˆlÓ!Ø $€K�Ó$Ø€M�3ÓØ€O�SÓØ€L�#ÓØ€M�3ÓØ€IˆtÓØ€CˆÓØ!€J�
Ó!Ø $€M�:Ó$Ø$(Ð�zÓ(Ø€FˆKÓØ€FˆKÓØ €HˆkÓ Ø$(€O�\Ó(Ø'+Ð˜Ó+Ø#'Ð�jÓ'Ø $€M�:Ó$Ù"'°Ð<NÔ"O€O�ZÓOÙ$)°$¸nÔ$M€KÐ!ÓMð %)Ð�z×(r   rr   c                  ó&   € ] tR t^’tRtRtRtRtRtR# )ÚToolLabelKindz@Which surface one inner call of a bridged ``tool_call`` runs on.Ú	connectorÚmcpÚtoolr   N)	r   r   r   r   r   r‘   r’   r“   r   r   r   r   r�   r�   ’   s   † ÙJà€IØ
€CØ„Dr   r�   c                  óf   € ] tR t^št$ RtR]R&   R]R&   R]R&   R]R&   R]R&   R]R	&   R
tR]R&   RtR# )Ú	ToolLabeluÖ   ``tools.tool_labels.ToolLabel`` â€” what one call executed through the tool_search bridge is,
in words. Clients render ``text`` (or ``app``/``action`` in their own columns) and never parse
the tool name themselves.r�   Úkindr   ÚappÚactionÚemojiÚtextrD   r%   rs   r   N)r   r   r   r   r   r"   rs   r   r   r   r   r•   r•   š   s2   ‡ ñ!ð ÓØ	ƒHØƒKØƒJØ
ƒIØ
ƒIØ€GˆS×r   r•   c                  óÎ   € ] tR t^¨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]R&   RtR]R&   RtR# )ÚTranscriptMessageuv  One transcript row as the gateway PROJECTS it for renderers (``session_history._project_history``):
``text``, display-only ``timestamp`` / ``display_kind`` / ``display_metadata``, the durable ``row_id``
rewind targets, and for tool rows raw ``content``, ``tool_call_id``, ``name``, ``context`` and ``args``.
Assistant detail sidecars (``reasoning``, â€¦) ride as extra keys.r   ÚroleNr2   rš   rf   ÚcontentÚtool_call_idr9   Ú	timestampr    Úrow_idÚdisplay_kindÚdisplay_metadatarD   Úcontextzdict[str, JsonValue] | NoneÚargszlist[ToolLabel] | NoneÚlabelsr)   r   )r   r   r   r   r   r"   rš   rž   rŸ   r    r¡   r¢   r£   rD   r¤   r¥   r¦   r)   r   r   r   r   rœ   rœ   ¨   sŒ   ‡ ñJð
 ƒIØ€Dˆ*ÓØ $€GÐÓ$Ø#€L�*Ó#Ø"€Iˆ|Ó"Ø€FˆJÓØ#€L�*Ó#Ø)-ÐÐ&Ó-Ø€Dˆ*ÓØ€GˆZÓØ(,€DÐ
%Ó,Ø%)€FÐ"Ó)Ø €Iˆz× r   rœ   c                  ó6   € ] tR t^½tRtRtRtRtRtRt	Rt
RtR	tR
# )ÚSubagentStatusz�Lifecycle of one delegated child (``tools/delegate_tool_child_run.py``); ``failed`` /
``error`` / ``timeout`` / ``interrupted`` / ``completed`` are terminal.Úqueuedr_   Ú	completedÚfailedrJ   ÚtimeoutÚinterruptedr   N)r   r   r   r   r   r©   r_   rª   r«   rJ   r¬   r­   r   r   r   r   r¨   r¨   ½   s-   † ñOð €FØ€GØ€IØ€FØ€EØ€GØ„Kr   r¨   c                  ó¨   € ] tR t^Ð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# )ÚPendingApprovalzÃOne unresolved ``tools/approval.py`` gateway queue entry as ``server._approval_request_payload``
renders it (command redacted; ``choices`` precomputed). The key set is owned by the approval tool.Nr2   Ú
request_idÚcommandÚdescriptionÚpattern_keyrŒ   Úpattern_keysr4   Úallow_permanentÚallow_sessionÚsmart_deniedÚchoicesÚ	tool_namer   )r   r   r   r   r   r°   r"   r±   r²   r³   r´   rµ   r¶   r·   r¸   r¹   r   r   r   r   r¯   r¯   Ð   sp   ‡ ñjð "€J�
Ó!Ø€GˆZÓØ"€K�Ó"Ø"€K�Ó"Ø%)€LÐ"Ó)Ø#'€O�[Ó'Ø!%€M�;Ó%Ø $€L�+Ó$Ø $€GÐÓ$Ø €Iˆz× r   r¯   c                  óL   € ] tR t^àt$ RtR]R&   R]R&   RtR]R&   RtR]R	&   R
tR# )ÚMessageReactionzpOne persisted reaction row (``hermes_state_messages.set_message_reaction``); ``seen`` is
stamped once announced.r   r™   ÚauthorNr9   Úatr4   Úseenr   )	r   r   r   r   r   r"   r½   r¾   r   r   r   r   r»   r»   à   s'   ‡ ñð ƒJØƒKØ€BˆÓØ€Dˆ+×r   r»   c                  ó4   € ] tR t^êt$ RtR]R&   RtR]R&   RtR# )ÚSessionParamsz)Any method addressed at one live session.r   Ú
session_idNr2   Úprofiler   )r   r   r   r   r   r"   rÂ   r   r   r   r   rÀ   rÀ   ê   s   ‡ Ù3àƒOØ€GˆZ×r   rÀ   c                  ó*   € ] tR t^ñt$ RtRtR]R&   RtR# )ÚProfileParamszdAny method the desktop may route to a named profile (``requestGatewayForProfile`` adds ``profile``).Nr2   rÂ   r   )r   r   r   r   r   rÂ   r"   r   r   r   r   rÄ   rÄ   ñ   s   ‡ Ùnà€GˆZ×r   rÄ   c                  ó>   € ] tR t^÷t$ R]R&   ]! ^R7      tR]R&   RtR# )ÚSessionOwnerzLiteral['session']Útype)Ú
min_lengthr   rÁ   r   N)r   r   r   r   r"   r   rÁ   r   r   r   r   rÆ   rÆ   ÷   s   ‡ Ø
ÓÙ qÔ)€J�×)r   rÆ   c                  ó"   € ] tR t^üt$ R]R&   RtR# )ÚAccountOwnerzLiteral['account']rÇ   r   N©r   r   r   r   r"   r   r   r   r   rÊ   rÊ   ü   s   ‡ Ø
×r   rÊ   rÇ   )Údiscriminatorc                  ó&   € ] tR tRt$ RtR]R&   RtR# )ÚOkResulti  TrQ   Úokr   N)r   r   r   r   rÏ   r"   r   r   r   r   rÎ   rÎ     s   ‡ Ø€Bˆ‡Or   rÎ   c                  ó"   € ] tR tRt$ R]R&   RtR# )ÚStatusResulti  r   rH   r   NrË   r   r   r   rÑ   rÑ     s   ‡ Ø‡Kr   rÑ   c                  ó   € ] tR tRtRtR# )ÚEmptyResulti  r   N©r   r   r   r   r   r   r   r   rÓ   rÓ     ó   † Ûr   rÓ   c                  ó   € ] tR tRtRtR# )ÚEmptyPayloadi  r   NrÔ   r   r   r   r×   r×     rÕ   r   r×   c                  ód   € ] tR tRt$ RtR]R&   R]R&   R]R&   RtR	]R
&   RtR]R&   RtR]R&   Rt	R# )ÚPlanUsageGaugei  a  One server allowance on ``ModelOptionProvider.plan_usage``, in the server's order. ``label`` is the
server's id (``day`` / ``week`` / ``month`` / ``top_tier`` have client words; any other id shows
``title``). ``scope``: which models a full one stops (``all`` / ``top_tier``).r   r   ÚfloatÚleft_fractionÚstyleNr    r!   ÚallÚscoper%   ra   r   )
r   r   r   r   r   r"   r!   rÞ   ra   r   r   r   r   rÙ   rÙ     s7   ‡ ñVð ƒJØÓØƒJØ#€L�*Ó#Ø€Eˆ3ÓØ€Eˆ3‡Or   rÙ   c                  ó¤   € ] tR tRt$ RtR]R&   RtR]R&   ]! ]R7      t	R	]R
&   ]! ]R7      t
R]R&   ]! ]R7      tR]R&   RtR]R&   RtR]R&   RtR# )Ú	PlanUsagei   uZ   ``hermes_cli/model_picker_usage.py::PickerUsage.to_payload`` â€” usage-window plan chrome.r   r–   Nr2   ÚplanrV   zlist[PlanUsageGauge]Úgaugesz	list[str]Útop_tier_model_idsÚfeatured_model_idsÚpaused_reasonr4   Úcredits_payr   )r   r   r   r   r   r"   rá   r   rp   râ   rã   rä   rå   ræ   r   r   r   r   rà   rà      sZ   ‡ Ùdà
ƒIØ€Dˆ*ÓÙ#(¸Ô#>€FÐ Ó>á$)¸$Ô$?Ð˜	Ó?Ù$)¸$Ô$?Ð˜	Ó?Ø $€M�:Ó$ð  $€K�×#r   rà   N)ÚTERMINAL_SUBAGENT_STATUSESrÊ   ÚConnectorOwnerr×   rÓ   rG   r»   rÎ   r   r¯   rà   rÙ   rÄ   rB   rL   rÆ   rÀ   rÑ   rr   r¨   r•   r�   rœ   r$   ).r   Ú
__future__r   Útypingr   r   Úpydanticr   Úbaser   r   r   r	   r
   r   r   r$   rB   rG   rL   rr   r�   r•   rœ   r¨   Ú	frozensetrª   r«   rJ   r¬   r­   rç   r¯   r»   rÀ   rÄ   rÆ   rÊ   rè   rÎ   rÑ   rÓ   r×   rÙ   rà   Ú__all__r   r   r   Ú<module>rï      s‹  ðÙ ]å "ç %å ç >Õ >ô<�ô <ô$�ô $ô(ˆIô (ô:$�ô $ô�iô ô#�iô #ôL )�yô  )ôF�Hô ô�ô ô!˜	ô !ô*
 �Xô 
 ñ 'Ø×Ñ˜n×3Ñ3°^×5IÑ5IØ×Ñ˜N×6Ñ6ð(ó Ð ô!�iô !ô �iô ô�Fô ô�Fô ô*�6ô *ô
�6ô ð ˜<¨,Õ6¹ÈFÔ8SÐSÕT€ôˆvô ô�9ô ô	�&ô 	ô	�7ô 	ô
�Vô 
ô$�ô $ò‚r   