import * as react_jsx_runtime from 'react/jsx-runtime';
import { ComponentProps } from 'react';
import { NodeTypes } from '@xyflow/react';
import { A as AgentWithPrompts, W as WorkflowEntityDefinition } from '../index-CoB18TbG.js';
import { AgentModel, WorkflowTool, AgentTool, AgentRule, WorkflowGraph, LogicNodeConfig } from './contracts.js';

type AgentModalRenderProps = {
    agent: AgentWithPrompts | null;
    models: AgentModel[];
    open: boolean;
    isCreateMode: boolean;
    onClose: () => void;
    onSaved: () => void;
};
type LogicNodeModalRenderProps = {
    nodeId: string | null;
    nodeLabel: string;
    config: LogicNodeConfig | null;
    open: boolean;
    onClose: () => void;
    onSave: (nodeId: string, updatedConfig: LogicNodeConfig) => void;
    entities: WorkflowEntityDefinition[];
};
type WorkflowCanvasProps = {
    agents: AgentWithPrompts[];
    models: AgentModel[];
    tools?: WorkflowTool[];
    agentTools?: AgentTool[];
    rules?: AgentRule[];
    entities?: WorkflowEntityDefinition[];
    datasources?: Array<{
        id: string;
        name: string;
        dialect: string;
    }>;
    onLoadTables?: (datasourceId: string) => Promise<string[]>;
    onLoadSchema?: (datasourceId: string, table: string) => Promise<Array<{
        name: string;
        type: string;
        nullable?: boolean;
    }>>;
    initialGraph?: WorkflowGraph | null;
    onGraphChange?: (graph: WorkflowGraph) => void;
    onEditTool?: (tool: WorkflowTool) => void;
    onToggleTool?: (tool: WorkflowTool) => void;
    onEditRule?: (rule: AgentRule) => void;
    onToggleRule?: (rule: AgentRule) => void;
    onCancelCreateAgent?: () => void;
    onAgentSaved?: () => void;
    isCreatingAgent?: boolean;
    /** Custom node type components — merged with built-in edge types */
    nodeTypes?: NodeTypes;
    /** Optional: render the AgentModal externally (frontend provides the component) */
    renderAgentModal?: (props: AgentModalRenderProps) => React.ReactNode;
    /** Optional: render a custom LogicNodeModal; defaults to internal modal */
    renderLogicNodeModal?: (props: LogicNodeModalRenderProps) => React.ReactNode;
};
declare function WorkflowCanvas(props: WorkflowCanvasProps): react_jsx_runtime.JSX.Element;

type BuilderCanvasProps = ComponentProps<typeof WorkflowCanvas>;
type WorkspaceProps = {
    locale?: string;
    messages?: Record<string, unknown>;
    className?: string;
    workflowId?: string;
} & Partial<BuilderCanvasProps>;
declare function Workspace({ locale, messages, className, workflowId, ...canvasProps }: WorkspaceProps): react_jsx_runtime.JSX.Element;

export { Workspace, type WorkspaceProps };
