+
    lHàj  ã                   óÈ  € R t ^ RIt^ RIHtHtHtHtHt ^ RIH	t	H
t
Ht ]P                  ! ]4      tRLR ltR R ltR R	 ltR
RRR/tR
RRRRR/tR
RRR/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^d/R#]/R$R.//tRR%RR&RR
RRR]R'R
RRR(/R]R R
R!RR)R^d/R#]/R$RR'.//tRR*RR+RR
RRR]R'R
RRR,/R-R
RRR./R]/R$. RMO//tRR/RR0RR
RRR]R-R
RRR1/R]/R$RR-.//t]! RNR2R3R4]R5 R67      t]! ROR7R8R4]]R67      t]! RMR9R:R;]R< R= R>R?7      t]! RPR@RAR;]RB R>RC7      t]]RDRE3]]RFRE3]]RGRH3]]RIRH33 F*  w  t t!t"t#]	PH                  ! ] R,          RJ] ]!]. R]"]#RK7	       K,  	  R# )QaD  Feishu Drive Tools -- document comment operations via Feishu/Lark API.

List / reply-to / add document comments through the generic BaseRequest path (lazy SDK
import), sharing client/request plumbing with feishu_doc_tool via ``tools.feishu_lark``.
The lark client is injected per-thread by the feishu_comment event handler.
N)Ú_check_feishuÚbuild_requestÚ
get_clientÚ	lark_callÚ
set_client)ÚregistryÚ
tool_errorÚtool_resultFc           	     ó6   a aaaaaaa€ R VVV VVVVV3R llpV# )u  Handler factory: client check, then required ``keys`` (stripped) â†’ lark_call â†’ result.

All keys except ``content`` are URI path params. ``queries(args)`` / ``body(args, values)``
build the request pieces; ``flag_success`` adds ``success=True`` to the result (writes).
c                ó0   € V ^8„  d   QhR\         R\        /# ©é   ÚargsÚreturn©ÚdictÚstr)Úformats   "Ú</home/ubuntu/.hermes/hermes-agent/tools/feishu_drive_tool.pyÚ__annotate__Ú!_comment_op.<locals>.__annotate__   s   € ÷ [ñ [”tð [¬#ñ [ó    c                 ó  <a € \        4       p\        ;QJ d    . V 3R  lS 4       F  NK  	  5M! V 3R  lS 4       4      pVf   \        R4      # \        V4      '       g   \        S4      # \	        TSS\        SV4       UUu/ uF  w  rEVR8w  g   K  WEbK  	  uppS;'       d	    S! S 4      S	;'       d
    S	! S V4      R7      w  rgpV^ 8w  d   \        S RV RV 24      # S
'       d   \        RVR7      # \        V4      # u uppi )c              3   ód   <"  € T F%  pSP                  VR 4      P                  4       x € K'  	  R# 5i)Ú N)ÚgetÚstrip)Ú.0Úkr   s   & €r   Ú	<genexpr>Ú0_comment_op.<locals>._handler.<locals>.<genexpr>   s'   øé € Ð=¹°1�t—x‘x  2“×,Ñ,×.Ð.»ùs   ƒ-0zFeishu client not availableÚcontent)ÚpathsÚqueriesÚbodyz failed: code=z msg=T)ÚsuccessÚdata)r   Útupler   Úallr   Úzipr	   )r   ÚkwargsÚclientÚvaluesr   ÚvÚcodeÚmsgr&   r$   Úflag_successÚkeysÚlabelÚmethodÚmissing_msgr#   Úuris   f,       €€€€€€€€r   Ú_handlerÚ_comment_op.<locals>._handler   sï   ù€ Ü“ˆß”Ô=¹Ó=—‘Ô=¹Ó=Ó=ˆØŠ>ÜÐ;Ó<Ð<Ü�6�{Š{Ü˜kÓ*Ð*Ü#Ø�F˜C¼¸TÀ6Ô9JÔ']Ñ9J±°ÈaÐS\Én¬¨ªÑ9JÒ']Ø×-Ð-¡¨£°D×4OÐ4O¹TÀ$ÈÓ=OôQ‰ˆ�4ð �1Œ9Ü   ~°d°V¸5ÀÀÐFÓGÐGß7CŒ{ 4¨dÔ3ÐZÌÐUYÓIZÐZùó	 (^s   ÂD ÂD © )	r1   r4   r2   r3   r5   r#   r$   r0   r6   s	   ffffffff r   Ú_comment_opr9      s   ÿ€ ÷[÷ [ð €Or   c                ó0   € V ^8„  d   QhR\         R\        /# r   r   )r   s   "r   r   r   +   s   € ÷ 3ñ 3”Tð 3œcñ 3r   c                 ó:   € V P                  R R4      ;'       g    R# )Ú	file_typeÚdocx)r   )r   s   &r   Ú
_file_typer>   +   s   € Ø�8‰8�K Ó(×2Ð2¨FÐ2r   c                ó0   € V ^8„  d   QhR\         R\        /# r   )r   Úlist)r   s   "r   r   r   /   s   € ÷ ñ œð ¬$ñ r   c           	     óº   € R\        V 4      3RR\        V P                  R^d4      4      3.VOpV P                  RR4      pV'       d   VP                  RV34       V# )zUQuery params shared by the listing endpoints; page_token goes last (after any extra).r<   Ú	page_sizeÚ
page_tokenr   )Úuser_id_typeÚopen_id)r>   r   r   Úappend)r   Úextrar#   rC   s   &*  r   Ú_paged_queriesrH   /   sh   € ð 
”j Ó&Ð'Ð)DØ	”c˜$Ÿ(™( ;°Ó4Ó5Ð6ð@à9>ð@€Gð —‘˜,¨Ó+€JßØ�‰˜ jÐ1Ô2Ø€Nr   ÚtypeÚstringÚdescriptionzThe document file token.zFile type (default: docx).Údefaultr=   zPagination token for next page.z./open-apis/drive/v1/files/:file_token/commentszB/open-apis/drive/v1/files/:file_token/comments/:comment_id/repliesz2/open-apis/drive/v1/files/:file_token/new_commentsÚnameÚfeishu_drive_list_commentsz[List comments on a Feishu document. Use is_whole=true to list whole-document comments only.Ú
parametersÚobjectÚ
propertiesÚ
file_tokenr<   Úis_wholeÚbooleanz-If true, only return whole-document comments.rB   Úintegerz&Number of comments per page (max 100).rC   ÚrequiredÚ!feishu_drive_list_comment_repliesz:List all replies in a comment thread on a Feishu document.Ú
comment_idz#The comment ID to list replies for.z%Number of replies per page (max 100).Úfeishu_drive_reply_commentz£Reply to a local comment thread on a Feishu document. Use this for local (quoted-text) comments. For whole-document comments, use feishu_drive_add_comment instead.zThe comment ID to reply to.r!   z6The reply text content (plain text only, no markdown).Úfeishu_drive_add_commentz˜Add a new whole-document comment on a Feishu document. Use this for whole-document comments or as a fallback when reply_comment fails with code 1069302.z8The comment text content (plain text only, no markdown).zfile_token is requiredzList commentsÚGETc                 óR   € \        V .V P                  R R4      '       d   R.M. O5!  # )rS   F)rS   Útrue)rH   r   ©Úas   &r   Ú<lambda>r`   ¨   s&   € ”n QÐfÀAÇEÁEÈ*ÐV[×D\ÒD\Ð+?Ñ*@ÐbdÔfr   )r#   z&file_token and comment_id are requiredzList repliesz0file_token, comment_id, and content are requiredzReply commentÚPOSTc                 ó   € R \        V 4      3.# )r<   ©r>   r^   s   &r   r`   r`   ¯   s   € ¸{ÌJÐWXËMÐ>ZÑ=[r   c                 ó*   € R RRRRRVR,          //.//# )r!   ÚelementsrI   Útext_runÚtextéÿÿÿÿr8   ©r_   r-   s   &&r   r`   r`   °   s'   € �y :°¸ÀZÐRXÐZ[Ð\^ÕZ_ÐQ`Ð0aÐ/bÐ"cÑdr   T)r#   r$   r0   z#file_token and content are requiredzAdd commentc                 ó8   € R \        V 4      RRRRVR,          /./# )r<   Úreply_elementsrI   rg   rh   rc   ri   s   &&r   r`   r`   ¶   s&   € �{¤J¨q£MÐ3CÀvÈvÐW]Ð_`ÐacÕ_dÐFeÐEfÑgr   )r$   r0   zList document commentsu   ðŸ’¬zList comment replieszReply to a document commentu   âœ‰ï¸�zAdd a whole-document commentÚfeishu_drive)	rM   ÚtoolsetÚschemaÚhandlerÚcheck_fnÚrequires_envÚis_asyncrK   Úemoji)NNF)rR   rX   r!   )rR   )rR   rX   )rR   r!   )%Ú__doc__ÚloggingÚtools.feishu_larkr   r   r   r   r   Útools.registryr   r   r	   Ú	getLoggerÚ__name__Úloggerr9   r>   rH   Ú_FILE_TOKEN_PROPÚ_FILE_TYPE_PROPÚ_PAGE_TOKEN_PROPÚ_COMMENTS_URIÚ_REPLIES_URIÚ_ADD_COMMENT_URIÚ!FEISHU_DRIVE_LIST_COMMENTS_SCHEMAÚ FEISHU_DRIVE_LIST_REPLIES_SCHEMAÚFEISHU_DRIVE_REPLY_SCHEMAÚFEISHU_DRIVE_ADD_COMMENT_SCHEMAÚ_handle_list_commentsÚ_handle_list_repliesÚ_handle_reply_commentÚ_handle_add_commentÚ_schemar6   Ú_descÚ_emojiÚregisterr8   r   r   Ú<module>r�      s?  ðñó ÷õ ÷ =Ñ <à	×	Ò	˜8Ó	$€ôõ,3õð ˜H mÐ5OÐPÐ Ø˜8 ]Ð4PÐR[Ð]cÐd€Ø˜H mÐ5VÐWÐ Ø@€ØS€ØGÐ ð Ð(Øð	Bð Ø�ØØÐ*Ø˜ØØ˜	ØÐNØ˜5ðð
 Ø˜	ØÐGØ˜3ðð
 Ð*ð
ð 	�\�Nð#ð%Ð !ð: Ð/ØÐOØØ�ØØÐ*ØØ˜ØÐDðð ˜ØØ˜	ØÐFØ˜3ðð
 Ð*ð
ð 	�\ <Ð0ð!ð$Ð  ð2 Ð(Øð	Mð Ø�ØØÐ*ØØ˜ØÐ<ðð Ø˜ØÐWðð ˜ð
ð 	Ò;ððÐ ð6 Ð&Øð	1ð Ø�ØØÐ*ØØ˜ØÐYðð ˜ð
ð 	�\ 9Ð-ðð#Ð ñ, $ØÐ-¨ÀÀ}ÙfôhÐ ñ #Ø Ð"JÈNÐ\aØ˜.ô*Ð ñ $Ø+Ð-_Ø�V˜\Ñ3[Ù	dØô	Ð ñ "ØÐDÀmÐU[ØÙ	gØô	Ð ð 'Ð(=Ð?WÐYeÐfØ%Ð';Ð=SÐUaÐbØÐ 5Ð7TÐVdÐeØ$Ð&9Ð;YÐ[iÐjó	)Ñ$€GˆX�u˜fð ×ÒØ�V�_ n¸WÈhØ¨R¸%ÈUÐZ`÷bó)r   