import { AgentConfig, AnswerNodeConfig, CodeNodeConfig, DashboardOutputNodeConfig, DocumentExtractorNodeConfig, EndNodeConfig, EntityNodeConfig, GroupNodeConfig, HttpRequestNodeConfig, IfElseNodeConfig, IterationNodeConfig, IterationStartNodeConfig, KnowledgeBaseNodeConfig, ListOperatorNodeConfig, ModelProviderNodeConfig, NoteNodeConfig, ParameterExtractorNodeConfig, QuestionClassifierNodeConfig, AgentRule, RuleNodeConfig, S3WriteNodeConfig, StartNodeConfig, TemplateTransformNodeConfig, WorkflowTool, VariableAggregatorNodeConfig, VariableAssignerNodeConfig } from './astrlabe/contracts.js';

type WorkflowCardDisplayMode = 'detailed' | 'compact';
type WorkflowEntityDefinition = {
    id: string;
    label: string;
    description: string;
    defaultLimit: number;
    fields: Array<{
        name: string;
        type: string;
        description?: string;
    }>;
};
type AgentWithPrompts = AgentConfig & {
    promptCount: number;
    activePromptVersion: number;
};
type ModelProviderNodeData = {
    config?: ModelProviderNodeConfig;
    label: string;
    displayMode?: WorkflowCardDisplayMode;
    onEdit?: (nodeId: string) => void;
    onRemoveFromCanvas?: (nodeId: string) => void;
};
type AgentNodeTool = {
    id: string;
    name: string;
    category?: string;
    enabled: boolean;
};
type AgentNodeData = {
    agent: AgentWithPrompts;
    order: number;
    selected: boolean;
    displayMode?: WorkflowCardDisplayMode;
    /** Agent tools assigned to this agent */
    agentTools?: AgentNodeTool[];
    /** Model provider name for display */
    providerName?: string;
    /** Model provider node ID (for config reference) */
    modelProviderId?: string;
    /** Model provider display label (e.g. "AWS Bedrock us-east-1") */
    modelProviderLabel?: string;
    onSelect: (agentId: string) => void;
    onRemoveFromCanvas?: (nodeId: string) => void;
};
type ToolCanvasData = {
    tool: WorkflowTool;
    order: number;
    displayMode?: WorkflowCardDisplayMode;
    onEdit?: (tool: WorkflowTool) => void;
    onToggle?: (tool: WorkflowTool) => void;
    onRemoveFromCanvas?: (nodeId: string) => void;
};
type RuleNodeData = {
    rule: AgentRule;
    order: number;
    displayMode?: WorkflowCardDisplayMode;
    onEdit?: (rule: AgentRule) => void;
    onToggle?: (rule: AgentRule) => void;
    onRemoveFromCanvas?: (nodeId: string) => void;
} | {
    rule: undefined;
    config: RuleNodeConfig;
    label: string;
    order: number;
    displayMode?: WorkflowCardDisplayMode;
    onEdit?: (nodeId: string) => void;
    onRemoveFromCanvas?: (nodeId: string) => void;
};
type EntityNodeData = {
    config?: EntityNodeConfig;
    label: string;
    entity?: WorkflowEntityDefinition;
    displayMode?: WorkflowCardDisplayMode;
    onEdit?: (nodeId: string) => void;
    onRemoveFromCanvas?: (nodeId: string) => void;
};
type StartNodeData = {
    config: StartNodeConfig;
    label: string;
    displayMode?: WorkflowCardDisplayMode;
    onDelete?: (nodeId: string) => void;
    onEdit?: (nodeId: string) => void;
};
type EndNodeData = {
    config: EndNodeConfig;
    label: string;
    displayMode?: WorkflowCardDisplayMode;
    onDelete?: (nodeId: string) => void;
    onEdit?: (nodeId: string) => void;
};
type DashboardOutputNodeData = {
    config: DashboardOutputNodeConfig;
    label: string;
    displayMode?: WorkflowCardDisplayMode;
    onDelete?: (nodeId: string) => void;
    onEdit?: (nodeId: string) => void;
};
type IfElseNodeData = {
    config: IfElseNodeConfig;
    label: string;
    displayMode?: WorkflowCardDisplayMode;
    onDelete?: (nodeId: string) => void;
    onEdit?: (nodeId: string) => void;
};
type CodeNodeData = {
    config: CodeNodeConfig;
    label: string;
    displayMode?: WorkflowCardDisplayMode;
    onDelete?: (nodeId: string) => void;
    onEdit?: (nodeId: string) => void;
};
type HttpRequestNodeData = {
    config: HttpRequestNodeConfig;
    label: string;
    displayMode?: WorkflowCardDisplayMode;
    onDelete?: (nodeId: string) => void;
    onEdit?: (nodeId: string) => void;
};
type S3WriteNodeData = {
    config: S3WriteNodeConfig;
    label: string;
    displayMode?: WorkflowCardDisplayMode;
    onDelete?: (nodeId: string) => void;
    onEdit?: (nodeId: string) => void;
};
type TemplateTransformNodeData = {
    config: TemplateTransformNodeConfig;
    label: string;
    displayMode?: WorkflowCardDisplayMode;
    onDelete?: (nodeId: string) => void;
    onEdit?: (nodeId: string) => void;
};
type IterationNodeData = {
    config: IterationNodeConfig;
    label: string;
    displayMode?: WorkflowCardDisplayMode;
    onDelete?: (nodeId: string) => void;
    onEdit?: (nodeId: string) => void;
};
type KnowledgeBaseNodeData = {
    config: KnowledgeBaseNodeConfig;
    label: string;
    displayMode?: WorkflowCardDisplayMode;
    onDelete?: (nodeId: string) => void;
    onEdit?: (nodeId: string) => void;
};
type AnswerNodeData = {
    config: AnswerNodeConfig;
    label: string;
    displayMode?: WorkflowCardDisplayMode;
    onDelete?: (nodeId: string) => void;
    onEdit?: (nodeId: string) => void;
};
type QuestionClassifierNodeData = {
    config: QuestionClassifierNodeConfig;
    label: string;
    displayMode?: WorkflowCardDisplayMode;
    onDelete?: (nodeId: string) => void;
    onEdit?: (nodeId: string) => void;
};
type ParameterExtractorNodeData = {
    config: ParameterExtractorNodeConfig;
    label: string;
    displayMode?: WorkflowCardDisplayMode;
    onDelete?: (nodeId: string) => void;
    onEdit?: (nodeId: string) => void;
};
type VariableAssignerNodeData = {
    config: VariableAssignerNodeConfig;
    label: string;
    displayMode?: WorkflowCardDisplayMode;
    onDelete?: (nodeId: string) => void;
    onEdit?: (nodeId: string) => void;
};
type VariableAggregatorNodeData = {
    config: VariableAggregatorNodeConfig;
    label: string;
    displayMode?: WorkflowCardDisplayMode;
    onDelete?: (nodeId: string) => void;
    onEdit?: (nodeId: string) => void;
};
type DocumentExtractorNodeData = {
    config: DocumentExtractorNodeConfig;
    label: string;
    displayMode?: WorkflowCardDisplayMode;
    onDelete?: (nodeId: string) => void;
    onEdit?: (nodeId: string) => void;
};
type ListOperatorNodeData = {
    config: ListOperatorNodeConfig;
    label: string;
    displayMode?: WorkflowCardDisplayMode;
    onDelete?: (nodeId: string) => void;
    onEdit?: (nodeId: string) => void;
};
type IterationStartNodeData = {
    config: IterationStartNodeConfig;
    label: string;
    displayMode?: WorkflowCardDisplayMode;
    onDelete?: (nodeId: string) => void;
    onEdit?: (nodeId: string) => void;
};
type NoteNodeData = {
    config: NoteNodeConfig;
    label: string;
    displayMode?: WorkflowCardDisplayMode;
    onDelete?: (nodeId: string) => void;
    onEdit?: (nodeId: string) => void;
};
type GroupNodeData = {
    config: GroupNodeConfig;
    label: string;
    displayMode?: WorkflowCardDisplayMode;
    onEdit?: (nodeId: string) => void;
    onToggleExpand?: (nodeId: string) => void;
    onRemoveFromCanvas?: (nodeId: string) => void;
};

export type { AgentWithPrompts as A, CodeNodeData as C, DocumentExtractorNodeData as D, EntityNodeData as E, GroupNodeData as G, HttpRequestNodeData as H, IfElseNodeData as I, KnowledgeBaseNodeData as K, ListOperatorNodeData as L, ModelProviderNodeData as M, NoteNodeData as N, ParameterExtractorNodeData as P, QuestionClassifierNodeData as Q, RuleNodeData as R, StartNodeData as S, ToolCanvasData as T, VariableAssignerNodeData as V, WorkflowEntityDefinition as W, AgentNodeData as a, EndNodeData as b, S3WriteNodeData as c, TemplateTransformNodeData as d, IterationNodeData as e, AnswerNodeData as f, VariableAggregatorNodeData as g, IterationStartNodeData as h, AgentNodeTool as i, DashboardOutputNodeData as j };
