// Health tracking types

import type { ProjectId, SessionId } from './ids';

export type ActivityState = 'inactive' | 'running' | 'idle' | 'stalled';

export interface ProjectHealth {
  projectId: ProjectId;
  sessionId: SessionId | null;
  /** Current activity state */
  activityState: ActivityState;
  /** Name of currently running tool (if any) */
  activeTool: string | null;
  /** Duration in ms since last activity (0 if running a tool) */
  idleDurationMs: number;
  /** Burn rate in USD per hour (0 if no data) */
  burnRatePerHour: number;
  /** Context pressure as fraction 0..1 (null if unknown) */
  contextPressure: number | null;
  /** Number of file conflicts (2+ agents writing same file) */
  fileConflictCount: number;
  /** Number of external write conflicts */
  externalConflictCount: number;
  /** Attention urgency score (higher = more urgent, 0 = no attention needed) */
  attentionScore: number;
  /** Human-readable attention reason */
  attentionReason: string | null;
}

export interface AttentionItem extends ProjectHealth {
  projectName: string;
  projectIcon: string;
}
