import { WorkflowNodeType, LogicNodeConfig, WorkflowNode, WorkflowEdge, WorkflowGraph } from './contracts.js';
export { L as LayoutDirection, a as applyDagreLayout } from '../layout-engine-YZcVr20M.js';
import '@xyflow/react';

/**
 * Logic Node Default Configs
 * ==========================
 * Factory function to create default configs for each logic node type.
 */

declare function createDefaultLogicNodeConfig(nodeType: WorkflowNodeType): LogicNodeConfig | null;

/**
 * Workflow Validator
 * =================
 * Localizes validation output inside the UI package while keeping issue codes
 * stable enough for future contract tests against the backend validator.
 */

type SupportedLocale = 'en' | 'pt-BR' | 'es' | 'fr' | 'de' | 'it';
type ValidationParams = Record<string, string | number | undefined>;
type ValidationLocale = SupportedLocale | string;
type ValidationIssueCode = 'graph.noAgents' | 'graph.missingSource' | 'graph.missingTarget' | 'graph.orphanNode' | 'graph.toolToNonAgent' | 'graph.ruleNoAgent' | 'graph.cycleDetected' | 'graph.multipleStartNodes' | 'graph.multipleEndNodes' | 'graph.startHasIncoming' | 'graph.endHasOutgoing' | 'graph.iterationNoOutgoing' | 'node.required' | 'node.requiredWhenLanguageSet' | 'node.codeShapeRequired' | 'node.mustBeArray' | 'node.mustBeReferenceArray' | 'node.mustBeNonEmptyReferenceArray' | 'node.assignmentNeedsSourceOrValue' | 'node.invalidAggregationMode' | 'node.invalidListOperation' | 'node.invalidLogicalOperator' | 'node.mustBeNumber' | 'node.invalidHttpMethod' | 'node.providerIdentityRequired' | 'node.inputOrInstructionsRequired' | 'node.invalidExtractionMode' | 'node.s3WriteSourceOrBodyRequired' | 'node.unknownType';
type ValidationIssue = {
    code: ValidationIssueCode;
    message: string;
    params?: ValidationParams;
};
type NodeValidationIssue = ValidationIssue & {
    nodeId: string;
    nodeType: string;
    field?: string;
};
type ValidationResult = {
    valid: boolean;
    errors: string[];
    issues: ValidationIssue[];
    nodeIssues: NodeValidationIssue[];
};
type ValidationOptions = {
    locale?: ValidationLocale;
};
declare function validateNodeConfig(node: WorkflowNode, options?: ValidationOptions): NodeValidationIssue[];
declare function validateGraphNodeConfigs(graph: WorkflowGraph, options?: ValidationOptions): NodeValidationIssue[];
declare function validateWorkflowGraph(graph: WorkflowGraph, options?: ValidationOptions): ValidationResult;
declare function topologicalSortAgents(agentNodes: WorkflowNode[], edges: WorkflowEdge[], nodeMap: Map<string, WorkflowNode>): WorkflowNode[];

/**
 * Agent ELO Tier
 * ==============
 * Derives difficulty tier from agent ELO rating.
 * Used in node palette, agent flow node, and agent modal.
 */
type AgentTier = {
    key: 'beginner' | 'intermediate' | 'advanced' | 'expert';
    pillColor: string;
};
declare function getAgentTier(elo: number | undefined): AgentTier;

export { type AgentTier, type NodeValidationIssue, type ValidationResult, createDefaultLogicNodeConfig, getAgentTier, topologicalSortAgents, validateGraphNodeConfigs, validateNodeConfig, validateWorkflowGraph };
