/**
 * Auto-Assignment Type Definitions
 *
 * Types for the automatic task assignment system.
 *
 * @module types/auto-assign.types
 */
/**
 * Prioritization strategy for task assignment
 */
export type PrioritizationStrategy = 'fifo' | 'priority' | 'deadline' | 'custom';
/**
 * Role matching rule for task assignment
 */
export interface RoleMatchRule {
    /** The agent role this rule applies to */
    role: string;
    /** Task types this role can handle */
    taskTypes: string[];
    /** Priority order (lower = higher priority) */
    priority: number;
    /** If true, only this role can handle these task types */
    exclusive?: boolean;
}
/**
 * Load balancing configuration
 */
export interface LoadBalancingConfig {
    /** Whether load balancing is enabled */
    enabled: boolean;
    /** Maximum tasks an agent can work on simultaneously */
    maxConcurrentTasks: number;
    /** Whether to prefer assigning to idle agents */
    preferIdleAgents: boolean;
}
/**
 * Dependency handling configuration
 */
export interface DependencyConfig {
    /** Whether to respect blocking dependencies */
    respectBlocking: boolean;
    /** Whether to wait for dependencies before assignment */
    waitForDependencies: boolean;
}
/**
 * Complete assignment strategy configuration
 */
export interface AssignmentStrategy {
    /** How tasks are prioritized */
    prioritization: PrioritizationStrategy;
    /** Role matching rules */
    roleMatching: RoleMatchRule[];
    /** Load balancing settings */
    loadBalancing: LoadBalancingConfig;
    /** Dependency handling settings */
    dependencies: DependencyConfig;
}
/**
 * Result of a task assignment operation
 */
export interface TaskAssignmentResult {
    /** Task ID that was assigned */
    taskId: string;
    /** Path to the task file */
    taskPath: string;
    /** Agent ID that received the task */
    agentId: string;
    /** Session name of the agent */
    sessionName: string;
    /** When the task was assigned */
    assignedAt: string;
    /** Estimated completion time (optional) */
    estimatedCompletion?: string;
}
/**
 * Task in the assignment queue
 */
export interface QueuedTask {
    /** Unique task identifier */
    taskId: string;
    /** Path to the task file */
    taskPath: string;
    /** Task title */
    title: string;
    /** Task priority (lower = higher priority) */
    priority: number;
    /** Type of task (feature, fix, test, etc.) */
    taskType?: string;
    /** Role required to complete this task */
    requiredRole?: string;
    /** Task IDs that must complete before this task */
    dependencies: string[];
    /** Task IDs currently blocking this task */
    blockedBy: string[];
    /** When the task was created */
    createdAt: string;
    /** Estimated hours to complete */
    estimatedHours?: number;
    /** Task labels/tags */
    labels?: string[];
}
/**
 * Assignment status
 */
export type AssignmentStatus = 'active' | 'completed' | 'failed' | 'reassigned';
/**
 * Record of a task assignment
 */
export interface TaskAssignment {
    /** Task ID */
    taskId: string;
    /** Agent ID assigned to the task */
    agentId: string;
    /** Session name of the agent */
    sessionName: string;
    /** When the task was assigned */
    assignedAt: string;
    /** Current status of the assignment */
    status: AssignmentStatus;
    /** When the task was completed (if applicable) */
    completedAt?: string;
    /** Number of continuation iterations */
    iterations?: number;
}
/**
 * Task queue for a project
 */
export interface TaskQueue {
    /** Project path */
    projectPath: string;
    /** All open tasks, sorted by priority */
    tasks: QueuedTask[];
    /** Assignment history */
    assignments: TaskAssignment[];
    /** Assignment strategy configuration */
    config: AssignmentStrategy;
    /** Last updated timestamp */
    lastUpdated: string;
}
/**
 * Types of assignment events
 */
export type AssignmentEventType = 'task_assigned' | 'task_completed' | 'task_failed' | 'agent_idle' | 'no_tasks' | 'assignment_skipped';
/**
 * Event emitted by the AutoAssignService
 */
export interface AssignmentEvent {
    /** Type of event */
    type: AssignmentEventType;
    /** Agent ID involved */
    agentId: string;
    /** Session name of the agent */
    sessionName: string;
    /** Task ID (if applicable) */
    taskId?: string;
    /** Timestamp of the event */
    timestamp: string;
    /** Additional metadata */
    metadata?: Record<string, unknown>;
}
/**
 * Notification configuration for auto-assignment
 */
export interface NotificationConfig {
    /** Notify when agent becomes idle */
    notifyOnIdle: boolean;
    /** Idle threshold in minutes before notification */
    idleThresholdMinutes: number;
    /** Notify when no tasks available */
    notifyOnNoTasks: boolean;
}
/**
 * Rate limits for auto-assignment
 */
export interface AssignmentLimits {
    /** Maximum assignments per day per agent */
    maxAssignmentsPerDay: number;
    /** Cooldown between task assignments in seconds */
    cooldownBetweenTasks: number;
}
/**
 * Complete auto-assignment configuration
 */
export interface AutoAssignConfig {
    /** Whether auto-assignment is enabled */
    enabled: boolean;
    /** Assignment strategy */
    strategy: AssignmentStrategy;
    /** Notification settings */
    notifications: NotificationConfig;
    /** Rate limits */
    limits: AssignmentLimits;
}
/**
 * Parameters for finding the next task
 */
export interface FindNextTaskParams {
    /** Session name of the agent */
    sessionName: string;
    /** Agent's role */
    role: string;
    /** Project path */
    projectPath: string;
    /** Preferred task types (optional) */
    preferredTaskTypes?: string[];
}
/**
 * Result of finding the next task
 */
export interface FindNextTaskResult {
    /** Whether a task was found */
    found: boolean;
    /** The task (if found) */
    task?: QueuedTask;
    /** Reason if no task found */
    reason?: 'no_tasks' | 'all_blocked' | 'role_mismatch' | 'at_limit' | 'cooldown';
}
/**
 * Auto-assignment related constants
 */
export declare const AUTO_ASSIGN_CONSTANTS: {
    /** Default configuration values */
    readonly DEFAULTS: {
        readonly MAX_CONCURRENT_TASKS: 1;
        readonly MAX_ASSIGNMENTS_PER_DAY: 50;
        readonly COOLDOWN_BETWEEN_TASKS: 60;
        readonly IDLE_THRESHOLD_MINUTES: 5;
    };
    /** Task type categories */
    readonly TASK_TYPES: {
        readonly DEVELOPMENT: readonly ["feature", "fix", "refactor", "implement"];
        readonly TESTING: readonly ["test", "verify", "qa"];
        readonly FRONTEND: readonly ["ui", "component", "style", "frontend"];
        readonly BACKEND: readonly ["api", "service", "database", "backend"];
        readonly MANAGEMENT: readonly ["planning", "review", "coordination", "documentation"];
    };
    /** Priority levels */
    readonly PRIORITY: {
        readonly CRITICAL: 1;
        readonly HIGH: 2;
        readonly MEDIUM: 5;
        readonly LOW: 10;
        readonly BACKLOG: 20;
    };
    /** Configuration file paths */
    readonly PATHS: {
        readonly CONFIG_FILE: "auto-assign.yaml";
        readonly CONFIG_DIR: ".crewly/config";
    };
};
/**
 * Default role matching rules
 */
export declare const DEFAULT_ROLE_MATCHING: RoleMatchRule[];
/**
 * Default assignment strategy
 */
export declare const DEFAULT_ASSIGNMENT_STRATEGY: AssignmentStrategy;
/**
 * Default notification configuration
 */
export declare const DEFAULT_NOTIFICATION_CONFIG: NotificationConfig;
/**
 * Default assignment limits
 */
export declare const DEFAULT_ASSIGNMENT_LIMITS: AssignmentLimits;
/**
 * Default complete auto-assignment configuration
 */
export declare const DEFAULT_AUTO_ASSIGN_CONFIG: AutoAssignConfig;
//# sourceMappingURL=auto-assign.types.d.ts.map