Merge branch 'main' into feat/support-agent-sandbox

This commit is contained in:
twwu
2026-02-11 17:50:35 +08:00
25 changed files with 602 additions and 250 deletions

View File

@@ -26,14 +26,26 @@ export const useAppWorkflow = (appID: string) => {
})
}
const WorkflowRunHistoryKey = [NAME_SPACE, 'runHistory']
export const useWorkflowRunHistory = (url?: string, enabled = true) => {
return useQuery<WorkflowRunHistoryResponse>({
queryKey: [NAME_SPACE, 'runHistory', url],
queryKey: [...WorkflowRunHistoryKey, url],
queryFn: () => get<WorkflowRunHistoryResponse>(url as string),
enabled: !!url && enabled,
staleTime: 0,
})
}
export const useInvalidateWorkflowRunHistory = () => {
const queryClient = useQueryClient()
return (url: string) => {
queryClient.invalidateQueries({
queryKey: [...WorkflowRunHistoryKey, url],
})
}
}
export const useInvalidateAppWorkflow = () => {
const queryClient = useQueryClient()
return (appID: string) => {