
    i`                     :   U d Z ddlmZ ddlmZmZmZmZmZm	Z	 ddl
mZ ddlmZmZmZ ddlmZ  e	de      Zeej&                  d	ej(                  d
ej*                  dej,                  dej.                  dieej0                  dej2                  dieej4                  dej6                  dej8                  dej:                  diiZeee   eeef   f   e d<   dee   dee   fdZ!	 d!dddee   deeedz  f   dz  de"dee   fdZ#deeeeef   f   fdZ$g d Z%y)"z2Helper utilities for building EnumOption metadata.    )Enum)DictListMappingSequenceTypeTypeVar)
EnumOption)LogLevelAgentExecFlowStageAgentInputMode)titleizeEnumT)boundz@Verbose developer logging; useful when debugging graph behavior.z2High-level execution progress and key checkpoints.zDRecoverable problems that require attention but do not stop the run.zOErrors that abort the current node or edge execution, even the entire workflow.z0Fatal issues that stop the workflow immediately.z=Send a single string prompt assembled from previous messages.zTSend structured role/content messages (Chat Completions style) which is recommended.z)Pre-generation thinking / planning stage.z0Main generation stage; also covers tool calling.z,Reflection or verification after generation.z+Finalization stage for cleanup and summary._ENUM_DESCRIPTIONSenum_clsreturnc           
          t         j                  | i       }g }| D ]M  }t        |j                        }|j	                  t        |j                  ||j                  |                   O |S )z2Return EnumOption entries for a Python Enum class.valuelabeldescription)r   getr   nameappendr
   r   )r   descriptionsoptionsmemberr   s        @/Users/bowang/.openclaw/workspace/ChatDev/entity/enum_options.pyenum_options_forr    "   s_     &))(B7L "G%zE|O_O_`fOghi  N    NF)preserve_label_casevaluesr   r"   c          
          g }|xs i }| D ]=  }|r|n
t        |      }|j                  t        |||j                  |                   ? |S )z5Create EnumOption entries from literal string values.r   )r   r   r
   r   )r#   r   r"   r   desc_mapr   r   s          r   enum_options_from_valuesr&   -   sP     !#G!rH,(5/zUUZH[\]  Nr!   c                      i } t         j                         D ]C  \  }}|j                         D ci c]  \  }}|s	|j                  | c}}| |j                  <   E | S c c}}w )zCReturn a serializable description map (mostly for tests/debugging).)r   itemsr   __name__)payloadr   mappingr   texts        r   describe_enums_mapr-   =   sa     *,G/557'MT]]_%e_\VT`dfllD&8_%e!!" 8N &fs
   
AA)r    r&   r-   )N)&__doc__enumr   typingr   r   r   r   r   r	   entity.configs.baser
   entity.enumsr   r   r   
utils.strsr   r   DEBUGINFOWARNINGERRORCRITICALPROMPTMESSAGESPRE_GEN_THINKING_STAGE	GEN_STAGEPOST_GEN_THINKING_STAGEFINISHED_STAGEr   str__annotations__r    boolr&   r-   __all__ r!   r   <module>rD      s~   8  ? ? * E E t$ ZK`iM ^!w 113^$$&X224b))+X	9 DdT$)_45 *tE{ tJ/?  59 !&	SM#sTz/*T1 	
 
* Dd38n!45 r!   