import type { AgentRegistryEntry, AgentMessage, WorkClaim, WorkAnnouncement, WorkOverlap, CollaborationSuggestion, DeployAction, CoordinationStatus, AgentStatus, MessageChannel, ClaimType, WorkIntentType, DeployActionType, DeployStatus, MessagePayload } from '../types/coordination.js'; export interface CoordinationServiceConfig { dbPath?: string; sessionId?: string; heartbeatIntervalMs?: number; claimExpiryMs?: number; } export declare class CoordinationService { private db; private sessionId; private heartbeatIntervalMs; private claimExpiryMs; constructor(config?: CoordinationServiceConfig); register(name: string, capabilities?: string[], worktreeBranch?: string): string; heartbeat(agentId: string): void; updateStatus(agentId: string, status: AgentStatus, currentTask?: string): void; deregister(agentId: string): void; getAgent(agentId: string): AgentRegistryEntry | null; getActiveAgents(): AgentRegistryEntry[]; cleanupStaleAgents(): number; cleanupStaleAgentsByTime(hours?: number): number; private cleanupAgentsOlderThan; claimResource(agentId: string, resource: string, claimType?: ClaimType): boolean; releaseResource(agentId: string, resource: string): void; releaseAllClaims(agentId: string): void; isResourceClaimed(resource: string): string | null; getResourceClaims(resource: string): WorkClaim[]; getAgentClaims(agentId: string): WorkClaim[]; /** * Announce intent to work on a resource. Does NOT lock - just informs other agents. * Returns overlap info if other agents are also working on related resources. */ announceWork(agentId: string, resource: string, intentType: WorkIntentType, options?: { description?: string; filesAffected?: string[]; estimatedMinutes?: number; }): { announcement: WorkAnnouncement; overlaps: WorkOverlap[]; suggestions: CollaborationSuggestion[]; }; /** * Mark work as complete on a resource. */ completeWork(agentId: string, resource: string): void; /** * Get all active work announcements (not completed). */ getActiveWork(): WorkAnnouncement[]; /** * Get work announcements for a specific resource. */ getWorkOnResource(resource: string): WorkAnnouncement[]; /** * Detect overlapping work that might cause merge conflicts. */ detectOverlaps(resource: string, excludeAgentId?: string): WorkOverlap[]; private assessConflictRisk; private generateOverlapSuggestion; /** * Generate collaboration suggestions based on overlaps. */ generateCollaborationSuggestions(agentId: string, _resource: string, overlaps: WorkOverlap[]): CollaborationSuggestion[]; private suggestMergeOrder; broadcast(fromAgent: string, channel: MessageChannel, payload: MessagePayload, priority?: number): void; send(fromAgent: string, toAgent: string, payload: MessagePayload, priority?: number): void; private sendMessage; receive(agentId: string, channel?: MessageChannel, markAsRead?: boolean): AgentMessage[]; getPendingMessages(agentId: string): number; queueDeploy(agentId: string, actionType: DeployActionType, target: string, payload?: Record, options?: { priority?: number; executeAfter?: Date; dependencies?: string[]; }): number; getPendingDeploys(): DeployAction[]; getReadyDeploys(): DeployAction[]; updateDeployStatus(deployId: number, status: DeployStatus, batchId?: string): void; getStatus(): CoordinationStatus; cleanup(): void; } //# sourceMappingURL=service.d.ts.map