@@ -40,8 +40,9 @@ export const a2aAgentKeys = {
4040 list : ( workspaceId : string ) => [ ...a2aAgentKeys . lists ( ) , workspaceId ] as const ,
4141 details : ( ) => [ ...a2aAgentKeys . all , 'detail' ] as const ,
4242 detail : ( agentId : string ) => [ ...a2aAgentKeys . details ( ) , agentId ] as const ,
43+ byWorkflows : ( ) => [ ...a2aAgentKeys . all , 'byWorkflow' ] as const ,
4344 byWorkflow : ( workspaceId : string , workflowId : string ) =>
44- [ ...a2aAgentKeys . all , 'byWorkflow' , workspaceId , workflowId ] as const ,
45+ [ ...a2aAgentKeys . byWorkflows ( ) , workspaceId , workflowId ] as const ,
4546}
4647
4748/**
@@ -153,6 +154,9 @@ export function useCreateA2AAgent() {
153154 queryClient . invalidateQueries ( {
154155 queryKey : a2aAgentKeys . lists ( ) ,
155156 } )
157+ queryClient . invalidateQueries ( {
158+ queryKey : a2aAgentKeys . byWorkflows ( ) ,
159+ } )
156160 } ,
157161 } )
158162}
@@ -205,6 +209,9 @@ export function useUpdateA2AAgent() {
205209 queryClient . invalidateQueries ( {
206210 queryKey : a2aAgentKeys . detail ( variables . agentId ) ,
207211 } )
212+ queryClient . invalidateQueries ( {
213+ queryKey : a2aAgentKeys . byWorkflows ( ) ,
214+ } )
208215 } ,
209216 } )
210217}
@@ -237,6 +244,9 @@ export function useDeleteA2AAgent() {
237244 queryClient . invalidateQueries ( {
238245 queryKey : a2aAgentKeys . detail ( variables . agentId ) ,
239246 } )
247+ queryClient . invalidateQueries ( {
248+ queryKey : a2aAgentKeys . byWorkflows ( ) ,
249+ } )
240250 } ,
241251 } )
242252}
@@ -284,6 +294,9 @@ export function usePublishA2AAgent() {
284294 queryClient . invalidateQueries ( {
285295 queryKey : a2aAgentKeys . detail ( variables . agentId ) ,
286296 } )
297+ queryClient . invalidateQueries ( {
298+ queryKey : a2aAgentKeys . byWorkflows ( ) ,
299+ } )
287300 } ,
288301 } )
289302}
0 commit comments