@@ -98,7 +98,7 @@ ${stepText}`;
9898// Concat 2 -> 1, and sort by role
9999export const concatHistories = ( histories1 : ChatItemMiniType [ ] , histories2 : ChatItemMiniType [ ] ) => {
100100 const newHistories = [ ...histories1 , ...histories2 ] ;
101- return newHistories . sort ( ( a , b ) => {
101+ return newHistories . sort ( ( a ) => {
102102 if ( a . obj === ChatRoleEnum . System ) {
103103 return - 1 ;
104104 }
@@ -110,7 +110,6 @@ export const getChatTitleFromChatMessage = (
110110 message ?: ChatItemMiniType ,
111111 defaultValue = '新对话'
112112) => {
113- // @ts -ignore
114113 const textMsg = message ?. value . find ( ( item ) => 'text' in item && item . text ) ;
115114
116115 if ( textMsg ?. text ?. content ) {
@@ -185,32 +184,32 @@ export const filterPublicNodeResponseData = ({
185184 [ FlowNodeTypeEnum . agent ] : true ,
186185 [ FlowNodeTypeEnum . pluginOutput ] : true ,
187186 [ FlowNodeTypeEnum . runApp ] : true ,
188- [ FlowNodeTypeEnum . toolCall ] : true
187+ [ FlowNodeTypeEnum . toolCall ] : true ,
188+ [ FlowNodeTypeEnum . tool ] : true
189189 } ;
190190
191+ const commonFields = {
192+ moduleType : true ,
193+ pluginOutput : true ,
194+ runningTime : true ,
195+ toolId : true
196+ } ;
191197 const filedMap : Record < string , boolean > = responseDetail
192198 ? {
193199 quoteList : true ,
194- moduleType : true ,
195- pluginOutput : true ,
196- runningTime : true
200+ ...commonFields
197201 }
198- : {
199- moduleType : true ,
200- pluginOutput : true ,
201- runningTime : true
202- } ;
202+ : commonFields ;
203203
204204 return nodeRespones
205205 . filter ( ( item ) => publicNodeMap [ item . moduleType ] )
206206 . map ( ( item ) => {
207207 const obj : DispatchNodeResponseType = { } ;
208- for ( let key in item ) {
208+ for ( const key in item ) {
209209 if ( key === 'toolDetail' || key === 'pluginDetail' ) {
210- // @ts -ignore
211210 obj [ key ] = filterPublicNodeResponseData ( { nodeRespones : item [ key ] , responseDetail } ) ;
212211 } else if ( filedMap [ key ] ) {
213- // @ts -ignore
212+ // @ts -expect-error Dynamic public field copy is constrained by filedMap.
214213 obj [ key ] = item [ key ] ;
215214 }
216215 }
0 commit comments