updates on the hook and endpoints for the ai agents

This commit is contained in:
2026-09-30 15:08:33 +05:30
parent ede1731fa5
commit d33fff01d3
5 changed files with 180 additions and 38 deletions

View File

@@ -865,6 +865,18 @@ export const useUpdateAiAgent = () =>
});
// Read-only, and it changes as agents work: refetched every minute while open.
// The banner's source of truth; re-checked every 30 s so it turns green on its
// own once AI_engine starts reading the registry.
export const useAiStatus = (options) =>
useQuery({
queryKey: [...KEYS.aiRegistry, 'status'],
queryFn: api.getAiStatus,
staleTime: 15_000,
refetchInterval: 30_000,
retry: false,
...options,
});
export const useAiInsights = (days = 7, options) =>
useQuery({
queryKey: [...KEYS.aiRegistry, 'insights', days],