+
    „WÝjj5 ã                  ó*  € R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	H
t
 ^ RIHtHt ^ RIHtHtHt ]P$                  ! ]4      tRtRtRt/ R	R
bRRbRRbRRbRRbRRbRRbRRbR^ bRRbRRbRRbRRbRRbRRbR/ btRRRRR R!R"R#R$R%R&R'R(R)R*R+R,R/	t ! R- R.4      t ! R/ R04      t ! R1 R24      tR3 tR4 tR5 tR6 t R7 R8 lt!]PD                  ! 4       t#R9]PH                  R:]PJ                  R;]PL                  /t'/ R<]PP                  bR=]PR                  bR>]PT                  bR?]PV                  bR@]PX                  bRA]PZ                  bRB]P\                  bRC]P^                  bRD]P`                  bRE]Pb                  bRF]Pd                  bRG] ! RG4      bRH] ! RH4      bRI]Pf                  bRJ]Ph                  bRK]Pj                  bRL]Pl                  bRM]Pn                  RN]Pp                  RO]Pr                  RP]Pt                  RQ]Pv                  /Ct<R# )Rum  The AIAgent surface main's HermesCLI uses, backed by the shared gateway session (CALLMAP Â§3.2-3.3).

``run_conversation`` submits ``prompt.submit`` and replays the gateway's event stream, on the
calling (agent) thread, into the SAME callbacks HermesCLI passed to ``AIAgent`` on main, then
returns a dict shaped like ``AIAgent.run_conversation``'s. The CLI process never builds an agent,
never runs a tool and never writes ``state.db``: the turn runs in the gateway.

Event contract: wave_a.md (frozen). Every frame is a gateway ``event`` with params
``{type, session_id, execution_generation, admission_id?, payload}``.
)ÚannotationsN)Úsuppress)ÚGatewayClientErrorÚGatewayRPCError)ÚDISCONNECTEDÚCallStoppedÚlost_beforeg      $@gš™™™™™¹?Úvoice_stoppedÚfinal_responseÚ ÚfailedFÚpartialÚerrorÚfailure_reasonÚ	completedTÚinterruptedÚinterrupt_messageÚ	api_callsÚpending_steerÚlast_reasoningÚresponse_previewedÚresponse_transformedÚpre_transform_responseÚbilling_blockÚauxiliary_usageÚsession_input_tokensÚinput_tokensÚsession_output_tokensÚoutput_tokensÚsession_prompt_tokensÚprompt_tokensÚsession_completion_tokensÚcompletion_tokensÚsession_total_tokensÚtotal_tokensÚsession_cache_read_tokensÚcache_read_tokensÚsession_cache_write_tokensÚcache_write_tokensÚsession_reasoning_tokensÚreasoning_tokensÚsession_api_callsc                  ó    € ] tR t^3tRtR tRtR# )Ú_CompressorViewzS``agent.context_compressor`` as the status bar / banner read it (plain attributes).c                	óZ   € ^ V n         RV n        ^ V n        ^ V n        RV n        ^ V n        R# )é    N)Úlast_prompt_tokensÚlast_real_prompt_tokensÚcontext_lengthÚcompression_countÚ_config_context_lengthÚthreshold_tokens©Úselfs   &ÚLC:\Users\johnn\AppData\Local\hermes\hermes-agent\hermes_cli\gateway_agent.pyÚ__init__Ú_CompressorView.__init__6   s2   € Ø"#ˆÔØ'+ˆÔ$ØˆÔØ!"ˆÔØ&*ˆÔ#Ø !ˆÖó    )r4   r3   r2   r0   r1   r5   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r9   Ú__static_attributes__© r;   r8   r-   r-   3   s
   † Ù]ö"r;   r-   c                  óF   € ] tR t^?tRtR t]R 4       t]R 4       tR t	Rt
R# )Ú_TurnzâOne ``run_conversation``; what each consumer got of the reply's current segment (``shown``: the
terminal, ``spoken``: ``stream_callback``) and the closed segments and interims (``seen``), for the
settlement after a replay gap.c                	óŽ   € VR uV n         V n        . . uV n        V n        \	        4       \	        4       RuV n        V n        V n        R # )NF)Ú
session_idÚ	admissionÚ_shownÚ_spokenÚsetÚseenÚansweredÚgapped)r7   rF   s   &&r8   r9   Ú_Turn.__init__D   s<   € Ø*4°dÐ'ˆŒ˜œà$&¨Ð!ˆŒ�T”\Ü03³´s³u¸eÐ-ˆŒ	�4”= $¦+r;   c                	ó8   € R P                  V P                  4      # ©r   )ÚjoinrH   r6   s   &r8   ÚshownÚ_Turn.shownJ   s   € à�w‰w�t—{‘{Ó#Ð#r;   c                	ó8   € R P                  V P                  4      # rP   )rQ   rI   r6   s   &r8   ÚspokenÚ_Turn.spokenN   s   € à�w‰w�t—|‘|Ó$Ð$r;   c                	óº   € V ;P                   V P                  P                  4       V P                  P                  4       0,          un         . . uV n        V n        R # ©N)rK   rR   ÚstriprU   rH   rI   r6   s   &r8   Úclose_segmentÚ_Turn.close_segmentR   s?   € Ø�	Š	�d—j‘j×&Ñ&Ó(¨$¯+©+×*;Ñ*;Ó*=Ð>Õ>�	Ø$&¨Ð!ˆŒ�T–\r;   )rH   rI   rG   rL   rM   rK   rF   N)r<   r=   r>   r?   r@   r9   ÚpropertyrR   rU   rZ   rA   rB   r;   r8   rD   rD   ?   s:   † ñ&òDð ñ$ó ð$ð ñ%ó ð%ö+r;   rD   c            @      ó@  € ] tR t^WtRtRtRtRRRRRRRRR	RR
RR^ZRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR R!R"RR#RR$R!R%RR&R'/ R( lt]R) 4       t	]	P                  R* 4       t	]R+ 4       t]P                  R, 4       tR- tR. tR/ tR0 tR“R1 ltR”R2R!R3R!R4R'/R5 llt]R6 4       t]P                  R7 4       t]R8 4       t]P                  R9 4       t]R: 4       t]P                  R; 4       t]R< 4       t]P                  R= 4       tR> tR? t]R@ 4       t]RA 4       tRB tRC tRD tRE tRF tRG tRH t RI t!RJ t"RK t#RL t$RM t%RN t&RO t'R•RP lt(R–RQ lt)RR t*R•RSRRTRRURRVR/RW llt+RX t,RY t-RZ t.R[ t/R\ t0R] t1R—R^ lt2R_ t3R` t4Ra t5Rb t6Rc t7Rd t8Re t9Rf t:Rg t;Rh t<R˜Ri lt=Rj t>Rk t?Rl t@Rm tARn tBRo tCRp tDRq tERr tFRs tGRt tHRu tIRv tJRw tKRx tLRy tMRz tNR{ tOR| tPR} tQR~ tRR tSR€ tTR� tUR‚ tVRƒ tWR„ tXR… tYR† tZR‡ t[Rˆ t\R‰ t]RŠRR‹R!/RŒ lt^R� t_RŽ t`R� taR•R� ltbR‘ tcR’tdR# )™ÚGatewayAgentzVGateway-backed stand-in for ``run_agent.AIAgent`` (constructed at the same call site).ÚcliTÚ
session_dbNrF   ÚmodelÚproviderÚbase_urlÚapi_modeÚmax_iterationsÚ
quiet_modeÚtool_progress_modeÚallÚreasoning_configÚservice_tierÚclarify_callbackÚconnection_callbackÚconnection_update_callbackÚreasoning_callbackÚthinking_callbackÚtool_progress_callbackÚtool_start_callbackÚtool_complete_callbackÚstream_delta_callbackÚtool_gen_callbackÚnotice_callbackÚnotice_clear_callbackÚreaction_callbackÚinterim_assistant_callbackÚ
connectionÚpush_reasoningFÚmodel_confirm_callbackÚmodal_withdraw_callbackÚone_turnÚone_turn_reasoningÚone_turn_aliasr   c                	ó�  € T;'       g    \        VR R4      p"V"f   \        R4      hV"V n        Wn        W n        T;'       g    RV n        T;'       g    RV n        T;'       g    RT n        W`n        RV n	        Wpn
        W€n        RV n        WÀn        WÐn        Wàn        RV n        RV n        VV n        VV n        VV n        VV n        VV n        VV n        VV n        VV n        VV n        VV n        VV n        VV n        RV n        RV n        RV n         RV n!        ^ V n"        . V n#        RV n$        R;V n%        V n&        RV n'        RV n(        RV n)        RV n*        RV n+        RV n,        RV n-        RV n.        RV n/        RV n0        . V n1        RV n2        RV n3        R;V n4        ;V n5        V n6        RV n7        RV n8        RV n9        \u        4       V n;        V Py                  4        ^ RI=H>p# V#! 4       V n?        RV n@        RV nA        RV nB        RV nC        RV nD        RV nE        RV nF        RV nG        RV nH        W�nI        RV nJ        RV nK        V'       d   V P™                  V
4      V nK        MW nJ        VR8X  d   TMRV nM        V'       d   V P�                  W4V 4      MRV nO        RV nP        V'       d   TMRV nQ        V P¥                  V P§                  4       P¨                  4       V Pž                  '       d@   W0n        V Pž                  P«                  R	4      '       d   V Pž                  R	,          V n        WðnV        W°nW        V P§                  4       p$V$P°                  P³                  V P´                  4       V$P¶                  P³                  V P¸                  4       V$Pº                  '       d   V Pµ                  V$Pº                  4       R# R# )
ry   Nz.Gateway session unavailable; no local fallbackr   FT)Ú	TodoStorerh   Úmoarb   )^Úgetattrr   ry   Ú_session_dbrF   ra   rb   rc   rd   Úapi_keyre   rf   Ú_service_tierrk   rl   rm   Ú_reasoning_callbackÚ_show_reasoning_sentro   rp   rq   rr   rs   rt   ru   rv   rw   rx   r{   r|   Ú_open_requestÚcontrol_update_callbackÚsuppress_status_outputÚ	_print_fnÚ_last_flushed_db_idxÚ_session_messagesÚ_db_flush_scan_prefixÚ_persist_user_message_idxÚ_persist_user_message_overrideÚ_persist_user_message_timestampÚ_pending_cli_user_messageÚ_voice_turn_pendingÚ_auto_load_skills_resultÚ_auto_load_skills_resolvedÚ_session_db_createdÚ_fallback_activatedÚ_rate_limited_untilÚ_primary_runtimeÚ_interrupt_requestedÚ_active_childrenÚ_turn_ask_indexÚ_usage_staleÚ_current_task_idÚ_current_turn_idÚ_current_api_request_idÚ_memory_managerÚ_memory_storeÚ_checkpoint_mgrr-   Úcontext_compressorÚ_reset_session_figuresÚtools.todo_toolr�   Ú_todo_storeÚcompression_summaryÚ_generationÚ
_admissionÚ_turnÚ_epochÚ_interrupt_sent_atÚ_rate_limit_stater4   Ú_tool_progress_moderg   Ú_reasoning_configÚreasoning_pushedÚpin_reasoningÚ_moa_presetÚ_route_off_sessionÚ_turn_routeÚ_taken_turn_routeÚ_turn_reasoningÚ_apply_infoÚ_stateÚinfoÚgetrn   rj   Úusage_listenersÚappendÚapply_session_usageÚrequest_listenersÚ_on_request_withdrawnÚusage)%r7   r`   rF   ra   rb   rc   rd   re   rf   rg   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r}   r~   r   Ú_ignoredÚconnr�   Ústates%   &$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$,   r8   r9   ÚGatewayAgent.__init__]   s‘  € ð ×DÐDœW Z°¸tÓDˆØŠ<Ü$Ð%UÓVÐVØˆŒØ%ÔØ$ŒØ—[�[˜bˆŒ
Ø Ÿ˜ BˆŒØ Ÿ˜ BˆŒØ ŒØˆŒØ,ÔØ$ŒØ!ˆÔØ 0Ôð $7Ô Ø*DÔ'Ø#'ˆÔ Ø$(ˆÔ!Ø!2ˆÔØ&<ˆÔ#Ø#6ˆÔ Ø&<ˆÔ#Ø%:ˆÔ"Ø!2ˆÔØ.ˆÔØ%:ˆÔ"Ø!2ˆÔØ*DˆÔ'à&<ˆÔ#ð (?ˆÔ$Ø!ˆÔð (,ˆÔ$Ø&+ˆÔ#ØˆŒà$%ˆÔ!Ø')ˆÔØ%)ˆÔ"ØOSÐSˆÔ&¨Ô)LØ/3ˆÔ,Ø)-ˆÔ&Ø#(ˆÔ Ø(,ˆÔ%Ø*/ˆÔ'Ø#'ˆÔ Ø#(ˆÔ Ø#'ˆÔ Ø $ˆÔØ$)ˆÔ!Ø&(ˆÔØ#ˆÔØ!ˆÔØWYÐYˆÔÐY Ô 5¸Ô8TØ#ˆÔØ!ˆÔØ#ˆÔÜ"1Ó"3ˆÔØ×#Ñ#Ô%õ 	.Ù$›;ˆÔà#'ˆÔ ØˆÔØˆŒØˆŒ
ØˆŒØ"&ˆÔØ!%ˆÔØ&*ˆÔ#ð $)ˆÔ Ø"4ÔØ!%ˆÔð !&ˆÔßØ$(×$6Ñ$6Ð7GÓ$HˆDÕ!à%5Ô"ð %-°Ô$5™5¸4ˆÔ÷ X`˜4×2Ñ2°5ÀNÔSÐeiˆÔØ!%ˆÔç5=Ñ1À4ˆÔØ×Ñ˜Ÿ™›×+Ñ+Ô,Ø××ÐØŒJØ×Ñ×#Ñ# J×/Ò/Ø $× 0Ñ 0°Õ <�”Ø"4ÔØ(ÔØ—‘“ˆØ×Ñ×$Ñ$ T×%=Ñ%=Ô>Ø×Ñ×&Ñ& t×'AÑ'AÔBØ�;�;ˆ;Ø×$Ñ$ U§[¡[Ö1ñ r;   c                	ó   € V P                   # rX   )r°   r6   s   &r8   rg   ÚGatewayAgent.tool_progress_modeÛ   ó   € à×'Ñ'Ð'r;   c                ó  € WP                   8X  g   VR9  d	   Wn         R# Wn          V P                  P                  RV P                  RVR7       R#   \         d"   p\
        P                  RT4        Rp?R# Rp?ii ; i)z‡``/verbose`` / ``/focus``: ``config.set verbose`` with the explicit mode (never ``cycle``, which
could drift from the CLI's own cycle).ÚverboseNú
config.set)rF   ÚkeyÚvaluezconfig.set verbose failed: %s>   rh   ÚnewÚoffrË   )r°   ry   ÚcallrF   r   ÚloggerÚdebug)r7   ÚmodeÚexcs   && r8   rg   rÈ   ß   sn   € ð ×+Ñ+Ô+¨tÐ;[Ô/[Ø'+Ô$ÙØ#'Ô ð	?Ø�O‰O× Ñ  ¸$¿/¹/ÈyÐ`dÐ ÖeøÜ!ô 	?Ü�L‰LÐ8¸#×>Ò>ûð	?ús   §)A ÁA>ÁA9Á9A>c                	ó   € V P                   # rX   )r±   r6   s   &r8   ri   ÚGatewayAgent.reasoning_configì   s   € à×%Ñ%Ð%r;   c                ó,   € V P                  VRR7       R# )z�/new's re-derived effort and a one-turn restore: ``session.mutate reasoning`` when it differs from
the session's effort (an inherited level stays inherited).F©ÚexplicitN©Ú_set_reasoning©r7   Úconfigs   &&r8   ri   r×   ð   s   € ð 	×Ñ˜F¨UÐÖ3r;   c                ó(   € V P                  VRR7      # )a$  ``/reasoning <level>`` (session scope; main rebuilds its agent with the new config) and a model
pick's ``--reasoning``: always ``session.mutate reasoning``, even when the session already runs that
level by inheritance, so it becomes the session's own choice. True when the owner committed it.TrÙ   rÛ   rÝ   s   &&r8   r³   ÚGatewayAgent.pin_reasoningö   s   € ð ×"Ñ" 6°DÐ"Ó9Ð9r;   c                ó2   € Wn         \        V4      V n        R# )z~``/model B --once --reasoning X``: X for the one-turn admission only (its ``model_override``).
Nothing is sent to the session.N)r±   Ú_effort_wordr¸   rÝ   s   &&r8   Ústage_turn_reasoningÚ!GatewayAgent.stage_turn_reasoningü   s   € ð "(ÔÜ+¨FÓ3ˆÖr;   c                ó    € Wn         RV n        R# )z[A one-turn restore: the level goes back on this object only. The session was never written.N)r±   r¸   rÝ   s   &&r8   Úrestore_reasoningÚGatewayAgent.restore_reasoning  s   € à!'ÔØ#ˆÖr;   c          
     	ó:  € Wn         \        V4      pVf   R# V P                  4       P                  ;'       g    / pV'       g   VP	                  R4      V8X  d   R#  V P
                  P                  RV P                  R7      pV P
                  P                  RV P                  \        P                  ! 4       P                  VR,          VR,          R	R
V/R7       W4R&   R#   \        \        \        3 d"   p\        P                  RT4        R p?R# R p?ii ; i)NFÚreasoning_effortTúsession.resume©rF   úsession.mutateÚrevisionÚexecution_generationÚ	reasoningÚeffort)rF   Ú
request_idÚexpected_revisionÚexpected_generationÚ	operationÚpayloadz#session.mutate reasoning failed: %s)r±   râ   rº   r»   r¼   ry   rÑ   rF   ÚuuidÚuuid4Úhexr   ÚKeyErrorÚ	TypeErrorrÒ   rÓ   )r7   rÞ   rÚ   rð   r»   ÚsnapshotrÕ   s   &&$    r8   rÜ   ÚGatewayAgent._set_reasoning  sò   € Ø!'ÔÜ˜fÓ%ˆØŠ>ÙØ�{‰{‹}×!Ñ!×'Ð' Rˆß˜DŸH™HÐ%7Ó8¸FÔBÙð	Ø—‘×+Ñ+Ð,<ÈÏÉÐ+ÓYˆHà�O‰O× Ñ Ð!1¸d¿o¹oÔZ^×ZdÒZdÓZf×ZjÑZjØ3;¸JÕ3GØ5=Ð>TÕ5UÐalØ*2°FÐ);ð !ô =ð (.Ð#Ñ$ÙøÜ"¤H¬iÐ8ô 	Ü�L‰LÐ>ÀÔDÝûð	ús   ÁBC# Ã#DÃ9DÄDc                ó  € V P                  4       pV'       dK   VP                  ;'       g    / P                  R4      '       d    VP                  W4      '       d   V'       g   R# RT;'       g    T/V'       d   RV/C# / C# )aW  ``{model, provider}`` the turn sends when the session runs another route, else None.

``alias``, the ``model_aliases`` entry the pick resolved through, is sent instead of the bare
model: two aliases may name one model at different endpoints, so the owner must not re-resolve
it. An alias makes even the session's own model a one-turn override.ra   Nrb   )rº   r»   r¼   Ú
runs_route)r7   ra   rb   ÚaliasrÅ   s   &&&& r8   rµ   ÚGatewayAgent._route_off_session  sk   € ð —‘“ˆß˜UŸZ™Z×-Ð-¨2×2Ñ2°7×;Ò;À×@PÑ@PÐQV×@aÒ@a×joÙØ˜Ÿ˜ %ÐXÇh¨Z¸Ð,BÐXÐXÐTVÐXÐXr;   ÚonceÚrestorerÿ   c          
     óD  € V'       g	   V'       dO   V'       d   RMV P                  WV	4      V n        V'       d   RV n        V'       d   Wn        V'       d   W n        R# WP                  8X  d5   V'       d   W P                  8X  d   V P                  W4      f
   RV n        R# ^ RIHp
 RV/V'       d   RV/M/ CpV P                  P                  RV P                  R7      p\        V P                  RVR,          VR	,          R
7      pV P                  P                  ! RR\        P                  ! 4       P                  RV/VB ;'       g    / pVP                  R4      R8X  d¶   V P                  f   \!        V
! V4      4      hV P                  V4      '       g   R# V P                  P                  ! RR\        P                  ! 4       P                  R/ VCRVR,          /C/VB ;'       g    / pVP                  R4      R8X  d   \!        V
! VRR7      4      hV P#                  4       p VP%                  V P                  P                  RV P                  R7      4       VP                  R4      ;'       g    Tp/ VP.                  ;'       g    / CRVP                  R4      ;'       g    T/CV'       d   RV/M/ CVn        RV n        V P1                  VP.                  4       R#   \         \&        \(        3 d!   p\*        P-                  RT4        Rp?L¸Rp?ii ; i)aq  Session-scoped ``/model`` and /resume commit ``session.mutate model``.

``once=True`` does not write the session. The next ``chat`` builds a new agent; that
constructor carries the pick, because this agent is retired when the route signature
changes. ``restore=True`` only puts the previous model back on this object and clears the
one-turn route. The admission already has its ``model_override``.

"Already on this route" is the session row, not ``self.model`` (a one-turn pick sets
``self.model`` without committing). A session switch of that same target still mutates
on the generation fence.

A guarded target the owner refuses with ``confirmation_required`` is re-sent with its token
only on the user's yes to ``model_confirm_callback``: a no returns False with nothing
written; with no prompt the refusal raises. Any refusal raises: main's callers roll their
own fields back.NT)Úmodel_refusal_textra   rb   rê   rë   rí   rî   )rF   rô   rò   ró   rñ   rõ   ÚstatusÚconfirmation_requiredFÚconfirm)Ú	confirmedz:session.resume after the committed model switch failed: %s)rì   )rµ   r¶   r¸   ra   rb   Úhermes_cli.gateway_mutationsr  ry   rÑ   rF   Údictrö   r÷   rø   r¼   r{   r   rº   Úadopt_snapshotrù   rú   rÒ   Úwarningr»   r¹   )r7   Ú	new_modelÚnew_providerr…   rc   rd   Úcapabilitiesr  r  rÿ   r  rõ   rû   ÚfenceÚresultrÅ   rÕ   rb   s   &&&&&&&$$$        r8   Úswitch_modelÚGatewayAgent.switch_model'  s»  € ÷" —7ç'.™t°D×4KÑ4KÈIÐejÓ4kˆDÔßØ'+�Ô$ßØ&”
ßØ ,”ÙØŸ
™
Ô"¯L¸LÏMÉMÔ<YØ×&Ñ& yÓ?ÒGØ#'�Ô ÙÝCØ˜IÐ^Ï¨:°|Ñ*DÐZ\Ð^ˆØ—?‘?×'Ñ'Ð(8ÀTÇ_Á_Ð'ÓUˆÜ §¡¸7ÐV^Ð_iÕVjØ)1Ð2HÕ)IôKˆà—‘×%Ò%ÑnÄ4Ç:Â:Ã<×CSÑCSÐnÐ]dÐnÐhmÑn×tÐtÐrtˆØ�:‰:�hÓÐ#:Ô:Ø×*Ñ*Ò2Ü(Ñ);¸FÓ)CÓDÐDØ×.Ñ.¨v×6Ò6Ùà—_‘_×)Ò)ñ fÄtÇzÂzÃ|×GWÑGWð fØ2[°WÐ2[¸iÈÐPYÕIZÑ2[ðfØ_dñf÷ lð lØikð à�z‰z˜(Ó#Ð'>Ô>Ü(Ñ);¸FÈdÔ)SÓTÐTØ—‘“ˆð	^Ø× Ñ  §¡×!5Ñ!5Ð6FÐSW×SbÑSbÐ!5Ó!cÔdð
 —:‘:˜jÓ)×9Ð9¨\ˆðF˜Ÿ™×)Ð) rð F¨G°V·Z±ZÀÓ5H×5UÐ5UÈIñ Fß3;˜* hÑ/ÀðFˆŒ
ð  ˆÔØ×Ñ˜Ÿ™Ô$Ùøô #¤H¬iÐ8ô 	^ä�N‰NÐWÐY\×]Ñ]ûð	^ús   È,6K) Ë)LË?LÌLc                	ó   € V P                   # rX   )Ú_todosr6   s   &r8   r¨   ÚGatewayAgent._todo_storef  s   € à�{‰{Ðr;   c                ó|   € Wn         V P                  4       P                  pV'       d   V P                  V4       R# R# )zíMain swaps in a fresh ``TodoStore`` after /new, /resume and /branch move ``session_id`` (and the
constructor builds one): it starts with the gateway's snapshot of that session, so a resumed
plan is there before its next ``todo.updated``.N)r  rº   Ú
todo_stateÚ
_set_todos)r7   Ústorerû   s   && r8   r¨   r  j  s.   € ð
 ŒØ—;‘;“=×+Ñ+ˆßØ�O‰O˜HÖ%ñ r;   c                	ó   € V P                   # rX   )Ú_session_idr6   s   &r8   rF   ÚGatewayAgent.session_idt  s   € à×ÑÐr;   c                ó  € \        V RR4      pWn        Ve   W8X  g	   V'       g   R# V P                  P                  V4      p\	        \
        4      ;_uu_ 4        VP                  P                  V P                  4       RRR4       \	        \
        4      ;_uu_ 4        VP                  P                  V P                  4       RRR4       V P                  pVe&   \        VR4      '       d    VP                  V4       M V P                  P#                  RVR7       V P%                  4       pV P                  VP                  9  d&   VP                  P'                  V P                  4       V P                  VP                  9  d&   VP                  P'                  V P                  4       V P)                  VP*                  4       VP,                  '       d   V P                  VP,                  4       R# R#   + '       g   i     EL…; i  + '       g   i     ELT; i  \         d"   p\        P!                  RY4        Rp?EL+Rp?ii ; i  \         d"   p\        P!                  RY4        Rp?ELZRp?ii ; i)z™Main repoints ``agent.session_id`` on /new, /resume and /branch: attach this viewer to that
gateway session (idempotent) and read its state from then on.r  NÚattachzsession.resume %s failed: %srê   rë   )rƒ   r  ry   rÅ   r   Ú
ValueErrorr½   Úremover¿   rÀ   rÁ   r„   Úhasattrr  r   rÒ   rÓ   rÑ   rº   r¾   r¹   r»   rÂ   )r7   rÎ   ÚpreviousÚleftr  rÕ   rÅ   s   &&     r8   rF   r  x  sØ  € ô ˜4 °Ó5ˆØ ÔØÒ˜uÔ0¿Ùà�‰×$Ñ$ XÓ.ˆÜ”j×!Õ!Ø× Ñ ×'Ñ'¨×(@Ñ(@ÔA÷ "ä”j×!Õ!Ø×"Ñ"×)Ñ)¨$×*DÑ*DÔE÷ "à× Ñ ˆØÒ¤¨°×!9Ò!9ðIØ—‘˜UÕ#ðIØ—‘×$Ñ$Ð%5À%Ð$ÔHð —‘“ˆØ×#Ñ#¨5×+@Ñ+@Ô@Ø×!Ñ!×(Ñ(¨×)AÑ)AÔBØ×%Ñ%¨U×-DÑ-DÔDØ×#Ñ#×*Ñ*¨4×+EÑ+EÔFØ×Ñ˜Ÿ™Ô$Ø�;�;ˆ;Ø×$Ñ$ U§[¡[Ö1ñ ÷+ "×!Ð!úç!×!Ð!ûô &ô IÜ—‘Ð;¸U×HÒHûðIûô
 &ô IÜ—‘Ð;¸U×HÒHûðIúsH   Á&G<Â&HÃ0H$ ÄI Ç<H	ÈH!	È$IÈ/IÉIÉI?ÉI:É:I?c                	ó   € V P                   # rX   )r‡   r6   s   &r8   rn   ÚGatewayAgent.reasoning_callback›  rÉ   r;   c                ó8  € Wn         V P                  VRJ3pW P                  8X  d   R#  V P                  P	                  RV P                  RV^,          '       d   RMR^
R7       Y n        R#   \
         d"   p\        P                  RT4        Rp?R# Rp?ii ; i)a  Main installs a reasoning sink at construction and on ``/reasoning show|hide`` / verbose; the
sink's presence is what makes the agent ask the provider for reasoning. The gateway agent
gets the same switch: the session's ``show_reasoning`` display flag, sent on each change.NrÌ   Úshow_reasoningÚ1Ú0©rF   rÍ   rÎ   Útimeoutz$config.set show_reasoning failed: %s)r‡   rF   rˆ   ry   rÑ   r   rÒ   rÓ   )r7   ÚcallbackÚwantedrÕ   s   &&  r8   rn   r&  Ÿ  s�   € ð
 $,Ô Ø—/‘/ 8°4Ð#7Ð8ˆØ×.Ñ.Ô.Ùð	Ø�O‰O× Ñ  ¸$¿/¹/ÐO_Ø.4°Q¯i¬i¡s¸SÈ"ð !ô Nð
 %+Ö!øô "ô 	Ü�L‰LÐ?ÀÔEÝûð	ús   ª0A- Á
A- Á-BÁ8BÂBc                	ó   € V P                   # rX   )r†   r6   s   &r8   rj   ÚGatewayAgent.service_tier°  s   € à×!Ñ!Ð!r;   c                óL  € Wn         V P                  4       pT;'       g    Rp\        VRR4      pW48X  g   Vf   V'       g   R#  V P                  P	                  RV P
                  RV^
R7       Y2n	        R#   \         d"   p\        P                  RT4        Rp?R# Rp?ii ; i)a  Main rebuilds AIAgent(service_tier=...) after ``/fast``; the gateway agent gets the same tier
as the session's override (``config.set service_tier``), sent when it differs from the last
one sent for this session. The session's own default (None at first build) is left alone.ÚnormalÚservice_tier_sentNrÌ   rj   r+  z"config.set service_tier failed: %s)
r†   rº   rƒ   ry   rÑ   rF   r   rÒ   rÓ   r3  )r7   ÚtierrÅ   r.  ÚsentrÕ   s   &&    r8   rj   r0  ´  s–   € ð
 "Ôà—‘“ˆØ×!Ð!˜ˆÜ�uÐ1°4Ó8ˆØŒ>˜dšl·4Ùð	Ø�O‰O× Ñ  ¸$¿/¹/È~Ø'-°rð !ô ;ð
 #)Öøô "ô 	Ü�L‰LÐ=¸sÔCÝûð	ús   Á*A7 Á7B#ÂBÂB#c                	óL   € V P                   P                  V P                  4      # rX   )ry   rÅ   rF   r6   s   &r8   rº   ÚGatewayAgent._stateÉ  s   € Ø�‰×$Ñ$ T§_¡_Ó5Ð5r;   c                	ó&  € T;'       g    / pVP                  R 4      '       d   VR ,          V n        VP                  R4      '       d   VR,          V n        VP                  R4      '       d$   \        VR,          4      V P                  n        R# R# )ra   rb   r2   N)r¼   ra   rb   Úintr¥   r2   )r7   r»   s   &&r8   r¹   ÚGatewayAgent._apply_infoÌ  sp   € Ø�zˆz�rˆØ�8‰8�G×ÒØ˜g�ˆDŒJØ�8‰8�J×ÒØ  Õ,ˆDŒMØ�8‰8Ð$×%Ò%Ü58¸Ð>NÕ9OÓ5PˆD×#Ñ#Ö2ñ &r;   c                ó&  € V P                  4       P                  ;'       g    / P                  R4      ;'       g    / pVP                  4        UUu. uF  q";'       g    .  F  q3NK  	  K  	  pppV Uu. uF  pRRRRV//NK  	  up# u uppi u upi )zOTool schemas the gateway session will load (``info.tools`` {toolset: [names]}).ÚtoolsÚtypeÚfunctionÚname)rº   r»   r¼   Úvalues)r7   ÚgroupsÚmembersr?  Únamess   &    r8   r<  ÚGatewayAgent.toolsÕ  sƒ   € ð —+‘+“-×$Ñ$×*Ð*¨×/Ñ/°Ó8×>Ð>¸BˆØ%+§]¡]¤_ÔQ¡_˜'Ç-À-ÈRÂ-¸’Á-‘¡_ˆÑQÙMRÓSÉUÀT�˜ Z°&¸$°Ó@ÉUÑSÐSùó RùÚSs   ÁBÁBÁ4Bc                	ó^   € V P                    Uu0 uF  qR ,          R,          kK  	  up# u upi )r>  r?  )r<  )r7   Útools   & r8   Úvalid_tool_namesÚGatewayAgent.valid_tool_namesÜ  s)   € à59·Z²ZÓ@±Z¨T�ZÕ  ×(Ð(±ZÑ@Ð@ùÒ@s   �*c                	ó   € V P                   # rX   )r¯   r6   s   &r8   Úget_rate_limit_stateÚ!GatewayAgent.get_rate_limit_stateà  s   € Ø×%Ñ%Ð%r;   c                óÀ  € \        V\        4      '       g   R# \        P                  4        FR  w  r#VP	                  V4      p\        V\
        4      '       g   K.  \        V\        4      '       d   KF  \        WV4       KT  	  V P                  p\        VP	                  R4      \
        4      '       d   VR,          Vn	        VP	                  R4      '       d   \        VR,          4      Vn
        RV9   d8   VP	                  R4      p\        V\
        4      '       d   TMR;Vn        V n        \        VP	                  R4      \
        4      '       d   VR,          Vn        VP	                  R4      pVe"   VR8X  d   RMVP                  ^,           Vn        \        VP	                  R4      \
        4      '       d   VR,          V n        V P                  4        VP	                  R	4      VP	                  R
4      r˜\        V\
        \         34      '       dV   V^ 8”  dO   \        V	\
        \         34      '       d3   \!        V4      .V n        \!        V	4      \!        V4      ,          .V n        RV9   d    \'        VP	                  R4      4      V n        VP	                  R4      '       d   VR,          V n        VP	                  R4      '       d   VR,          V n        R# R# )z³Install one session-cumulative usage dict (the ``session.usage`` event / ``session.stats``
result) on main's attributes. Plain assignments: the render thread reads them lock-free.Nr0   r2   Úconfig_context_lengthr3   Úcontext_sourceÚprovider_usageÚcontext_tokensÚavg_latency_sÚtokens_per_sÚ
rate_limitra   rb   )Ú
isinstancer
  Ú_COUNTER_FROM_USAGEÚitemsr¼   r9  ÚboolÚsetattrr¥   r0   r2   r4   r3   r1   Ú_context_tokensÚ_anchor_displayÚfloatÚ_api_latency_historyÚ_api_output_historyr¯   ra   rb   )
r7   rÂ   ÚattrrÍ   rÎ   Ú
compressorÚpinÚsourceÚlatencyÚtpss
   &&        r8   r¿   Ú GatewayAgent.apply_session_usageã  s6  € ô ˜%¤×&Ò&ÙÜ,×2Ñ2Ö4‰IˆDØ—I‘I˜c“NˆEÜ˜%¤×%Ô%¬j¸Ä×.EÔ.EÜ˜ EÖ*ñ 5ð ×,Ñ,ˆ
Ü�e—i‘iÐ 4Ó5´s×;Ò;Ø,1Ð2FÕ,GˆJÔ)Ø�9‰9Ð%×&Ò&Ü(+¨EÐ2BÕ,CÓ(DˆJÔ%Ø" eÔ+Ø—)‘)Ð3Ó4ˆCÜU_Ð`cÔeh×UiÒUiÉcÐosÐsˆJÔ-°Ô0KÜ�e—i‘iÐ 3Ó4´c×:Ò:Ø+0Ð1DÕ+EˆJÔ(Ø—‘Ð+Ó,ˆØÒð Ð"2Ô2‘¸
×8UÑ8UÐXYÕ8Yð Ô.ä�e—i‘iÐ 0Ó1´3×7Ò7Ø#(Ð)9Õ#:ˆDÔ Ø× Ñ Ô"Ø—y‘y Ó1°5·9±9¸^Ó3L�Ü�g¤¤U˜|×,Ò,°¸1´ÄÈCÔRUÔW\ÐQ]×A^ÒA^ä).¨w«Ð(8ˆDÔ%Ü(-¨c«
´U¸7³^Õ(CÐ'DˆDÔ$Ø˜5Ô Ü%6°u·y±yÀÓ7NÓ%OˆDÔ"Ø�9‰9�W×ÒØ˜w�ˆDŒJØ�9‰9�Z× Ò Ø! *Õ-ˆDŽMñ !r;   c                	ó   € R # rX   rB   ©r7   ÚaÚks   &*,r8   Ú_flush_messages_to_session_dbÚ*GatewayAgent._flush_messages_to_session_db  ó   € Ùr;   c                	ó   € R # rX   rB   rf  s   &*,r8   Ú_persist_sessionÚGatewayAgent._persist_session  rk  r;   c                	ó   € R # rX   rB   rf  s   &*,r8   Ú_ensure_db_sessionÚGatewayAgent._ensure_db_session  rk  r;   c                	ó   € R # rX   rB   rf  s   &*,r8   Ú_invalidate_system_promptÚ&GatewayAgent._invalidate_system_prompt  rk  r;   c                óÒ   € \          F  p\        W^ 4       K  	  V P                  p^ R^ uVn        Vn        Vn        ^ ;V n        V n        R;V n        V n	        . . uV n
        V n        R# )zXZero the per-session figures main's bar, spinner and /usage read (context length stays).N)rU  rX  r¥   r0   r1   r3   rY  Ú_turn_calls_baseÚ_turn_base_usage_anchorÚ_turn_api_callsr\  r]  )r7   r^  r_  s   &  r8   r¦   Ú#GatewayAgent._reset_session_figures  sn   € ç'ˆDÜ�D Ö"ñ (à×,Ñ,ˆ
ØjkÐmqÐstÐgˆ
Ô% zÔ'IÈ:ÔKgØ78Ð8ˆÔ˜tÔ4Ø>BÐBˆÔ$ tÔ';Ø>@À"Ð;ˆÔ! 4Ö#;r;   c                ó   € V P                  4        V P                  4       pVP                  '       g   VP                  '       g   R# V P	                  4       '       g2   VP                  '       d   V P                  VP                  4       R# R# R# )a0  /new, /resume and /branch, after the ``session_id`` switch: drop the previous session's
figures, then show the gateway's for this one (``session.stats``, else its cached
``session.usage``). A brand-new session (no transcript, no usage yet) reads zero until its
first turn publishes, without a round trip.N)r¦   rº   ÚmessagesrÂ   Ú_refresh_statsr¿   )r7   rg  rh  rÅ   s   &*, r8   Úreset_session_stateÚ GatewayAgent.reset_session_state!  s`   € ð
 	×#Ñ#Ô%Ø—‘“ˆØ——� %§+§+ +ÙØ×"Ñ"×$Ò$¨¯¯¨Ø×$Ñ$ U§[¡[Ö1ñ *5Ñ$r;   c                	ó   € R # rX   rB   rf  s   &*,r8   Úrelease_clientsÚGatewayAgent.release_clients-  rk  r;   c                	ó   € R V n         R# )FN)r›   rf  s   &*,r8   Úclear_interruptÚGatewayAgent.clear_interrupt0  s
   € Ø$)ˆÖ!r;   c                	ó   € R # rX   rB   rf  s   &*,r8   Úshutdown_memory_providerÚ%GatewayAgent.shutdown_memory_provider3  rk  r;   c                	ó   € R # rX   rB   rf  s   &*,r8   ÚcloseÚGatewayAgent.close6  rk  r;   c                	ó   € R # rX   rB   rf  s   &*,r8   Ú_restore_primary_runtimeÚ%GatewayAgent._restore_primary_runtime9  rk  r;   c                	ó&   € \        V4      R ,          # ):Ni,  N)Ústr)r7   rÕ   s   &&r8   Ú_summarize_api_errorÚ!GatewayAgent._summarize_api_error<  s   € Ü�3‹x˜�~Ðr;   c                ój  € RV n         V P                  f   \        P                  ! 4       V n        V P                  pVf   V P                  4       P                  p V P                  P                  RV P                  V^R7       R#   \         d"   p\        P                  RT4        Rp?R# Rp?ii ; i)zy``session.interrupt`` for the running generation; ``message`` stays CLI-side (main
re-queues it as the next turn itself).TNzsession.interrupt)rF   rî   r,  zsession.interrupt failed: %s)r›   r®   ÚtimeÚ	monotonicrª   rº   rî   ry   rÑ   rF   Ú	ExceptionrÒ   rÓ   )r7   ÚmessageÚ
generationrÕ   s   &&  r8   Ú	interruptÚGatewayAgent.interrupt@  s–   € ð %)ˆÔ!Ø×"Ñ"Ò*Ü&*§n¢nÓ&6ˆDÔ#Ø×%Ñ%ˆ
ØÒØŸ™›×;Ñ;ˆJð	>Ø�O‰O× Ñ Ð!4ÀÇÁØ6@È!ð !ö Møäô 	>Ü�L‰LÐ7¸×=Ò=ûð	>ús   Á)B ÂB2ÂB-Â-B2c                	ó(   € V P                  V4       R # rX   )r˜  )r7   r–  Útool_reasons   &&&r8   Úhard_interruptÚGatewayAgent.hard_interruptO  s   € Ø�‰�wÖr;   c                ód  € V P                   pVf   R#  V P                  P                  RV 2V P                  VVR7      pT;'       g    / P                  R4      RJ d$   ^ RIHp T P                  T! R4      4       \        # T;'       g    / P                  R4      R	9   #   \         d     R# i ; i)
a   -> ``True`` (accepted), ``False`` (not taken: the caller queues the text), or
``"voice_stopped"`` (TUI-26: the owner took a bare stop phrase as the end of this LOCAL
session's voice chat; the text is consumed and reaches no turn, so it is never re-queued).Fzsession.)rF   Útextrî   r	   T©Útúcli.voice.stop_phrase_typedr  >   ÚqueuedÚ
redirected)
rª   ry   rÑ   rF   r   r¼   Ú
agent.i18nr¡  Ú_emit_printÚVOICE_STOPPED)r7   ÚverbrŸ  r—  r  r¡  s   &&&   r8   Ú_correctÚGatewayAgent._correctR  sµ   € ð ×%Ñ%ˆ
ØÒÙð	Ø—_‘_×)Ñ)¨H°T°FÐ*;ÈÏÉÐ^bØ?Ið *ó KˆFð �LˆL�b×Ñ˜oÓ.°$Ó6Ý$Ø×Ñ™QÐ<Ó=Ô>Ü Ð Ø—�˜"×!Ñ! (Ó+Ð/GÑGÐGøô "ô 	Úð	ús   ”,B  Â B/Â.B/Úapprox_tokensÚfocus_topicÚforceÚverbatim_tailc               ó®  € ^ RI Hp ^ RIHp	 ^ RIHp
 / pV'       d   WKR&   V'       d%   RVR&   \        ^\        R V 4       4      4      VR&   V P                  V	4       R	V n	        V P                  P                  R
V P                  R7      pV P                  P                  RW P                  \        P                  ! 4       P                  VR,          VR,          RVR7      ;'       g    / p\!        VP#                  R4      \$        4      '       d   VR,          V n	        VP#                  R4      R8X  d   \'        V4      V3# T;'       g    R F  pRWè&   K	  	  V P                  P                  R
V P                  R7      pV P)                  4       P+                  V4       V P,                  pV;P.                  ^,          un        RVn        R	V n        VP#                  R4      ;'       g    .  UUUu. uFK  pVP#                  R4      '       d   K  VP5                  4        UUu/ uF  w  ppVR8w  g   K  VVbK  	  uppNKM  	  upppV3# u uppi u upppi )a  Main's manual ``/compress`` seam (``compress_now``) as ``session.mutate compress``: the
gateway summarizes and commits; the returned transcript is the gateway's compacted history.
``verbatim_tail`` rows are stamped as stored, so ``compress_now`` does not rejoin them.
The gateway's own report (``summary``: flags and note (with the reason)) is kept for ``compress_now``;
a ``noop`` answer (a failed summary or nothing removable) committed nothing, so the history,
the tail and the compression count stay as they were.)Ú_DB_PERSISTED_MARKER)ÚCOMPACTION_STATUS)ÚCOMPRESS_RPC_TIMEOUTÚfocusTr   c              3  óT   "  € T F  qP                  R 4      R8X  g   K  ^x € K   	  R# 5i©ÚroleÚuserN©r¼   )Ú.0Úms   & r8   Ú	<genexpr>Ú1GatewayAgent._compress_context.<locals>.<genexpr>t  s!   é € Ð-b¹°AÏ%É%ÐPVË-Ð[aÑJa¯aªa»ùs   ‚(ž
(Ú	keep_lastNrê   rë   rì   rí   rî   Úcompress)r,  rF   rñ   rò   ró   rô   rõ   Úsummaryr  Únoopr{  ÚarchivedÚrow_idrB   éÿÿÿÿ)Úagent.context_compressorr°  Úagent.conversation_compressionr±  Úhermes_cli.gateway_clientr²  ÚmaxÚsumr¦  r©   ry   rÑ   rF   rö   r÷   rø   rT  r¼   r
  Úlistrº   r  r¥   r3   r0   rw  rV  )r7   r{  Úsystem_messager«  r¬  r­  r®  Ú_kwr°  r±  r²  rõ   rû   r  ÚrowÚafterr_  rº  rh  Úvs   &&&$$$$,            r8   Ú_compress_contextÚGatewayAgent._compress_contextd  s  € õ 	BÝDÝBØˆßØ*�GÑßØ!%ˆG�IÑÜ#& q¬#Ñ-b¹Ó-bÓ*bÓ#cˆG�KÑ Ø×ÑÐ*Ô+Ø#'ˆÔ Ø—?‘?×'Ñ'Ð(8ÀTÇ_Á_Ð'ÓUˆØ—‘×%Ñ%Ð&6Ð@T×apÑapÜ15·²³×1AÑ1AÐU]Ð^hÕUiØ:BÐCYÕ:ZØ0:ÀGð &ó M÷ Sð Sð QSð 	ô �f—j‘j Ó+¬T×2Ò2Ø'-¨iÕ'8ˆDÔ$Ø�:‰:�hÓ 6Ô)Ü˜“> >Ð1Ð1Ø ×&Ð& BÒ&ˆCØ(,ˆCÓ%ñ 'à—‘×$Ñ$Ð%5À$Ç/Á/Ð$ÓRˆØ�‰‹×$Ñ$ UÔ+Ø×,Ñ,ˆ
Ø×$Ò$¨Õ)Õ$Ø(*ˆ
Ô%Ø'+ˆÔ$ØGLÇyÁyÐQ[ÓG\×GbÐGbÐ`bÐGbõ *ÑGbÀ!Ø—u‘u˜Z×(ô > !§'¡'¤)Ô=¡)™$˜!˜Q¨q°H©}”��A’¡)Õ=ÑGbó *Ø+9ð:ð 	:ùÓ=ùô *s$   Ç2IÈIÈ#I
È4I
È;IÉ
Ic                	ó&   € V P                  R V4      # )Ústeer)r©  ©r7   rŸ  s   &&r8   rÒ  ÚGatewayAgent.steer‹  s   € Ø�}‰}˜W dÓ+Ð+r;   c                	óD   € V P                  R V4      pVRJ d   RV n        V# )ÚredirectTN)r©  r�   )r7   rŸ  Úaccepteds   && r8   rÖ  ÚGatewayAgent.redirectŽ  s)   € Ø—=‘= ¨TÓ2ˆØ�tÓð $(ˆDÔ Øˆr;   c                	óÐ  € R p\        V\        4      '       d,   V P                  V4      w  r\        V\        4      '       d   Tp\        V\        4      '       d   TMTpRV P                  R\
        P                  ! 4       P                  RV/pV'       d   WFR&   \        V\        4      '       d   W8w  d   WR&   V'       d   W6R&   V P                  '       d   RVR&   V P                  p\        V\        4      '       d$   VP                  R	4      '       d   VR	,          VR	&   \        V R
R4      '       d   RVR&   V P                  e   RVR&   V P                  4       P                  ;'       g    / pV P!                  4       p	V	'       d   W–R&   V# V P"                  '       dG   VP                  R4      VP                  R4      3RV P"                  38w  d   RV P"                  RR/VR&   V# )NrF   Úsubmission_idrŸ  ÚattachmentsÚapi_textÚturn_authorTÚ
voice_turnÚdisplay_kindÚ_finiteFÚfiniteÚclarify_batchÚmodel_overriderb   ra   r‚   )rT  rÉ  Ú_stage_content_partsr�  rF   rö   r÷   rø   r”   r“   r
  r¼   rƒ   rk   rº   r»   Ú_take_turn_router´   )
r7   Úuser_messageÚpersist_user_messagerÝ  rÛ  rŸ  ÚparamsÚstagedr»   Úpendings
   &&&&      r8   Ú_submit_paramsÚGatewayAgent._submit_params—  sµ  € ØˆÜ�l¤D×)Ò)ð )-×(AÑ(AÀ,Ó(OÑ%ˆLÜÐ.´×5Ò5Ø'3Ð$Ü'1Ð2FÌ×'LÒ'LÑ#ÐR^ˆØ §¡°Ä$Ç*Â*Ã,×BRÑBRÐTZÐ\`ÐaˆßØ$/�=Ñ!Ü�l¤C×(Ò(¨\Ô-AØ!-�:ÑßØ$/�=Ñ!Ø×#×#Ð#Ø#'ˆF�<Ñ Ø×/Ñ/ˆÜ�fœd×#Ò#¨¯
©
°>×(BÒ(BØ%+¨NÕ%;ˆF�>Ñ"Ü�4˜ E×*Ò*Ø#ˆF�8ÑØ× Ñ Ò,à&*ˆF�?Ñ#Ø�{‰{‹}×!Ñ!×'Ð' RˆØ×'Ñ'Ó)ˆßà'.Ð#Ñ$ð
 ˆð	 ××Ð 4§8¡8¨JÓ#7¸¿¹À'Ó9JÐ"KÐPUÐW[×WgÑWgÐOhÔ"hð )0°×1AÑ1AÀ:ÈuÐ'UˆFÐ#Ñ$Øˆr;   c                ó¤   € V P                   V P                  r!R;V n         ;V n        V n        V'       g   R# W3V n        / VCV'       d   RV/C# / C# )aJ  The ``/model --once`` pick for the admission being built, consumed here: one admission carries
it, even when a later ``run_conversation`` submits while this one's ``prompt.submit`` still blocks.
A refusal that admitted nothing (``session_busy``) puts it back with ``_give_back_turn_route``.

Staging already compared the pick with the session's route (``_route_off_session``), so it is not
compared again: its ``model`` may be an alias spelled like the session's model, and the owner runs a
plain pick of the session's own route on the session's endpoint and key (``one_turn_runtime``).Nrï   )r¶   r¸   r·   )r7   rê  rï   s   &  r8   rå  ÚGatewayAgent._take_turn_route¼  s_   € ð "×-Ñ-¨t×/CÑ/C�ØKOÐOˆÔÐO˜4Ô/°$Ô2HßÙØ")Ð!5ˆÔØM�'ÐM¿)˜{¨IÐ6ÐMÐMÈÐMÐMr;   c                	ó€   € \        V R R4      Ruqn        V'       d"   V P                  f   Vw  V n        V n        R# R# R# )r·   N)rƒ   r·   r¶   r¸   )r7   Útakens   & r8   Ú_give_back_turn_routeÚ"GatewayAgent._give_back_turn_routeË  s?   € Ü(/°Ð6IÈ4Ó(PÐRVÐ%ˆÔ%ß�T×%Ñ%Ò-Ø5:Ñ2ˆDÔ˜dÖ2ñ .‰5r;   c                óN  € . . r2V EF‚  p\        V\        4      '       g   K  VP                  R4      R8X  dj   \        VP                  R4      ;'       g    R4      P	                  4       pVP                  RP                  R V 4       4      P                  4       4       K›  VP                  R4      R8X  g   K³  \        VP                  R4      \        4      '       d+   VP                  R4      ;'       g    / P                  R4      MRp\        V\        4      '       g   EK  VP                  R	4      '       g   EK7  V P                  P                  R
V P                  VR7      pVP                  RVR,          RVR,          /4       EK…  	  RP                  R V 4       4      V3# )aM  ``[{type: text}, {type: image_url, image_url: {url: data:...}}]`` -> (text, attachments): each
image is staged on the owner with ``image.attach_bytes`` (bytes read here, locally, by main's
``build_native_content_parts``); main's ``[Image attached at: <local path>]`` hints are dropped
because the gateway names its own staged copies.r=  rŸ  r   Ú
c              3  óV   "  € T F  qP                  R 4      '       d   K  Vx € K!  	  R# 5i)z[Image attachedN)Ú
startswith)r¹  Úlns   & r8   r»  Ú4GatewayAgent._stage_content_parts.<locals>.<genexpr>Û  s   é € Ð&b±E¨bÇÁÐO`×Aa§r¢r³Eùs   ‚)Ÿ
)Ú	image_urlÚurlNzdata:image/zimage.attach_bytes)rF   Úcontent_base64ÚpathÚmimez

c              3  ó8   "  € T F  q'       g   K  Vx € K  	  R # 5irX   rB   )r¹  r¡  s   & r8   r»  rø  á  s   é € Ð1¡e «qŸ1š1£eùs   ‚	�
)rT  r
  r¼   r�  Ú
splitlinesr¾   rQ   rY   rö  ry   rÑ   rF   )r7   ÚpartsÚtextsrÛ  ÚpartÚlinesrú  ré  s   &&      r8   rä  Ú!GatewayAgent._stage_content_partsÐ  sD  € ð
   ˆ{ÜˆDÜ˜d¤D×)Ò)ÙØ�x‰x˜Ó 6Ô)Ü˜DŸH™H VÓ,×2Ð2°Ó3×>Ñ>Ó@�Ø—‘˜TŸY™YÑ&b±EÓ&bÓb×hÑhÓjÖkØ—‘˜&Ó! [Ö0ÜBLÈTÏXÉXÐVaÓMbÔdh×BiÒBi�t—x‘x Ó,×2Ð2°×7Ñ7¸Ô>Ðos�Ü˜c¤3×'Õ'¨C¯N©N¸=×,IÕ,IØ!Ÿ_™_×1Ñ1Ð2FÐSW×SbÑSbÐsvÐ1Ów�FØ×&Ñ&¨°°vµÀÈÈvÍÐ'W×Xñ ð �{‰{Ñ1¡eÓ1Ó1°;Ð>Ð>r;   c           	     	óÀ  € \        V P                  4      ;q€n        \        T;'       g    . 4      p	\	        V	4      V n        R V n        V P                  V n        RV n	        RV n
        R V n        ^ RIHp
 T
! T \        V\        4      '       d   TMT4      pVe$   Tp\!        VP#                  R4      4      Vn        EMV P'                  4        R V n         V P+                  4       pVP,                  VP.                  8w  d7   V P0                  P3                  VP                  V P5                  V4      R7       V P7                  WV4      pV P5                  V4      ! 4       '       d   \9        R4      hV P0                  P:                  ! R/ / VCRVP                  /CB pT;'       g    / P#                  R4      RJ d   T PE                  T	4      # \G        V P0                  RR 4      V n$        T;'       g    / P#                  R4      ;Vn%        V n&        V'       d"   VP#                  R4      e   VR,          V n'        / p T;'       g    / P#                  R4      pV'       d   RV/MV PQ                  VVV4      pV PS                  V4      '       d   V PU                  4        \        T\V        4      '       dC   T PS                  T4      '       d,   T P?                  Y‘\        T4      ;'       g    \X        RR7      # T PS                  T4      '       d   T P[                  Y‘TT4      MR pT PS                  T4      '       g   T P?                  Y‘R4      # TP$                  '       d   T P]                  TTTT4       T#   \8         d&    T P=                  4        T P?                  Y‘R4      u # \@         dY   p\        T4      R	8H  pT'       d   T P=                  4        T P?                  Y‘\        T4      T'       d   R	MR TR
7      u R p?# R p?i\B         d(   pT P?                  Y‘\        T4      RR7      u R p?# R p?ii ; i  T PS                  T4      '       d   T PU                  4        i i ; i)NTF)Útake_admitted_turnÚ	recovered©Úabandonúprompt.submitrF   z5Stopped before the prompt was sent; nothing was sent.Úsession_busy)r   Ú	retryableÚgateway_connection)r   r	   ÚepochÚadmission_idrî   ÚreceiptÚ_receiptz%A later turn took over this terminal.)r
  )/rD   rF   r¬   rÉ  Úlenr�   rx  r+   rv  rž   r›   r®   Úhermes_cli.gateway_tools_notifyr  rT  r�  rW  r¼   rM   Ú_drain_staler·   rº   ÚgapsÚattached_gapsry   ÚreattachÚ_stoprë  r   rÑ   rñ  Ú_failedr   r   Ú_voice_stoppedrƒ   r­   rG   r«   rª   Ú_pumpÚ_ownsÚ_generation_doner•  r   Ú_resultÚ_paint_owed)r7   ræ  Úconversation_historyÚstream_callbackÚtask_idrç  rÝ  rË  ÚturnÚhistoryr  Úadoptedr  rÅ   rè  rÕ   ÚbusyÚstartsÚsettledÚoutcomer  s   &&&&&&&,             r8   Úrun_conversationÚGatewayAgent.run_conversationã  s°  € ä! $§/¡/Ó2Ð2ˆŒzÜÐ+×1Ð1¨rÓ2ˆÜ" 7›|ˆÔØ#ˆÔØ $× 6Ñ 6ˆÔØ ˆÔØ$)ˆÔ!Ø"&ˆÔÝFÙ$ TÄ:ÐNbÔdg×ChÒChÑ+?Ø*6ó8ˆàÒð ˆGÜ˜wŸ{™{¨;Ó7Ó8ˆDŽKà×ÑÔØ%)ˆDÔ"ðjð Ÿ™›�Ø—:‘: ×!4Ñ!4Ô4Ø—O‘O×,Ñ,¨T¯_©_ÀdÇjÁjÐQUÓFVÐ,ÔWØ×,Ñ,¨\ÐQ\Ó]�Ø—:‘:˜dÔ#×%Ò%Ü% oÓ6Ð6ØŸ/™/×.Ò.ÑlÐBkÀVÐBkÈ\Ð[_×[jÑ[jÑBkÑl�ð —�˜2×"Ñ" ?Ó3°tÓ;Ø×*Ñ*¨7Ó3Ð3Ü˜dŸo™o¨w¸Ó=ˆŒØ,3¯M¨M°r×+>Ñ+>¸~Ó+NÐNˆŒ˜œß�w—{‘{Ð#9Ó:ÒFØ&Ð'=Õ>ˆDÔØˆð	(Ø—}�} "×)Ñ)¨)Ó4ˆGß/6�z 7Ñ+¸D¿J¹JÀÐX^Ð`dÓ<eˆGà�z‰z˜$×ÒØ×%Ñ%Ô'Ü�gœy×)Ò)¨d¯j©j¸×.>Ò.>Ø—<‘< ´s¸7³|×7SÐ7SÄ|Ø/Cð  ó Eð EàGKÇzÁzÐRV×GWÒGW�—‘˜g°W¸dÔCÐ]aˆØ�z‰z˜$×ÒØ—<‘< Ð7^Ó_Ð_Ø�;�;ˆ;Ø×Ñ˜T 6¨7°OÔDØˆøôG ô tØ×*Ñ*Ô,Ø—|‘| GÐ;rÓsÒsÜ"ô eô ˜3“x >Ñ1�ßà×.Ñ.Ô0Ø—|‘| G¼3¸s»8ßEI±>ÈtÐ_cð $ó eõ eûä%ô jØ—|‘| G¼3¸s»8ÐTh�|ÓiÕiûðjûð �z‰z˜$×ÒØ×%Ñ%Õ'ð  ús\   ÃCM/ È9P3 ÉP3 ÉP3 Í/-P0ÎP0Î'P0Î(AO;Ï5P0Ï;P0ÐP0Ð	P+Ð%P0Ð+P0Ð3*Qc                óX  € ^ RI Hp   V P                  P                  P	                  4       p\        T\        4      '       dQ   \        T\        T P                  RR4      4      '       d   Ke  T P                  P                  P                  T4       R# \        T\        4      '       d   TP                  R4      MRp\        T\        4      '       g   KÍ  TP                  R4      T P                  8X  g   Kï  T! T P                  4       T4       EK	    \
        P                   d     R# i ; i)z¶Frames left from an earlier turn of this viewer (a late settlement) are not this turn's. A
``/queue`` admission's start among them is remembered: that turn is painted after this one.©Úmissed_startNr  rè  rF   )r  r.  ry   ÚeventsÚ
get_nowaitÚqueueÚEmptyrT  r•  r   rƒ   Úputr
  r¼   rF   rº   )r7   r.  Úframerè  s   &   r8   r  ÚGatewayAgent._drain_stale'  sÔ   € õ 	AØðØŸ™×.Ñ.×9Ñ9Ó;�ô ˜%¤×+Ò+Ü˜u¤g¨d¯o©o¸wÈÓ&M×NÒNÙØ—‘×&Ñ&×*Ñ*¨5Ô1ÙÜ,6°u¼d×,CÒ,C�U—Y‘Y˜xÔ(ÈˆFÜ˜&¤$×'Ô'¨F¯J©J°|Ó,DÈÏÉÖ,WÙ˜TŸ[™[›]¨F×3øô —;‘;ô Úðús   ‰$D ÄD)Ä(D)c                	ó   € R V n         R # rX   )rª   r6   s   &r8   r  ÚGatewayAgent._generation_done9  s
   € ØˆÖr;   c                	óˆ   € V P                   R J;'       d.    \        P                  ! 4       V P                   ,
          \        8„  # rX   )r®   r“  r”  ÚINTERRUPT_SETTLE_SECONDSr6   s   &r8   Ú_expiredÚGatewayAgent._expired<  s3   € Ø×&Ñ&¨dÐ2×|Ð|´t·~²~Ó7GÈ$×JaÑJaÕ7aÔd|Ñ7|Ð|r;   c                	ó`   € V P                   VJ ;'       d    V P                  VP                  8H  # rX   )r¬   rF   ©r7   r#  s   &&r8   r  ÚGatewayAgent._owns?  s&   € Ø�z‰z˜TÐ!×HÐH d§o¡o¸¿¹Ñ&HÐHr;   c                ó   a a€ V V3R l# )zbThe ``abandon`` of a turn's blocking reads: it lost the terminal, or Ctrl-C's settle bound passed.c                 ó`   <€ S P                  S4      '       * ;'       g    S P                  4       # rX   )r  r:  r=  s   €€r8   Ú<lambda>Ú$GatewayAgent._stop.<locals>.<lambda>D  s"   ø€ ˜4Ÿ:™: dÓ+Ô+×>Ð>¨t¯}©}«Ð>r;   rB   r=  s   ffr8   r  ÚGatewayAgent._stopB  s	   ù€ å>Ð>r;   c                ó   a a€ V V3R l# )zÁThe ``abandon`` of a turn's end-of-turn reads (its receipt, the cumulative stats): only losing the
terminal stops them. Past Ctrl-C's settle bound they still run, bounded by their own timeouts.c                 ó0   <€ S P                  S4      '       * # rX   )r  r=  s   €€r8   rA  Ú$GatewayAgent._lost.<locals>.<lambda>I  s   ø€ ˜4Ÿ:™: dÓ+Õ+r;   rB   r=  s   ffr8   Ú_lostÚGatewayAgent._lostF  s   ù€ õ ,Ð+r;   c                ó(  € V P                   P                  pV P                  V4      '       Edˆ   V P                  4       '       d	   RRRRRR/#  VP	                  \
        R7      pT P                  T4      '       g<   TP                  ;_uu_ 4        TP                  P                  T4       RRR4        R# \        T\        4      '       d    \        YPP                  4      '       d   KÒ  T# \        T\        4      '       d   TP	                  R	4      MRp\        T\        4      '       d!   TP	                  R
4      T P                  8w  d   EK6  TP	                  R4      \         9   d   RT9   d   T P#                  T4       EKk  TP	                  R4      TP	                  R4      ;'       g    / r‡TP	                  R4      ;'       g*    \        T\        4      '       d   TP	                  R4      MRp	T P$                  '       d9   T	'       d1   Y�P$                  8w  d!   ^ RIHp
 T
! T P+                  4       T4       EK"  TP	                  R4      e+   TR,          T n        TR,          T P+                  4       n        TR8X  d   T# TR8X  d   T P1                  T4      pTe   T# EK‰   T P3                  YxY4       EKŸ  R#   \        P                   d     EKº  i ; i  + '       g   i     EL3; i  \         d    \4        P7                  RTRR7        EKù  i ; i)zvDispatch frames until this admission's ``message.complete``; returns its payload, or the
transport error (disconnect).r  r   r)  Ú	cancelledÚ_settle_timeoutT)r,  Nrè  rF   ÚmethodÚidr=  rõ   r  r-  rî   zmessage.completezsession.replay_gapzevent %s dispatch failed©Úexc_info)ry   r/  r  r:  r¼   Ú_POLLr1  r2  ÚmutexÚ
appendleftrT  r•  r   r­   r
  rF   Ú_SERVER_REQUESTSÚ_answer_requestr«   r  r.  rº   rª   rî   Ú_recoverÚ	_dispatchrÒ   rÓ   )r7   r!  r'  r#  r/  r4  rè  Úkindrõ   rG   r.  r)  s   &&&&        r8   r  ÚGatewayAgent._pumpK  sd  € ð —‘×'Ñ'ˆØ�j‰j˜×ÓØ�}‰}�ŠØ  -°¸KÐIZÐ\`ÐaÐaðØŸ
™
¬5˜
Ó1�ð —:‘:˜d×#Ò#Ø—\—\“\Ø—L‘L×+Ñ+¨EÔ2÷ "àñ> ô= ˜%¤×+Ò+Ü˜u§k¡k×2Ò2ÙØ�Ü,6°u¼d×,CÒ,C�U—Y‘Y˜xÔ(ÈˆFÜ˜f¤d×+Ò+¨v¯z©z¸,Ó/GÈ4Ï?É?Ô/ZÚØ�y‰y˜Ó"Ô&6Ô6¸4À5¼=Ø×$Ñ$ UÔ+ÚØ"ŸJ™J vÓ.°·
±
¸9Ó0E×0KÐ0KÈ�'ØŸ
™
 >Ó2×zÐzÔV`ÐahÔjn×VoÒVo°w·{±{À>Ô7RÐuyˆIØ��ˆ§9°¿o¹oÔ1MÝHÙ˜TŸ[™[›]¨FÔ3ÚØ�z‰zÐ0Ó1Ò=Ø#)Ð*@Õ#A�Ô Ø5;Ð<RÕ5S�—‘“Ô2ØÐ)Ô)Ø�ØÐ+Ô+ØŸ-™-¨Ó-�ØÒ&Ø"�NÚðNØ—‘˜t¨o×Fñ øôI —;‘;ô Ûðú÷ "—\�\ûô> ô NÜ—‘Ð7¸È�×MÐMðNús0   ÁJ8 ÂKÊ!K) Ê8KËKËK&	Ë)#LÌLc                óP  a€ ^ RI Hp \        R\        ,           4      V P	                  S4      rC V P
                  P                  SP                  VR7      p\        V3R lVP                  R4      ;'       g    .  4       / 4      pVP                  R4      R8X  d   V# S;P                  VP                  R4      R8g  ,          un
        V P                  VP                  R	4      4       VP                  R
4      ;'       g    .  FÄ  pVP                  R4      R8X  g   K  VP                  R4      VP                  R4      8X  g   KB  VP                  R4      SP                  9  g   Kd  V! 4       '       d   Ks  SP                  P                  VP                  R4      4        V P                  VP                  R4       R2VR/ 4       KÆ  	  V'       g    SP$                  '       d   V! 4       '       d   R# V P
                  P'                  RSP                  SP$                  RVR7      pT! T;'       g    / 4      p	T	'       d   RT/# T	f   T# R#   \         d-    \         P#                  RTP                  R4      RR7        EK�  i ; i  \(         d     R# \         d    Tu # i ; i)z¿``gateway_replay_gap``: re-attach, answer the controls the hole hid, stop painting live text. A
turn the snapshot no longer lists settles from its receipt; None waits for the live completion.)r(  zsession_replay_gap: r  c              3  ój   <"  € T F(  qP                  R 4      SP                  8X  g   K$  Vx € K*  	  R# 5i)r  N)r¼   rG   )r¹  Úrr#  s   & €r8   r»  Ú(GatewayAgent._recover.<locals>.<genexpr>�  s*   øé € ÐlÑ#@˜aÇEÁEÈ.ÓDYÐ]a×]kÑ]kÑDkŸšÓ#@ùs   ƒ!3©
3rê  r  Úunknownr£  Úpending_connectionÚpromptsÚstartedrî   Ú	prompt_idrW  z.requestNzcontrol %s dispatch failedTrN  úprompt.receipt)rF   r  Úinclude_resultr	  r  )Úhermes_cli.gateway_replay_gapr(  r   r   r  ry   r  rF   Únextr¼   rM   Ú_restore_connection_cardrL   ÚaddrV  r•  rÒ   rÓ   rG   rÑ   r   )
r7   r#  r(  ÚlostÚstoprû   rÌ  Úpromptr  Úverdicts
   &f        r8   rU  ÚGatewayAgent._recoverz  s3  ø€ õ 	:Ü'Ð(>ÄÕ(MÓNÐPT×PZÑPZÐ[_ÓP`ˆdð	Ø—‘×/Ñ/°·±ÈÐ/ÓNˆHÜÔl 8§<¡<°	Ó#:×#@Ð#@¸bÐ#@ÓlÐnpÓqˆCØ�w‰w�xÓ  IÔ-Ø�Ø�KŠK˜3Ÿ7™7 8Ó,°Ñ8Õ8�KØ×)Ñ)¨(¯,©,Ð7KÓ*LÔMØ"Ÿ,™, yÓ1×7Ð7°RÒ7�Ø—7‘7˜8Ó$¨	Ö1°f·j±jÐAWÓ6XÐ\_×\cÑ\cÐdzÓ\{Ö6{Ø"ŸJ™J {Ó3¸4¿=¹=ÖHÑQU×QWÔQWØ—M‘M×%Ñ% f§j¡j°Ó&=Ô>ðkØŸ™¨&¯*©*°VÓ*<Ð)=¸XÐ'FÈÐPTÐVXÖYñ 8÷ ˜$Ÿ.Ÿ.˜.©D¯FªFÙØ—o‘o×*Ñ*Ð+;ÈÏÉÐfj×ftÑftØ:>Èð +ó NˆGñ ˜'Ÿ-˜- RÓ(ˆß(/�
˜GÐ$ÐV¸Wº_°TÐVÐRVÐVøô %ô kÜŸ™Ð%AÀ6Ç:Á:ÈkÓCZÐei˜×jÐjðkûô ô 	ÚÜ!ô 	ØŠKð	úsy   ¯A-J ÂA"J Ä J Ä"J ÅJ Å'
J Å6*J Æ!&IÇJ ÇJ Ç%J Ç44J É2JÊ J ÊJÊJ ÊJ%ÊJ%ÊJ%Ê$J%c                	óN   € \         P                  V4      pVe   V! WW44       R # R # rX   )Ú	_HANDLERSr¼   )r7   rW  rõ   r!  r'  Úhandlers   &&&&& r8   rV  ÚGatewayAgent._dispatch™  s%   € Ü—-‘- Ó%ˆØÒÙ�D ?Ö;ñ r;   c                	ó~  € VP                  R 4      V P                  rT\        V\        4      '       g   V P	                  VRR7      # VP
                  '       d   R# V P                  e-   V P                  V4       VP                  P                  V4       Ve&   V! V4       VP                  P                  V4       R# R# )rŸ  T)Ú	separatorN)
r¼   r¬   rT  r�  Ú_close_segmentrM   rs   rH   r¾   rI   )r7   rõ   r!  r'  rŸ  r#  s   &&&&  r8   Ú	_on_deltaÚGatewayAgent._on_deltaŸ  s–   € Ø—[‘[ Ó(¨$¯*©*ˆdÜ˜$¤×$Ò$Ø×&Ñ& v¸Ð&Ó>Ð>Ø�;�;ˆ;ÙØ×%Ñ%Ò1Ø×&Ñ& tÔ,Ø�K‰K×Ñ˜tÔ$ØÒ&Ù˜DÔ!Ø�L‰L×Ñ Ö%ñ 'r;   c                óÂ   € V P                   pV P                  e5   V'       g   \        VP                  4      '       d   V P                  R4       VP	                  4        R# )z\A segment boundary: the ``text: None`` separator, or a later boundary when it fell in a gap.N)r¬   rs   ÚanyrH   rZ   )r7   r'  rr  r#  s   &&& r8   rs  ÚGatewayAgent._close_segment¬  sA   € à�z‰zˆØ×%Ñ%Ò1·yÄCÈÏÉ×DTÒDTØ×&Ñ& tÔ,Ø×ÑÖr;   c                	óÄ  € VP                  R 4      pV P                  V4       V P                  P                  P	                  \        T;'       g    R4      P                  4       4       V P                  e.   V P                  V\        VP                  R4      4      R7       R# V'       d5   \        V4      P                  4       '       d   V P                  V4       R# R# R# )rŸ  r   NÚalready_streamed)rz  )
r¼   rs  r¬   rK   rg  r�  rY   rx   rW  r¦  )r7   rõ   r!  r'  rŸ  s   &&&& r8   Ú_on_interimÚGatewayAgent._on_interim³  s�   € Ø�{‰{˜6Ó"ˆØ×Ñ˜FÔ#Ø�
‰
�‰×ÑœC §
 
¨›O×1Ñ1Ó3Ô4Ø×*Ñ*Ò6Ø×+Ñ+¨DÄ4ÈÏÉÐTfÓHgÓChÐ+Öiß”c˜$“i—o‘o×'Ò'Ø×Ñ˜TÖ"ñ (‰Tr;   c                	óf   € V P                   e#   V P                  VP                  R4      4       R # R # )Nr?  )rt   r¼   ©r7   rõ   r!  r'  s   &&&&r8   Ú_on_tool_generatingÚ GatewayAgent._on_tool_generating¼  ó*   € Ø×!Ñ!Ò-Ø×"Ñ" 7§;¡;¨vÓ#6Ö7ñ .r;   c                	ó  € V P                   ev   V P                  RVP                  R4      VP                  R4      R VP                  R4      VP                  R4      VP                  R4      VP                  R4      R7       R # R # )	Nútool.progressr?  r–  Útool_idÚprogressÚtotalÚpercent)Útool_call_idr…  r†  r‡  ©rp   r¼   r~  s   &&&&r8   Ú_on_tool_progressÚGatewayAgent._on_tool_progressÀ  sv   € Ø×&Ñ&Ò2Ø×'Ñ'¨¸¿¹ÀVÓ9LÈgÏkÉkÐZcÓNdÐfjØ5<·[±[ÀÓ5KÐV]×VaÑVaÐblÓVmØ.5¯k©k¸'Ó.BÈGÏKÉKÐXaÓLbð (ö dñ 3r;   c                	óF  € V P                  V4       VP                  R 4      ;'       g    VP                  R4      ;'       g    Rp\        VP                  R4      \        4      '       d   VP                  R4      M/ pVP                  R4      ;'       g    VP                  R4      ;'       g    Rp\        P
                  ! 4       W6&   V P                  '       d   RV n        V P                  4        V P                  e"   ^ R	I	H
p V P                  R
WG! WE4      V4       R# R# )r?  Ú	tool_namerF  Úargsr„  rˆ  r   FN)Úbuild_tool_previewztool.started)rs  r¼   rT  r
  r“  r”  rž   r|  rp   Úagent.displayr�  )r7   rõ   r!  r'  r?  rŽ  Úcall_idr�  s   &&&&    r8   Ú_on_tool_startÚGatewayAgent._on_tool_startÆ  sä   € Ø×Ñ˜FÔ#Ø�{‰{˜6Ó"×HÐH g§k¡k°+Ó&>×HÐHÀ&ˆÜ&0°·±¸VÓ1DÄd×&KÒ&Kˆw�{‰{˜6Ô"ÐQSˆØ—+‘+˜iÓ(×MÐM¨G¯K©K¸Ó,G×MÐMÈ2ˆÜŸ.š.Ó*ˆ‰Ø××Ðð !&ˆDÔØ×ÑÔ!Ø×&Ñ&Ò2Ý8Ø×'Ñ'¨¸Ð>PÐQUÓ>\Ð^bÖcñ 3r;   c                	óN  € VP                  R 4      ;'       g    VP                  R4      ;'       g    Rp\        VP                  R4      \        4      '       d   VP                  R4      M/ pVP                  R4      ;'       g    VP                  R4      ;'       g    RpVP                  R4      pVP                  R4      pVf5   VP                  VR	4      p	V	e   \        P
                  ! 4       V	,
          MR
pV P                  e1   V P                  RVR	R	V\        VP                  R4      4      VR7       RV n        ^ RI	H
p
 V
! 4        VR8X  d   V P                  V4       VP                  R4      p\        V\        4      '       dx   V'       dp   ^ RIHp ^ RIHp V! V4      pVP#                  R4      P%                  4        F  pV! V4       K  	  VR8X  d%   V P&                  e   V P'                  WdWW4       R	# R	# R	# V P&                  e   V P'                  WdWW4       R	# R	# )r?  r�  rF  rŽ  r„  rˆ  r   r  Ú
duration_sNç        ztool.completedÚis_error)Údurationr—  r  T)Ú
mark_dirtyÚtodoÚinline_diff)Ú_cprint)Údiff_printerrô  Údelegate_task)r¼   rT  r
  Úpopr“  r”  rp   rW  rž   Úhermes_cli.gateway_toolsr™  Ú_todo_from_resultr�  r_   rœ  Úhermes_cli.cli_modern_layoutr�  Úrstriprÿ  rr   )r7   rõ   r!  r'  r?  rŽ  r‘  r  r˜  r`  r™  Údiffrœ  r�  ÚemitÚlines   &&&&            r8   Ú_on_tool_completeÚGatewayAgent._on_tool_completeØ  sÃ  € Ø�{‰{˜6Ó"×HÐH g§k¡k°+Ó&>×HÐHÀ&ˆÜ&0°·±¸VÓ1DÄd×&KÒ&Kˆw�{‰{˜6Ô"ÐQSˆØ—+‘+˜iÓ(×MÐM¨G¯K©K¸Ó,G×MÐMÈ2ˆØ—‘˜XÓ&ˆØ—;‘;˜|Ó,ˆØÒØ—j‘j ¨$Ó/ˆGØ7>Ò7JœŸšÓ(¨7Ö2ÐPSˆHØ×&Ñ&Ò2Ø×'Ñ'Ð(8¸$ÀÀdÐU]Ü15°g·k±kÀ*Ó6MÓ1NÐW]ð (ô _à ˆÔÝ7ÙŒØ�6Œ>Ø×"Ñ" 6Ô*Ø�{‰{˜=Ó)ˆÜ�dœC× Ò §TÝ#ÝAÙ Ó(ˆDØŸ™ DÓ)×4Ñ4Ö6�Ù�T–
ñ 7à�Ô&¨4×+FÑ+FÒ+RØ×+Ñ+¨G¸4ÖHñ ,SÑ&à×(Ñ(Ò4Ø×'Ñ'¨°tÖDñ 5r;   c                	óÚ   €  \        V\        4      '       d   \        P                  ! V4      MTp\        T\
        4      '       d   T P                  T4       R # R #   \         d     R # i ; irX   )rT  r�  ÚjsonÚloadsr   r
  r  )r7   r  Údatas   && r8   r¡  ÚGatewayAgent._todo_from_resultõ  sW   € ð	Ü)3°F¼C×)@Ò)@”4—:’:˜fÔ%ÀfˆDô �dœD×!Ò!Ø�O‰O˜DÖ!ñ "øô ô 	Úð	ús   ‚.A ÁA*Á)A*c                	ó(   € V P                  V4       R # rX   )r  r~  s   &&&&r8   Ú_on_todoÚGatewayAgent._on_todoý  s   € Ø�‰˜Ö r;   c                ó&  € \        VP                  R4      \        4      '       d7    V P                  P	                  VR,          VP                  R4      R7       R# R#   \
        \        3 d"   p\        P                  RT4        Rp?R# Rp?ii ; i)z`The gateway's ``{todos, revision}`` into the CLI's ``TodoStore`` (``restore``: no new revision).Útodosrí   )rí   ztodo snapshot not mirrored: %sN)	rT  r¼   rÉ  r¨   r  r   rú   rÒ   rÓ   )r7   rû   rÕ   s   && r8   r  ÚGatewayAgent._set_todos   sv   € ä�h—l‘l 7Ó+¬T×2Ò2ðDØ× Ñ ×(Ñ(¨°'Õ):ÀXÇ\Á\ÐR\ÓE]Ð(Ö^ñ 3øô ¤	Ð*ô DÜ—‘Ð=¸s×CÒCûðDús   §3A ÁBÁ/BÂBc                	óF   € V P                   e   V P                  4        R # R # rX   )rŠ   r~  s   &&&&r8   Ú_on_control_updateÚGatewayAgent._on_control_update  s   € Ø×'Ñ'Ò3Ø×(Ñ(Ö*ñ 4r;   c                	óz   € V P                   e-   T P                  VP                  R4      ;'       g    R4       R # R # ©NrŸ  r   )ro   r¼   r~  s   &&&&r8   Ú_on_thinkingÚGatewayAgent._on_thinking  s2   € Ø×!Ñ!Ò-Ø×"Ñ" 7§;¡;¨vÓ#6×#<Ð#<¸"Ö=ñ .r;   c                	óz   € V P                   e-   T P                  VP                  R4      ;'       g    R4       R # R # r¸  )rn   r¼   r~  s   &&&&r8   Ú_on_reasoningÚGatewayAgent._on_reasoning  s2   € Ø×"Ñ"Ò.Ø×#Ñ# G§K¡K°Ó$7×$=Ð$=¸2Ö>ñ /r;   c                	óŽ   € V P                   e7   T P                  RRVP                  R4      ;'       g    RR,          R 4       R # R # )Núreasoning.availableÚ	_thinkingrŸ  r   :Niô  Nr‰  r~  s   &&&&r8   Ú_on_reasoning_availableÚ$GatewayAgent._on_reasoning_available  sB   € Ø×&Ñ&Ò2Ø×'Ñ'Ð(=¸{ÈWÏ[É[ÐY_ÓM`×MfÐMfÐdfÐhlÕLmÐosÖtñ 3r;   c                	ón  € V P                   f   R # ^ RIHp T P                  T! \        VP	                  R4      ;'       g    R4      VP	                  R4      ;'       g    RVP	                  R4      ;'       g    RVP	                  R4      VP	                  R	4      VP	                  R
4      R7      4       R # )N)ÚAgentNoticerŸ  r   Úlevelr»   rW  ÚstickyÚttl_msrÍ   rM  )rŸ  rÅ  rW  rÇ  rÍ   rM  )ru   Úagent.credits_trackerrÄ  r�  r¼   )r7   rõ   r!  r'  rÄ  s   &&&& r8   Ú
_on_noticeÚGatewayAgent._on_notice  s–   € Ø×ÑÒ'ÙÝ5Ø×Ñ™[¬c°'·+±+¸fÓ2E×2KÐ2KÈÓ.LÐT[×T_ÑT_Ð`gÓTh×TrÐTrÐlrØ.5¯k©k¸&Ó.A×.MÐ.MÀXÐV]×VaÑVaÐbjÓVkØ-4¯[©[¸Ó-?ÀGÇKÁKÐPTÓDUôWö 	Xr;   c                	óf   € V P                   e#   V P                  VP                  R4      4       R # R # )NrÍ   )rv   r¼   r~  s   &&&&r8   Ú_on_notice_clearÚGatewayAgent._on_notice_clear   s*   € Ø×%Ñ%Ò1Ø×&Ñ& w§{¡{°5Ó'9Ö:ñ 2r;   c                	óf   € V P                   e#   V P                  VP                  R4      4       R # R # )NrW  )rw   r¼   r~  s   &&&&r8   Ú_on_reactionÚGatewayAgent._on_reaction$  r�  r;   c                	óZ   € T P                  VP                  R 4      ;'       g    R4       R# )rŸ  r   N)r¦  r¼   r~  s   &&&&r8   Ú	_on_printÚGatewayAgent._on_print(  s!   € Ø×Ñ˜Ÿ™ VÓ,×2Ð2°Ö3r;   c                	óR   € \        V4      pV'       d   V P                  V4       R # R # rX   )Úreview_summary_liner¦  )r7   rõ   r!  r'  r¦  s   &&&& r8   Ú_on_review_summaryÚGatewayAgent._on_review_summary+  s"   € Ü" 7Ó+ˆßØ×Ñ˜TÖ"ñ r;   c                	ón   € V P                   '       d   R # V P                  ;'       g    \        ! V4       R # rX   )r‹   rŒ   ÚprintrÓ  s   &&r8   r¦  ÚGatewayAgent._emit_print0  s(   € Ø×&×&Ð&ÙØ	�‰×	 Ð	 œ5Ð	  $Ö'r;   c                	óN  € ^ RI Hp V! 4       p\        VP                  R4      ;'       g    . 4      pRpVeG    T! VP                  R4      ;'       g    RVP                  R4      ;'       g    RRV9   R	V9   R
R7      pWv9  d   RpV P
                  P                  RV P                  VP                  RV P                  4      VP                  R4      VR7       R#   \         d?    T! TP                  R4      ;'       g    RTP                  R4      ;'       g    R4      p L¥i ; i)r/   )Ú_get_approval_callbackÚchoicesÚdenyNÚcommandr   ÚdescriptionÚalwaysÚsessionF)Úallow_permanentÚallow_sessionÚsmart_deniedzapproval.respondrî   ra  )rF   rî   ra  Úchoice)	Útools.terminal_toolrÜ  rÉ  r¼   rú   ry   rÑ   rF   rª   )r7   rõ   r!  r'  rÜ  r-  rÝ  ræ  s   &&&&    r8   Ú_on_approvalÚGatewayAgent._on_approval5  s  € Ý>Ù)Ó+ˆÜ�w—{‘{ 9Ó-×3Ð3°Ó4ˆØˆØÒðbÙ! '§+¡+¨iÓ"8×">Ð">¸BÀÇÁÈMÓ@Z×@`Ð@`Ð^`Ø2:¸gÑ2EÐU^ÐbiÑUiØ/4ô6�ð
 Ô ØˆFØ�‰×ÑÐ/¸D¿O¹OØ29·+±+Ð>TÐVZ×VfÑVfÓ2gØ'.§{¡{°;Ó'?Èð 	ö 	Pøô	 ô bÙ! '§+¡+¨iÓ"8×">Ð">¸BÀÇÁÈMÓ@Z×@`Ð@`Ð^`Óa’ðbús)   ¹C ÁC Á-C Ã$D$Ä D$ÄD$Ä#D$c                	ó0  € R pV P                   Ee)   VP                  R4      ;'       g    RpT P                  RTRVP                  R4      ;'       g    R R\        VP                  R4      ;'       g    . 4      R\        VP                  R4      4      /.4      p\	        V\
        4      '       ds   VP                  R4      ;'       g    / P                  V4      p\	        V\        \        34      '       d    R	P                  \        \        V4      4      MT;'       g    R pM\	        V\        4      '       d   TpV P                  P                  R
V P                  VP                  RV P                  4      VP                  R4      \        V4      R7       R# )r   Nra  Úq0ÚqidÚquestionrÝ  Úmulti_selectÚanswersz, zclarify.respondrî   )rF   rî   ra  Úanswer)rk   r¼   rÉ  rW  rT  r
  ÚtuplerQ   Úmapr�  ry   rÑ   rF   rª   )r7   rõ   r!  r'  rð  rì  ÚreplyrÎ   s   &&&&    r8   Ú_on_clarifyÚGatewayAgent._on_clarifyG  sL  € ØˆØ× Ñ Ó,Ø—+‘+˜kÓ*×2Ð2¨dˆCØ×)Ñ)¨E°3¸
ÀGÇKÁKÐPZÓD[×DaÐDaÐ_aØ,5´t¸G¿K¹KÈ	Ó<R×<XÐ<XÐVXÓ7YØ,:¼DÀÇÁÈ^ÓA\Ó<]ð,_ð +`ó aˆEô ˜%¤×&Ò&ØŸ™ 9Ó-×3Ð3°×8Ñ8¸Ó=�Ü7AÀ%Ì$ÔPUÈ×7WÒ7W˜Ÿ™¤3¤s¨E£?Ô3Ð^c×^iÐ^iÐgi‘Ü˜E¤3×'Ò'Ø�Ø�‰×ÑÐ.¸4¿?¹?Ø29·+±+Ð>TÐVZ×VfÑVfÓ2gØ'.§{¡{°;Ó'?ÌÈFËð 	ö 	Ur;   c                	óH   € V P                   e   V P                  V4       R # R # rX   )rl   r~  s   &&&&r8   Ú_on_connection_requestÚ#GatewayAgent._on_connection_requestW  s!   € Ø×#Ñ#Ò/Ø×$Ñ$ WÖ-ñ 0r;   c                	óH   € V P                   e   V P                  V4       R # R # rX   )rm   r~  s   &&&&r8   Ú_on_connection_updateÚ"GatewayAgent._on_connection_update[  s!   € Ø×*Ñ*Ò6Ø×+Ñ+¨GÖ4ñ 7r;   c                ó¢   € V'       d$   V P                   e   V P                  V4       R# R# V P                  e   V P                  RR/4       R# R# )z°After a replay gap, the resume snapshot's open operation: (re)open the card from it, or
close a stale card when none remains (the gap may have eaten the request or the settle).Nr(  T)rl   rm   )r7   rê  s   &&r8   rf  Ú%GatewayAgent._restore_connection_card_  sJ   € ÷ Ø×'Ñ'Ò3Ø×(Ñ(¨Ö1ñ 4à×,Ñ,Ò8Ø×+Ñ+¨Y¸Ð,=Ö>ñ 9r;   c           	     óZ   € V P                   P                  RWRRRV P                  /R7      # )z_The card's answer to the gateway's open operation (``connection.respond``); returns its result.zconnection.respondr=  râ  rF   )Úop_idr  Úowner©ry   rÑ   rF   )r7   rÿ  r  s   &&&r8   Úconnection_respondÚGatewayAgent.connection_respondh  s5   € à�‰×#Ñ#Ð$8ÀØ+1°9¸lÈDÏOÉOÐ*\ð $ó ^ð 	^r;   c           	     ó^   € V P                   P                  RV.RRRRV P                  /R7      # )z_The card's Try again on a failed or expired row: the gateway re-mints it on the open operation.zconnectors.connectTr=  râ  rF   )Ú
connectorsÚ	reconnectr   r  )r7   r?  s   &&r8   Úconnection_retryÚGatewayAgent.connection_retrym  s:   € à�‰×#Ñ#Ð$8ÀdÀVÐW[Ø+1°9¸lÈDÏOÉOÐ*\ð $ó ^ð 	^r;   c                óö  € VR,          pVR,          V3V n          \        V,          ! YP                  R4      ;'       g    / 4      pRV n         VR8X  d&   V P                  P                  VR,          V4       R# V P                  P                  VR,          R\        V\        4      '       d   TMR
/4       R#   \         d)    \        P                  RTRR7       TR8X  d   RR	/MR
p L¤i ; i  RT n         i ; i)uê   A gateway serverâ†’client request (``sudo``, ``secret``, ``clarify``): main's own modal
answers it on this (agent) thread, through the callback HermesCLI registered for the turn; the
answer travels only in the JSON-RPC response frame.rL  rM  rè  zserver request %s failedTrN  Úclarifyr)  rJ  r   NrÎ   )
r‰   rS  r¼   r•  rÒ   rÓ   ry   ró  rT  r�  )r7   r4  rL  rð  s   &&  r8   rT  ÚGatewayAgent._answer_requestr  sÞ   € ð �x•ˆØ# D�k¨6Ð2ˆÔð	&Ü% fÖ-¨d·I±I¸hÓ4G×4MÐ4MÈ2ÓNˆFð
 "&ˆDÔØ�YÔØ�O‰O×!Ñ! %¨¥+¨vÖ6à�O‰O×!Ñ! %¨¥+°Ä:ÈfÔVY×CZÒCZ¹Ð`bÐ/cÖdøô ô 	MÜ�L‰LÐ3°VÀdˆLÔKØ17¸9Ô1D�i Ñ-È"ŠFð	Mûð "&ˆDÕús#   ›,B9 Â90C,Ã)C/ Ã+C,Ã,C/ Ã/	C8c                ó  € V P                   pVe,   VP                  R4      V^ ,          8w  g   V P                  f   R#  V P                  V^,          4       R#   \         d$    \        P                  RT^,          RR7        R# i ; i)ai  ``request.cancel`` (connection loop thread): the gateway settled or withdrew a request. When
this agent thread is parked in the modal answering it (another viewer completed the form, the
turn timed out or was interrupted), release that modal so the pump reads the turn's remaining
frames; its late reply to the already-settled request is dropped by the gateway.NrM  zmodal withdraw for %s failedTrN  )r‰   r¼   r|   r•  rÒ   rÓ   )r7   rõ   Úcurrents   && r8   rÁ   Ú"GatewayAgent._on_request_withdrawn„  sv   € ð
 ×$Ñ$ˆØŠ?˜gŸk™k¨$Ó/°7¸1µ:Ô=À×A]ÑA]ÒAeÙð	TØ×(Ñ(¨°­Ö4øÜô 	TÜ�L‰LÐ7¸À½ÈdˆL×Sð	Tús   ¿A Á*BÂBc                	ó.   € \        V P                  V4      # rX   )Úclarify_replyrk   )r7   rè  s   &&r8   Ú_ask_clarifyÚGatewayAgent._ask_clarify‘  s   € Ü˜T×2Ñ2°FÓ;Ð;r;   c                	óJ   € ^ RI Hp V! 4       pVe   V! 4       ;'       g    R# R# )r/   )Ú_get_sudo_password_callbackr   )rç  r  )r7   rè  r  r-  s   &&  r8   Ú	_ask_sudoÚGatewayAgent._ask_sudo”  s'   € ÝCÙ.Ó0ˆØ%-Ò%9‘“
× Ð ˜bÐA¸rÐAr;   c           	     ó¬  a€ ^ RI Hp VP                  pVf   R# ^ RIHp . oV3R lp\
        ;_uu_ 4        VP                  Vuqdn         T! VP                  R4      ;'       g    RVP                  R4      ;'       g    RVP                  R4      4       Wdn         RRR4       S'       d
   S^ ,          # R#   Ydn        i ; i  + '       g   i     L.; i)	a  Main's masked "Skill Setup Required" panel (the CLI's registered secret-capture callback,
``hermes_cli.callbacks.prompt_for_secret``) collects the value and prints main's lines; the
gateway, not this process, saves it in the profile ``.env``, so the panel's save is captured.)Úskills_toolNr   )Ú	callbacksc                ó6   <€ SP                  V4       R RRV RR/# )ÚsuccessTÚ	stored_asÚ	validatedF)r¾   )rÍ   rÎ   Úcaptureds   &&€r8   ÚcaptureÚ)GatewayAgent._ask_secret.<locals>.capture¤  s"   ø€ Ø�O‰O˜EÔ"Ø˜t [°#°{ÀEÐJÐJr;   Úenv_varrj  Úmetadata)r<  r  Ú_secret_capture_callbackÚ
hermes_clir  Ú_SECRET_LOCKÚsave_env_value_securer¼   )r7   rè  r  r-  r  r  Úsaverr  s   &&     @r8   Ú_ask_secretÚGatewayAgent._ask_secret™  sµ   ø€ õ 	&Ø×7Ñ7ˆØÒÙÝ(Øˆõ	K÷ Ž\Ø5>×5TÑ5TÐV]Ð2ˆEÔ2ð8Ù˜Ÿ™ IÓ.×4Ð4°"°f·j±jÀÓ6J×6PÐ6PÈbÐRX×R\ÑR\Ð]gÓRhÔià27Õ/÷ ÷ 'ˆx˜�{Ð.¨BÐ.øð 38Õ/ú÷ �\ús)   ¶CÁ3B8Á?B8ÂCÂ8C Ã CÃC	c                	óV   € V P                   p\        V\        4      '       d   V# R RRV/# )r¶  r·  Úcontent)r“   rT  r
  )r7   ræ  ré  s   && r8   Ú	_user_rowÚGatewayAgent._user_row°  s.   € Ø×/Ñ/ˆÜ�fœd×#Ò#ØˆMØ˜ 	¨<Ð8Ð8r;   c                ó¢   € ^ RI Hp V P                  4        V P                  V! R4      4       / \        CR\        V4      RRRV P                  /C# )a  TUI-26: the owner took a bare stop phrase typed into this LOCAL session's voice chat (turned
on by another viewer) as the end of that chat and admitted nothing, so no ``message.complete``
will come. The turn ends at once with main's typed-stop notice; the history is unchanged.r   r¢  r{  r	   TrF   )r¥  r¡  rñ  r¦  Ú_RESULT_DEFAULTSrÉ  rF   )r7   r$  r¡  s   && r8   r  ÚGatewayAgent._voice_stopped¶  sO   € õ 	!Ø×"Ñ"Ô$Ø×Ñ™Ð8Ó9Ô:ØtÔ"Ðt J´°W³¸ÐPTÐVbÐdh×dsÑdsÑtÐtr;   r   r  c               ó¦   € / \         CRRRWP                  V4      .,           RRRRRVR	V P                  /CpV'       d   VP                  WER
7       V# )z¡``failure_reason="gateway_connection"``: the CLI shows ``error`` as written instead of
classifying a lost gateway as a model failure ("Run /model to switch...").r
   r   r{  r   Tr   Fr   rF   )r   Úfailure_retryable)r/  r,  rF   Úupdate)r7   r$  ræ  r   r   r  Úouts   &&&&$$ r8   r  ÚGatewayAgent._failed¿  sb   € ðbÔ!ð bÐ#3°R¸ÀW×P^ÑP^Ð_kÓPlÐOmÕEmØ˜˜{¨E°7¸EÀ<ÐQU×Q`ÑQ`ñbˆçØ�J‰J nˆJÔRØˆ
r;   c                	ó\  € T;'       g    / P                  R 4      ;'       g    / pV'       d   RVP                  R4      /pM`VP                  '       dO    V P                  P                  RVP                  V P                  V4      VP                  RR7      ;'       g    / p\        VP                  R4      ;'       g    / 4      p\        VP                  R4      ;'       g    / 4      pT;'       g    / P                  R	4      ;'       g    T;'       g    / P                  R4      p	/ \        CVCp
R
V9  dL   T;'       g    / P                  R4      ;'       g&    T;'       g    / P                  R4      ;'       g    RV
R
&   V	R9   g!   T;'       g    / P                  R4      R8X  d   RV
R&   RV
R&   M"V	R9   d   V'       g   V
P                  RRR7       \        VP                  R4      \        4      '       d   VP                  R4      MRpVe'   VP                  R4      '       d   \        V4      V
R&   M5WP                  V4      .,           \        T;'       g    . 4      ,           V
R&   V'       gR   V
P                  R
4      '       d;   V
P                  R4      '       g$   V
R,          P                  RRRV
R
,          /4       V P                  V
R&   V P!                  V4      '       g   V
# V
R,          V n        VP                  R4      p\        V\$        4      ;'       d4    \        V\&        4      '       * ;'       d    V
P                  R4      '       * pV'       d   TMRV n        V P+                  WxV4       V
#   \         d"   p\        P                  RT4        Rp?ELRp?ii ; i)r  r)  rb  T)rF   r	  r  rc  zprompt.receipt failed: %sNr  rÂ   r  r
   rŸ  r+  r   r   rJ  Fr   r   )r   r   r{  Ú_compressedr¶  Ú	assistantrF   r   >   rJ  r   >   r   r   )r¼   rG   ry   rÑ   rF   rG  r   rÒ   rÓ   r
  r/  r3  rT  rÉ  r,  r¾   r  rŽ   r9  rW  rx  Ú_apply_usage)r7   r$  ræ  Úcompleter#  r  rÕ   ÚstoredrÂ   r  r4  ÚsuffixÚcallsÚcounteds   &&&&&         r8   r  ÚGatewayAgent._resultÈ  s  € Ø—>�>˜r×&Ñ& zÓ2×8Ð8°bˆßØ! 7§;¡;¨yÓ#9Ð:‰HØ�^�^ˆ^ð?ØŸ/™/×.Ñ.Ð/?ÈDÏOÉOÐei×eoÑeoÐptÓeuØ<@¿N¹NÐ[_ð /ó a÷ gð gØdfð ô �g—k‘k (Ó+×1Ð1¨rÓ2ˆÜ�W—[‘[ Ó)×/Ð/¨RÓ0ˆØ—.�.˜b×%Ñ% hÓ/×RÐR°H·N°NÀ×3GÑ3GÈ	Ó3RˆØ,Ô!Ð, VÐ,ˆØ 6Ô)Ø%-§^ ^°×$8Ñ$8¸Ó$@×$iÐ$iÀXÇ^À^ÐQS×DXÑDXÐYbÓDc×$iÐ$iÐgiˆCÐ Ñ!ØÐ1Ô1°h·n°nÀ"×5IÑ5IÈ)Ó5TÐXcÔ5cØ!%ˆC�ÑØ$ˆC�ÒØÐ*Ô*·6Ø�J‰J˜d¨eˆJÔ4Ü+5°f·j±jÀÓ6LÌd×+SÒ+S�—‘˜JÔ'ÐY]ˆØÒ &§*¡*¨]×";Ò";Ü" 6›lˆC�
ŠOà%¯©¸Ó)EÐ(FÕFÌÈfÏlÈlÐXZÓI[Õ[ˆC�
‰Oß˜#Ÿ'™'Ð"2×3Ò3¸C¿G¹GÀH×<MÒ<MØ�
�O×"Ñ" F¨K¸ÀCÐHXÕDYÐ#ZÔ[Ø ŸO™OˆˆLÑØ�z‰z˜$×ÒØˆJØ!$ Z¥ˆÔØ—
‘
˜;Ó'ˆô ˜U¤CÓ(×gÐg´¸EÄ4Ó1HÔ-H×gÐgÐQT×QXÑQXÐYfÓQgÔMgˆß(/™u°TˆÔØ×Ñ˜&¨Ô.Øˆ
øô? &ô ?Ü—‘Ð8¸#×>Ò>ûð?ús   ÁA	M? ÂM? Í?N+Î
N&Î&N+c                óZ  € ^ RI Hp VP                  R4      '       d   VP                  R4      MRp\        V\        4      '       d   TMVP                  R4      pVP                  R4      '       g-   \        V\        4      '       d   VP                  4       '       g   R# VP                  R4      ;'       g+    VP                  R4      ;'       g    VP                  R4      p\        V4      ;'       dW    VP                  4       VP                  VP                  P                  4       VP                  P                  4       0,          9   VR&   V P                  VP                  3WAP                  33 F4  w  r‰Ve   VR,          '       g	   V! W–4      MR	p
V
'       g   K,  V! V
4       K6  	  R# )
z¡After a replay gap, the reply once (``owed_reply``): a reuse this terminal showed whole stays
the only copy; otherwise main's panel shows what streaming did not.)Ú
owed_replyr   r   Nr
   r   r   Úresponse_reusedr   )rd  rA  r¼   rT  r�  rY   rW  rK   rR   rU   rs   )r7   r#  r4  r:  r!  rA  ró  ÚreusedÚconsumerÚgotÚoweds   &&&&&      r8   r  ÚGatewayAgent._paint_owedñ  sF  € õ 	=Ø58·W±WÐ=S×5TÒ5T�—‘Ð0Ô1ÐZ^ˆÜ# E¬3×/Ò/‘°S·W±WÐ=MÓ5NˆØ�7‰7�8×Ò¤J¨u´c×$:Ò$:À%Ç+Á+Ç-Â-ÙØ—‘Ð-Ó.×oÐo°#·'±'Ð:KÓ2L×oÐoÐPX×P\ÑP\Ð]nÓPoˆÜ$(¨£L×${Ð${°U·[±[³]ÀdÇiÁiÐSW×S]ÑS]×ScÑScÓSeÐgk×grÑgr×gxÑgxÓgzÐR{ÕF{Ñ5{ˆÐ Ñ!Ø#×9Ñ9¸4¿:¹:ÐFÈ×ZeÑZeÐHfÓg‰MˆHØ-5Ò-AÈ#ÐNb×JcÔJc‘:˜cÔ)ÐikˆDß‰tÙ˜–ó hr;   c                ó
  a€ ^ RI Hp ^ RIHp \	        V P
                  \        4      '       d   V P
                  M. o\        V R^ 4      ;'       g    ^ pV^ 8:  g   S'       d   V P                  e
   RV n	        R# \        V RR4      p\	        V\        4      '       d;   ^ Tu;8:  d   \        S4      8  d#   M MSV,          P                  R4      R8X  d   TM@\        V3R l\        \        S4      ^,
          RR4       4       \        S4      ^,
          4      pV P                  pV P                   V P"                  r‡\	        V\        4      '       d   V^ 8„  M!Wx8„  ;'       g    ^ Tu;8  ;'       d    V8  Mu p	V	'       d
   V^,           MTp
V
^ 8:  d
   RV n	        R# SV
R pV'       d'   V^ ,          P                  R4      R	8X  d
   VR
,          pV'       d   V! VRR7      M^ pV! \%        ^W<,
          4      ^ SRV
 4      V n	        R# )a¼  Main's bar shows the anchored ``context_tokens`` by re-deriving it from
``_turn_base_usage_anchor`` over ``_session_messages`` (``anchored_context_tokens``), and marks
it ``~`` when the turn appended rows after its first response. Rebuild an anchor over this
viewer's transcript that yields the gateway's figure: rows after the first API call of a
multi-call turn are the estimated delta (main's ``~``); a single reply is covered by the anchor.)Úestimate_messages_tokens_rough)Úcapture_usage_anchorrY  Nr�   r¶  r·  c              3  óf   <"  € T F&  pSV,          P                  R 4      R8X  g   K"  Vx € K(  	  R# 5irµ  r¸  )r¹  Úir{  s   & €r8   r»  Ú/GatewayAgent._anchor_display.<locals>.<genexpr>  s+   øé € ÐhÑ"B˜QÀhÈqÅkÇoÁoÐV\ÓF]ÐagÑFg—q’qÓ"Bùs   ƒ1§
1r8  :é   NNF)Úcharge_stale_thinkingrÃ  )Úagent.model_metadatarI  Úagent.usage_anchorrJ  rT  rŽ   rÉ  rƒ   rª   rw  r9  r  r¼   re  Úrangerx  r+   rv  rÇ  )r7   rI  rJ  ÚtokensÚaskÚ	last_userÚ
turn_callsr=  Ú	turn_baseÚ	made_callÚbaseÚdeltaÚestimater{  s   &            @r8   rZ  ÚGatewayAgent._anchor_display   sµ  ø€ õ 	HÝ;Ü-7¸×8NÑ8NÔPT×-UÒ-U�4×)Ò)Ð[]ˆÜ˜Ð0°!Ó4×9Ð9¸ˆØ�QŒ;Ÿh¨$×*:Ñ*:Ò*FØ+/ˆDÔ(Ùô
 �dÐ-¨tÓ4ˆÜ% c¬3×/Ò/°A¸Ö4L¼sÀ8»}×4LÐQYÐZ]ÕQ^×QbÑQbÐciÓQjÐntÔQt‘CÜÔh¤%¬¨H«¸Õ(9¸2¸rÔ"BÓhÜ˜(“m aÕ'ó)ð 	ð ×)Ñ)ˆ
Ø×1Ñ1°4×3HÑ3HˆyÜ&0°¼S×&AÒ&A�J ’NÈÑHY×HrÐHrÐ]^Ðaf×]rÔ]rÐirÔ]rˆ	ß )ˆy˜1Ž}¨yˆØ�1Œ9Ø+/ˆDÔ(ÙØ˜˜�ˆß�U˜1•X—\‘\ &Ó)¨[Ô8Ø˜"•IˆEßY^Ñ1°%ÈuÕUÐdeˆÙ';¼CÀÀ6ÕCTÓ<UÐWXÐZbÐchÐdhÐZiÓ'jˆÖ$r;   c                ót  €  V P                   P                  RV P                  ^
T;'       d    V P                  V4      R7      p\        T\        4      '       d7   \        TP                  R4      \        4      '       d   TP                  R4      MTp\        T\        4      '       d&   \        TP                  R4      \        4      '       g   R# Te   T P                  T4      '       d    T P                  4       P                  T4       R#   \         d"   p\
        P                  RT4        Rp?R# Rp?ii ; i)	uY   ``session.stats`` â†’ the same attributes ``session.usage`` sets; False when unavailable.zsession.stats)rF   r,  r	  zsession.stats unavailable: %sNFrÂ   r   T)ry   rÑ   rF   rG  r   rÒ   rÓ   rT  r
  r¼   r9  r  rº   Úapply_usage)r7   r#  ÚstatsrÕ   s   &&  r8   r|  ÚGatewayAgent._refresh_stats&  sé   € ð	Ø—O‘O×(Ñ(¨ÀTÇ_Á_Ð^`Ø15×1JÐ1J¸$¿*¹*ÀTÓ:Jð )ó LˆEô
 '1°¼×&=Ò&=Ä*ÈUÏYÉYÐW^ÓM_Ôae×BfÒBf�—	‘	˜'Ô"ÐlqˆÜ˜5¤$×'Ò'¬J°u·y±yÀÓ7MÌs×,SÒ,SÙØŠ<˜4Ÿ:™: d×+Ò+Ø�K‰K‹M×%Ñ% eÔ,Ùøô "ô 	Ü�L‰LÐ8¸#Ô>Ýûð	ús   ‚*D ­D ÄD7ÄD2Ä2D7c                óž  € V P                  V4      '       g   V P                  V4      '       g   R# \        P                  4        Uu/ uF3  p\	        VP                  V4      \        4      '       g   K*  WAV,          bK5  	  ppR	 FU  pWE9  g   K  \	        VP                  V4      \        4      '       g   K2  RV,           p\        W4      W$,          ,           WT&   KW  	  VP                  RVP                  R4      4       VP                  RVP                  R4      4       \	        VP                  R4      \        4      '       dM   \	        VP                  R4      \        4      '       d(   VP                  RVR,          VR,          ,           4       \	        VP                  R4      \        4      '       d   V P                  VR,          ,           VR&   R
 F_  pVP                  V4      '       g   VP                  V4      '       g   K3  VP                  V4      ;'       g    VP                  V4      WT&   Ka  	  V P                  V4       R# u upi )z§Turn end: the session-cumulative ``session.stats`` (the same dict ``session.usage`` carries);
a gateway without the verb leaves the per-turn receipt figures as before.Nr   r   Úsession_r    r"   r$   r   )r   r   )r0   r2   ra   )r|  r  rU  r@  rT  r¼   r9  rƒ   Ú
setdefaultr+   r¿   )r7   r;  Úreceipt_usager#  rÍ   rÂ   r^  s   &&&&   r8   r9  ÚGatewayAgent._apply_usage5  sÀ  € ð ×Ñ˜t×$Ò$¨D¯J©J°t×,<Ò,<Ùô .A×-GÑ-GÔ-IÓnÑ-I cÌZÐX^×XbÑXbÐcfÓXgÔil×MmÔ!�˜S•kÒ!Ñ-IˆÐnÛ4ˆCØÖ¤J¨}×/@Ñ/@ÀÓ/EÄs×$KÔ$KØ! CÕ'�Ü$ TÓ0°=Õ3EÕE�“
ñ 5ð 	×Ñ˜¨%¯)©)°NÓ*CÔDØ×ÑÐ,¨e¯i©i¸Ó.HÔIÜ�e—i‘i Ó0´#×6Ò6¼:ÀeÇiÁiÐPcÓFdÔfi×;jÒ;jØ×Ñ˜^¨U°?Õ-CÀeÐL_ÕF`Õ-`ÔaÜ�f—j‘j Ó-¬s×3Ò3Ø!%×!7Ñ!7¸&ÀÕ:MÕ!MˆE�+ÑÛDˆCØ× Ñ  ×%Ò%¨¯©°C¯¬Ø*×.Ñ.¨sÓ3×FÐF°v·z±zÀ#³�“
ñ Eð 	× Ñ  Ö'ùò os   Á'I
Á3I
)Trœ   r«   r\  r]  r–   r•   r¤   r4   rY  r¡   rŸ   r    r�   r­   r˜   rª   r›   r®   r�   r¢   r£   r´   r‰   r“   r�   r‘   r’   rš   rŒ   r¯   r™   r‡   r±   r†   r„   r—   r  rŽ   rˆ   r·   r¨   r  r°   r¬   rx  r�   rw  rv  r¸   r¶   rž   r”   r…   rd   rc   rk   r©   ry   rl   rm   r¥   rŠ   rx   re   r|   ra   r{   ru   rv   rb   rf   rw   rn   r²   rj   rF   rs   r‹   ro   rr   rt   rp   rg   rq   )r   r   )r   r   r   r   NrX   )NN)NNNNN)F)er<   r=   r>   r?   r@   ÚplatformÚ_supports_active_turn_redirectr9   r\   rg   Úsetterri   r³   rã   ræ   rÜ   rµ   r  r¨   rF   rn   rj   rº   r¹   r<  rG  rJ  r¿   ri  rm  rp  rs  r¦   r}  r€  rƒ  r†  r‰  rŒ  r�  r˜  rœ  r©  rÏ  rÒ  rÖ  rë  rå  rñ  rä  r*  r  r  r:  r  r  rG  r  rU  rV  rt  rs  r{  r  rŠ  r’  r§  r¡  r¯  r  rµ  r¹  r¼  rÁ  rÉ  rÌ  rÏ  rÒ  rÖ  r¦  rè  rô  r÷  rú  rf  r  r  rT  rÁ   r  r  r(  r,  r  r  r  r  rZ  r|  r9  rA   rB   r;   r8   r^   r^   W   s®  † Ù`à€HØ%)Ð"ð{2 Tð {2°dð {2À$ð {2ÐQUð {2Ð`dð {2Øð{2Ø/1ð{2Ø>Bð{2ØW\ð{2à"&ð{2à59ð{2àLPð{2àfjð{2ð -1ð{2ð %)ð	{2ð =Að	{2ð Z^ð	{2ð
 &*ð{2ð
 CGð{2ð
 _cð{2ð $(ð{2ð :>ð{2ð VZð{2ð $(ð{2ð EIð{2ð VZð{2ð !&ð{2ð ?Cð{2ð ]að{2ð  ð{2ð 59ð{2ð JLô{2ð| ñ(ó ð(ð ×Ññ
?ó ð
?ð ñ&ó ð&ð ×Ññ4ó ð4ò
:ò4ò$ò
ô*	Yñ<Øð<Ø).ð<Ø68õ<ð~ ñó ðð ×Ññ&ó ð&ð ñ ó ð ð ×Ññ2ó ð2ðD ñ(ó ð(ð ×Ññ+ó ð+ð  ñ"ó ð"ð ×Ññ)ó ð)ò(6òQð ñTó ðTð ñAó ðAò&ò%.òPòòòòEò
2òò*òòòòô>ô òHñ$%:ÐPTð %:Ðbfð %:Ø $ð%:Ø48õ%:òN,òò#òJNò;ò
?ô&BòH4ò$ ò}òIò?ò,ò
-ò^Wò><ò&ôò#ò8òdòdò$Eò:"ò!òDò+ò>ò?òuòXò;ò8ò4ò#ò
(ò
Pò$Uò .ò5ò?ò^ò
^ò
eò$Tò<òBò
/ò.9òuðÀdð ÐV[ô ò'òRò$kôLö(r;   r^   c                óÆ   € \        V \        4      '       g   R# V P                  R4      RJ d   R# V P                  R4      p\        V\        4      '       d   V'       d   V# R# )zaThe ``session.mutate reasoning`` effort for main's ``reasoning_config`` dict (None: no override).NÚenabledFÚnonerð   )rT  r
  r¼   r�  )rÞ   rð   s   & r8   râ   râ   M  sM   € ä�fœd×#Ò#ÙØ‡z�z�)Ó Ó%ÙØ�Z‰Z˜Ó!€FÜ ¬×,Ò,·ˆ6ÐA¸TÐAr;   c                ó¾  € \        V \        4      '       g   R# ^ RIHpHp R UUUu/ uFO  pY1! R/ V P                  V4      ;'       g    / P                  4        UUu/ uF  w  rEVR	9   g   K  WEbK  	  uppB bKQ  	  ppppT! R/ VBR\        V P                  R4      ;'       g    R4      R\        V P                  R4      ;'       g    R4      /B # u uppi u upppi )
zN``get_rate_limit_state()`` rebuilt from its serialized dict (None stays None).N)ÚRateLimitBucketÚRateLimitStateÚcaptured_atr–  rb   r   )Úrequests_minÚrequests_hourÚ
tokens_minÚtokens_hourrB   >   ÚlimitÚ	remainingro  Úreset_seconds)	rT  r
  Úagent.rate_limit_trackerrm  rn  r¼   rV  r[  r�  )r¬  rm  rn  r?  rh  rÎ  Úbucketss   &      r8   r¯   r¯   W  sõ   € ä�dœD×!Ò!ÙßHñ Zõ[áY�4ð �_ñ i¸$¿(¹(À4».×:NÐ:NÈB×9UÑ9UÔ9Wô (hÑ9W±°Ø+,Ð0fÑ+fô )-¨ªÑ9Wò (hñ iò iáYð ò [ñ ñ D˜Gñ D´°t·x±xÀÓ7N×7UÐ7UÐRUÓ1Vð DÜ#& t§x¡x°
Ó';×'AÐ'A¸rÓ#BòDð Dùó(hùô [s#   § CÁCÁCÁ,CÁ2
CÃCc                ó´   € \        V \        4      '       d3   \        V P                  R4      ;'       g    R4      P	                  4       MRpV'       d   RV 2# R# )u  Main's ``display.review.summary_cli`` line for the gateway's ``review.summary`` frame: the background
review's "ðŸ’¾ Self-improvement review: ..." (``/refine``, the post-turn review), which the gateway
publishes to a local viewer once the turn settled. None for an empty one.rŸ  r   z  N)rT  r
  r�  r¼   rY   )rõ   rŸ  s   & r8   rÕ  rÕ  c  sK   € ô 6@ÀÌ×5NÒ5NŒ3ˆw�{‰{˜6Ó"×(Ð( bÓ)×/Ñ/Ô1ÐTV€DßˆR�ˆvˆ;Ð( DÐ(r;   c                ó   a € V 3R  lpV# )c                óÔ  <€ V P                   f   R # VP                  4        UUu/ uF  w  rEVR	9  g   K  WEbK  	  pppVP                  R4      e   VR,          VR&   VP                  R4      e   VR,          VR&   V P                   ! SVP                  R4      ;'       g    VP                  R4      VP                  R4      ;'       g    VP                  R4      R 3/ VB  R # u uppi )
NÚlabelrŸ  r?  ÚpreviewÚindexÚcountÚ	moa_indexÚ	moa_count>   r?  rŸ  r  r~  r|  r}  )rp   rV  r¼   )Úagentrõ   r!  r'  rh  rÎ  ÚextrarW  s   &&&&   €r8   ro  Ú_moa_handler.<locals>.handlerl  sÒ   ø€ Ø×'Ñ'Ò/ÙØ")§-¡-¤/Ôu¡/™$˜!°QÐ>tÑ5t”�’¡/ˆÑuà�;‰;�wÓÒ+Ø!(¨Õ!1ˆE�+ÑØ�;‰;�wÓÒ+Ø!(¨Õ!1ˆE�+ÑØ×$Ò$ T¨7¯;©;°wÓ+?×+VÐ+VÀ7Ç;Á;ÈvÓCVØ%,§[¡[°Ó%8×%RÐ%R¸G¿K¹KÈ	Ó<RÐTXñ	cØ\aô	cùó vs
   ¥C$µC$rB   )rW  ro  s   f r8   Ú_moa_handlerr…  k  s   ø€ õ
cð €Nr;   c               ó   € V ^8„  d   QhRR/# )é   Úreturnr
  rB   )Úformats   "r8   Ú__annotate__rŠ  z  s   € ÷ ñ  tñ r;   c                ó0  € VP                  R4      ;'       g    .  Uu. uF   p\        V\        4      '       g   K  VP                  R4      '       g   K4  RVP                  R4      RVP                  R4      ;'       g    RR\        VP                  R4      ;'       g    . 4      R\	        VP                  R4      4      /NK¢  	  ppV e	   V'       g   RR/# V ! V4      p\        V\        4      '       g   RR/# VP                  R	4      ;'       g    / P                  4        UUu/ uF8  w  rVT\        V\        4      '       g   Vf   TM\        P                  ! V4      bK:  	  pppR	V/pVP                  R4      R
9   d   VR,          VR&   V# u upi u uppi )z©Main's batch clarify panel (``callback(questions)``, ``HermesCLI._clarify_callback``) answering a
``clarify`` server request's whole question set: its ``ClarifyResult``.Ú	questionsrì  rí  r   rÝ  rî  r)  rJ  rï  )Ú	submittedÚ	timed_outrJ  )	r¼   rT  r
  rÉ  rW  rV  r�  rª  Údumps)	r-  rè  ÚqrŒ  ró  rì  rÎ   rï  r4  s	   &&       r8   r  r  z  s‚  € ð
 !Ÿ*™* [Ó1×7Ð7°RÐ7óaá7�Q¼:ÀaÌ×;NôhàST×SXÑSXÐY^×S_ôh�%˜Ÿ™˜u› z°1·5±5¸Ó3D×3JÐ3JÈØœT !§%¡%¨	Ó"2×"8Ð"8°bÓ9¸>Ì4ÐPQ×PUÑPUÐVdÓPeÓKfóhá7ð ð að ÒŸyØ˜;Ð'Ð'Ù�YÓ€EÜ�eœT×"Ò"Ø˜;Ð'Ð'à"'§)¡)¨IÓ"6×"<Ð"<¸"×!CÑ!CÔ!EôGÙ!E‘:�3ð œj¨´×4Ò4¸º‘UÌ4Ï:Ê:ÐV[ÓK\Ò\Ù!Eð ñ Gà�gÐ
€CØ‡y�y�ÓÐFÔFØ˜yÕ)ˆˆI‰Ø€JùòaùóGs"   žF»FÁ)FÁ>FÂ&FÄ$>FÚsudoÚsecretr
  zmessage.deltazmessage.interimztool.generatingrƒ  z
tool.startztool.completeztodo.updatedzsession.control.updatezthinking.deltazreasoning.deltar¿  zmoa.referencezmoa.aggregatingznotification.showznotification.clearÚreactionzagent.printzreview.summaryzapproval.requestzclarify.requestzconnection.requestzconnection.update)=r@   Ú
__future__r   rª  Úloggingr1  Ú	threadingr“  rö   Ú
contextlibr   rÆ  r   r   Úhermes_cli.gateway_connectionr   r   r   Ú	getLoggerr<   rÒ   r9  rP  r§  r/  rU  r-   rD   r^   râ   r¯   rÕ  r…  r  ÚLockr%  r  r(  r  rS  rt  r{  r  rŠ  r’  r§  r¯  rµ  r¹  r¼  rÁ  rÉ  rÌ  rÏ  rÒ  rÖ  rè  rô  r÷  rú  rn  rB   r;   r8   Ú<module>r›     s-  ðñ	õ #ã Û Û Û Û Û Ý ç Iß PÑ Pà	×	Ò	˜8Ó	$€ð  Ð Ø€ð  €ðØ�bðØ" EðØ+4°eðØ=DÀdðØL\Ð^bðà�ðà$ eðà-@À$ðàHSÐUVðð �Tðð ,¨Tðð 4HÈðð ˜Eð	ð $<¸Tð	ð DSÐTXð	ð
 �rðÐ ð ˜NÐ,CÀ_Ø˜_Ð.IÐK^Ø˜NÐ,GÐI\Ø Ð"6Ð8RÐTfØ˜ðÐ ÷	"ñ 	"÷+ñ +÷0s(ñ s(òl'Bò	Dò)òõð& �~Š~Ó€à
ˆL×"Ñ"Øˆl×&Ñ&Øˆ|×(Ñ(ðÐ ðØ�\×+Ñ+ðà�|×/Ñ/ðð �|×7Ñ7ðð �\×3Ñ3ð	ð
 �,×-Ñ-ðð �\×3Ñ3ðð �L×)Ñ)ðð ˜l×=Ñ=ðð �l×/Ñ/ðð �|×1Ñ1ðð ˜<×?Ñ?ðð ‘\ /Ó2ðð ‘|Ð$5Ó6ðð ˜×0Ñ0ðð ˜,×7Ñ7ðð  �×)Ñ)ð!ð" �<×)Ñ)ð#ð$ �l×5Ñ5Ø˜×1Ñ1Ø�|×/Ñ/Ø˜,×=Ñ=Ø˜×;Ñ;ñ-‚	r;   