+
    .pÐjé¬ ã                  ón  € 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
t
^ RIt^ RIt^ RIt^ RIHt ^ RIHtHtHt ]P(                  ! R4      t]! 0 R¿m4      t]! R04      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RbRRbRR bRR!bRR"bRR#bR	R$bR%R&btR#R'/tR( R) ltR* R+ ltRÀR, R- lltR. R/ ltR0^R1^R2^R3^/tR4R/R5 R6 llt R7 R8 lt!R9 R: lt"R; R< lt#R= R> lt$RÁR?R@/RA RB lllt%RRCRRCRRC/t&RD RE lt'RFRRGR@/RH RI llt(RÂRJ RK llt)RLRRMR/RN RO llt*RP RQ lt+RR RS lt,RT RU lt-RV RW lt.RX RY lt/RÃRZR@/R[ R\ lllt0R] R^ lt1R_ R` lt2Ra Rb lt3Rc t4Rd Re lt5Rf Rg lt6Rh Ri lt7Rj Rk lt8RÀRl Rm llt9RnR@/Ro Rp llt:Rq Rr lt;Rs Rt lt<Rut=^Èt>RÄt?Rv Rw lt@Rx Ry ltARzRR{R@/R| R} lltBR~ R ltC]! R€04      tDR�tER‚tFRƒ R„ ltGR… R† ltHR‡ Rˆ ltIR{R@/R‰ RŠ lltJR{R@/R‹ RŒ lltKR� RŽ ltL]! 0 RÅm4      tM]! 0 RÆm4      tNRÀR� R� lltORÀR‘ R’ lltPRÇR“ R” lltQR• R– ltRR— R˜ ltSR™ Rš ltT] ! R› Rœ4      4       tUR� Rž ltVRŸ R  ltWR¡ R¢ ltXR£ R¤ ltYR¥ R¦ ltZ^<t[R§ R¨ lt\R© Rª lt]R« R¬ lt^R­ R® lt_R¯ R° lt`R± R² ltaR³ R´ ltbRµ R¶ ltcR· R¸ ltdRÁR{R@/R¹ Rº lllte^ R»IfHgth ^ R¼IfHitj ^ R½IfHktl ^ R¾IfHmtn R# )ÈaÖ  Cron delivery: target resolution (origin/home/explicit/bot-chat), transcript mirroring and
session seeding, live-adapter / relay / standalone send lanes, and ``_deliver_result``.

Split out of ``cron.scheduler``. Import names from this module directly (``cron.scheduler`` only
imports the few it calls itself). Origin-resident helpers and sibling split modules are reached
late-bound (``_sched`` / module refs at the bottom) so monkeypatching the defining module works.
)ÚannotationsN)Ú	dataclass)ÚAnyÚListÚOptionalzcron.schedulerÚtelegramÚdiscordÚslackÚwhatsappÚsignalÚmatrixÚ
mattermostÚdingtalkÚfeishuÚwecomÚweixinÚsmsÚemailÚbluebubblesÚqqbotÚ
api_serverÚMATRIX_HOME_ROOMÚTELEGRAM_HOME_CHANNELÚDISCORD_HOME_CHANNELÚSLACK_HOME_CHANNELÚSIGNAL_HOME_CHANNELÚMATTERMOST_HOME_CHANNELÚSMS_HOME_CHANNELÚEMAIL_HOME_ADDRESSÚDINGTALK_HOME_CHANNELÚFEISHU_HOME_CHANNELÚWECOM_HOME_CHANNELÚWEIXIN_HOME_CHANNELÚBLUEBUBBLES_HOME_CHANNELÚQQBOT_HOME_CHANNELÚWHATSAPP_HOME_CHANNELÚwhatsapp_cloudÚWHATSAPP_CLOUD_HOME_CHANNELÚQQ_HOME_CHANNELc               ó    € V ^8„  d   QhRRRR/# )é   Úlogical_platform_nameÚstrÚreturn© )Úformats   "Ú&/opt/hermes/cron/scheduler_delivery.pyÚ__annotate__r1   @   s   € ÷ ñ ¸sð Àsñ ó    c                ó  € \         P                  ! \        4      ;_uu_ 4        \        V RR4      ;'       g    / pTP	                  \        T;'       g    R4      P                  4       4      p\        V\        4      '       d   VP	                  R4      MRpVf   VP	                  R4      pVe8   \        V4      P                  4       P                  4       R8X  d    RRR4       R# RRR4       R#   + '       g   i     R# ; i)uÿ  Return ``"in_channel"`` or ``"thread"`` (default) for a platform config.

Native: flat ``platforms.<p>.extra.cron_continuable_surface``. Relay-fronted:
``platforms.relay.extra.<logical>.cron_continuable_surface`` (same sub-block as the relay's
Slack knobs); the sub-block wins and is scoped to its logical platform. Unlike
_relay_slack_extra, a sub-block that omits the knob falls back to the flat key (deliberate â€”
the flat key must keep working), so a flat value applies to EVERY platform the relay fronts.
ÚextraNÚ Úcron_continuable_surfaceÚ
in_channelÚthread)
Ú
contextlibÚsuppressÚ	ExceptionÚgetattrÚgetr,   ÚlowerÚ
isinstanceÚdictÚstrip)Úpconfigr+   r4   ÚsubÚraws   &&   r0   Ú_resolve_cron_surface_moderE   @   sÃ   € ô 
×	Ò	œY×	'Õ	'Ü˜ ¨$Ó/×5Ð5°2ˆØ�i‰iœÐ1×7Ð7°RÓ8×>Ñ>Ó@ÓAˆÜ5?ÀÄT×5JÒ5Jˆc�g‰gÐ0Ô1ÐPTˆØŠ;Ø—)‘)Ð6Ó7ˆCØŠ?œs 3›xŸ~™~Ó/×5Ñ5Ó7¸<ÔGØ÷ 
(×	'Ñ	'ñ ÷ 
(Ö	'ñ ús   £0C0ÁBC0Ã0D	c               ó    € V ^8„  d   QhRRRR/# ©r*   Újobr@   r-   úOptional[dict]r.   )r/   s   "r0   r1   r1   T   s   € ÷ ñ ˜ð  .ñ r2   c                ó
  € V P                  R4      p\        V\        4      '       d\   VP                  R4      '       dE   VP                  R4      '       d.   \        VR,          4      P	                  4       \
        9   d   R# V# R# )uê  Extract origin info from a job. Non-dict origins (provenance strings, hand-edited
jobs.json) are treated as missing â€” otherwise every fire crashed on ``origin.get``.

Without this guard, a job tagged with e.g. ``"combined-digest-replaces-x-and-y"`` crashed every fire
attempt with ``'str' object has no attribute 'get'`` â€” ``mark_job_run`` recorded the failure, but the
next tick re-loaded the same poisoned origin and crashed identically until the field was patched
manually (#18722).
ÚoriginÚplatformÚchat_idN)r=   r?   r@   r,   r>   Ú_NON_PUSH_ORIGIN_PLATFORMS)rH   rK   s   & r0   Ú_resolve_originrO   T   sd   € ð �W‰W�XÓ€FÜ�&œ$×Ò F§J¡J¨z×$:Ò$:¸v¿z¹zÈ)×?TÒ?Tô ˆv�jÕ!Ó"×(Ñ(Ó*Ô.HÔHÙØˆÙr2   c               ó$   € V ^8„  d   QhRRRRRR/# )r*   rH   r@   ÚcfgrI   r-   Úboolr.   )r/   s   "r0   r1   r1   h   s!   € ÷ ñ  tð °.ð ÈDñ r2   c                ó*  € V P                  R4      p\        V\        4      '       d   V#  Vf    \        P                  ! 4       ;'       g    / p\        VP                  R/ 4      ;'       g    / P                  RR4      4      #   \
         d     R# i ; i)u¶  Whether a cron delivery is also mirrored into the target chat's session transcript.

Default OFF. Precedence: per-job ``attach_to_session`` (bool) â†’ global
``cron.mirror_delivery`` â†’ False. CARVE-OUT: the ``in_channel`` surface seeds its session
independently of this knob (the seed IS that feature) â€” this governs only the thread-surface
mirror. ``mirror_to_session`` runs at a turn boundary, so it is alternation- and cache-safe.
Úattach_to_sessionÚcronÚmirror_deliveryF)r=   r?   rR   Ú_schedÚload_configr;   )rH   rQ   Úper_jobs   && r0   Ú_cron_mirror_delivery_enabledrZ   h   sƒ   € ð �g‰gÐ)Ó*€GÜ�'œ4× Ò ØˆðØŠ;Ü×$Ò$Ó&×,Ð,¨"ˆCÜ�S—W‘W˜V RÓ(×.Ð.¨B×3Ñ3Ð4EÀuÓMÓNÐNøÜô Úðús   «B Á B Á,B ÂBÂBc          
     ó,   € V ^8„  d   QhRRRRRRRRRR	/# )
r*   rK   r@   Úplatform_namer,   rM   Ú	thread_idúOptional[str]r-   rR   r.   )r/   s   "r0   r1   r1   {   s8   € ÷ Oñ O 4ð O¸ð OÀcð OØ&3ðOØ8<ñOr2   c                ón  € V '       do   \        V P                  RR4      4      P                  4       \        V4      P                  4       8w  g*   \        V P                  RR4      4      \        V4      8w  d   R# V P                  R4      pVRJ ;'       g"    \        V4      \        T;'       g    R4      8H  # )uè   True when a delivery target is the job's own origin conversation. A pinned origin
thread_id must match â€” a target without it is a different lane. Mirror eligibility for
non-origin targets is decided by ``_target_mirror_eligible``.rL   r5   rM   Fr]   N)r,   r=   r>   )rK   r\   rM   r]   Úorigin_threads   &&&& r0   Ú_target_matches_originra   {   s‹   € ÷ Üˆv�z‰z˜* bÓ)Ó*×0Ñ0Ó2´c¸-Ó6H×6NÑ6NÓ6PÔPÜˆv�z‰z˜) RÓ(Ó)¬S°«\Ô9áØ—J‘J˜{Ó+€MØ˜DÐ ×NÐN¤C¨Ó$6¼#¸i¿o¸oÈ2Ó:NÑ$NÐNr2   rK   Úorigin_fallbackÚhomeÚexplicitÚorigin_matchc          
     ó,   € V ^8„  d   QhRRRRRRRRRR/# )	r*   rH   r@   ÚtargetÚglobal_mirrorrR   re   zOptional[bool]r-   r.   )r/   s   "r0   r1   r1   �   s4   € ÷ ñ Ø	ðØðØ/3ðØCQðØ]añr2   c               ó�  € VfR   \        V 4      ;'       g    / p\        WAP                  RR4      VP                  RR4      VP                  R4      4      pV'       d   R# VP                  R4      pVR
9   d5   V P                  R4      p\        V\        4      '       d   V# \	        V4      # VR8X  d   V P                  R4      RJ # R	# )u‚  Whether a resolved delivery target may receive the transcript mirror. Origin targets:
always. ``origin_fallback`` (deliver=origin with no captured origin â†’ home channel, standing
in for the primary conversation) and ``home`` (user-written bare-platform token, e.g.
``deliver: slack`` â€” deliberately addresses that platform's home channel): same flags as a
true origin. ``explicit`` ``platform:chat_id``: ONLY with per-job ``attach_to_session: true``
â€” the global flag must never write transcripts into arbitrary explicitly-addressed chats.
Untagged broadcast expansions (``all``) are never eligible. ``origin_match`` may be
precomputed.rL   r5   rM   r]   TÚ_resolved_fromrT   rd   F)rb   rc   )rO   ra   r=   r?   rR   )rH   rg   rh   re   rK   Úresolved_fromrY   s   &&$$   r0   Ú_target_mirror_eligiblerl   �   s¹   € ð ÒÜ  Ó%×+Ð+¨ˆÜ-Ø—J‘J˜z¨2Ó.°·
±
¸9ÀbÓ0IÈ6Ï:É:ÐVaÓKbódˆçÙØ—J‘JÐ/Ó0€MØÐ3Ô3ð —'‘'Ð-Ó.ˆÜ$ W¬d×3Ò3ˆwÐL¼¸mÓ9LÐLØ˜
Ô"Ø�w‰wÐ*Ó+¨tÐ3Ð3Ùr2   c               ó$   € V ^8„  d   QhRRRRRR/# )r*   Úis_dmrR   Úuser_idr^   r-   r.   )r/   s   "r0   r1   r1   ª   s!   € ÷ "ñ " dð "°]ð "Àtñ "r2   c                ó,   € \        T ;'       g    T4      # )u  Whether the flat in_channel seed may run. Group keys are user-isolated
(``â€¦:group:<chat_id>:<user_id>``): seeding without a real user_id creates an orphan session no
reply resolves to â€” worse than no seed. DM keys omit user_id, so DMs are always seedable.)rR   ©rn   ro   s   $$r0   Ú_inchannel_seed_allowedrr   ª   s   € ô �× Ð ˜Ó!Ð!r2   c               ó$   € V ^8„  d   QhRRRRRR/# )r*   Útextr,   Úwhatr-   r.   )r/   s   "r0   r1   r1   ±   s!   € ÷ /ñ /˜sð /¨#ð /°#ñ /r2   c                ó–   € V '       g   V #  ^ RI Hp V! V RR7      #   \         d"   p\        P	                  RY4        Rp?R# Rp?ii ; i)um  Fail-closed secret redaction for anything a cron job emits outward.

Every outward lane â€” chat message, session mirror, bot-chat turn â€” must apply the same policy,
so the policy lives in one place. ``force=True`` because this is a safety boundary, not
logging: the ``security.redact_secrets`` preference governs how much is scrubbed from the
user's own logs and must not be able to turn scrubbing off on the way out to a chat (same
reasoning as ``tools/delegation_live_log.py``). Empty input is returned as-is; any failure
inside the redactor replaces the payload entirely rather than letting an unscanned value out.
©Úredact_sensitive_textT)Úforcez)Failed to redact secrets from cron %s: %sNz[REDACTED - redaction failed])Úagent.redactrx   r;   ÚloggerÚwarning)rt   ru   rx   Úes   &&  r0   Ú_redact_cron_payloadr~   ±   sC   € ÷ Øˆð/Ý6Ù$ T°Ô6Ð6øÜô /Ü�‰ÐBÀDÔLÝ.ûð/ús   Œ œA§AÁAc               ó    € V ^8„  d   QhRRRR/# ©r*   rH   r@   r-   r,   r.   )r/   s   "r0   r1   r1   Å   s   € ÷ Vñ V˜Dð V Sñ Vr2   c                ól   € \        V P                  R4      ;'       g    V P                  RR4      R4      # )uÿ   Job name/id as it appears in outward-facing text. The mirror sinks and the thread title
splice the job *name* around the redacted payload, and the name is user-controlled config â€” a
name embedding a credential would re-leak it next to the scrubbed body.ÚnameÚidrU   újob name)r~   r=   )rH   s   &r0   Ú_cron_display_namer…   Å   s,   € ô   §¡¨£× HÐ H°3·7±7¸4ÀÓ3HÈ*ÓUÐUr2   c               ó$   € V ^8„  d   QhRRRRRR/# )r*   rH   r@   rt   r,   r-   r.   )r/   s   "r0   r1   r1   Ì   s&   € ÷ Añ A˜dð A¨#ð A°#ñ Ar2   c                ó$   € R \        V 4       RV 2# )z[Cron delivery: z]
)r…   )rH   rt   s   &&r0   Ú_cron_mirror_messagerˆ   Ì   s   € ØÔ0°Ó5Ð6°c¸$¸Ð@Ð@r2   ÚenabledFc               ó8   € V ^8„  d   QhRRRRRRRRRRR	RR
RRR/# )r*   rH   r@   r\   r,   rM   Úmirror_textr]   r^   ro   r‰   rR   r-   ÚNoner.   )r/   s   "r0   r1   r1   Ð   sN   € ÷ '
ñ '
Ø	ð'
Ø!ð'
Ø,/ð'
Ø>Að'
ØN[ð'
àð'
à/3ð'
ð 
ñ'
r2   c          
     óâ  € V'       g   R# T;'       g    RP                  4       pV'       g   R#  ^ RIHp V! V\        V4      \	        W4      RWERR7      p	V	'       d*   \
        P                  RV P                  RR	4      W4       R# \
        P                  R
V P                  RR	4      W4       R#   \         d4   p
\
        P                  RT P                  RR	4      TY*4        Rp
?
R# Rp
?
ii ; i)uŒ  Best-effort mirror of a cron delivery into the origin chat's session. No-op unless
``enabled`` (caller resolves it, scoped to the origin target). Rides the same
``mirror_to_session`` path as ``send_message``, passing ``user_id`` so user-isolated group
chats resolve to the scheduling member. All failures swallowed â€” a successful delivery must
never be reported failed because the mirror broke.Nr5   ©Úmirror_to_sessionrU   Úuser)Úsource_labelr]   ro   Úrolez9Job '%s': mirrored delivery into %s:%s session transcriptrƒ   Ú?uX   Job '%s': delivery mirror skipped for %s:%s (no matching gateway session â€” cold start)z.Job '%s': delivery mirror failed for %s:%s: %s)
rA   Úgateway.mirrorr�   r,   rˆ   r{   Úinfor=   Údebugr;   )rH   r\   rM   r‹   r]   ro   r‰   rt   r�   Úokr}   s   &&&&&&$    r0   Ú_maybe_mirror_cron_deliveryr˜   Ð   sÓ   € ÷ ÙØ×Ð˜2×$Ñ$Ó&€DßÙð
Ý4ñ Øœ3˜w›<Ô)=¸cÓ)HØ¨9ÈFôTˆ÷ Ü�K‰KØKØ—‘˜˜cÓ" Mö<ô �L‰Lð?à—‘˜˜cÓ" Mö<øô ô 
Ü�‰Ø<¸c¿g¹gÀdÈCÓ>PÐR_Ø÷	
ò 	
ûð
ús   °AB0 Â'B0 Â0C.Â;(C)Ã)C.Úgroupc               ó$   € V ^8„  d   QhRRRRRR/# )r*   rH   r@   rM   r,   r-   r^   r.   )r/   s   "r0   r1   r1     s!   € ÷ ñ  tð ¸sð È]ñ r2   c           
     óš  € \        VRR4      p\        V4      '       d   Vf   R# R\        V 4       2p ^ RIHp V! \        V4      V4      pV! Ws4      pVf   R# VP                  ^R7      p	V	'       d   \        V	4      # R#   \         d?   p
\        P                  RT P                  RR4      \        TR	R4      T
4        Rp
?
R# Rp
?
ii ; i)
z·Open a thread for a continuable cron job via ``adapter.create_handoff_thread``. Returns the
thread_id, or ``None`` (no thread primitive / failed) = caller falls back to the DM mirror.Úcreate_handoff_threadNu   Hermes â€” ©Úsafe_schedule_threadsafe©ÚtimeoutuV   Job '%s': create_handoff_thread failed on %s â€” falling back to DM-session mirror: %srƒ   r“   r‚   )r<   Úcallabler…   Úagent.async_utilsrž   r,   Úresultr;   r{   r–   r=   )rH   ÚadapterrM   ÚloopÚcreate_threadÚthread_namerž   ÚcoroÚfutureÚnew_thread_idr}   s   &&&&       r0   Ú_open_continuable_cron_threadr«     sÆ   € ô ˜GÐ%<¸dÓC€MÜ�M×"Ò" d¢lÙØÔ 2°3Ó 7Ð8Ð9€KðÝ>ÙœS ›\¨;Ó7ˆÙ)¨$Ó5ˆØŠ>ÙØŸ™¨b˜Ó1ˆß%2Œs�=Ó!Ð<¸Ð<øÜô Ü�‰ð$à�G‰G�D˜#Ó¤¨°¸Ó =¸qô	Bõ ûðús)   ´$B ÁB Á4
B Á?B ÂC
Â3CÃC
Ú	user_nameÚdiscord_keys_on_threadc               óH   € V ^8„  d   Qh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*   rH   r@   r\   r,   rM   rt   r]   r^   Ú	chat_typero   r¬   Ú	chat_nameÚscope_idr­   rR   r-   r.   )r/   s   "r0   r1   r1     sv   € ÷ 'ñ 'Ø	ð'Ø'*ð'Ø58ð'Ø@Cð'ØS`ð'àð'à*ð'à7Dð'ð ð'ð )6ð'ð PTð'ð 
ñ	'r2   c               óÔ  € ^ RI Hp ^ RIHp ^ RIHp Rp\        VRR4      pVe‹    V! VP                  4       4      pVep   V'       d   VVP                  8X  d   \        V4      M
\        V4      pT! TTT	TYxTV
'       d   \        V
4      MRR7      pVP                  V4      p\        VRR4      pV! V\        V4      \        W4      RWWR	VR
7      #   \        \        3 d    Rp L©i ; i)a  Create the session row (so the mirror has a target) and mirror the brief as a USER turn.
The seeded key must equal the reply's ``build_session_key``: chat_type, user_id, thread_id and
scope_id (Slack team id) are all part of it, so callers pass exactly what the reply carries.©ÚPlatform)ÚSessionSourcerŽ   NÚ_session_store)rL   rM   r°   r¯   ro   r¬   r]   r±   Ú
session_idrU   r�   )r‘   r]   ro   r’   r·   )Úgateway.configr´   Úgateway.sessionrµ   r”   r�   r<   r>   Ú
ValueErrorÚKeyErrorÚDISCORDr,   Úget_or_create_sessionrˆ   )rH   r¤   r\   rM   rt   r]   r¯   ro   r¬   r°   r±   r­   r´   rµ   r�   Úseeded_session_idÚsession_storeÚplatform_enumÚseed_chat_idÚdest_sourceÚ_entrys   &&&&&$$$$$$$         r0   Ú_seed_cron_sessionrÄ     sù   € õ (Ý-Ý0Ø'+ÐÜ˜GÐ%5°tÓ<€MØÒ ð	!Ù$ ]×%8Ñ%8Ó%:Ó;ˆMð Ò$÷
 *¨m¸x×?OÑ?OÔ.Oô �I”ä˜“\ð ñ
 (Ø&°È	Ø#ØÀ	ß*2œ˜Xœ¸ô	>ˆKð #×8Ñ8¸ÓEˆFÜ '¨°¸dÓ CÐÙØ”s˜7“|Ô%9¸#Ó%DØ yÈØ$ôð øô' œHÐ%ô 	!Ø ŠMð	!ús   §C ÃC'Ã&C'c               ó<   € V ^8„  d   QhRRRRRRRRRRRR	R
RRR	RR/	# )r*   rH   r@   r\   r,   rM   r]   r‹   r°   r^   rn   rR   r±   r-   rŒ   r.   )r/   s   "r0   r1   r1   B  sa   € ÷ !Fñ !FØ	ð!FØ'*ð!FØ58ð!FØEHð!FØWZð!Fàð!Fà,0ð!FàDQð!Fð 
ñ!Fr2   c	                ó  € T;'       g    RP                  4       p	V	'       g   R#  \        YY#T	\        V4      V'       d   RM#\        P	                  VP                  4       R4      RRWhRR7      p
V
'       d+   \        P                  R	V P	                  R
R4      WBV4       R# \        P                  RV P	                  R
R4      W#V4       R#   \         d4   p\        P                  RT P	                  R
R4      Y#YK4        Rp?R# Rp?ii ; i)uÛ  Seed the freshly-opened cron thread's session with the brief (never raises), else the
user's in-thread reply resolves to a transcript without it. Threads are participant-shared
(no real user_id); a DM thread must seed ``chat_type="dm"`` â€” DM-thread replies route through
the DM arm (``â€¦:dm:<chat>:<thread>``), so a "thread"-typed seed is a row no DM reply hits.
Non-DM threads seed the slot the platform's adapter puts on an in-thread reply
(``_THREAD_REPLY_CHAT_TYPE``).r5   NÚdmr8   zsystem:cronÚCronT)r]   r¯   ro   r¬   r°   r±   r­   zDJob '%s': opened continuable thread %s on %s:%s and seeded the briefrƒ   r“   ud   Job '%s': thread seed did NOT land on %s:%s thread=%s â€” an in-thread reply will not see this briefz=Job '%s': seeding cron thread session failed for %s:%s:%s: %s)
rA   rÄ   r,   Ú_THREAD_REPLY_CHAT_TYPEr=   r>   r{   r•   r|   r;   )rH   r¤   r\   rM   r]   r‹   r°   rn   r±   rt   r—   r}   s   &&&&&&&&&   r0   Ú_seed_cron_thread_sessionrÊ   B  sð   € ð ×Ð˜2×$Ñ$Ó&€DßÙðFÜØ˜-°$Ü˜)“nß#‘dÔ)@×)DÑ)DÀ]×EXÑEXÓEZÐ\dÓ)eØ!¨V¸yØ#'ô)ˆ÷ Ü�K‰KØVØ—‘˜˜cÓ" I¸göGô �N‰Nð:à—‘˜˜cÓ" M¸IöGøô ô Fä�‰ØKØ�G‰G�D˜#Ó ¸	÷	Fò 	FûðFús   ¦A9C Â!(C ÃD	Ã(DÄD	r°   r±   c               ó<   € V ^8„  d   QhRRRRRRRRRRR	R
RR
RR
RR/	# )r*   rH   r@   r\   r,   rM   r‹   rn   rR   ro   r^   r°   r±   r-   r.   )r/   s   "r0   r1   r1   f  sV   € ÷ ñ Ø	ðØ'*ðØ58ðØGJðØVZðàðà'4ðàGTðð 
ñr2   c               ó¤  € T;'       g    RP                  4       p	V	'       g   R#  V'       d   RMRp
\        YY#T	RY¦'       d   \        V4      MRWxR7
      pV'       d)   \        P	                  RV P                  RR	4      W#V
4       \        V4      #   \         d4   p\        P                  R
T P                  RR	4      Y#T4        Rp?R# Rp?ii ; i)uÌ  Seed the FLAT (thread_id=None) session for an ``in_channel`` delivery; True on success.
``mirror_to_session`` only APPENDS to an existing session and the flat row is only created by
an inbound human message, so create the row first or the brief is silently dropped. Group keys
are user-isolated (``â€¦:group:<chat_id>:<user_id>``): the seed MUST carry the origin's real
user_id, not ``system:cron``; DM keys omit user_id. chat_type mirrors the inbound handler.r5   FrÇ   r™   N)r]   r¯   ro   r°   r±   z@Job '%s': seeded flat in_channel session on %s:%s (chat_type=%s)rƒ   r“   z9Job '%s': seeding in_channel session failed for %s:%s: %s)	rA   rÄ   r,   r{   r•   r=   rR   r;   r|   )rH   r¤   r\   rM   r‹   rn   ro   r°   r±   rt   r¯   r—   r}   s   &&&&&$$$$    r0   Ú_seed_cron_channel_sessionrÍ   f  sº   € ð ×Ð˜2×$Ñ$Ó&€DßÙðß!‘D wˆ	ÜØ˜-°$ØØ¾¬¨W¬ÀdØô	
ˆ÷ Ü�K‰KØRØ—‘˜˜cÓ" M¸IôGô �B‹xˆøÜô ä�‰ØGØ�G‰G�D˜#Ó ¸ô	;õ ûðús   ¦B ®A"B ÂCÂ(C
Ã
Cc               ó    € V ^8„  d   QhRRRR/# r€   r.   )r/   s   "r0   r1   r1   ‡  s   € ÷ 4ñ 4 Tð 4¨cñ 4r2   c                ó   € V P                  R4      p\        V\        4      '       g   R# . pR	 F|  pVP                  V4      pVf   K  \        V4      P	                  RR4      P	                  RR4      P                  4       pV'       g   K]  VP                  RV RVR,          : 24       K~  	  V'       d   RRP                  V4      ,           # R# )
z¯Secret-free provenance suffix (origin platform/chat/source-IP fields) for security warnings
about a bad stored ``context_from`` reference, where no live request object exists.rK   r5   ÚÚ Ú
Úorigin_Ú=:NéÈ   N)rL   rM   r]   Ú	source_ipÚremoteÚforwarded_for)r=   r?   r@   r,   ÚreplacerA   ÚappendÚjoin)rH   rK   ÚfieldsÚkeyÚvaluert   s   &     r0   Ú_cron_job_origin_log_suffixrß   ‡  s²   € ð �W‰W�XÓ€FÜ�fœd×#Ò#ÙØ€FÛ[ˆØ—
‘
˜3“ˆØŠ=ÙÜ�5‹z×!Ñ! $¨Ó,×4Ñ4°T¸3Ó?×EÑEÓGˆß‰4Ø�M‰M˜G C 5¨¨$¨t­*©Ð8Ö9ñ \÷ &,ˆ3�—‘˜&Ó!Õ!Ð3°Ð3r2   c               ó    € V ^8„  d   QhRRRR/# ©r*   r\   r,   r-   r.   )r/   s   "r0   r1   r1   ˜  s   € ÷ 	ñ 	¨ð 	°ñ 	r2   c                óH  € \         P                  ! \        4      ;_uu_ 4        ^ RIHp V! 4        ^ RIHp VP                  V P                  4       4      pV'       d)   VP                  '       d   VP                  uuRRR4       # RRR4       R#   + '       g   i     R# ; i)zXCron home-channel env var registered by a plugin ``PlatformEntry.cron_deliver_env_var``.©Údiscover_plugins©Úplatform_registryNr5   )
r9   r:   r;   Úhermes_cli.pluginsrä   Úgateway.platform_registryræ   r=   r>   Úcron_deliver_env_var)r\   rä   ræ   Úentrys   &   r0   Ú_plugin_cron_env_varrë   ˜  sm   € ä	×	Ò	œY×	'Õ	'Ý7ÙÔÝ?Ø!×%Ñ% m×&9Ñ&9Ó&;Ó<ˆß�U×/×/Ð/Ø×-Ñ-÷ 
(×	'Ò	'ñ ÷ 
(Ö	'ñ ús   £ABÁ0BÂB!	c               ó    € V ^8„  d   QhRRRR/# ©r*   r\   r,   r-   rR   r.   )r/   s   "r0   r1   r1   ¤  s   € ÷ Qñ Q¨sð Q°tñ Qr2   c                ól   € V P                  4       pV\        9   ;'       g    \        \        V4      4      # )zRValid cron delivery platform: built-in, or plugin with a ``cron_deliver_env_var``.)r>   Ú_KNOWN_DELIVERY_PLATFORMSrR   rë   ©r\   r‚   s   & r0   Ú_is_known_delivery_platformrñ   ¤  s/   € à×ÑÓ €DØÔ,Ñ,×PÐP´Ô5IÈ$Ó5OÓ0PÐPr2   c               ó    € V ^8„  d   QhRRRR/# rá   r.   )r/   s   "r0   r1   r1   ª  s   € ÷ Iñ I¨ð I°ñ Ir2   c                ór   € V P                  4       p\        P                  V4      ;'       g    \        V4      # )zWEnv var name for a platform's cron home channel (built-in table, then plugin registry).)r>   Ú_HOME_TARGET_ENV_VARSr=   rë   rð   s   & r0   Ú_resolve_home_env_varrõ   ª  s/   € à×ÑÓ €DÜ ×$Ñ$ TÓ*×HÐHÔ.BÀ4Ó.HÐHr2   c               ó   € V ^8„  d   QhRR/# )r*   r\   r,   r.   )r/   s   "r0   r1   r1   °  s   € ÷ 
ñ 
¨Cñ 
r2   c                ó¼   €  ^ RI HpHp V! 4       P                  V! V P	                  4       4      4      #   \
         d    \        P                  RT RR7        R# i ; i)u  Persisted ``HomeChannel`` from gateway config â€” the canonical store ``/sethome`` writes.
The ``<PLATFORM>_HOME_CHANNEL`` env var is only a best-effort mirror; relay-fronted platforms
may exist solely in config.yaml, so reading only the env mirror would drop their delivery.)Úload_gateway_configr´   z1config home_channel lookup failed for platform %rT©Úexc_infoN)r¸   rø   r´   Úget_home_channelr>   r;   r{   r–   )r\   rø   r´   s   &  r0   Ú_get_config_home_channelrü   °  sX   € ðß@Ù"Ó$×5Ñ5±h¸}×?RÑ?RÓ?TÓ6UÓVÐVøÜô Ü�‰Ø?ÀÐY]ð 	ô 	_âðús   ‚14 ´#AÁArA   c               ó(   € V ^8„  d   QhRRRRRRRR/# )r*   Úenv_varr,   ÚsuffixrA   rR   r-   r.   )r/   s   "r0   r1   r1   ½  s)   € ÷ ñ ˜cð ¨3ð ¸tð ÐPSñ r2   c               óÔ   aa€  ^ RI Ho R VV3R llpV! W,           4      p\        P	                  V 4      pV'       g   V'       d   V! WQ,           4      pV#   \         d    Ro L\i ; i)ac  Value of ``<env_var><suffix>``, falling back to the legacy name (same suffix) when unset.
Reads via ``get_secret``, not ``os.getenv``: in a multiplex gateway the tick runs with the
job-owning profile's secret scope (run_one_job sets it), so this resolves the OWNING profile's
value, not the host environ. ``os.getenv`` only if the scope module is missing.)Ú
get_secretNc               ó    € V ^8„  d   QhRRRR/# )r*   r‚   r,   r-   r.   )r/   s   "r0   r1   Ú&_home_env_lookup.<locals>.__annotate__Ç  s   € ÷ 1ñ 1�3ð 1˜3ñ 1r2   c                ó”   <€ Se   S! V R4      ;'       g    RM\         P                  ! V R4      pS'       d   VP                  4       # T# )Nr5   )ÚosÚgetenvrA   )r‚   rÞ   r  rA   s   & €€r0   ÚreadÚ_home_env_lookup.<locals>.readÇ  s?   ø€ Ø0:Ò0F‘˜D "Ó%×+Ð+¨øÌBÏIÊIÐVZÐ\^ÓL_ˆß %ˆu�{‰{‹}Ð0¨5Ð0r2   )Úagent.secret_scoper  r;   Ú_LEGACY_HOME_TARGET_ENV_VARSr=   )rþ   rÿ   rA   r  rÞ   Úlegacyr  s   &&d   @r0   Ú_home_env_lookupr  ½  s`   ù€ ð
Ý1÷1ñ 1ñ �Õ!Ó"€EÜ)×-Ñ-¨gÓ6€Fß—VÙ�V•_Ó%ˆØ€Løô ô ØŠ
ðús   „A ÁA'Á&A'c               ó    € V ^8„  d   QhRRRR/# rá   r.   )r/   s   "r0   r1   r1   Ò  s   € ÷ 8ñ 8¨Cð 8°Cñ 8r2   c                óB   € \        V 4      pV'       d   \        V4      # R# )u9  Home chat id from the env mirror only (no config).

Reads through ``get_secret`` (not raw ``os.getenv``) so a profile-scoped secret scope wins in a
multiplex gateway. ``DISCORD_HOME_CHANNEL`` lives in each profile's ``.env``; in a multiplex process the
winning cron tick runs with the job-owning profile's scope installed (run_one_job sets it), so reading
via ``get_secret`` resolves the OWNING profile's chat id rather than the host process's ``os.environ``
(#83182, chat-id leg â€” the token leg was fixed earlier; chat id / thread id resolve through the same
leak).
r5   )rõ   r  )r\   rþ   s   & r0   Ú_env_home_target_chat_idr  Ò  s!   € ô $ MÓ2€Gß(/Ô˜GÓ$Ð7°RÐ7r2   c               ó    € V ^8„  d   QhRRRR/# rá   r.   )r/   s   "r0   r1   r1   à  s   € ÷ Jñ J¨Cð J°Cñ Jr2   c                óœ   € \        V 4      pV'       d   V# \        V 4      pVe(   VP                  '       d   \        VP                  4      # R# )ut   Home target chat id: env var (first, so operator overrides win) â†’ legacy env var â†’
config.yaml ``home_channel``.r5   )r  rü   rM   r,   )r\   rÞ   rc   s   &  r0   Ú_get_home_target_chat_idr  à  sA   € ô % ]Ó3€EßØˆÜ# MÓ2€DØ $Ò 0°T·\·\°\Œ3ˆt�|‰|ÓÐIÀrÐIr2   c               ó    € V ^8„  d   QhRRRR/# )r*   r\   r,   r-   r^   r.   )r/   s   "r0   r1   r1   ê  s   € ÷ ñ ¨cð °mñ r2   c                óF  € V P                  4       R8X  d   \        RRR7      pV'       d   V# \        V 4      pV'       d   \        VRRR7      MRpV'       d   V# \        V 4      '       g7   \	        V 4      pVe(   VP
                  '       d   \        VP
                  4      # R# )uH  Optional thread/topic id for a platform home target. Telegram: ``TELEGRAM_CRON_THREAD_ID``
overrides ``TELEGRAM_HOME_CHANNEL_THREAD_ID`` â€” in topic mode a root-DM delivery lands in the
system-only lobby where the user cannot reply.

When topic mode is enabled, deliveries that land in the root DM (thread_id unset) end up in the
system-only lobby where the user cannot reply â€” the gateway returns the lobby reminder and drops
``reply_to_message_id`` (#24409). Pointing cron at a dedicated topic via this env var lets replies work
as expected without changing the lobby invariant.
r   ÚTELEGRAM_CRON_THREAD_IDT)rA   Ú
_THREAD_IDr5   N)r>   r  rõ   r  rü   r]   r,   )r\   Úcron_threadrþ   rÞ   rc   s   &    r0   Ú_get_home_target_thread_idr  ê  sˆ   € ð ×ÑÓ 
Ô*Ü&Ð'@ÈÔMˆßØÐÜ# MÓ2€GßCJÔ˜W l¸$Õ?ÐPR€EßØˆô $ M×2Ò2Ü'¨Ó6ˆØÒ §§ Ü�t—~‘~Ó&Ð&Ùr2   c               #  ór  "  € \          Rj  x€L
  \        P                  ! \        4      ;_uu_ 4        ^ RIHp  V ! 4        ^ RIHp VP                  4        F<  pVP                  '       g   K  VP                  \         9  g   K.  VP                  x € K>  	  RRR4       R#  L”  + '       g   i     R# ; i5i)zDIterate built-in + plugin platform names that expose a home channel.Nrã   rå   )rô   r9   r:   r;   rç   rä   rè   ræ   Úplugin_entriesré   r‚   )rä   ræ   rê   s      r0   Ú_iter_home_target_platformsr    sv   é € ä$×$Ð$Ü	×	Ò	œY×	'Õ	'Ý7ÙÔÝ?Ø&×5Ñ5Ö7ˆEØ×)×)Ò)¨e¯j©jÔ@UÖ.UØ—j‘jÔ ñ 8÷	 
(Ñ	'ñ %ß	'×	'Ð	'üs2   ‚
B7ŒB!�&B7³6B#Á.B#ÂB#ÂB7Â#B4	Â.	B7c               ó    € V ^8„  d   QhRRRR/# )r*   Ú	connectedÚsetr-   r.   )r/   s   "r0   r1   r1     s   € ÷ ñ °ð ¸ñ r2   c                ó¤   € RV 9  d   \        4       #  ^ RIHp V! 4       #   \         d%    \        P                  RRR7       \        4       u # i ; i)a  Logical platforms deliverable through a connected relay. ``get_connected_platforms()`` only
sees native platforms; fronted ones come from the same ``GATEWAY_RELAY_PLATFORMS`` stamp
fire-time routing uses (validation symmetric with routing). No relay -> empty set.Úrelay©Úrelay_fronted_platformsz$relay fronted-platform lookup failedTrù   )r  Úgateway.relayr"  r;   r{   r–   )r  r"  s   & r0   Ú!_relay_fronted_delivery_platformsr$    sK   € ð �iÔÜ‹uˆðÝ9Ù&Ó(Ð(øÜô Ü�‰Ð;ÀdˆÔKÜ‹uŠðús   “   ,AÁAc               ó   € V ^8„  d   QhRR/# )r*   r-   ú
list[dict]r.   )r/   s   "r0   r1   r1     s   € ÷ "ñ "˜zñ "r2   c                 óØ  € . p  ^ RI Hp V! 4       P                  4        Uu0 uF  q"P                  kK  	  ppV\	        V4      ,          p\        4        Fx  pWC9  g   \        V4      '       g   K  T P                  RTRVP                  RR4      P                  4       R	\        \        V4      4      R
\!        V4      ;'       g    R/4       Kz  	   ^ RIHp V! 4        F)  pV P                  R\&         RV 2RRV R2R	RR
R/4       K+  	  V # u upi   \
         d%    \        P                  RRR7       \        4       p Löi ; i  \
         d    \        P                  RRR7        T # i ; i)a?  Platforms a cron job can auto-deliver to (single source of truth for UIs): valid delivery
platform AND gateway-configured; ``home_target_set`` flags whether the home channel exists.
``{"id", "name", "home_target_set", "home_env_var"}`` dicts in canonical order; callers
prepend the implicit ``local`` option themselves.©rø   z1cron_delivery_targets: gateway config unavailableTrù   rƒ   r‚   Ú_rÑ   Úhome_target_setÚhome_env_varN)Úlist_profile_namesÚ:z
Bot Chat (Ú)z2cron_delivery_targets: profile listing unavailable)r¸   rø   Úget_connected_platformsrÞ   r$  r;   r{   r–   r  r  rñ   rÚ   rÙ   ÚtitlerR   r  rõ   Úhermes_cli.profilesr,  ÚBOT_CHAT_PLATFORM)Útargetsrø   Úpr  r‚   r,  Úprofile_names          r0   Úcron_delivery_targetsr6    sk  € ð
 €GðÝ6Ù&9Ó&;×&SÑ&SÔ&UÓVÑ&U —W”WÑ&Uˆ	ÐVØÔ6°yÓAÕAˆ	ô
 ,Ö-ˆØÔ Ô(CÀD×(IÒ(IÙØ�‰Ø�$Ø�D—L‘L  cÓ*×0Ñ0Ó2ØœtÔ$<¸TÓ$BÓCØÔ1°$Ó7×?Ð?¸4ð	Aö 	Bñ .ð	ZÝ:Ù.Ö0ˆLØ�N‰NØÔ*Ð+¨1¨\¨NÐ;Ø˜* \ N°!Ð4Ø! 4Ø ð	&ö 'ñ 1ð €Nùò5 Wøäô Ü�‰ÐHÐSWˆÔXÜ“EŠ	ðûô, ô ZÜ�‰ÐIÐTXˆÕYØ€NðZús3   „D ¡DµD Ã:E ÄD Ä,E Ä?E Å"E)Å(E)c               ó    € V ^8„  d   QhRRRR/# )r*   rK   r@   r-   rR   r.   )r/   s   "r0   r1   r1   D  s   € ÷ Lñ L Dð L¨Tñ Lr2   c                ó*  € \        V P                  R4      ;'       g    R4      P                  4       R8w  g   V P                  R4      '       g   R# \        R4      p\	        V4      ;'       d'    \        V P                  R4      4      \        V4      8H  # )ao  True when a Slack origin's thread is a stale creation-turn artifact. Thread-per-message
Slack stamps each top-level message id as the session thread (a KEY, not a location); old jobs
carry it as ``origin.thread_id``. Heuristic: if the origin chat IS the Slack home chat, the
pinned thread is that artifact and delivery goes top-level (or to the home target's thread).rL   r5   r	   r]   FrM   )r,   r=   r>   r  rR   )rK   Ú	home_chats   & r0   Ú_origin_thread_is_staler:  D  so   € ô
 ˆ6�:‰:�jÓ!×'Ð' RÓ(×.Ñ.Ó0°GÔ;À6Ç:Á:Èk×CZÒCZÙÜ(¨Ó1€IÜ�	‹?×KÐKœs 6§:¡:¨iÓ#8Ó9¼SÀ»^ÑKÐKr2   c               ó   € V ^8„  d   QhRR/# )r*   rK   r@   r.   )r/   s   "r0   r1   r1   O  s   € ÷ #ñ # Dñ #r2   c                óp   € \        V 4      '       d   \        R4      ;'       g    R# V P                  R4      # )zAThe thread a deliver=origin job should use, stale stamps dropped.r	   Nr]   )r:  r  r=   )rK   s   &r0   Ú_origin_delivery_threadr=  O  s/   € ä˜v×&Ò&Ü)¨'Ó2×:Ð:°dÐ:Ø�:‰:�kÓ"Ð"r2   c               ó(   € V ^8„  d   QhRRRRRRRR/# )r*   r\   r,   rM   rk   r^   r-   r@   r.   )r/   s   "r0   r1   r1   V  s)   € ÷ ñ  ð ¨cð À-ð Ð[_ñ r2   c                ó@   € RV RVR\        V 4      /pV'       d   W#R&   V# )zTTarget dict for a platform's configured home channel (+ optional mirror provenance).rL   rM   r]   rj   )r  )r\   rM   rk   rg   s   &&& r0   Ú_home_targetr@  V  s4   € ð 	�MØ�7ØÔ/°Ó>ð@€F÷ Ø#0ÐÑ Ø€Mr2   Úfrom_broadcastc               ó(   € V ^8„  d   QhRRRRRRRR/# )	r*   rH   r@   Údeliver_valuer,   rA  rR   r-   rI   r.   )r/   s   "r0   r1   r1   a  s8   € ÷ PVñ PVØ	ðPVØ!ðPVØ6:ðPVàñPVr2   c               ó,  € \        V 4      pVR8X  d   R# \        V4      pVe   \        W4      # VR8X  dž   V'       d+   RVR,          R\        VR,          4      R\	        V4      RR/# \        4        F[  p\        V4      pV'       g   K  \        P                  RV P                  R	V P                  R
R4      4      V4       \        WVR4      u # 	  R# RV9   Ed   TP                  R^4      w  rWVP                  4       p^ RIHp	Hp
 V	! 4        V
! W‡RR7      w  rkpV'       d   \        P!                  RW4       R# Vf¨   VR8X  d¡   V'       d™   \        VP                  R4      ;'       g    R4      P                  4       V8X  db   \        VP                  R4      4      \        V4      8X  d:   VP                  R4      '       d#   \#        V4      '       g   VP                  R4      pRVRVRVRR/# TpV'       d   RMRpV'       d]   VP                  R4      V8X  dG   \        V4      pV'       d   \        WVV4      # RVR\        VR,          4      RVP                  R4      /# \%        V4      '       g   R# \        V4      pV'       d   \        WVV4      # R# )a~  Resolve one concrete auto-delivery target for a cron job.

``from_broadcast`` marks a bare-platform token that was produced by expanding a broadcast
token (``all``) rather than written by the user; broadcast expansions carry no mirror
provenance (fan-out is never continuable), while a user-written bare platform token is a
deliberate home-channel address and gets the ``home`` tag.ÚlocalNrK   rL   rM   r]   rj   zJJob '%s' has deliver=origin but no origin; falling back to %s home channelr‚   rƒ   r“   rb   r-  )Úprepare_send_message_platformsÚresolve_send_targetT)Úpass_unresolved_referencesz%Invalid cron delivery target '%s': %sr	   r5   rd   rc   )rO   Úparse_bot_chat_deliver_tokenÚ_resolve_bot_chat_targetr,   r=  r  r  r{   r•   r=   r@  Úsplitr>   Útools.send_message_toolrF  rG  r|   r:  rñ   )rH   rC  rA  rK   Úbot_chat_profiler\   rM   ÚrestÚplatform_keyrF  rG  r]   Úresolution_errorÚhome_provenances   &&$           r0   Ú_resolve_single_delivery_targetrR  a  se  € ô ˜SÓ!€FØ˜ÔÙä3°MÓBÐØÒ#Ü'¨Ó>Ð>à˜Ô ßà˜F :Õ.Øœ3˜v iÕ0Ó1ØÔ4°VÓ<Ø  (ð	ð ô 9Ö:ˆMÜ.¨}Ó=ˆGß‰wÜ—‘Ø`Ø—G‘G˜F C§G¡G¨D°#Ó$6Ó7¸ôHô $ MÐ<MÓNÒNñ ;ñ à
ˆmÕØ+×1Ñ1°#°qÓ9ÑˆØ$×*Ñ*Ó,ˆß_Ù&Ô(ñ 0CØ¸4ô0AÑ,ˆÐ,çÜ�N‰NÐBÀMÔdÙàÒØ Ô'ßÜ�F—J‘J˜zÓ*×0Ð0¨bÓ1×7Ñ7Ó9¸\ÔIÜ�F—J‘J˜yÓ)Ó*¬c°'«lÔ:Ø—
‘
˜;×'Ò'Ü+¨F×3Ò3àŸ
™
 ;Ó/ˆIà˜Ø�wØ˜Ø˜jð	
ð 	
ð "€Mß,‘d°&€Oß�&—*‘*˜ZÓ(¨MÔ9Ü*¨=Ó9ˆßÜ ¸ÓHÐHð ˜Ø”s˜6 )Õ,Ó-Ø˜Ÿ™ KÓ0ð
ð 	
ô
 ' }×5Ò5ÙÜ& }Ó5€GßDKŒ<˜°Ó@ÐUÐQUÐUr2   c               ó   € V ^8„  d   QhRR/# ©r*   r-   Úintr.   )r/   s   "r0   r1   r1   ´  s   € ÷ ñ ¨ñ r2   c                 ó¾   €  \         P                  ! 4       p \        V P                  R/ 4      P                  RR4      4      pV^ 8”  d   V# R#   \         d     R# i ; i)u�   Timeout for one bot-chat delivery turn (a full agent turn â€” minutes, not seconds).
``cron.bot_chat_delivery_timeout_seconds``; default 600.rU   Ú!bot_chat_delivery_timeout_secondsiX  ©rW   rX   rU  r=   r;   ©rQ   rÞ   s     r0   Ú_get_bot_chat_delivery_timeoutrZ  ´  s\   € ðÜ× Ò Ó"ˆÜ�C—G‘G˜F BÓ'×+Ñ+Ð,OÐQTÓUÓVˆØ œ	ˆuÐ* sÐ*øÜô Úðúó   ‚AA ÁA ÁAÁAc               ó   € V ^8„  d   QhRR/# rT  r.   )r/   s   "r0   r1   r1   ¿  s   € ÷ ñ  cñ r2   c                 ó¾   €  \         P                  ! 4       p \        V P                  R/ 4      P                  R^<4      4      pV^ 8”  d   V# ^<#   \         d     ^<# i ; i)u?  Wall-clock bound for one standalone-lane send (#115469).

``_send_to_platform``'s gateway-loop dispatch deliberately awaits its future with no
timeout ("the adapter and outer _run_async bound the wait") â€” but on this lane the
outer runner is a bare ``asyncio.run``, not ``model_tools._run_async``, so without a
bound here a reconnecting transport pins the run (and the restart drain behind it)
indefinitely. Mirrors the sibling lanes: live dispatch ``future.result(timeout=60)``,
thread fallback ``result(timeout=30)``. ``cron.standalone_send_timeout_seconds``;
default 60.rU   Ústandalone_send_timeout_secondsrX  rY  s     r0   Ú_get_standalone_send_timeoutr_  ¿  s[   € ðÜ× Ò Ó"ˆÜ�C—G‘G˜F BÓ'×+Ñ+Ð,MÈrÓRÓSˆØ œ	ˆuÐ) rÐ)øÜô Úðúr[  iô  c          
     ó,   € V ^8„  d   QhRRRRRRRRR	R
/# )r*   ÚargvÚlistÚenvr@   Úreport_pathr,   r    Úfloatr-   zsubprocess.CompletedProcessr.   )r/   s   "r0   r1   r1   ×  s7   € ÷ Añ A˜Tð A¨ð A¸3ð AÈð AÐSnñ Ar2   c           	     óV   € ^ RI Hp T! YY#VP                  R4      ;'       g    RR7      # )a]  Run one ``hermes chat -Q`` delivery child; the cap bounds the TURN, not the process (#113608).

The booking policy lives with the report contract (``quiet_single_query.run_reported_turn``):
this lane needs only the outcome, so a child that reported its turn gets the exit grace and is
then left to its linger; only a turn that never ends is killed.
)Úrun_reported_turnÚHERMES_HOMEN)rc  rd  r    Úcwd)Úhermes_cli.quiet_single_queryrg  r=   )ra  rc  rd  r    rg  s   &&&& r0   Ú_run_bot_chat_turnrk  ×  s1   € õ @ñ ˜T¸Ø!$§¡¨Ó!7×!?Ð!?¸4ôAð Ar2   c               ó   € V ^8„  d   QhRR/# ©r*   r-   r,   r.   )r/   s   "r0   r1   r1   é  s   € ÷ ]ñ ] sñ ]r2   c                óè  € ^ RI Hp \        V RR4      ;'       g    RP                  4       p\        V RR4      ;'       g    RP                  4       pR\        V RR4       2.pV'       d   VP	                  R	V\
        ) R  24       V'       dM   R
P                  R VP                  4        4       4      pTP	                  V'       d   RV\        ) R  2MR4       V! RP                  V4      RRR7      # )uU  Exit code plus labeled, redacted stderr/stdout tails for a failed delivery turn.

``-Q`` reports the resume banner and ``session_id:`` while the response
rides stdout, so ``stderr or stdout`` discarded half the signal â€” and when
stderr is empty and stdout holds only the banner, the recorded error
carried zero diagnostics (#104056). The banner lines are dropped from the
stdout tail so what remains is the reason; the exit code is always named.
The text lands in ``last_delivery_error`` on disk, so it is scrubbed like
``cron.incidents`` / ``cron.delivery_queue`` scrub their persisted errors.
rw   ÚstderrNr5   Ústdoutz
exit code Ú
returncoder“   zstderr: rÒ   c              3  óÊ   "  € T FY  pVP                  4       '       g   K  VP                  4       P                  R 4      P                  \        4      '       d   KU  Vx € K[  	  R# 5i)u   â†» N)rA   ÚlstripÚ
startswithÚ_BOT_CHAT_BANNER_PREFIXES)Ú.0Úlines   & r0   Ú	<genexpr>Ú*_format_failure_streams.<locals>.<genexpr>ü  sH   é € ð gÙ-�TØ�z‰z�|ô Ø$(§J¡J£L×$7Ñ$7¸Ó$?×$JÑ$JÔKd×$e÷ ŠDÓ-ùs   ‚A#Ÿ5A#Á
A#zstdout: z!stdout was only the resume bannerz | T)ry   Úredact_url_credentials)	rz   rx   r<   rA   rÚ   Ú_BOT_CHAT_STDERR_TAILrÛ   Ú
splitlinesÚ_BOT_CHAT_STDOUT_TAIL)r£   rx   ÚerrÚoutÚpartsÚkepts   &     r0   Ú_format_failure_streamsr‚  é  sî   € õ 3ä�6˜8 TÓ*×0Ð0¨b×
7Ñ
7Ó
9€CÜ�6˜8 TÓ*×0Ð0¨b×
7Ñ
7Ó
9€CØœ' &¨,¸Ó<Ð=Ð>Ð?€Eß
Ø�‰�x Ô%:Ð$:Ð$;Ð <Ð=Ð>Ô?ß
Ø�y‰yñ gØ Ÿ^™^Ô-ógó gˆð 	�‰ß:>ˆh�tÔ2Ð2Ð3Ð4Ð5Ñ6Ø4ô	6ñ ! §¡¨EÓ!2¸$ÐW[Ô\Ð\r2   ÚdeferredÚfor_failurec               ó0   € V ^8„  d   QhRRRRRRRRRR	R
R/# )r*   rH   r@   Úcontentr,   Úprofilerƒ  rI   r„  rR   r-   r^   r.   )r/   s   "r0   r1   r1     s@   € ÷ `$ñ `$˜dð `$¨Sð `$¸3ð `$È^ð `$Ø&*ð`$Ø7Dñ`$r2   c               óX  a<€ ^ RI p^ RIp^ RIp^ RIp^ RIHp	 ^ RIHp
 ^ RIH	pH
pHp V P                  RR4      o<T;'       g    Rp\        VR4      p\        V P                  R	S<4      R
4      pRV RV 2p V	! 4       P                  4       p^ RIHp Ve   V! VR,          4      MV'       d	   V
! V4      MTP                  4       pT;'       g%    \#        T;'       g    / P                  R4      4      p^ RIHp ^ RIHp T;'       d     V! \,        V! VR,          4      4      '       * pVe$   VR,          P/                  4       '       g   RV R2# V P                  R4      pV'       g+   V P1                  RVP3                  4       P4                  4      pVP7                  VP9                  \;        V4      S<\;        V4      \;        V4      .RRlR7      P=                  R4      4      P?                  4       pVe
   VR,          pV! VV4      pVf¥   V'       g�   ^ RI H!pH"p ^ RIH#p V! V4      pVf!   V'       g   V! V4      f&   V! V4      '       d   V! V\I        V 4      WVVVR7      pVeH   VR,          pRV 2pRVR V/V P1                  R!/ 4      V&   VR"8X  d   R#V R$&   VRm9   d   R# V R&V R'V R(2# Vf&   V! V4      p V e   T! VV V3R V/V'       d   R)R*/M/ B pVeÐ   VR+,          V8w  g"   VP                  R)R,4      V'       d   R*MR,8w  d   \K        R-4      hVR,          pRV 2pV P1                  R!/ 4      p!RVR V/V!V&   \L        PO                  R.S<VVV4       VR%8X  d   R# VRn9   d   R/M3VP                  R04      ;'       g    VP                  R14      ;'       g    R2p"V R&V R'V R3V" 2#   ^ RI)H*p$ T$PW                  R64      RJp%T%'       d   \X        PZ                  R7R8.p&M#\\        P^                  ! R94      p'T''       g   R:# T'.p&R; T<3R< llp(^ R=I0H1p) ^ R>I2H3p* TPi                  4       '       g   T(! RT R24      #  T*! T)! \j        Pl                  4      TR#R?7      p+TPr                  Pt                  RC8w  d   T&RDRE.,          p&T&RF,          R7R8.8X  d?   ^ RIHp ^ RGI;H<p, T,! T+T! \z        4      P                  4       P|                  ^,          4       Rp- TP                  RHRRIRJRRK7      ;_uu_ 4       p.T.P�                  T4       T.Pt                  p-RRR4       T&RLRMRNRORPRQRRRST-.	,          p&^ RTIAHBp/ T- RU2p0T0T+T/&   \‡        4       p1\‰        T&T+T0T14      p2T2PŠ                  ^ 8w  d†   \�        T24      p3\L        P�                  RVS<TTT34       RWT RXT3 2 T-'       dQ   T-T- RU23 FD  p4\�        P’                  ! \”        4      ;_uu_ 4        \j        P–                  ! T44       RRR4       KF  	  # # \L        PO                  RYS<T4        T-'       dR   T-T- RU23 FD  p4\�        P’                  ! \”        4      ;_uu_ 4        \j        P–                  ! T44       RRR4       KF  	  R# R#   \P         d   p#R4T R5T# 2u Rp#?## Rp#?#ii ; i  \P         d    Rp% ELÄi ; i  \P         d0   p#T(! R4T R@\o        T#4      Pp                   RAT# RB24      u Rp#?## Rp#?#ii ; i  + '       g   i     ELÅ; i  + '       g   i     EKT  ; i  + '       g   i     K÷  ; i  \˜        Pš                   EdV    Rp5T;'       g    / P                  RZ4      '       g¢   R[X1 R\S< R]TP�                  4       R^,           2p6 ^ R_I H!p7 TP7                  T R`2P=                  4       4      P?                  4       p8T7! T8\I        T 4      T6TTTR#Ra7       R#p5M/  \P         d"   p9\L        P�                  RbS<T94        Rp9?9MRp9?9ii ; iT5'       d   RcS< Rd2MRep:T(! R4T RfX1 RgT: Rh24      u T-'       de   T-T- RU23 FX  p4\�        P’                  ! \”        4      ;_uu_ 4        \j        P–                  ! T44       RRR4       KF    + '       g   i     KW  ; i	  # # \P         d½   p;\L        P�                  RiS<T\;        T;4      ;'       g    \o        T;4      Pp                  R#Rj7       RWT Rk2u Rp;?;T-'       de   T-T- RU23 FX  p4\�        P’                  ! \”        4      ;_uu_ 4        \j        P–                  ! T44       RRR4       KF    + '       g   i     KW  ; i	  # # Rp;?;ii ; i  T-'       de   T-T- RU23 FX  p4\�        P’                  ! \”        4      ;_uu_ 4        \j        P–                  ! T44       RRR4       KF    + '       g   i     KW  ; i	  i i ; i)oaÊ  Hand output to the live Bot Chat owner, or use the legacy unowned CLI lane.

None means completed; a queued/claimed receipt returns an explicit unverified status
string so existing Optional[str] callers cannot misreport admission as delivery.
``profile`` is ``""`` for the job's own profile. A ``for_failure`` notice whose target
profile hides warning notifications is recorded as ``suppressed`` (a durable
disposition, never a send) and flagged on the job.
N)Úget_hermes_home)Úget_profile_dir)Údeliver_to_live_ownerÚfind_canonical_live_ownerÚread_delivery_resultrƒ   r“   ú(own)zbot-chat payloadr‚   r„   z
[Cronjob "uv   " output â€” scheduled job, not the user. Review it, act on anything that needs action, and summarize for the chat.]

)ÚPathrc   r„  ©Úwarning_notifications_enabled)Úload_user_config_effectivezconfig.yamlzstate.dbz+bot-chat delivery target no longer exists: z; do not resendÚexecution_idÚ_bot_chat_run_idF)Úensure_asciiÚ
separatorszutf-8)ÚdeferÚread_pending)Úfind_canonical_owner)r„  Ú
suppressedÚstatusú	bot-chat:Údelivery_idÚ_bot_chat_delivery_receiptsrš  TÚ$_notification_all_targets_suppressedÚsettledrÑ   z
 (receipt z'): completion unverified; do not resendÚnotification_categoryÚ
diagnosticÚmessager£   z2delivery id already belongs to a different payloadz*Job '%s': Bot Chat %s receipt=%s status=%sz$completion unverified; do not resendÚerrorÚreasonznot completedz): zbot-chat delivery to profile 'z' unverified: Ú
hermes_cliz-mzhermes_cli.mainÚhermesz·Hermes could not deliver this result to Bot Chat: the `hermes` command was not found. The result is saved; run `hermes cron runs` to see it, or `hermes doctor` if this keeps happeningc               ó    € V ^8„  d   QhRRRR/# )r*   Úmsgr,   r-   r.   )r/   s   "r0   r1   Ú*_deliver_to_bot_chat.<locals>.__annotate__}  s   € ÷ ñ �3ð ¨ñ r2   c                ó:   <€ \         P                  ! R SV 3/ VB  V # )úJob '%s': %s©r{   r|   )r©  Ú
log_kwargsÚjob_ids   &,€r0   Ú_failÚ#_deliver_to_bot_chat.<locals>._fail}  s   ø€ Ü�Š�~ v¨sÑA°jÒAØˆ
r2   )Údelegated_child_subprocess_env)Úserved_profile_child_env)Útarget_homeÚinherit_credentialsz4' could not build the target profile's environment (ú: z); do not resendÚprofilesz-pÚdefault:é   é   N)Úpin_hermes_tree_on_pythonpathÚwz.txtzhermes-cron-botchat-)Úencodingrÿ   ÚprefixÚdeleteÚchatz--inÚ~z-czBot Chatz--create-if-missingz-Qz--query-file)ÚTURN_REPORT_FILE_ENVz
.turn.jsonz<Job '%s': bot-chat delivery to profile '%s' failed at %s: %sz;Hermes could not deliver this result to Bot Chat (profile 'zp'). The result is saved; run `hermes cron runs` to see it, or `hermes doctor` if this keeps happening. Details: z/Job '%s': delivered to Bot Chat of profile '%s'Údegradedz>DELIVERY DEGRADED: this alert's bot-chat turn timed out after zms, so the full output could NOT be posted here. Read the complete saved output with `hermes cron runs` (job 'z'). Excerpt: :Ni  N)r—  z	:degraded)r„  rÃ  z:Job '%s': degraded-delivery marker could not be queued: %su”   a short degraded-delivery notice was queued to Bot Chat â€” posted once the session frees; full output stays saved, run `hermes cron runs` for job 'Ú'zathe result is saved; run `hermes cron runs` to see it, or `hermes doctor` if this keeps happeningz' timed out after zs (z>; raise cron.bot_chat_delivery_timeout_seconds if this recurs)z6Job '%s': bot-chat delivery to profile '%s' failed: %srù   ze'). The result is saved; run `hermes cron runs` to see it, or `hermes doctor` if this keeps happening)Ú,r-  )r   rš  ©ÚqueuedÚclaimed)OÚhashlibÚjsonÚtempfileÚuuidÚhermes_constantsr‰  r1  rŠ  Útools.bot_live_deliveryr‹  rŒ  r�  r=   r~   ÚresolveÚpathlibr�  rR   Úgateway.warning_notificationsr‘  Úhermes_cli.config_effectiver’  ÚBOT_CHAT_POLICY_PLATFORMÚis_fileÚ
setdefaultÚuuid4ÚhexÚsha256Údumpsr,   ÚencodeÚ	hexdigestÚcron.bot_chat_deliveryr—  r˜  r™  r@   rº   r{   r•   r;   Úimportlib.utilÚutilÚ	find_specÚsysÚ
executableÚshutilÚwhichÚagent.delegation_contextr²  Útools.environments.localr³  Úis_dirr  ÚenvironÚtypeÚ__name__Úparentr‚   Úcron.scheduler_worker_envr»  Ú__file__ÚparentsÚNamedTemporaryFileÚwriterj  rÂ  rZ  rk  rq  r‚  r|   r9   r:   ÚOSErrorÚunlinkÚ
subprocessÚTimeoutExpiredrA   )=rH   r†  r‡  rƒ  r„  rÉ  rÊ  rË  rÌ  r‰  rŠ  r‹  rŒ  r�  Úprofile_labelÚjob_namer£  Úsource_homer�  rc   r‘  r’  Úsuppress_notificationÚrun_idrÝ   Úreceiptr—  r˜  r™  Úpendingr›  rg   ÚownerÚreceiptsÚdetailÚexcÚ_iluÚfoundra  Ú
hermes_binr°  r²  r³  rc  r»  Ú
query_fileÚfhrÂ  Úreport_fileÚ	timeout_sr£   ÚtailÚpathÚmarker_queuedÚmarkerÚ_defer_markerÚ
marker_keyÚ	defer_excÚhintr}   r¯  s=   &&&$$                                                       @r0   Ú_deliver_to_bot_chatr    sÊ	  ø€ ó ÛÛÛÝ0Ý3÷ñ ð �W‰W�T˜3Ó€FØ×&Ð&˜w€Mô
 # 7Ð,>Ó?€GÜ# C§G¡G¨F°FÓ$;¸ZÓH€Hà
�X�Jð 'à'. ið	1ð ð
DSÙ%Ó'×/Ñ/Ó1ˆÝ Ø*2Ò*>‘�X˜fÕ%Ô&ß,3‘ Ô(¸ÇgÁgÃið 	à!×NÐN¤T¨8¯>¨>°r×*>Ñ*>¸}Ó*MÓ%NˆÝOÝJØ +÷ !Xð !XÑ4QÜ$Ñ&@ÀÈÕAUÓ&Vó5Xô 1XÐàÒ¨°
Õ):×(CÑ(C×(EÒ(EØ@ÀÀÀoÐVÐVð —‘˜Ó(ˆßØ—^‘^Ð$6¸¿
¹
»×8HÑ8HÓIˆFØ�n‰n˜TŸZ™ZÜ�Ó˜v¤s¨6£{´C¸³IÐ>Ø¨:ð (ó 
÷ ‰&�‹/ó÷ %™9›;ð 	ð ÒØ˜4•.ˆCñ ' t¨SÓ1ˆØŠ?§8ßBÝDá" 3Ó'ˆGð Ò#×'<Ù1°$Ó7Ò?ÑDXÐY]×D^ÒD^Ù ¤T¨#£Y°À$Ø,7ÐDYô[�àÒ"Ø  Õ*�Ø$ ] OÐ4�à˜f m°SðM:�—‘Ð<¸bÓAÀ&ÑIà˜\Ô)ØBF�CÐ>Ñ?Ø%Ð)BÔB�tð  SÈ6È(ÐRSÐTZÐS[Ð[eÐfiÐejð  kRð  ISð  SØŠ?Ù-¨dÓ3ˆEØÒ Ù/°°e¸Wñ XÐRUð XßBMÐ/°Ñ>ÐSUñX�àÒØ˜	Õ" gÔ-Ø—{‘{Ð#:¸HÓE×ZeÉ,ÐksÔtÜ Ð!UÓVÐVØ˜XÕ&ˆFØ   Ð0ˆFØ—~‘~Ð&CÀRÓHˆHØ (¨&°-ÀÐEˆH�VÑÜ�K‰KÐDØ ¨s°Fô<à˜Ô"ÙØ@FÐJ_Ô@_Ñ<Ø"Ÿ;™; wÓ/×[Ð[°7·;±;¸xÓ3H×[Ð[ÈOð à�X˜Q˜v˜h j°°°S¸¸ÐAÐAð ð,Ý%Ø—‘˜|Ó,°DÐ8ˆ÷ Ü—‘ Ð&7Ð8‰ä—\’\ (Ó+ˆ
ßñxàˆ|ˆ÷ð õ HÝAØ�;‰;�=Š=ÙÐBÀ4À&ÈÐXÓYÐYð\Ù&Ù*¬2¯:©:Ó6ÀDÐ^bôdˆð
 ‡{�{×Ñ˜:Ô%Ø��yÐ!Õ!ˆØˆC…y�TÐ,Ð-Ô-õ 	!åKÙ% c©4´«>×+AÑ+AÓ+C×+KÑ+KÈAÕ+NÔOà€JðJ$Ø×(Ñ(Ø˜'¨&Ð9OÐX]ð )÷ 
ô 
àØ�H‰H�WÔØŸ™ˆJ÷	
ð 	Ø�F˜C  zÐ3HØ�. *ð
õ 	
ˆõ 	GØ#˜ JÐ/ˆØ$/ˆÐ Ñ!Ü2Ó4ˆ	Ü# D¨#¨{¸IÓFˆØ×Ñ Ô!Ü*¨6Ó2ˆDÜ�N‰NØNØ˜ t¨Tô3ð NÈmÈ_ð ]à"˜Vð%ð&÷d Ø#¨
 |°:Ð%>Ó?�Ü×(Ò(¬×1Õ1Ü—I’I˜d”O÷ 2Ñ1ò @ð ô] 	�‰ÐEÀvÈ}Ô]Ø÷Z Ø#¨
 |°:Ð%>Ó?�Ü×(Ò(¬×1Õ1Ü—I’I˜d”O÷ 2Ñ1ó @ñ øôu ô Sà/°¨¸nÈSÈEÐRÕRûðSûô ô Ø‹ðûô6 ô \ÙÐ5°m°_ð E/Ü/3°C«y×/AÑ/AÐ.BÀ"ÀSÀEÐIYð[ó \õ 	\ûð\ú÷
÷ 
ð 
ú÷P 2×1Ñ1ú×1×1Ð1ûô] ×$Ñ$õ #Fð
 ˆØ—�˜B×#Ñ# J×/Ò/àPØ�+ð GØGMÀhð OØ#ŸM™M›O¨DÕ1Ð2ð4ð ð'ÝIð %Ÿ^™^¨s¨e°9Ð,=×,DÑ,DÓ,FÓG×QÑQÓS�
Ù˜j¬$¨s«)°V¸WÀdØ*5ÀõFà $‘øÜô 'Ü—‘ØPØ˜I÷'ñ 'ûð'ú÷ ðWØW]ÐV^Ð^_ñað&ð	 	ñ Ø,¨]¨Oð <Ø�K˜s 4 &ð )EðEóFñ 	F÷ Ø#¨
 |°:Ð%>Ó?�Ü×(Ò(¬×1Õ1Ü—I’I˜d”O÷ 2×1×1Ò1úò @ð ô ô qÜ�‰ØDÀfÈmÜ�‹F×&Ð&”d˜1“g×&Ñ&°ð 	ô 	7ð JÈ-Èð Ypð pô	q÷ Ø#¨
 |°:Ð%>Ó?�Ü×(Ò(¬×1Õ1Ü—I’I˜d”O÷ 2×1×1Ò1úò @ð ûðqû÷ Ø#¨
 |°:Ð%>Ó?�Ü×(Ò(¬×1Õ1Ü—I’I˜d”O÷ 2×1×1Ò1úò @ð úsŸ  Á75Y Â- Y ÃY Ã*Y ÄA Y Å	Y ÅY Å(B*Y È!Y È5Y ÉAY Ê$
Y Ê/ Y Ë2Y ÌAY Í! Y ÎY ÎY Î-Y: Ð=Z Ó\ Ó1[ÔA>\ ×[	×'\ Ø3[4ÙY7Ù%Y2Ù,Y7Ù2Y7Ù:ZÚ
ZÚ[Ú$[Ú=[Û[Û[	Û	\ Û[1Û4\Ü d8Ü)d8Ý d8Ý"A^3Þ2d8Þ3_Þ>_ßd8ß_ß
d8ß*d8àd; à9a	áa+á2d8á;d8á<Ad3ãd8ãd; ã:d	äd,ä3d8ä8d; ä;5f)å0fæ
f)æf"æf)c               ó   € V ^8„  d   QhRR/# rm  r.   )r/   s   "r0   r1   r1   è  s   € ÷ 	ñ 	¨ñ 	r2   c                ó<  € V e   V R8X  d   R# \        V \        \        34      '       de   V  Uu. uF=  p\        V4      P	                  4       '       g   K$  \        V4      P	                  4       NK?  	  ppV'       d   RP                  V4      # R# \        V 4      # u upi )uí   Normalize ``deliver`` to its canonical comma-separated string; ``"local"`` when falsy.
Lists/tuples (MCP clients, hand-edited jobs.json) are flattened â€” ``str(["telegram"])`` would
yield ``"['telegram']"`` and fail resolution silently.r5   rE  rÅ  )r?   rb  Útupler,   rA   rÛ   )Údeliverr4  r€  s   &  r0   Ú_normalize_deliver_valuer  è  st   € ð ‚˜' Rœ-ÙÜ�'œD¤%˜=×)Ò)Ù)0ÓC© A´C¸³F·L±L·N””�Q“—‘–©ˆÐCß"'ˆs�x‰x˜‹Ð4¨WÐ4Üˆw‹<Ðùò Ds   ®!BÁBÚallzbot-chatÚtuic               ó    € V ^8„  d   QhRRRR/# )r*   Úpartr,   r-   r^   r.   )r/   s   "r0   r1   r1   ÿ  s   € ÷ 
ñ 
 sð 
¨}ñ 
r2   c                óô   € T ;'       g    RP                  4       pVP                  4       pV\        8X  d   R# \        R,           pVP                  V4      '       d   V\	        V4      R P                  4       # R# )u¬   ``bot-chat[:<name>]`` â†’ ``""`` (own profile), the name, or ``None`` if not a bot-chat
token. Token is case-insensitive; the name is normalized later by the profile layer.r5   r-  N)rA   r>   r2  rt  Úlen)r  rD   Úloweredr¾  s   &   r0   rI  rI  ÿ  sg   € ð �:ˆ:�2×
Ñ
Ó
€CØ�i‰i‹k€GØÔ#Ô#ÙÜ Õ$€FØ×Ñ˜&×!Ò!Ø”3�v“;�<Ð ×&Ñ&Ó(Ð(Ùr2   c               ó$   € V ^8„  d   QhRRRRRR/# )r*   rH   r@   Úprofile_argr,   r-   rI   r.   )r/   s   "r0   r1   r1     s!   € ÷ ñ  $ð °Sð ¸^ñ r2   c                óH  € V'       g   R\         RRRR/#  ^ RIHpHp V! V4      pV! V4      '       g*   \        P                  RV P                  RR	4      V4       R# R\         RVRR/#   \         d.    \        P                  R
T P                  RR	4      TRR7        R# i ; i)u  Resolve a bot-chat token to a delivery target. ``""`` = own profile (no ``-p`` needed);
otherwise the profile must exist locally â€” cross-machine delivery is intentionally unsupported
so same-named profiles on other gateways can never be targeted by accident.rL   rM   r5   r]   N)Únormalize_profile_nameÚprofile_existsuV   Job '%s': bot-chat delivery profile '%s' not found on this machine â€” skipping targetrƒ   r“   z1Job '%s': failed to resolve bot-chat profile '%s'Trù   )r2  r1  r  r  r{   r|   r=   r;   )rH   r  r  r  Úcanons   &&   r0   rJ  rJ    s­   € ÷ ØÔ-¨y¸"¸kÈ4ÐPÐPðßNÙ& {Ó3ˆÙ˜e×$Ò$Ü�N‰Nð.à—‘˜˜cÓ" Kô1ñ ØÔ-¨y¸%ÀÈdÐSÐSøÜô Ü�‰Ø?ÀÇÁÈÈsÓASÐU`Øð 	ô 	
ò ðús   –A) ´'A) ÁA) Á)4B!Â B!c               ó    € V ^8„  d   QhRRRR/# )r*   r  r,   r-   z	list[str]r.   )r/   s   "r0   r1   r1   $  s   € ÷ Uñ U ð U¨ñ Ur2   c                óž   € V P                  4       \        9  d   V .# \        4        Uu. uF  p\        V4      '       g   K  VNK  	  up# u upi )zyExpand ``all`` to every home-target platform with a configured chat_id; non-tokens pass
through as a single-element list.)r>   Ú_ROUTING_TOKENSr  r  )r  r4  s   & r0   Ú_expand_routing_tokensr$  $  sA   € ð ‡z�zƒ|œ?Ô*ØˆvˆÜ2Ô4ÓTÑ4�!Ô8PÐQR×8S�AˆAÑ4ÑTÐTùÒTs   ©A
ÁA
c               ó    € V ^8„  d   QhRRRR/# )r*   rH   r@   r„  rR   r.   )r/   s   "r0   r1   r1   ,  s   € ÷ 'ñ '˜dð '°Dñ 'r2   c               ó¢   € V'       d7   V P                  R4      pVe"   \        V4      P                  4       '       d   V# V P                  RR4      # )a  Raw deliver-lane value for a run outcome: the failure lane when ``for_failure`` and the job
overrides it, else ``deliver``. Bookkeeping (outcome classification, unresolved-origin, incident
'alerted' marking) must read the SAME lane the notice was routed through (NS-788).Úfailure_deliverr  rE  )r=   r,   rA   )rH   r„  r'  s   &$ r0   Ú_delivery_lane_valuer(  ,  sF   € ÷ ØŸ'™'Ð"3Ó4ˆØÒ&¬3¨Ó+?×+EÑ+E×+GÒ+GØ"Ð"Ø�7‰7�9˜gÓ&Ð&r2   c               ó$   € V ^8„  d   QhRRRRRR/# )r*   rH   r@   r„  rR   r-   r&  r.   )r/   s   "r0   r1   r1   7  s!   € ÷  ñ   4ð  ¸ð  È*ñ  r2   c          
     ó  € \        \        WR7      4      pVR8X  d   . # / p. pVP                  R4       EFN  pVP                  4       pV'       g   K  VP	                  4       \
        9   p\        V4       EF	  p\        WVR7      pV'       g   K  VR,          P	                  4       \        VR,          4      VP                  R4      3p	VP                  V	4      p
V
f   WƒV	&   VP                  V4       K€  \        P                  \        VP                  R4      ;'       g    R	4      ^ 4      \        P                  \        V
P                  R4      ;'       g    R	4      ^ 4      8”  g   Kõ  VP                  R4      V
R&   EK  	  EKQ  	  V# )
u¾  Resolve auto-delivery targets from comma-separated ``deliver``; ``all`` expands to every
platform with a home channel and combines with explicit targets. Dedup by (platform, chat_id,
thread_id). ``for_failure=True`` (failure summaries, interrupted-run notices, drift/preflight
alerts) resolves from ``failure_deliver`` INSTEAD when the job carries one â€”
``failure_deliver: local`` is the structural opt-out; absent, failures follow ``deliver``.©r„  rE  rÅ  )rA  rL   rM   r]   rj   r5   )r  r(  rK  rA   r>   r#  r$  rR  r,   r=   rÚ   Ú_MIRROR_PROVENANCE_RANK)rH   r„  r  Úseenr3  rD   rA  r  rg   rÝ   r�  s   &$         r0   Ú_resolve_delivery_targetsr.  7  sK  € ô 'Ô';¸CÔ'YÓZ€GØ�'ÔØˆ	à€DØ€GØ�}‰}˜S×!ˆØ�i‰i‹kˆßÙØŸ™›¬Ñ7ˆÜ*¨3×/ˆDÜ4°SÈ~Ô^ˆFßÙØ˜*Õ%×+Ñ+Ó-¬s°6¸)Õ3DÓ/EÀvÇzÁzÐR]ÓG^Ð_ˆCØ—8‘8˜C“=ˆDØŠ|Ø"�S‘	Ø—‘˜vÖ&ô (×+Ñ+¬C°·
±
Ð;KÓ0L×0RÐ0RÐPRÓ,SÐUVÓWÜ)×-Ñ-¬c°$·(±(Ð;KÓ2L×2RÐ2RÐPRÓ.SÐUVÓWöXð *0¯©Ð4DÓ)E�Ð%Ô&ô 0ñ "ð( €Nr2   c               ó    € V ^8„  d   QhRRRR/# rG   r.   )r/   s   "r0   r1   r1   Z  s   € ÷ +ñ + $ð +¨>ñ +r2   c                ó>   € \        V 4      pV'       d
   V^ ,          # R# )zAResolve the concrete auto-delivery target for a cron job, if any.N)r.  )rH   r3  s   & r0   Ú_resolve_delivery_targetr1  Z  s   € ä'¨Ó,€Gß ˆ7�1�:Ð* dÐ*r2   c          
     ó,   € V ^8„  d   QhRRRRRRRRR	R/# )
r*   rM   r,   Úmedia_filesrb  Úmetadatazdict | NonerH   r@   r-   r.   )r/   s   "r0   r1   r1   e  s4   € ÷ :ñ :Øð:Ø(,ð:Ø8Cð:ØPTð:à	ñ:r2   c                óØ  € ^ RI HpHpHp	 ^ RIHp
 RVP                  RR4      /p. pT;'       g    .  UUu. uF  w  rÞ\        V4      V3NK  	  pppVP                  V4      pV UUu0 uF  w  ppVkK
  	  pppV F0  w  pp V	! V4      V9  pV'       g   K  VP                  RV 24       K2  	  Ve   TM\        V RR4      pV EF  w  pp \        P                  ! V4      P                  P                  4       pV! VVVR	7      '       d   R
RppM$V\         9   d   RRppMV\"        9   d   RRppMRRpp\        V V4      ! RRVRV/VV/B pV
! VV4      pVf   \%        VRV R2V4       Vu #  VP'                  \(        P*                  ! 4       R7      pT'       d8   \        TRR4      '       g"   \%        TRT R\        TRR4       2T4       EK  EK  EK  	  V# u uppi u uppi   \         d    Rp ELii ; i  \,         d    TP/                  4        h i ; i  \         dF   p\%        TRT R\        T4      ;'       g    \1        T4      P2                   2T4        Rp?EK¡  Rp?ii ; i)zÉSend MEDIA files as native attachments (routed by extension, as in
_process_message_background). Returns per-file error strings so a dropped attachment surfaces
in run status, not just the gateway log.)ÚBasePlatformAdapterÚshould_send_media_as_audioÚvalidate_media_delivery_pathr�   rƒ   r“   Tz)attachment dropped by media path policy: NrL   )Úis_voiceÚ
send_voiceÚ
audio_pathÚ
send_videoÚ
video_pathÚsend_image_fileÚ
image_pathÚsend_documentÚ	file_pathrM   r4  zcannot send media z: gateway loop unavailablerŸ   Úsuccesszmedia send failed for r¶  r¤  Úunknownzfailed to send media r.   )Úgateway.platforms.baser6  r7  r8  r¢   rž   r=   r,   Úfilter_media_delivery_pathsr;   rÚ   r<   rW   r�  rÿ   r>   Ú_VIDEO_EXTSÚ_IMAGE_EXTSÚ_note_target_errorr£   Ú_scriptÚ_get_media_send_timeoutÚTimeoutErrorÚcancelrè  ré  )r¤   rM   r3  r4  r¥   rH   rL   r6  r7  r8  rž   Újob_refÚerrorsr4  ÚvÚ	requestedr)  r�  Úraw_pathÚ_vÚdroppedÚroute_platformÚ
media_pathÚ	_is_voiceÚextÚmethodÚpath_kwr¨   r©   r£   r}   s   &&&&&&&                        r0   Ú_send_media_via_adapterrZ  e  s§  € ÷Wñ Wå:Ø�S—W‘W˜T 3Ó'Ð(€GØ€FØ*5×*;Ð*;¸Ð*;Ô=Ñ*;¡ ”#�a“&˜!“Ñ*;€IÑ=Ø%×AÑAÀ+ÓN€Ká%Ô&™+‘$�!�Q‹A™+€DÑ&Û!‰ˆ�"ð	Ù2°8Ó<ÀDÑHˆG÷ ‰7Ø�M‰MÐEÀhÀZÐPÖQñ "ð "*Ò!5‘X¼7À7ÈJÐX\Ó;]€NÜ!,Ñˆ
�Ið 	eÜ—+’+˜jÓ)×0Ñ0×6Ñ6Ó8ˆCÙ)¨.¸#È	×RÓRØ".°˜�˜ØœÔ#Ø".°˜�˜ØœÔ#Ø"3°\˜�˜à"1°;˜�Ü˜7 FÔ+ñ MØðMØ*2ðMØ7>À
Ð6KñMˆDá-¨d°DÓ9ˆFØŠ~Ü"ØÐ1°*°Ð=WÐXÐZ`ôbà’ðàŸ™¬w×/NÒ/NÓ/P˜ÓQ�÷ œg f¨i¸×>Ò>Ü"ØØ,¨Z¨L¸¼7À6È7ÐT]Ó;^Ð:_Ð`Ø÷ò ?Švñ1 "-ðD €Mùó_ >ùó 'øô ô 	Ø‹Gð	ûô6  ô Ø—‘”Øðûô ô 	eäØÐ0°°¸B¼sÀ1»v×?YÐ?YÌÈaË×IYÑIYÐ>ZÐ[Ð]c÷eó eûð	eúsT   ¶GÁ'GÂG%ÃBHÅ.%G9ÆHÆ1HÇ%G6Ç5G6Ç9HÈHÈI)È$9I$É$I)c               ó   € V ^8„  d   QhRR/# )r*   rÝ   r,   r.   )r/   s   "r0   r1   r1   ¢  s   € ÷ .ñ . Cñ .r2   c                óh   € \        V \        4      '       d   V P                  W4      # \        WV4      # )zXRead ``key`` from a SendResult-like object or the plain dict the silence filter returns.)r?   r@   r=   r<   )Úsend_resultrÝ   r¸  s   &&&r0   Ú_result_fieldr^  ¢  s+   € ä�+œt×$Ò$Ø�‰˜sÓ,Ð,Ü�; WÓ-Ð-r2   c               ó$   € V ^8„  d   QhRRRRRR/# )r*   r¯  r,   Ú
unverifiedzOptional[list]r-   rR   r.   )r/   s   "r0   r1   r1   ©  s$   € ÷ $ñ $Øð$Ø0>ð$ØJNñ$r2   c                óf  € V f   R# \        V \        4      '       d   RV 9   pM\        V R4      pV'       d   \        \	        V R4      4      '       g   R# \	        V R4      RJ d   R# \	        V R4      f>   \	        V R4      '       g,   \
        P                  RV4       Ve   VP                  R4       R# )u»  Return True only if ``send_result`` unambiguously confirms delivery. ``None`` or no
``success`` attr/key is NOT success (would log "delivered" while nothing was sent).
``delivered is False`` REJECTS even with truthy ``success`` (the silence-narration filter
returns ``{"success": True, "delivered": False}``). No ``message_id``/``raw_response`` is still
accepted (some adapters return a bare success) but logged at WARNING as UNVERIFIED.

A live adapter that returns ``None`` (e.g. a swallowed exception, a busy platform, or a code path that
returns early without producing a ``SendResult``) must NOT be treated as success â€” doing so causes the
scheduler to log ``"delivered to <chat> via live adapter"`` while the gateway never actually sees the
message (#47056).
* No ``message_id`` and no ``raw_response`` means we have no positive evidence of a send. Telegram
``SendResult`` objects carry ``message_id``; the dict-filter shape does not. See #77763.
FrB  Ú	deliveredÚ
message_idÚraw_responseu‹   Job '%s': live adapter reported success with no delivery evidence (no message_id, no raw_response) â€” treating as delivered but UNVERIFIEDT)r?   r@   ÚhasattrrR   r^  r{   r|   rÚ   )r]  r¯  r`  Úhas_successs   &&& r0   Ú_confirm_adapter_deliveryrg  ©  s¢   € ð ÒÙÜ�+œt×$Ò$Ø ;Ñ.‰ä˜k¨9Ó5ˆßœd¤=°¸iÓ#H×IÒIÙÜ�[ +Ó.°%Ó7Ùä�k <Ó0Ò8Ü˜k¨>×:Ò:ä�‰ðð ô		ð
 Ò!Ø×Ñ˜dÔ#Ùr2   c          
     ó,   € V ^8„  d   QhRRRRRRRRRR/# )	r*   Úruntime_adapterr   rM   r¥   r¯  r,   r-   rR   r.   )r/   s   "r0   r1   r1   Ð  s1   € ÷ #ñ #¨#ð #¸ð #À3ð #ÐPSð #ÐX\ñ #r2   c                óô  € \        \        V 4      RR4      p\        V4      '       g   R#  ^ RIHp V! V \        V4      4      pV! Wb4      pVf   R# VP                  ^
R7      p\        T\        4      ;'       d6    \        TP                  R	4      ;'       g    R
4      P                  4       R8H  p	T	'       d   \        P                  RY14       T	#   \         d    \        P                  RY1RR7        R# i ; i)u¢  Is an ambiguous ``telegram:<positive_chat_id>:<numeric_thread_id>`` target a channel
Direct-Messages topic (``direct_messages_topic_id``) rather than a private-chat forum topic
(``message_thread_id``)? Shape cannot decide; signal is ``get_chat_info`` type == ``channel``.
Fails SAFE to False (thread routing) without a probe or on any probe error/timeout.

Callers gate this on the ambiguous shape first (``telegram:<positive_chat_id>:<numeric_thread_id>``) â€”
that shape is identical for both cases, so shape alone cannot decide (this was the #52060 regression).
Probe the live adapter's ``get_chat_info`` once and only return True when the chat is a channel.
See #22773.
Úget_chat_infoNFr�   rŸ   u\   Job '%s': get_chat_info probe failed for chat=%s â€” defaulting to message_thread_id routingTrù   rè  r5   ÚchanneluG   Job '%s': chat=%s is a channel â€” routing via direct_messages_topic_id)r<   rè  r¡   r¢   rž   r,   r£   r;   r{   r–   r?   r@   r=   r>   r•   )
ri  rM   r¥   r¯  rk  rž   r¨   r©   r•   Ú
is_channels
   &&&&      r0   Ú_is_channel_dm_topicrn  Ð  sè   € ô œD Ó1°?ÀDÓI€MÜ�M×"Ò"ÙðÝ>Ù˜_¬c°'«lÓ;ˆÙ)¨$Ó5ˆØŠ>Ùà�}‰} Rˆ}Ó(ˆô ˜D¤$Ó'×\Ð\¬C°·±¸Ó0@×0FÐ0FÀBÓ,G×,MÑ,MÓ,OÐS\Ñ,\€JßÜ�‰ØUØô	ð Ðøô ô Ü�‰ð6à dð 	ô 	,ò ðús   «$C ÁC Ã#C7Ã6C7c               ó    € V ^8„  d   QhRRRR/# )r*   rQ   rI   r-   rR   r.   )r/   s   "r0   r1   r1   ö  s   € ÷ ñ  ~ð ¸$ñ r2   c                ó  €  T ;'       g    / P                  R4      p\        V\        4      '       d   VP                  R4      MRp\        V\        4      '       * ;'       g    VP                  RR4      RJ#   \         d     R# i ; i)zªResolve ``cron.delivery.notify`` (default True). Only an explicit ``False`` disables; a
missing/malformed section keeps the default so a typo cannot silently mute briefs.rU   ÚdeliveryNÚnotifyTF)r=   r?   r@   r;   )rQ   Úcron_cfgÚdelivery_cfgs   &  r0   Ú_cron_delivery_notify_enabledru  ö  sv   € ðØ—I�I˜2—?‘? 6Ó*ˆÜ3=¸hÌ×3MÒ3M�x—|‘| JÔ/ÐSWˆÜ˜l¬DÓ1Ô1×bÐb°\×5EÑ5EÀhÐPTÓ5UÐ]bÐ5bÐbøÜô Úðús   ‚A7 ‹AA7 Á"A7 Á7BÂBc               ó$   € V ^8„  d   QhRRRRRR/# )r*   rH   r@   Úunverified_targetsrb  r-   rŒ   r.   )r/   s   "r0   r1   r1     s&   € ÷ añ a tð aÀð aÈ$ñ ar2   c                óX  € \        V4      ;'       g    RpV P                  R/ 4      P                  4        UUu/ uF  w  r4VR,          R	9   g   K  W4bK  	  upp;'       g    RpRVRV/P                  4        UUu/ uF)  w  rgV P                  V4      ;'       g    RV8w  g   K'  WgbK+  	  pppV'       g   R# T P                  V4        ^ RIHp	 V	! V R,          V4       R# u uppi u uppi   \         d2   p
\        P                  RT P                  R4      T
4        Rp
?
R# Rp
?
ii ; i)
zÐPersist ``last_delivery_unverified``: list of ``platform:chat_id[:thread_id]`` targets acked with no
evidence, or None, alongside queued Bot Chat receipts. Never raises (bookkeeping must not fail a
delivery).Nrž  r›  Úlast_delivery_unverifiedÚlast_delivery_queued)Ú
update_jobrƒ   z4Job '%s': could not record delivery verification: %srÆ  )	rb  r=   ÚitemsÚupdateÚ	cron.jobsr{  r;   r{   r–   )rH   rw  Ú	new_valuerg   rù  rÇ  rÝ   rÞ   Úvaluesr{  rþ  s   &&         r0   Ú_record_delivery_verificationr�    s2  € ô Ð'Ó(×0Ð0¨D€Ià�g‰gÐ3°RÓ8×>Ñ>Ô@ô=Ù@ñ #2 &à˜Õ"Ð&;Ñ;ô ˆfŠoÙ@ò=÷ Eð Eà@Dð ð 	# IÐ/EÀvð,ç�eƒgð,ô 2ñ ,™Z˜Sà—'‘'˜#“,×&Ð& $¨5Ñ0ô ˆcŠjñ ,€Fñ 2÷ ÙØ‡J�JˆvÔðaÝ(Ù�3�t•9˜fÖ%ùó=ùó2øô ô aÜ�‰ÐKÈSÏWÉWÐUYË]Ð\_×`Ò`ûðaús5   ¹C!ÁC!Á;C'ÂC'Â$C'Ã	C- Ã-D)Ã8&D$Ä$D)c                  ó6  € ] tR tRt$ Rt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tR]R&   RtR
]R &   ]R! R" l4       t	]R# R$ l4       t
R%tR# )&Ú_TargetDeliveryi  zJPer-target delivery state shared by the live-adapter and standalone lanes.r@   rH   r   rL   r,   r\   rM   r^   r]   Ú	transportrB   ri  Útarget_adaptersÚconfigr¥   rR   Únotify_deliveryrK   Úorigin_targetÚorigin_user_idÚis_dm_targetr‹   Úmirror_this_targetÚin_channel_surfaceÚinchannel_continuableÚopened_thread_idFÚlive_adapter_readyNÚ
live_errorc               ó   € V ^8„  d   QhRR/# )r*   r-   rR   r.   )r/   s   "r0   r1   Ú_TargetDelivery.__annotate__3  s   € ÷ Fñ F˜$ñ Fr2   c                	óZ   € V P                   R J;'       d    V P                   P                  # ©N)r„  Úis_relay)Úselfs   &r0   r•  Ú_TargetDelivery.is_relay2  s#   € à�~‰~ TÐ)×EÐE¨d¯n©n×.EÑ.EÐEr2   c               ó   € V ^8„  d   QhRR/# rm  r.   )r/   s   "r0   r1   r’  7  s   € ÷ Fñ F�sñ Fr2   c                	ó‚   € V P                    R V P                   2pV P                  '       d   V R V P                   2# T# )r-  )r\   rM   r]   )r–  Úbases   & r0   ÚwhereÚ_TargetDelivery.where6  sB   € ð ×$Ñ$Ð% Q t§|¡| nÐ5ˆØ-1¯^¯^¨^�$��q˜Ÿ™Ð(Ð)ÐEÀÐEr2   r.   )ré  Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotations__r�  r�  Úpropertyr•  r›  Ú__static_attributes__r.   r2   r0   rƒ  rƒ    sº   ‡ áTà	ƒIØƒMØÓØƒLØÓØƒNØƒLØÓØÓØƒKØ
ƒIØÓØƒLØÓØ!Ó!ØÓØÓØÓØÓØÓØ#Ó#Ø$Ð˜Ó$Ø $€J�Ó$àôFó ðFð ôFó ôFr2   rƒ  c               ó(   € V ^8„  d   QhRRRRRRRR/# )	r*   rH   r@   r©  r,   rN  rb  r-   rŒ   r.   )r/   s   "r0   r1   r1   =  s(   € ÷ ñ ˜Dð  sð °Dð ¸Tñ r2   c                ód   € \         P                  RV R,          V4       VP                  V4       R# )zKLog a per-target delivery failure as a WARNING and record it in ``errors``.r¬  rƒ   N)r{   r|   rÚ   )rH   r©  rN  s   &&&r0   rH  rH  =  s"   € ä
‡N�N�> 3 t¥9¨cÔ2Ø
‡M�M�#Ör2   c               ó(   € V ^8„  d   QhRRRRRRRR/# )	r*   rH   r@   r©  r,   r•  rR   r-   rŒ   r.   )r/   s   "r0   r1   r1   C  s.   € ÷ Sñ S ð S¨Cð S¸4ð SÀDñ Sr2   c                ó’   € V'       d!   \         P                  RV R,          V4       R# \         P                  RV R,          V4       R# )zPRelay targets have no standalone fallback, so the log line must not promise one.r¬  rƒ   ú(Job '%s': %s, falling back to standaloneNr­  )rH   r©  r•  s   &&&r0   Ú_warn_live_lane_failurer©  C  s.   € çÜ�‰�~ s¨4¥y°#Ö6ä�‰ÐAÀ3ÀtÅ9ÈcÖRr2   c               ó$   € V ^8„  d   QhRRRRRR/# )r*   rH   r@   r\   r,   rg   r.   )r/   s   "r0   r1   r1   K  s)   € ÷ 6Hñ 6HØ	ð6HØ(+ð6HØ59ñ6Hr2   c                óŽ  € ^ RI HpHp TpRp	\        V\        P
                  4      '       dd   VP                  W4      p
V
e   W/M/ pV
eF   ^ RIHp ^ RI	H
p VP                  P                  V4      pT! Y­e   V! VRR7      MV! RR7      V4      p	V	f
   V! WV4      p	V	e   V	P                  pV	P                  pM7^ RIHp VV! 4       9   d	   RRV R	23# VP                  P                  V4      pRpV	e+   V	P                   '       g   Vf   Vf   ^ RI	H
p V! RR7      pM"V'       d   VP"                  '       g	   RRV R
23# WžWø3R3# )zÃResolve ``(transport, pconfig, runtime_adapter, target_adapters)`` for one target, or
``(None, error)`` when it cannot be served (relay-fronted with no live transport, or not
configured/enabled).)ÚDeliveryTransportÚresolve_delivery_transportN)rÙ   )ÚPlatformConfigT)r‰   r!  z
platform 'z’' is relay-fronted and has no live gateway transport; start the gateway (its ticker owns relay-fronted delivery and will fire the job on schedule)z' not configured/enabled)Úgateway.deliveryr¬  r­  r?   Ú
_preflightÚSharedRouteAdaptersr=   ÚdataclassesrÙ   r¸   r®  Ú	platformsr†  r¤   r#  r"  r•  r‰   )rH   rL   r\   rg   Úadaptersr†  r¬  r­  r…  r„  ÚsharedrÙ   r®  ÚownrB   ri  r"  s   &&&&&&           r0   Ú_resolve_target_transportr·  K  sa  € ÷
 OØ€OØ€IÜ�(œJ×:Ñ:×;Ò;ð —‘˜hÓ/ˆØ06Ò0B˜8Ñ,ÈˆØÒõ
 ,Ý5Ø×"Ñ"×&Ñ& xÓ0ˆCÙ)Ø²o™ ¨TÕ2É>ÐbfÔKgØóˆIð ÒÙ.¨xÀÓQˆ	ØÒØ×"Ñ"ˆØ#×+Ñ+‰õ 	:ØÑ3Ó5Ô5ØØ˜]˜Oð ,ð ðð ð ×"Ñ"×&Ñ& xÓ0ˆØˆàÒ )×"4×"4Ð"4¸ºð
 Š?Ý5Ù$¨TÔ2ˆGøß˜GŸOŸO˜OØ�z - Ð0HÐIÐIÐIØ ÐAÀ4ÐGÐGr2   c               ó    € V ^8„  d   QhRRRR/# rí   r.   )r/   s   "r0   r1   r1   „  s   € ÷ Sñ SÀð SÈñ Sr2   c                ó²   € \        V RR4      p\        V4      '       d    \        V! V4      4      # \        \        V RR4      4      #   \         d     R# i ; i)zùD6 probe: can this adapter deliver a continuable in_channel brief on ``platform_name``?
Per-platform check first (one RelayAdapter fronts N platforms; the scalar attr only carries
the PRIMARY identity's bit); native adapters use the class attribute.Ú+supports_inchannel_continuable_for_platformNFÚsupports_inchannel_continuable)r<   r¡   rR   r;   )ri  r\   Úper_platform_checks   && r0   Ú_inchannel_surface_supportedr½  „  se   € ô !ØÐFÈóNÐäÐ"×#Ò#ð	ÜÑ*¨=Ó9Ó:Ð:ô ”˜Ð)IÈ5ÓQÓRÐRøô ô 	Úð	ús    A ÁAÁAc               ó    € V ^8„  d   QhRRRR/# )r*   Útrƒ  r-   z tuple[Optional[str], dict, dict]r.   )r/   s   "r0   r1   r1   ’  s   € ÷ *;ñ *;˜Oð *;Ð0Pñ *;r2   c                óà  € ^ RI Hp ^ RIHpHp V P
                  pV P                  pV P                  VP                  8H  ;'       dA    VRJ;'       d5    V! \        V P                  4      4      ;'       d    V! \        V4      4      pV'       dx   \        V P                  V P                  V P                  VR,          4      '       d?   RpR\        V4      RVR,          RV P                  /pR\        V4      RV P                  /p	MNVe   \        V4      MRpRVR,          RV P                  /pV'       d   WxR&   RV P                  /p	V'       d   WYR&   \        P                   ! WV	4       WxV	3# )	uj  Compute ``(route_thread_id, route_metadata, media_metadata)`` for a live send, ONCE so text
and media agree. ``telegram:<positive_chat_id>:<numeric_thread_id>`` is ambiguous (private
forum topic vs channel DM topic need OPPOSITE routing) â€” see ``_is_channel_dm_topic``.
``thread_id`` rides in ``route_metadata`` to bypass the router's private-chat anchor rule.r³   )Ú_looks_like_intÚ#looks_like_telegram_private_chat_idNrƒ   Údirect_messages_topic_idr¯  rr  r]   )r¸   r´   r¯  rÁ  rÂ  rH   r]   rL   ÚTELEGRAMr,   rM   rn  ri  r¥   r‡  Ú_originÚstamp_origin_discriminators)
r¿  r´   rÁ  rÂ  rH   r]   Úis_ambiguous_telegram_topicÚroute_thread_idÚroute_metadataÚmedia_metadatas
   &         r0   Ú_live_route_metadatarË  ’  sV  € õ
 (ßUØ
�%‰%€CØ—‘€Ià	�
‰
�h×'Ñ'Ñ'÷ 	,ð 	,Ø˜TÐ!÷	,ð 	,á/´°A·I±I³Ó?÷	,ð 	,ñ œC 	›NÓ+ð	  ÷ #Ô';Ø	×Ñ˜1Ÿ9™9 a§f¡f¨c°$­i÷(9ò (9ð ˆà&¬¨I«¸À#ÀdÅ)Ø�a×'Ñ'ð
ˆð 5´c¸)³nÀhÐPQ×PaÑPaÐb‰ð -6Ò,Aœ#˜iœ.ÀtˆØ" C¨¥I¨x¸×9JÑ9JÐKˆßØ*9˜;Ñ'Ø" A×$5Ñ$5Ð6ˆßØ*3˜;Ñ'ô ×'Ò'¨¸>ÔJØ¨NÐ:Ð:r2   c               ó8   € V ^8„  d   QhRRRRRRRRR	R
RR
RR
RR/# )r*   r¿  rƒ  Útext_to_sendr,   rÈ  r^   rÉ  r@   Útarget_errorsrb  Údelivery_errorsrw  r-   ztuple[bool, bool, Any]r.   )r/   s   "r0   r1   r1   Â  sX   € ÷ c-ñ c-Øðc-Ø&)ðc-Ø<Iðc-Ø[_ðc-àðc-à*.ðc-àDHðc-ð ñc-r2   c               ó  a aaaaaa€ ^ RI Hp ^ RIHpHp	Hp
 S P                  pV! S P                  S P                  4      oV	! S P                  \        S P                  4      VRR7      o\        P                  ! 4       oRRRR/oVVVVVV V3R lpV! V! 4       S P                  4      pVf   VP                  R
4       R(#  VP!                  \"        R7      p\;        TR4      p\;        TR4      p. p\=        YëR,          T4      pT'       d$   T'       d   TP                  S P(                  4       T'       gÒ   Tf   RRppMo\?        T\@        4      '       d8   TP5                  R4      ;'       g    TP5                  R4      ;'       g    RpRpM"\1        TRR	4      \C        T4      PD                  ppRS P(                   R T R!T R"2pT'       d   \        T4      MR	S n        \G        Y¿S PH                  4       TP                  T4       R(# T'       dm   S PJ                  '       d[   TP5                  R#4      '       dD   TP5                  R$4      ;'       g    S PJ                  p\3        TR%T R&S P(                   R'2T4       RRT3#   \$         dÓ    S;_uu_ 4        SR,          '       * SR&   R	R	R	4       M  + '       g   i     M; iSR,          '       dT   TP'                  4        RS P(                   R2p\*        P-                  RTR,          T4       TP                  T4       R(u # \*        P-                  RTR,          S P.                  S P                  4       R)u # T
 dq   p\1        TP                   RR	4      ;'       g    / p\3        TRS P(                   RTP5                  RR4       RTP5                  RR4       RT 2T4       R*u R	p?# R	p?i\6         d+   p\        T4      S n        TP                  RT 24       h R	p?ii ; i)+z£Schedule the text send on the gateway loop; returns ``(adapter_ok, timed_out, message_id)``.
Re-raises a real send error so the caller falls through to standalone.r�   )ÚDeliveryRouterÚDeliveryTargetÚPartialDeliveryErrorT)rL   rM   r]   Úis_explicitÚstartedFÚ	abandonedc               “  óè   <"  € S;_uu_ 4        S R ,          '       d    RRR4       R# RS R&   RRR4       SP                  SSSSP                  R7      G Rj  x€L
 #   + '       g   i     L7; i L5i)rÖ  NTrÕ  )r„  )Ú_deliver_to_platformr„  )ÚdispatchÚdispatch_lockrÉ  Úroute_targetÚrouterr¿  rÍ  s   €€€€€€€r0   Ú
_send_onceÚ#_live_send_text.<locals>._send_onceÙ  se   øé € ßŠ]Ø˜×$Ô$Ø÷ ‰]ð #'ˆH�YÑ÷ ð ×0Ñ0°¸|È^Ðgh×grÑgrÐ0Ós×sÐs÷	 �]úñ tùs1   ƒA2ŽAŸ
A2©A®*A2ÁA0ÁA2ÁA-	Á(	A2Nz)live adapter event loop scheduling failedrŸ   zlive adapter send to z. timed out before the coroutine was dispatchedr¨  rƒ   zžJob '%s': live adapter send to %s:%s timed out after 60s; already dispatched (in flight), assuming delivered (skipping standalone fallback to avoid duplicate)rd  z delivered Údelivered_chunksr“   z of Útotal_chunksz chunks, then failed: zlive adapter send failed: rc  zno response from adapterrŒ   r¤  ÚfilteredrC  r@   z returned unconfirmed result (z, error=r.  Úthread_fallbackÚrequested_thread_idzconfigured thread_id z for z+ was not found; delivered without thread_id)FFN)TTN)TFN)&r¢   rž   r¯  rÑ  rÒ  rÓ  rH   r†  r…  rL   r,   rM   Ú	threadingÚLockr¥   rÚ   r£   Ú_LIVE_SEND_CONFIRM_TIMEOUT_SECSrK  rL  r›  r{   r|   r\   r<   rH  r=   r;   r�  r^  rg  r?   r@   rè  ré  r©  r•  r]   )r¿  rÍ  rÈ  rÉ  rÎ  rÏ  rw  rž   rÑ  rÒ  rÓ  rH   rÝ  r©   r]  r©  ÚexrD   Úsend_raw_responseÚdelivered_message_idÚ_evidence_gapÚsend_successr~  Úshaperã  rÙ  rÚ  rÛ  rÜ  s   ff&f$$$                  @@@@r0   Ú_live_send_textrí  Â  s–  þ€ õ ;ßUÑUØ
�%‰%€CÙ˜AŸH™H a×&7Ñ&7Ó8€FÙ!Ø—‘¤S¨¯©£^¸Ð\`ôb€Lô —N’NÓ$€MØ˜5 +¨uÐ5€H÷tó tñ &¡j£l°A·F±FÓ;€FØ‚~Ø×ÑÐHÔIØ!Ð!ð!Ø—m‘mÔ,K�mÓLˆôH & k°>ÓBÐÜ(¨°lÓCÐØ€MÜ,¨[¸d½)À]ÓS€LßŸØ×!Ñ! !§'¡'Ô*çØÒØ3°V�ˆC�Ü˜¤T×*Ò*à—/‘/ 'Ó*×VÐV¨k¯o©o¸jÓ.I×VÐVÈYˆCØ‰Eä  ¨g°tÓ<¼dÀ;Ó>O×>XÑ>X�ˆCØ% a§g¡g YÐ.LÈUÈGÐS[Ð\_Ð[`Ð`aÐbˆß#&”s˜3”x¨DˆŒÜ ¨!¯*©*Ô5Ø×Ñ˜SÔ!Ø!Ð!ß˜QŸ[Ÿ[˜[Ð->×-BÑ-BÐCT×-UÒ-UØ/×3Ñ3Ð4IÓJ×YÐYÈaÏkÉkÐÜØØ#Ð$7Ð#8¸Ø�w‰wˆiÐBðDàô		ð
 �Ð,Ð,Ð,øô ô  ÷ Š]Ø(0°Õ(;Ô$;ˆH�[Ñ!÷ �]�]ˆ]úà�K× Ô Ø�M‰MŒOØ)¨!¯'©'¨Ð2`ÐaˆCÜ�N‰NÐEÀsÈ4ÅyÐRUÔVØ× Ñ  Ô%Ø%Ò%Ü�‰ð"ð ��I�q—‘¨¯	©	ô	3ð  ÒØô !ä�b—i‘i °Ó6×<Ð<¸"ˆÜØÐ(¨¯©¨	°¸S¿W¹WÐEWÐY\Ó=]Ð<^Ð^bØ�w‰w�~ sÓ+Ð,Ð,BÀ2À$ðHØIXô	Zð !Õ ûÜô ô ˜2“wˆŒØ×ÑÐ9¸"¸Ð>Ô?Øûðúsb   ÃJ ÊPÊJ1Ê(	PÊ1KÊ<PËAPÌ&5PÍPÍ"PÍ#A%OÏPÏPÏPÏ%PÐPc          
     ó,   € V ^8„  d   QhRRRRRRRRRR	/# )
r*   r¿  rƒ  rÊ  r@   r3  rb  rÏ  r-   rŒ   r.   )r/   s   "r0   r1   r1   (  s4   € ÷ <ñ <Øð<Ø(,ð<Ø;?ð<ØRVð<Ø[_ñ<r2   c           
     ó€  € \        T;'       g    / 4      pV P                  '       d    V P                  P                  VR&   V P                  P                  V P                  4      pVe^   VP                  V P                  8X  dC   VP                  '       d   VP                  VR&   VP                  '       d   VP                  VR&   \        V P                  V P                  Y$;'       g    RV P                  V P                  V P                  R7      pV F$  pVP                  V RV P                   R24       K&  	  R# )zRSend extracted media as native attachments with the same routing as the text send.Ú_relay_logical_platformNro   r±   )rL   ú	 (target r.  )r@   r•  rL   rÞ   r†  rû   rM   ro   r±   rZ  ri  r¥   rH   rÚ   r›  )r¿  rÊ  r3  rÏ  Úrouted_media_metadataÚlogical_homeÚ_media_errorsÚ_mes   &&&&    r0   Ú_live_send_mediarö  (  s  € ô ! ×!5Ð!5°2Ó6ÐØ‡z‡z€zØ;<¿:¹:×;KÑ;KÐÐ7Ñ8Ø—x‘x×0Ñ0°·±Ó<ˆØÒ#¨×(<Ñ(<ÀÇ	Á	Ô(IØ×#×#Ð#Ø3?×3GÑ3GÐ% iÑ0Ø×$×$Ð$Ø4@×4IÑ4IÐ% jÑ1Ü+Ø	×Ñ˜1Ÿ9™9 k×3PÐ3PÈDÐRS×RXÑRXÐZ[×Z_ÑZ_Ø—‘ô€Mó
 ˆØ×Ñ #  i°·±¨y¸Ð:Ö;ó r2   c               ó    € V ^8„  d   QhRRRR/# )r*   r¿  rƒ  r-   rŒ   r.   )r/   s   "r0   r1   r1   =  s   € ÷ .Uñ .U Oð .UÈdñ .Ur2   c                ó"  € V P                   pV P                  p\        VP                  R4      V P                  VP                  R4      R7      pRpRpV P
                  '       dE   \        W P                  V P                  V P                  V P
                  V P                  3/ VB  RpV P                  '       dã   V P                  '       dÑ   V'       gÉ   \        W P                  V P                  V P                  V P                  3RV P                  /VB pV'       g4   \        P!                  RVR,          V P                  V P                  4       V'       dB   \        W P                  V P                  V P                  \#        V4      V P                  3/ VB  M‡V P                  '       dv   V P                  '       gd   \        P!                  R	VR,          V P                  V P                  VP                  R
4      VP                  R4      VP                  R4      4       \%        Y P                  V P                  V P                  V P&                  V P                  V P(                  ;'       d    V'       * ;'       d    V'       * R7       R# )z±After a confirmed live send, seed continuation session(s) and run the generic mirror.
Thread seeding is deferred here so open-succeeds/deliver-fails never seeds an unseen brief.r°   r±   )r°   rn   r±   FTro   uY   Job '%s': in_channel seed did NOT land on %s:%s â€” a plain reply will not see this briefrƒ   uö   Job '%s': in_channel delivery to %s:%s is not a continuable target (origin=%s:%s thread=%s; not the origin conversation, and not a mirror-eligible fallback/opted-in target the seed can key) â€” seed skipped; the plain mirror below may still applyrL   rM   r]   ©r]   ro   r‰   N)rH   rK   r@   r=   rŠ  rŽ  rÊ   ri  r\   rM   r‹   rŒ  r�  rÍ   r‰  r{   r|   r,   r˜   r]   r‹  )r¿  ré  rH   rK   Úseed_kwargsÚthread_seededÚinchannel_seededs   &&     r0   Ú_seed_live_delivery_sessionsrý  =  sþ  € ð �%‰%€CØ�X‰X€FÜØ—*‘*˜[Ó)°·±È&Ï*É*ÐU_ÓJ`ôb€Kà€MØÐØ××ÐÜ!Ø×"Ñ" A§O¡O°Q·Y±YÀ×@RÑ@RÐTU×TaÑTañ	
àò	
ð ˆð 	××Ð × 7× 7Ð 7ÇÜ5Ø×"Ñ" A§O¡O°Q·Y±YÀÇÁñ5à×$Ñ$ð5à(3ñ5Ð÷  Ü�N‰Nð<à�D•	˜1Ÿ?™?¨A¯I©Iô7÷  Ü%Ø×&Ñ&¨¯©¸¿¹ÄCÐH\ÓD]Ø—‘ñð òøð 
×	×	Ð	 a×&=×&=Ð&=Ü�‰ð>ð
 ��I�q—‘¨¯	©	Ø�J‰J�zÓ" F§J¡J¨yÓ$9¸6¿:¹:ÀkÓ;Rô	Tô  Ø�_‰_˜aŸi™i¨¯©À!Ç+Á+Ø× Ñ Ø×$Ñ$×SÐS¨]Ô):×SÐSÐCSÔ?S÷Ur2   c               ó4   € V ^8„  d   QhRRRRRRRRRRR	RR
R/# )r*   r¿  rƒ  Úcleaned_textr,   r3  rb  rÎ  rÏ  rw  r-   rR   r.   )r/   s   "r0   r1   r1   n  sF   € ÷ >ñ >Øð>Ø&)ð>Ø8<ð>ØPTð>àð>à/3ð>ð 
ñ>r2   c          
     ó‚  a€ V P                   p\        V 4      w  rxp	Rp
 VP                  4       pRRRrípV'       g&   V'       g   \        VRV P                   2V4       RpMV'       d   \        WWxW4VR7      w  rÍpV'       d   V'       g   V'       d   \        W	W$4       M6V'       d/   V'       d'   \        V\        V4       RV P                   R2V4       V'       dO   \        P                  RVR	,          V P                  V P                  Ve   TMR
Ve   TMR
4       Rp
\        W4       V
#   \         d†   pRT P                   RT 2o\        ;QJ d    T3R lT 4       F  '       g   K   RM	  RM! T3R lT 4       4      '       g   TP                  S4       \!        TST P"                  4        Rp?T
# Rp?ii ; i)zûDeliver one target via the live gateway adapter; True once delivered. ``target_errors`` =
this lane's soft failures (surfaced only if standalone also fails); ``delivery_errors`` =
partial failures (media, thread fallback) that surface even on success.FTNz8live adapter send skipped (empty text and no media) for ©rÎ  rÏ  rw  z& media attachment(s) not delivered to z& (live adapter confirmation timed out)zEJob '%s': delivered to %s:%s via live adapter thread=%s message_id=%srƒ   Ú-zlive adapter delivery to ú	 failed: c              3  ó.   <"  € T F
  pSV9   x € K  	  R # 5ir”  r.   )rv  r~  Úerr_msgs   & €r0   rx  Ú,_deliver_via_live_adapter.<locals>.<genexpr>©  s   øé € Ð;©] c�7˜c–>«]ùs   ƒ)rH   rË  rA   rH  r›  rí  rö  r  r{   r•   r\   rM   rý  r;   ÚanyrÚ   r©  r•  )r¿  rÿ  r3  rÎ  rÏ  rw  rH   rÈ  rÉ  rÊ  rb  rÍ  Ú
adapter_okÚ	timed_outré  r}   r  s   &&&$$$          @r0   Ú_deliver_via_live_adapterr
  n  s™  ø€ ð �%‰%€CÜ6JÈ1Ó6MÑ3€O ^Ø€Ið3:ð $×)Ñ)Ó+ˆØ6:¸EÀ4Ð3ˆ
ß§KäØÐOÐPQ×PWÑPWÈyÐYØôð ‰JßÜ:IØ Ø+Ø#5ô;Ñ7ˆJÐ#7÷ Ÿi¯KÜ˜Q°ÕMßŸ;ÜØÜ�{Ó#Ð$Ð$JØ—7‘7�)ÐAðCàô	!÷ ä�K‰Kð XØ�D•	˜1Ÿ?™?¨A¯I©IØ#2Ò#>‘ÀCØ(<Ò(HÑ$ÈcôSð ˆIÜ(¨ÔAð Ðøô ô :Ø-¨a¯g©g¨Y°iÀ¸sÐCˆß‹sÔ;©]Ó;�s�sŠsÔ;©]Ó;×;Ò;Ø× Ñ  Ô)Ü  W¨a¯j©j×9Ð9ØÐûð:úsT   Ÿ$D. Á$D. Á)D. ÂD. ÂD. ÂD. Â(D. Â0-D. ÃAD. Ä.F>Ä91F9Å-F9Æ(F9Æ9F>c               ó(   € V ^8„  d   QhRRRRRRRR/# )	r*   r¿  rƒ  r†  r,   r3  rb  r-   ztuple[Any, Optional[str]]r.   )r/   s   "r0   r1   r1   ¯  s2   € ÷ @ñ @Øð@Ø!$ð@Ø37ð@Ø<Uñ@r2   c                óÎ  a aaaaa€ ^ RI Ho S P                  oRS P                   R2p\	        4       oVVVVV 3R lpR V3R llpR VV 3R llp\
        P                  ! 4       '       d	   V! V4      # SP                  4       '       g   S'       g   V! R	S P                   24      # V! 4       p \        P                  ! V4      R
3#   \         d9    RS P                   RS R2p\        P                  RSR,          T4       R
T3u # \         Ed7   p	TP                  4        \
        P                  ! T	4      '       d   T! T4      u R
p	?	#  \        P                   P#                  ^R7      p
 T
P%                  \&        P(                  ! 4       P                  \        P                  T! 4       4      P+                  ^R7      R
3T
P-                  RR7       u R
p	?	#   T
P-                  RR7       i ; i  \.         dF   p\
        P                  ! T4      '       d   T! T4      u R
p?u R
p	?	# T! T4      u R
p?u R
p	?	# R
p?ii ; iR
p	?	i\.         d   pT! T4      u R
p?# R
p?ii ; i)u£   Run the standalone sender for one target: ``(result, None)`` or ``(None, error)`` (already
logged â€” WARNING for a shutdown race, ERROR with traceback otherwise).)Ú_send_to_platformúdelivery to u)    skipped â€” interpreter is shutting downc               “  ó¸   <"  € \         P                  ! S ! SP                  SP                  SP                  SSP
                  SR 7      SR7      G Rj  x€L
 #  L5i))r]   r3  rŸ   N)ÚasyncioÚwait_forrL   rB   rM   r]   )r  r†  r3  Úsend_timeoutr¿  s   €€€€€r0   Ú_sendÚ_standalone_send.<locals>._send¹  sN   øé € ô ×%Ò%Ñ&7Ø�J‰J˜Ÿ	™	 1§9¡9¨gÀÇÁØ#ô'%à.:ô<÷ <ð 	<ñ <ùs   ƒAAÁAÁAc               ó    € V ^8„  d   QhRRRR/# )r*   r©  r,   r-   útuple[None, str]r.   )r/   s   "r0   r1   Ú&_standalone_send.<locals>.__annotate__À  s   € ÷ ñ �Sð Ð-ñ r2   c                óH   <€ \         P                  R SR,          V 4       RV 3# )r¬  rƒ   Nr­  )r©  rH   s   &€r0   Ú_warnedÚ!_standalone_send.<locals>._warnedÀ  s!   ø€ Ü�‰�~ s¨4¥y°#Ô6Ø�SˆyÐr2   c               ó   € V ^8„  d   QhRR/# )r*   r-   r  r.   )r/   s   "r0   r1   r  Ä  s   € ÷ ñ Ð&ñ r2   c                óp   <€ R SP                    RV  2p\        P                  RSR,          VRR7       RV3# )r  r  r¬  rƒ   Trù   N)r›  r{   r¤  )r}   r©  rH   r¿  s   & €€r0   Ú_failedÚ!_standalone_send.<locals>._failedÄ  s;   ø€ Ø˜QŸW™W˜I Y¨q¨cÐ2ˆÜ�‰�^ S¨¥Y°¸dˆÔCØ�SˆyÐr2   z6standalone send skipped (empty text and no media) for Nzstandalone send to z timed out after z#s (the send may still be in flight)r¬  rƒ   )Úmax_workersrŸ   F)Úwait)rL  r  rH   r›  r_  rW   Ú_interpreter_shutting_downrA   r  ÚrunrK  r{   r¤  ÚRuntimeErrorÚcloseÚ
concurrentÚfuturesÚThreadPoolExecutorÚsubmitÚcontextvarsÚcopy_contextr£   Úshutdownr;   )r¿  r†  r3  Úshutdown_msgr  r  r  r¨   r©  Úrun_errÚpoolr}   r  rH   r  s   fff         @@@r0   Ú_standalone_sendr/  ¯  s  ý€ õ :Ø
�%‰%€CØ! !§'¡' Ð*SÐT€Lä/Ó1€L÷<ñ <÷ð ÷ñ ô ×(Ò(×*Ò*Ù�|Ó$Ð$ð �=‰=�?Š?§;ÙÐOÐPQ×PWÑPWÈyÐYÓZÐZÙ‹7€DðÜ�{Š{˜4Ó  $Ð&Ð&øÜô ð % Q§W¡W IÐ->¸|¸nð M3ð 3ˆä�‰�^ S¨¥Y°Ô4Ø�SˆyÒÜõ à�
‰
ŒÜ×,Ò,¨W×5Ò5Ù˜<Ó(Õ(ð	Ü×%Ñ%×8Ñ8ÀQÐ8ÓGˆDð*ð —{‘{¤;×#;Ò#;Ó#=×#AÑ#AÄ7Ç;Á;ÑPUÓPWÓX×_Ñ_Øð `ó  Ø!%ð&ð —‘ 5�×)Ò)ø�—‘ 5�Õ)ûÜô 	Ü×0Ò0°×3Ò3Ù˜|Ó,×,Ò,Ù˜1“:×Òûð	þô ô Ù�q‹zÕûðúsª   Â.C ÃA I$Ä	I$ÄI$Ä3IÅI$Å G1Å.AGÇG1ÇI$ÇG.Ç.G1Ç1IÇ<#H<ÈIÈ IÈ$I$È*H<È1IÈ2IÈ6I$È<IÉIÉI$ÉI$ÉIÉI$ÉI$c          
     ó,   € V ^8„  d   QhRRRRRRRRRR	/# )
r*   r¿  rƒ  r†  r,   r3  rb  rÏ  r-   rŒ   r.   )r/   s   "r0   r1   r1   ò  s1   € ÷ !ñ ! ð !¸3ð !ÈTð !Ðdhð !Ðmqñ !r2   c                ó¤  €  ^ RI HpHpHpHpHp V! V P                  4      '       d   V! 4       '       g   R# RV P                   RV P                   2V P                  '       d   RV P                   2MR,           p	V! V	RV P                  P                  RR4       2V4      p
V! W©V P                  \        V P                  4      V P                  V\        \        V P                  R	R4      R
R4      R7       V! V
\        V P                  4      4       RT P$                   R2pT'       d   TR\'        T4       R2,          p\         P#                  RT P                  P                  R4      T4       TP)                  T4       R#   \         dA    \         P#                  RT P                  P                  R4      T P$                  RR7        R# i ; i)a¥  Hand a payload the live lane rejected as reconnect-only (``send_path_degraded``) and the
standalone lane then failed to send to the delivery ledger, as a failed reconnect-only row
owned by the adapter that rejected it: the post-reconnect sweep redelivers it (#125363). Only
reached after standalone failed, so nothing was sent and a replay cannot duplicate. The ledger
carries text only; dropped attachments are reported.)Úcompute_obligation_idÚis_reconnect_onlyÚledger_enabledÚmark_failedÚrecord_obligationNzcron:r-  r5   zjob:rƒ   r“   r¤   Ú_owner_profile)Úobligation_idÚsession_keyrL   rM   r]   r†  Úadapter_profilez:Job '%s': could not queue %s for post-reconnect redeliveryTrù   zqueued text for z0 for redelivery once the live adapter reconnectsz (z attachment(s) not queued)r¬  )Úgateway.delivery_ledgerr2  r3  r4  r5  r6  r�  r\   rM   r]   rH   r=   r,   r<   r„  r;   r{   r|   r›  r  rÚ   )r¿  r†  r3  rÏ  r2  r3  r4  r5  r6  r9  r8  Únotes   &&&&        r0   Ú_queue_for_live_reconnectr=  ò  s  € ð÷	fõ 	fá  §¡×.Ò.±n×6FÒ6FÙØ˜aŸo™oÐ.¨a°·	±	¨{Ð;ÐTU×T_×T_ÐT_ÀÀ1Ç;Á;À-Ñ?PÐegÕhˆÙ-¨k¸TÀ!Ç%Á%Ç)Á)ÈDÐRUÓBVÐAWÐ;XÐZaÓbˆÙØ'È1Ï?É?Ü˜Ÿ	™	“N¨a¯k©kÀ7Ü#¤G¨A¯K©K¸ÀDÓ$IÐK[Ð]aÓbõ	dñ 	�M¤3 q§|¡|Ó#4Ô5ð
 ˜aŸg™g˜YÐ&VÐW€DßØ�"”S˜Ó%Ð&Ð&@ÐAÕAˆÜ
‡N�N�> 1§5¡5§9¡9¨T£?°DÔ9Ø×Ñ˜4Ö øô ô Ü�‰ÐSØ—u‘u—y‘y “¨¯©¸$ð 	ô 	@âðús#   ‚%F ¨F ·,F Á$B/F ÆAGÇGc               ó0   € V ^8„  d   QhRRRRRRRRRRR	R
/# )r*   r¿  rƒ  r†  r,   r3  rb  rÎ  rÏ  r-   rŒ   r.   )r/   s   "r0   r1   r1     s<   € ÷ "&ñ "&Øð"&Ø!$ð"&Ø37ð"&ØHLð"&Ø_cð"&à	ñ"&r2   c           
     óè  € V P                   pV P                  '       d;   V'       g    VP                  RV P                   R24       VP	                  V4       R# \        WV4      w  rgVfX   V'       dP   VP                  R4      '       d9   RVR,           RV P                   R2p\        P                  RVR	,          V4       Ve1   VP                  V4       VP	                  V4       \        WW$4       R# \        V\        4      '       d   VP                  R
4      MR;'       g    .  FE  pRV RV P                   R2p	\        P                  RVR	,          V	4       VP                  V	4       KG  	  \        P                  RVR	,          V P                  V P                  4       \        WPP                  V P                  V P                   V P"                  V P$                  V P&                  R7       R# )z?Standalone fallback for a target the live lane did not deliver.zrelay delivery to z failedNr¤  zdelivery error: rñ  r.  r¬  rƒ   Úwarningszdelivery warning: zJob '%s': delivered to %s:%srù  )rH   r•  rÚ   r›  Úextendr/  r=   r{   r¤  r=  r?   r@   r•   r\   rM   r˜   r‹   r]   r‰  r‹  )
r¿  r†  r3  rÎ  rÏ  rH   r£   r~  Ú_wr©  s
   &&&&&     r0   Ú_deliver_standalonerC    sˆ  € ð �%‰%€CØ‡z‡z€zçØ× Ñ Ð#5°a·g±g°Y¸gÐ!FÔGØ×Ñ˜}Ô-ÙÜ" 1¨{Ó;�K€FØ
‚{—v &§*¡*¨W×"5Ò"5à  ¨¥Ð 1°¸1¿7¹7¸)À1ÐEˆÜ�‰�^ S¨¥Y°Ô4Ø
‚Ø×Ñ˜SÔ!Ø×Ñ˜}Ô-ô 	" !¨kÔKÙô *4°F¼D×)AÒ)Aˆv�z‰z˜*Ô%Àt×RÐRÐPRÒRˆØ" 2 $ i°·±¨y¸Ð:ˆÜ�‰�^ S¨¥Y°Ô4Ø×Ñ˜sÖ#ñ Sô ‡K�KÐ.°°Dµ	¸1¿?¹?ÈAÏIÉIÔVäØ�_‰_˜aŸi™i¨¯©À!Ç+Á+Ø× Ñ Ø×$Ñ$÷&r2   c               ó4   € V ^8„  d   QhRRRRRRRRRRR	R
RR/# )r*   rH   r@   rg   r‡  rR   Úmirror_enabledr‹   r,   rÏ  rb  r-   zOptional[_TargetDelivery]r.   )r/   s   "r0   r1   r1   4  sX   € ÷ gRñ gRØ	ðgRØðgRØIMðgRØ_cðgRàðgRà'+ðgRð ñgRr2   c          	     ó$  € ^ RI Hp	 VR,          p
VR,          pVP                  R4      p\        V 4      ;'       g    / pVP                  R4      pV'       d9   V'       g1   \        P                  RV R,          WàP                  RR4      V4       M'V'       d    \        P                  R	V R,          W«V4       \        WÚW¼4      pT;'       d    \        WWoR
7      pV'       d   VP                  R4      MRp\        VP                  R4      ;'       g    R4      P                  4       pVR8H  ;'       g*    V'       * ;'       d    \        V4      P                  R4      pT;'       g    T;'       d    \        VVR7      p V	! V
P                  4       4      p\!        T TY¡Y$4      w  ppTf   \        T TT4       R# Tw  ppppTRJ;'       d     TRJ;'       d    \#        TRR 4      ! 4       p\%        TT
4      R8H  pT'       d@   Te<   \'        TT
4      '       g*   \        P                  RT P                  RR4      T
4       RpT'       d   T'       d   T'       d   RpRpT'       d:   T'       g2   Te.   Te*   T'       g"   \)        T TY³4      ;'       g    RpT'       d   Tp\+        R-/ RT bRTbRT
bRTbRTbRTbRTbRTbRTbR TbR!TbR"TbR#TbR$TbR%TbR&TbR'TbR(TbR)TbR*TbR+TbR,Tb #   \        \        3 d    \        T RT
 R2T4        R# i ; i).z³Per-target prologue of ``_deliver_result``: origin/mirror/in_channel gates, transport
resolution, continuable-thread open. None (error noted in ``delivery_errors``) if unservable.r³   rL   rM   r]   zUJob '%s': origin has thread_id=%s but delivery target lost it (deliver=%s, target=%s)rƒ   r  rE  z*Job '%s': delivering to %s:%s thread_id=%s)rh   re   ro   Nr¯   r5   rÇ   ÚDrq   zunknown platform 'rÄ  Ú
is_runningc                 ó   € R # )Fr.   r.   r2   r0   Ú<lambda>Ú*_prepare_target_delivery.<locals>.<lambda>o  s   € ±r2   r7   zOJob '%s': cron_continuable_surface=in_channel not supported on %s, using threadr“   FrH   r\   r„  rB   ri  r…  r†  r¥   r‡  rK   rˆ  r‰  rŠ  r‹   r‹  rŒ  r�  rŽ  r�  r.   )r¸   r´   r=   rO   r{   r|   r–   ra   rl   r,   r>   rt  rr   rº   r»   rH  r·  r<   rE   r½  r«   rƒ  )rH   rg   r´  r¥   r†  r‡  rE  r‹   rÏ  r´   r\   rM   r]   rK   r`   rˆ  r‹  r‰  Úorigin_chat_typerŠ  r�  rL   ÚresolvedÚresolve_errr„  rB   ri  r…  r�  rŒ  rŽ  s   &&$$$$$$$                      r0   Ú_prepare_target_deliveryrO  4  s¼  € õ (Ø˜:Õ&€MØ�YÕ€GØ—
‘
˜;Ó'€Iä˜SÓ!×'Ð' R€FØ—J‘J˜{Ó+€MßŸYÜ�‰ØcØ��I�}§g¡g¨i¸Ó&AÀ6õ	K÷ 
Ü�‰Ø8Ø��I�}¨yô	:ô
 +¨6À'ÓU€MØ'÷ Oð OÔ,CØ >ô-OÐ÷ /<�V—Z‘Z 	Ô*À€Nô ˜6Ÿ:™: kÓ2×8Ð8°bÓ9×?Ñ?ÓAÐØ# tÑ+÷ ?ð ?ØÔ×=Ð=¤ W£×!8Ñ!8¸Ó!=ð ð *÷ dð dØ×bÐbÔ6¸\ÐSaÔbð ðÙ˜M×/Ñ/Ó1Ó2ˆô
 6ØˆX�}¨hó@Ñ€HˆkàÒÜ˜3 ¨_Ô=ÙØ;CÑ8€Iˆw˜¨ð
 	˜tÐ#÷ 	9ð 	9Ø˜Ð÷	9ð 	9ä�D˜,©Ô6Ó8ð ô 4°G¸]ÓKÈ|Ñ[ÐçØÒ'Ü,¨_¸m×LÒLä�‰Ø]Ø�G‰G�D˜#Ó ô	/ð #Ðß×3×8Jð ˆ	ð
 '+Ðçß"ØÒ'ØÒßä8Ø� 'ó1÷ 9ð 9Ø48ð 	çØ(ˆIÜò RÙðRÙ"ðRÙ2?ðRÙIPðRáðRá'0ðRá:AðRáSbðRñ (ðRñ 17ðRñ >BðRñ TcðRñ ð	Rñ &3ð	Rñ DRð	Rñ
 "ðRñ
 0;ðRñ
 PbðRñ .ðRñ F[ðRñ *ðRñ ?QðRð Røôk œÐ!ô Ü˜3Ð"4°]°OÀ1Ð EÀÔWÚðús   Å?K) Ë)"LÌLc               ó$   € V ^8„  d   QhRRRRRR/# )r*   rH   r@   r„  rR   r-   r^   r.   )r/   s   "r0   r1   r1   ž  s!   € ÷ ñ  dð ¸ð À-ñ r2   c           
     ó  € \        \        WR7      4      pVR8X  d   R# VR8X  d9   \        P                  RV P	                  RV P	                  RR4      4      4       R# R	V 2p\        P                  R
V R,          V4       V# )uË   ``_deliver_result`` outcome when no target resolved: None (not a failure) for ``local`` and
origin-less ``origin`` (CLI jobs never capture an origin â€” a spurious error every run), else
an error string.r+  rE  NrK   uk   Job '%s': deliver=origin but no origin or home channels â€” skipping delivery (output saved in last_output)r‚   rƒ   r“   z(no delivery target resolved for deliver=r¬  )r  r(  r{   r•   r=   r|   )rH   r„  rC  r©  s   &&  r0   Ú_unresolved_delivery_outcomerR  ž  s{   € ô -Ô-AÀ#Ô-_Ó`€MØ˜ÔÙØ˜Ô Ü�‰ð>à�G‰G�F˜CŸG™G D¨#Ó.Ó/ô	1ñ Ø4°]°OÐ
D€CÜ
‡N�N�> 3 t¥9¨cÔ2Ø€Jr2   c               ó(   € V ^8„  d   QhRRRRRRRR/# )	r*   rH   r@   r†  r,   r„  rR   r-   r^   r.   )r/   s   "r0   r1   r1   µ  s8   € ÷ VCñ VCØ	ðVCØðVCØGKðVCàñVCr2   c               ó 
  € V P                  RR4       V P                  RR4       \        WR7      pV'       g   \        V . 4       \        W4      # \        P
                  P                  RR4      pV'       dâ   VfÞ   T\        V P                  R4      ;'       g    R4      8X  dµ   \        ;QJ d    R V 4       F  '       g   K   R	M	  R
M! R V 4       4      '       d{   ^ RI	H
p \        V . 4       V! W`WR7      p^ RI	Hp	 V	! V4      p
V
'       d   V
R,          R8X  d   R	V R&   ^ RIHp V! V R,          4      ;'       g    / pVP                  R4      V R&   V# ^ RIHp R	pRp\         P"                  ! \$        4      ;_uu_ 4        \&        P(                  ! 4       pVP                  R/ 4      P                  RR	4      pRRR4       \+        V4      p. pV'       d:   V P                  RV R,          4      pRV RV P                  RR4       RV RV R2	pMTp^ RIHp ^ RIHp V! V4       VP5                  V4      w  pp\7        VR4      p\9        V4      pVP;                  V4      pV\9        V4      ,
          pV^ 8”  d   V R2.M. p \=        W4      pVP5                  V4      w  pp\7        T;'       g    RP?                  4       R4      p V! 4       p. p!^ p"T EFp  p#^ R"I"H#p$ T'       d4   T#R#,          \H        8w  d"   T$! T#R#,          T4      '       g   T"^,          p"KE  T#R#,          \H        8X  d¿   \K        YT#R$,          TR7      p%T"T P                  RR
4      ,          p"T%'       d†   R%T#R$,          ;'       g    R& 2p&T P                  R/ 4      P                  T&4      p'T''       d   T'R,          R+9  d   T!PM                  T%4       T''       d    T'R,          R'8X  d   TPM                  T%4       EK  \O        T T#Y#TTTTT!R(7	      p(T(f   EK/  . p)T(PP                  ;'       d    \S        T(TTT)T!TR)7      p*T*'       d   EKa  \U        T(TTT)T!4       EKs  	  T"\9        T4      8X  d   R	T R&   MT!PW                  T4       \        T T4       T!'       d   R*PY                  T!4      # R#   + '       g   i     ELç; i  \$         d    R
p EL-i ; i  \$         d0   pR T 2p \@        PC                  R!T R,          T 4       T u Rp?# Rp?ii ; i),aj  Deliver job output to the configured target(s). With ``adapters``/``loop`` (gateway
running) the live adapter is tried first (E2EE rooms can't use the standalone HTTP path), then
standalone fallback. ``for_failure=True`` routes failure-category notices through the job's
``failure_deliver`` override when present (NS-788). Returns None on success, else an error.rž  NrŸ  r+  Ú_HERMES_CRON_EXTERNAL_WORKERr5   r“  c              3  ó@   "  € T F  qR ,          \         8g  x € K  	  R# 5i)rL   N)r2  )rv  rg   s   & r0   rx  Ú"_deliver_result.<locals>.<genexpr>Ë  s   é € ÐRÉ'À˜:Õ&Ô*;Ö;Ë'ùs   ‚TF)Úenqueue_and_wait)Ú
get_statusr›  rš  )Úget_jobrƒ   rz  r(  rU   Úwrap_responser‚   zCronjob Response: z

(job_id: z)
-------------

zI

To stop or manage this job, send me a new message (e.g. "stop reminder z").)r6  )Úapply_media_policy_envzdelivery contentz£ media attachment(s) dropped by media path policy (missing file, denied prefix, or strict-mode miss); see gateway.strict / media_delivery_allow_dirs in config.yamlzmirror payloadzfailed to load gateway config: r¬  r�  rL   rM   rœ  rŽ  Ú	ambiguous)r´  r¥   r†  r‡  rE  r‹   rÏ  r  z; rÆ  )-Úpopr.  r�  rR  r  rç  r=   r,   r  Úcron.delivery_queuerX  rY  r~  rZ  r¸   rø   r9   r:   r;   rW   rX   ru  rD  r6  Úgateway.media_policyr\  Úextract_mediar~   r  rE  rZ   rA   r{   r¤  rÑ  r‘  r2  r  rÚ   rO  r�  r
  rC  rA  rÛ   )+rH   r†  r´  r¥   r„  r3  Úexternal_executionrX  r¤  rY  Údelivery_statusrZ  Ú	refreshedrø   r[  Úuser_cfgr‡  rw  Ú	task_nameÚdelivery_contentr6  r\  r3  Úcleaned_delivery_contentÚrequested_mediaÚ_policy_droppedÚpolicy_drop_errorsrE  r)  r‹   r†  r}   r©  rÏ  Úsuppressed_targetsrg   r‘  Úbot_chat_errorÚreceipt_targetrù  r¿  rÎ  rb  s+   &&&&$                                      r0   Ú_deliver_resultro  µ  sÑ  € ð ‡G�GÐ)¨4Ô0Ø‡G�GÐ2°DÔ9Ü'¨ÔE€GßÜ% c¨2Ô.Ü+¨CÓ=Ð=ô Ÿ™Ÿ™Ð(FÈÓKÐß˜xÒ/Ø"¤c¨#¯'©'°.Ó*A×*GÐ*GÀRÓ&HÔHß“ÑRÉ'ÓR——’ÑRÉ'ÓR×RÒRÝ8ä% c¨2Ô.Ù Ð!3¸'Ô[ˆÝ2Ù$Ð%7Ó8ˆß˜¨xÕ8¸LÔHØ:>ˆCÐ6Ñ7Ý%Ù˜C �IÓ&×,Ð,¨"ˆ	Ø&/§m¡mÐ4JÓ&KˆÐ"Ñ#Øˆå2ð €MØ€HÜ	×	Ò	œY×	'Õ	'Ü×%Ò%Ó'ˆØ Ÿ™ V¨RÓ0×4Ñ4°_ÀdÓKˆ÷ 
(ô 4°HÓ=€Oð  "ÐßØ—G‘G˜F C¨¥IÓ.ˆ	à   ð ,ØŸ™  bÓ)Ð*ð + àˆið %à%. K¨tð5ñ 	ð #Ðå:õ <Ù˜8Ô$Ø,?×,MÑ,MÐN^Ó,_Ñ)€KÐ)ô
  4Ð4LÐN`ÓaÐÜ˜+Ó&€OØ%×AÑAÀ+ÓN€Kà%¬¨KÓ(8Õ8€Oð
 
˜1Ô	ð Ð
ð Hð 	Hñð #%ð	 ðÜ6°sÓEˆð
 )×6Ñ6°wÓ?�N€A€{ô '¨×(9Ð(9°r×'@Ñ'@Ó'BÐDTÓU€KðÙ$Ó&ˆð €OØÐÜˆõ 	Pß˜F :Õ.Ô2CÔCÙ5°f¸ZÕ6HÈ(×SÒSØ !Õ#ÐÙà�*ÕÔ!2Ô2Ü1°#ÀÀyÕ@QÐ_jÔkˆNØ #§'¡'Ð*PÐRWÓ"XÕXÐßØ#,¨V°IÕ->×-IÐ-IÀ'Ð,JÐ!K�ØŸ'™'Ð"?ÀÓD×HÑHÈÓX�ß '¨(Õ"3Ð;PÔ"PØ#×*Ñ*¨>Ô:ß˜w xÕ0°KÔ?Ø&×-Ñ-¨nÔ=Úä$Ø� (¸fØ+Ø)°{ÐTcôeˆð Š9ÚØ ˆØ×(Ñ(÷ 
ð 
Ô-FØÐ'¨Ø'¸Ø1ô.
ˆ	÷
 ŠyÜØÐ+¨[¸-È÷ZñE ðN œS ›\Ô)Ø6:ˆÐ2Ò3à×ÑÐ1Ô2Ü! #Ð'9Ô:ß)8ˆ4�9‰9�_Ó%ÐB¸dÐB÷[ 
(×	'Ð	'ûô\ ô Ø‹ðûô ô Ø/°¨sÐ3ˆÜ�‰�^ S¨¥Y°Ô4Ø�
ûðús<   Æ8RÊR/ ËS ÒR,	Ò/S Ò?S ÓS=Ó$S8Ó2S=Ó8S=)Ú	scheduler)Úscheduler_delivery_origin)Úscheduler_preflight)Úscheduler_script>   r   r   r   r	   r   r   r   r   r   r   ÚwebhookÚyuanbaor   r   r
   r   r   Úwecom_callbackr”  )NN)NFN)r5   )zResumed sessionzsession_id:>   ú.3gpú.aviú.mkvú.movú.mp4ú.webm>   ú.gifú.jpgú.pngú.jpegú.webp)r“   N)or   Ú
__future__r   r  Úconcurrent.futuresr%  r9   r)  Úloggingr  râ  rò  rà  rä  r²  r   Útypingr   r   r   Ú	getLoggerr{   Ú	frozensetrï   rN   rô   r
  rE   rO   rZ   ra   r,  rl   rr   r~   r…   rˆ   r˜   rÉ   r«   rÄ   rÊ   rÍ   rß   rë   rñ   rõ   rü   r  r  r  r  r  r$  r6  r:  r=  r@  rR  rZ  r_  r{  r}  ru  rk  r‚  r  r  r#  r2  rÓ  rI  rJ  r$  r(  r.  r1  rF  rG  rZ  r^  rg  rn  ru  r�  rƒ  rH  r©  r·  r½  rË  ræ  rí  rö  rý  r
  r/  r=  rC  rO  rR  ro  rU   rp  rW   rq  rÅ  rr  r°  rs  rI  r.   r2   r0   Ú<module>rˆ     sß  ðñõ #ã Û Û Û Û Û 	Û Û Û 
Û Ý !ß &Ñ &ð 
×	Ò	Ð+Ó	,€ñ &ò 'ó Ð ñ '¨ ~Ó6Ð ð5ØÐ ð5àÐ'ð5ð Ð%ð5ð Ð!ð	5ð
 Ð#ð5ð Ð+ð5ð 
Ðð5ð Ð!ð5ð Ð'ð5ð Ð#ð5ð Ð!ð5ð Ð#ð5ð Ð-ð5ð Ð!ð5ð Ð'ð5ð  Ð3ð!5Ð ð& !5Ð6GÐHÐ õõ(÷(õ&Oð" $ QÐ(9¸1¸fÀaÈÐUVÐWÐ ðØTX÷õ6"õ/õ(VõAñ'
à6;÷'
ð '
ð\ # G¨X°wÀ
ÈGÐTÐ õð.'àGKð'ð W\÷'÷T!FðHà7;ðàW[÷õB4õ"	õQõIõ
ñÀe÷ ð õ*8õJõò6	!õõ"õJLõ#÷ðPVØ=B÷PVõfõð$ Ð àÐ Ø>Ð õAõ$]ð8`$Ð^bð `$Ø-2÷`$õF	ñ ˜U˜GÓ$€ð Ð à Ð õ
õõ0Uð'¸5÷ 'ð À÷  õF+ñ ÒIÓJ€ÙÒBÓC€÷:÷z.÷$õN#õLõað* ÷#Fð #Fó ð#FõLõSõ6HõrSõ*;ðZ #%Ð õc-õL<õ*.Uõb>õB@õF!õ:"&õJgRõTñ.VCØNS÷VCð VCõv %Ý 5Ý 2ß ,r2   