/**
 * NEXUS Workspace — Cross-project orchestration operations.
 *
 * Implements ORCH-PLAN Phase B:
 * - B.2: nexus.route(directiveEvent) — dispatch Conduit directives to the correct project
 * - B.3: nexus.workspace.status() — aggregated cross-project task view
 * - B.4: nexus.workspace.agents() — cross-project agent registry view
 *
 * Security: project-level ACL enforced on all routing operations (HIGH-02).
 * Rate limiting: per-agent throttling on route operations (MEDIUM-05).
 * Audit: all routing operations logged (LOW-06).
 *
 * @module nexus/workspace
 */
import type { ConduitMessage } from '@cleocode/contracts';
/** Parsed directive from a Conduit message. */
export interface ParsedDirective {
    /** The directive verb (claim, done, blocked, action, etc.). */
    verb: string;
    /** Task references extracted from the message (e.g., T042, T1234). */
    taskRefs: string[];
    /** The agent ID that sent the directive. */
    agentId: string;
    /** Original message ID for audit trail. */
    messageId: string;
    /** Timestamp of the directive. */
    timestamp: string;
}
/** Result of routing a directive to a project. */
export interface RouteResult {
    /** Whether the routing succeeded. */
    success: boolean;
    /** The project that was routed to. */
    project: string;
    /** The project's filesystem path. */
    projectPath: string;
    /** The task that was affected. */
    taskId: string;
    /** What operation was performed. */
    operation: string;
    /** Error message if routing failed. */
    error?: string;
}
/** Aggregated task status across all projects. */
export interface WorkspaceStatus {
    /** Total projects in the workspace. */
    projectCount: number;
    /** Per-project task summaries. */
    projects: WorkspaceProjectSummary[];
    /** Aggregated totals. */
    totals: {
        pending: number;
        active: number;
        done: number;
        total: number;
    };
    /** When the status was computed. */
    computedAt: string;
}
/** Task summary for a single project. */
export interface WorkspaceProjectSummary {
    /** Project name. */
    name: string;
    /** Project path. */
    path: string;
    /** Task counts by status. */
    counts: {
        pending: number;
        active: number;
        done: number;
        total: number;
    };
    /** Health status from the Nexus registry. */
    health: string;
    /** Last sync time. */
    lastSync: string;
}
/** Agent info aggregated across projects. */
export interface WorkspaceAgent {
    /** Agent instance ID. */
    agentId: string;
    /** Agent type. */
    agentType: string;
    /** Current status. */
    status: string;
    /** Which project this agent is registered in. */
    project: string;
    /** Current task (if any). */
    taskId: string | null;
    /** Last heartbeat. */
    lastHeartbeat: string;
}
/** Project-level ACL entry. */
export interface ProjectACL {
    /** Agent IDs with write access. */
    authorizedAgents: string[];
}
/**
 * Parse a Conduit message into a structured directive.
 *
 * Extracts directive verbs (/claim, /done, /blocked) and task references
 * from the message content and metadata.
 */
export declare function parseDirective(message: ConduitMessage): ParsedDirective | null;
/**
 * Route a Conduit directive to the correct project's CLEO instance.
 *
 * Resolves which project owns the referenced task, checks ACL,
 * and dispatches the appropriate CLEO operation.
 *
 * @param directive - Parsed directive from a Conduit message
 * @returns Array of route results (one per task reference)
 */
export declare function routeDirective(directive: ParsedDirective): Promise<RouteResult[]>;
/**
 * Get aggregated task status across all registered projects.
 *
 * Returns per-project task counts and workspace-wide totals.
 * Respects project permissions — only includes readable projects.
 */
export declare function workspaceStatus(): Promise<WorkspaceStatus>;
/**
 * Get all agents registered across all projects.
 *
 * Queries each project's agent_instances table and returns a unified list.
 */
export declare function workspaceAgents(): Promise<WorkspaceAgent[]>;
//# sourceMappingURL=workspace.d.ts.map