export type SyncEventType =
  | 'task_created'
  | 'task_selected'
  | 'task_updated'
  | 'task_completed'
  | 'context_switch'
  | 'project_created'
  | 'project_updated';

export interface SyncEvent {
  eventId: string;
  userId: string;
  workspaceId: string;
  timestamp: string;
  version: string;
  eventType: SyncEventType;
  data: Record<string, unknown>;
  private: boolean;
  visibility: 'team' | 'private';
}

/** PF-local view of pulse config (loaded from team-hub.json via priority-forge-hub). */
export interface TeamPulseConfig {
  enabled: boolean;
  userId: string;
  pushImmediately: SyncEventType[];
  privacyRules: {
    defaultVisibility: 'team' | 'private';
    privateProjects: string[];
    privateTasks: string[];
  };
}

export const DEFAULT_TEAM_PULSE_CONFIG: TeamPulseConfig = {
  enabled: false,
  userId: '',
  pushImmediately: ['task_selected', 'task_completed'],
  privacyRules: {
    defaultVisibility: 'team',
    privateProjects: [],
    privateTasks: [],
  },
};
