import type { AgentPlatform, NoteTag } from '../common.js';
import type { Spec } from '../spec.js';
export interface AgentSession {
    sessionId: string;
    agentPlatform: AgentPlatform;
    agentName?: string;
    projectId: string;
    activeSpecs: string[];
    lockedResources: LockedResource[];
    startedAt: string;
    lastActivity: string;
    status: 'active' | 'idle' | 'disconnected';
    fileOwnership?: string[];
}
export interface LockedResource {
    type: 'spec' | 'file' | 'config' | 'knowledge';
    resourceId: string;
    lockedBy: string;
    lockedAt: string;
    reason: string;
    expiresAt?: string;
}
export interface AgentConflict {
    type: 'spec-overlap' | 'file-overlap' | 'dependency-conflict';
    agents: string[];
    resource: string;
    resolution: string;
    severity: 'blocking' | 'warning';
}
export interface TaskAssignment {
    specId: string;
    assignedTo?: string;
    status: 'available' | 'assigned' | 'in-progress' | 'blocked';
    blockedBy?: string[];
    estimatedHours: number;
    priority: 'critical' | 'high' | 'medium' | 'low';
}
export interface OrchestrateResult {
    action: string;
    sessionId?: string;
    sessions?: AgentSession[];
    conflicts?: AgentConflict[];
    distribution?: TaskAssignment[];
    granted?: boolean;
    message: string;
}
export interface ResourceLock {
    resourceId: string;
    resourceType: 'spec' | 'file';
    agentId: string;
    lockedAt: string;
    expiresAt: string;
    autoRenew: boolean;
}
export interface ConflictResolution {
    type: AgentConflict['type'];
    agents: string[];
    resources: string[];
    suggestion: string;
    severity: 'warning' | 'blocking';
}
export interface DistributionResult {
    assignments: Record<string, string[]>;
    unassigned: string[];
    reasoning: string;
}
export interface SessionBrief {
    inProgress: string[];
    pendingUnblocked: string[];
    blockers: string[];
    tokenBudget?: number;
    suggestions: {
        spec: string;
        reason: string;
    }[];
    lastSessionSummary?: string;
}
export type JournalEventType = 'criterion-completed' | 'spec-status-changed' | 'commit' | 'validate' | 'generate-plan';
export interface JournalEvent {
    type: JournalEventType;
    specId?: string;
    criterionIndex?: number;
    commitHash?: string;
    timestamp: string;
}
export interface JournalEntry {
    sessionId: string;
    startedAt: string;
    endedAt?: string;
    specsWorked: string[];
    criteriaCompleted: number;
    filesModified: string[];
    commits: string[];
    events: JournalEvent[];
}
export interface JournalStore {
    entries: JournalEntry[];
}
export interface PreCheckResult {
    specs: string[];
    overlaps: {
        file: string;
        specs: string[];
    }[];
    hasConflicts: boolean;
    recommendation: string;
}
export interface DecomposeSubtask {
    index: number;
    files: string[];
}
export interface DecomposeResult {
    specId: string;
    subtasks: DecomposeSubtask[];
    totalFiles: number;
}
export interface BriefInput {
    specs: Spec[];
    journal: JournalStore;
    tokenBudget?: number;
    experienceLevel?: 'beginner' | 'expert';
}
export interface OrchestrationState {
    sessions: AgentSession[];
    locks: LockedResource[];
    conflicts: AgentConflict[];
}
export interface NoteMeta {
    key: string;
    createdAt: string;
    expiresAt?: string;
    tags?: NoteTag[];
    specId?: string;
    resolvedAt?: string;
}
export interface OrchestrateInput {
    projectId: string;
    action: 'register' | 'heartbeat' | 'lock' | 'unlock' | 'distribute' | 'status' | 'resolve-conflict' | 'pre-check' | 'decompose' | 'brief' | 'journal';
    sessionId?: string;
    specId?: string;
    resourcePath?: string;
    specIds?: string[];
    agentCount?: number;
    limit?: number;
    experienceLevel?: 'beginner' | 'expert';
    lockTtlMinutes?: number;
    fileOwnership?: string[];
    journalAction?: 'emit' | 'list';
    eventType?: string;
    commitHash?: string;
}
//# sourceMappingURL=session.d.ts.map