+
    kHàjŠ  ã                   ó.  € R t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHtHt ^ RI	H
t
Ht ]P                  ! ]4      tRtRRR	R
RRRRR. R*ORRRRRRRRR/RRRRRRRR/./tR R ltR R ltR  R! ltR"RR#R/R$ ltR%t]P,                  ! R&4      tR' tR( R) ltR# )+zZYuanbao plugin registration: setup row, configured check, standalone sender, ``register``.N)Ú
send_error)Úconfig_connected_extra)ÚNOT_EXPLICITÚStandaloneSendPolicy)ÚWEBSOCKETS_AVAILABLEÚYuanbaoAdapterz>Yuanbao: websockets not installed. Run: pip install websocketsÚkeyÚyuanbaoÚlabelÚYuanbaoÚemojiõ   ðŸ’ŽÚ	token_varÚYUANBAO_APP_IDÚsetup_instructionsÚvarsÚnameÚpromptzApp IDÚpasswordFÚhelpz0The App ID from your Yuanbao IM Bot credentials.ÚYUANBAO_APP_SECRETz
App SecretTz@The App Secret (used for HMAC signing) from your Yuanbao IM Bot.c                ó$   € V ^8„  d   QhR\         /# ©é   Úreturn©Úbool)Úformats   "ÚG/home/ubuntu/.hermes/hermes-agent/plugins/platforms/yuanbao/register.pyÚ__annotate__r   $   s   € ÷  ñ  ¤Dñ  ó    c                 ó   € \         # )z-Runtime deps present (the websockets client).)r   © r    r   Úcheck_yuanbao_requirementsr#   $   s   € äÐr    c                ó   € V ^8„  d   QhRR/# ©r   r   Nr"   )r   s   "r   r   r   )   s   € ÷ @ñ @˜4ñ @r    c                 óN   € ^ RI Hp  V P                  \        \        4      4       R# )zH``hermes gateway setup`` flow: the standard App ID / App Secret prompts.)ÚgatewayN)Ú
hermes_clir'   Ú_setup_standard_platformÚdictÚ_SETUP_PLATFORM)Úgateway_mods    r   Úinteractive_setupr-   )   s   € å1Ø×(Ñ(¬¬oÓ)>Ö?r    c                ó$   € V ^8„  d   QhR\         /# r   r   )r   s   "r   r   r   /   s   € ÷ =ñ =œTñ =r    c                óÄ  € \        V R/ 4      ;'       g    / p^ RIHp VP                  R4      ;'       g5    VP	                  R4      ;'       g    VP	                  R4      ;'       g    RpVP                  R4      ;'       g    VP	                  R4      ;'       g    Rp\        \        V4      P                  4       ;'       d    \        V4      P                  4       4      # )	zPConfigured = App ID (or legacy App Key) + App Secret, from config extras or env.ÚextraNÚapp_idr   ÚYUANBAO_APP_KEYÚ Ú
app_secretr   )ÚgetattrÚhermes_cli.gatewayr'   ÚgetÚget_env_valuer   ÚstrÚstrip)Úconfigr0   r,   r1   Úsecrets   &    r   Ú_is_connectedr=   /   sÈ   € ä�F˜G RÓ(×.Ð.¨B€EÝ,Ø�i‰i˜Ó!÷ Dð D [×%>Ñ%>Ð?OÓ%P÷ Dð DØ×*Ñ*Ð+<Ó=÷Dð DØACð à�Y‰Y�|Ó$×]Ð]¨×(AÑ(AÐBVÓ(W×]Ð]Ð[]€FÜ”�F“×!Ñ!Ó#×;Ð;¬¨F«×(9Ñ(9Ó(;Ó<Ð<r    Ú	thread_idÚmedia_filesc             ‹  ó.  "  € \         P                  ! 4       pVf   \        R4      #  VP                  P                  P                  WV4      G Rj  x€L
 #  L  \         d0   p\        P                  RRR7       \        RT 24      u Rp?# Rp?ii ; i5i)u–   standalone_sender_fn: send via the running adapter's persistent WebSocket (no throwaway
client possible â€” Yuanbao needs the live signed connection).NzVYuanbao adapter is not running. Start the gateway with yuanbao platform enabled first.zYuanbao standalone send failedT)Úexc_infozYuanbao send failed: )	r   Ú
get_activer   Ú	_outboundÚsenderÚsend_directÚ	ExceptionÚloggerÚdebug)ÚpconfigÚchat_idÚmessager>   r?   Ú_kwargsÚadapterÚes   &&&$$,  r   Ú_standalone_sendrO   9   sƒ   é € ô ×'Ò'Ó)€GØ‚ÜÐrÓsÐsð7Ø×&Ñ&×-Ñ-×9Ñ9¸'ÈKÓX×XÐXÑXøÜô 7Ü�‰Ð5ÀˆÔEÜÐ1°!°Ð5Ó6Õ6ûð7üsF   ‚%B¨)A ÁAÁA ÁBÁA ÁBÁ#$BÂBÂBÂBÂBuå  You are on Yuanbao (è…¾è®¯å…ƒå®�), a Chinese AI assistant platform. Markdown renders (code blocks, tables, bold/italic). You can send files natively: write MEDIA:/absolute/path/to/file in your response. Images (.jpg, .png, .webp, .gif) send as photos, other files as downloadable documents (max 50 MB); image URLs via ![alt](url) are downloaded and sent as photos. Never claim you lack file-sending. Stickers (è´´çº¸/è¡¨æƒ…åŒ…): when the user sends one (you see '[emoji: å��ç§°]') or asks for one, use the sticker tools â€” yb_search_sticker with a Chinese keyword, then yb_send_sticker with the chosen id â€” which send a real native sticker. Never draw sticker-like PNGs and send them as images, and bare Unicode emoji is not a substitute.z ^\s*((?:group|direct):[^:]+)\s*$c                 óà   € \         P                  V 4      pV'       d   VP                  ^4      R3# V P                  4       P	                  4       '       d   RV P                  4        2R3# \
        # )é   Nzgroup:)Ú_SEND_TARGET_REÚ	fullmatchÚgroupr:   Úisdigitr   )ÚrefÚmatchs   & r   Ú_parse_send_targetrX   U   sY   € ä×%Ñ% cÓ*€EßØ�{‰{˜1‹~˜tÐ#Ð#Ø-0¯Y©Y«[×-@Ñ-@×-BÒ-Bˆf�S—Y‘Y“[�MÐ" DÐ)ÐTÌÐTr    c                ó   € V ^8„  d   QhRR/# r%   r"   )r   s   "r   r   r   ]   s   € ÷ ñ �Tñ r    c                ó`  € ^RI Hp V P                  ! R%/ R\        bR\	        RRRR7      bRRbR	RbR
\
        bRRbRRbRR%bR\        bR\        bR\        RR4      bRRR.bR\        bR\        bRRbR\        bRRbRR bR!\        bR"VP                  bR#VP                  bVP                  B  R$# )&u:   Plugin entry point â€” called by the Hermes plugin system.)Úgateway_envÚtarget_ref_syntax_fnÚstandalone_sendr   T)r
   ÚmediaÚtext_directr   r	   r
   Úadapter_factoryÚdashboard_labelu   Yuanbao (å…ƒå®�)Údashboard_descriptionz"Connect Hermes to Tencent Yuanbao.Údashboard_required_envÚcheck_fnÚis_connectedÚconfig_connected_fnr1   r4   Úrequired_envr   r   Úinstall_hintÚsetup_fnÚcron_deliver_env_varÚYUANBAO_HOME_CHANNELÚstandalone_sender_fnr   r   Úallow_update_commandFÚplatform_hintÚenv_overridesÚenv_enable_credentialsNr"   )r3   r[   Úregister_platformrX   r   r   r#   r=   r   Ú_INSTALL_HINTr-   rO   Ú_PLATFORM_HINTÚENV_OVERRIDESÚENV_ENABLE_CREDENTIALSÚAUTHZ)Úctxr[   s   & r   Úregisterrx   ]   s  € åØ×Òò Ý/ðä,°9ÀDÐVZÕ[ðñ ðñ (ðõ :Hðñ +ð	ñ
 Cðñ  "ðõ ,ðõ ;Hðô 3°8¸\ÔJðð 'Ð(<Ñ=ðõ MZðõ #ðñ :Pðõ .ðñ 6<ðñ SXðõ %ðð "×/Ò/ðð  +×AÒAÀ[×EVÑEVôr    )z=1. Download the Yuanbao app from https://yuanbao.tencent.com/u8   2. In the app, go to PAI â†’ My Bot and create a new botz;3. After the bot is created, copy the App ID and App SecretzH4. Enter them below and Hermes will connect automatically over WebSocket)Ú__doc__ÚreÚloggingÚgateway.platforms._sharedr   r   Úgateway.platforms.send_targetsr   r   Ú!plugins.platforms.yuanbao.adapterr   r   Ú	getLoggerÚ__name__rG   rr   r+   r#   r-   r=   rO   rs   ÚcompilerR   rX   rx   r"   r    r   Ú<module>r‚      sá   ðÙ `ã 	Û å 0Ý <ß M÷ Sà	×	Ò	˜8Ó	$€ð Q€ð 
ˆ9�g˜y¨'°6¸;ÐHXØò ð Ø	Ð! 8¨X°zÀ5Ø	ÐCð	Eà	Ð% x°¸zÈ4Ø	ÐSð	Uðð€õ" õ
@õ=ð
7À4ð 
7ÐUYô 
7ðbð ð —*’*Ð@ÓA€òU÷r    