/ src / features / chat / query-keys.ts
query-keys.ts
 1  // Keep query keys centralized so mutation handlers invalidate exactly the same keys.
 2  export const chatQueryKeys = {
 3    apiCosts(months = 12) {
 4      return ['chat', 'api-costs', months] as const
 5    },
 6    recentSessions(limit = 24) {
 7      return ['chat', 'recent-sessions', limit] as const
 8    },
 9    settings(sessionId: string) {
10      return ['chat', 'settings', sessionId] as const
11    },
12    agentAuth() {
13      return ['chat', 'agent-auth'] as const
14    },
15    toolExecutionLogs(sessionId: string, limit = 40) {
16      return ['chat', 'tool-execution-logs', sessionId, limit] as const
17    },
18    tasks(sessionId: string | null, scope: 'active' | 'all', limit = 60) {
19      return ['chat', 'tasks', sessionId ?? 'none', scope, limit] as const
20    },
21    taskEvents(taskId: string, limit = 200) {
22      return ['chat', 'task-events', taskId, limit] as const
23    },
24    agentHealth(sessionId: string | null, limit = 40) {
25      return ['chat', 'agent-health', sessionId ?? 'none', limit] as const
26    },
27  }