/**
 * OrchestratorGovernanceAdapter -- Abstract adapter for multi-agent orchestrators.
 *
 * Orchestrators like Paperclip, CrewAI, AutoGen, and LangGraph manage
 * multi-step plans, task delegation between agents, and complex workflows.
 * This adapter extends the base GovernanceAdapter with orchestration-level
 * governance hooks: task, plan, and delegation governance.
 *
 * Platform adapters for specific orchestrators extend this class and
 * implement the abstract methods to enforce governance at the orchestration
 * layer, not just the individual tool-call layer.
 *
 * @connexum/ai-governance
 */
import { BaseGovernanceAdapter, ActionDecisionType, type AgentIdentity, type AdapterCapabilities } from '../adapters/index';
export interface TaskContext {
    /** Unique identifier for this task */
    taskId: string;
    /** Type of task (e.g. "research", "code-review", "data-analysis") */
    taskType: string;
    /** Human-readable description of the task */
    description: string;
    /** The agent this task is assigned to */
    assignedAgent: AgentIdentity;
    /** Parent task ID if this is a subtask */
    parentTaskId?: string;
    /** Input data for the task */
    input: Record<string, unknown>;
    /** Constraints on how the task should be executed */
    constraints?: Record<string, unknown>;
    /** When the task was created */
    timestamp: Date;
    /** Organization/tenant ID for multi-tenant environments */
    orgId?: string;
}
export interface PlanStep {
    /** Unique identifier for this step */
    stepId: string;
    /** The action to be performed */
    action: string;
    /** The agent that will execute this step (if assigned) */
    agent?: AgentIdentity;
    /** IDs of steps that must complete before this step */
    dependencies: string[];
    /** Estimated risk level of this step */
    estimatedRisk?: 'low' | 'medium' | 'high';
}
export interface PlanContext {
    /** Unique identifier for this plan */
    planId: string;
    /** Ordered list of steps in the plan */
    steps: PlanStep[];
    /** The agent or entity that created this plan */
    creator: AgentIdentity;
    /** High-level objective of the plan */
    objective: string;
    /** When the plan was created */
    timestamp: Date;
    /** Organization/tenant ID for multi-tenant environments */
    orgId?: string;
}
export interface DelegationContext {
    /** Unique identifier for this delegation */
    delegationId: string;
    /** The agent delegating the work */
    fromAgent: AgentIdentity;
    /** The agent receiving the delegated work */
    toAgent: AgentIdentity;
    /** Description of the delegated task */
    task: string;
    /** Permissions being granted to the receiving agent */
    permissions: string[];
    /** When the delegation was created */
    timestamp: Date;
    /** Organization/tenant ID for multi-tenant environments */
    orgId?: string;
}
export interface TaskDecision {
    /** Whether the task is allowed, denied, or requires approval */
    type: ActionDecisionType;
    /** Explanation for the decision */
    reason: string;
    /** Modified constraints to apply if the task is allowed with conditions */
    modifiedConstraints?: Record<string, unknown>;
    /** Unique audit trail identifier for this decision */
    auditId: string;
    /** Additional metadata (e.g. HITL originalDecision) */
    metadata?: Record<string, unknown>;
}
export interface PlanDecision {
    /** Whether the plan is allowed, denied, or requires approval */
    type: ActionDecisionType;
    /** Explanation for the decision */
    reason: string;
    /** Step IDs that are denied (plan may proceed with remaining steps) */
    blockedSteps?: string[];
    /** Unique audit trail identifier for this decision */
    auditId: string;
    /** Additional metadata (e.g. HITL originalDecision) */
    metadata?: Record<string, unknown>;
}
export interface DelegationDecision {
    /** Whether the delegation is allowed, denied, or requires approval */
    type: ActionDecisionType;
    /** Explanation for the decision */
    reason: string;
    /** Permissions that are denied from the requested set */
    restrictedPermissions?: string[];
    /** Unique audit trail identifier for this decision */
    auditId: string;
    /** Additional metadata (e.g. HITL originalDecision) */
    metadata?: Record<string, unknown>;
}
export interface OrchestratorCapabilities extends AdapterCapabilities {
    /** Supports task-level governance (preTask/postTask) */
    taskGovernance: boolean;
    /** Supports plan-level governance (prePlan/postPlan) */
    planGovernance: boolean;
    /** Supports delegation governance (preDelegation/postDelegation) */
    delegationGovernance: boolean;
    /** Supports parallel task execution governance */
    parallelExecution: boolean;
    /** Supports nested/hierarchical plan governance */
    nestedPlans: boolean;
}
/**
 * @deprecated Use `BaseOrchestratorAdapter` from `src/orchestrator-adapters/base.ts`
 * and `OrchestratorAdapter` from `src/orchestrator-adapters/index.ts` instead.
 * This class is retained for one minor version and will be removed in the next
 * semver major release. All new adapters must extend BaseOrchestratorAdapter.
 *
 * @see src/orchestrator-adapters/base.ts
 * @see src/orchestrator-adapters/index.ts
 */
export declare abstract class OrchestratorGovernanceAdapter extends BaseGovernanceAdapter {
    /**
     * Pre-task governance check. Called before a task is assigned and executed.
     * Returns a TaskDecision indicating whether the task should proceed.
     */
    abstract preTask(task: TaskContext): Promise<TaskDecision>;
    /**
     * Post-task audit hook. Called after a task completes (success or failure).
     * Used for audit logging, metrics, and learning.
     */
    abstract postTask(task: TaskContext, result: Record<string, unknown>): Promise<void>;
    /**
     * Pre-plan governance check. Called before a multi-step plan is approved.
     * Can deny the entire plan or block individual steps.
     */
    abstract prePlan(plan: PlanContext): Promise<PlanDecision>;
    /**
     * Post-plan audit hook. Called after an entire plan completes.
     */
    abstract postPlan(plan: PlanContext, result: Record<string, unknown>): Promise<void>;
    /**
     * Pre-delegation governance check. Called before work is delegated
     * from one agent to another. Can deny the delegation entirely or
     * restrict which permissions are passed along.
     */
    abstract preDelegation(delegation: DelegationContext): Promise<DelegationDecision>;
    /**
     * Post-delegation audit hook. Called after a delegation completes.
     */
    abstract postDelegation(delegation: DelegationContext, result: Record<string, unknown>): Promise<void>;
    /**
     * Report orchestrator-specific capabilities beyond the base adapter set.
     */
    abstract getOrchestratorCapabilities(): OrchestratorCapabilities;
}
//# sourceMappingURL=orchestrator-adapter.d.ts.map