/**
 * Workforce module types — unified workers + jobs replacing Synapse+Architects split.
 *
 * Workers = WHO (agents, identity, budget, heartbeat)
 * Jobs    = WHAT (tasks, status, DAG deps, claim lock)
 *
 * Compatible with multi-client: every row stamps `client` field.
 */
import type BetterSqlite3 from 'better-sqlite3';
export type WorkforceDb = BetterSqlite3.Database;
export type WorkerStatus = 'idle' | 'active' | 'stale' | 'retired';
export interface Worker {
    id: string;
    name: string;
    role: string | null;
    client: string;
    status: WorkerStatus;
    budgetCapUsd: number;
    spentUsd: number;
    score: number;
    lastHeartbeat: number;
    createdAt: number;
}
export interface RegisterWorkerInput {
    id?: string;
    name: string;
    role?: string | null;
    client?: string;
    budgetCapUsd?: number;
}
export type JobStatus = 'backlog' | 'ready' | 'claimed' | 'wip' | 'blocked' | 'review' | 'done' | 'failed' | 'cancelled';
export type JobTier = 'strategy' | 'tactical';
export interface Job {
    id: string;
    title: string;
    tier: JobTier;
    status: JobStatus;
    priority: number;
    workerId: string | null;
    parentId: string | null;
    dependsOn: string[];
    budgetCapUsd: number | null;
    tokensUsed: number;
    payload: Record<string, unknown>;
    client: string;
    claimedAt: number | null;
    completedAt: number | null;
    createdAt: number;
}
export interface EnqueueJobInput {
    id?: string;
    title: string;
    tier?: JobTier;
    priority?: number;
    parentId?: string | null;
    dependsOn?: string[];
    budgetCapUsd?: number | null;
    payload?: Record<string, unknown>;
    client?: string;
}
export interface Claim {
    id: string;
    jobId: string;
    workerId: string;
    acquiredAt: number;
    releasedAt: number | null;
    leaseMs: number;
    expiresAt: number;
}
export interface KanbanLane {
    lane: JobStatus;
    jobs: KanbanCard[];
}
export interface KanbanCard {
    id: string;
    title: string;
    workerId: string | null;
    priority: number;
    tokensUsed: number;
    budgetCapUsd: number | null;
    payload: Record<string, unknown>;
    client: string;
    createdAt: number;
    claimedAt: number | null;
    completedAt: number | null;
}
export interface KanbanBoard {
    lanes: Record<JobStatus, KanbanCard[]>;
    totalJobs: number;
    generatedAt: number;
}
