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

type ModelProvider = {
    id: string;
    name: string;
    /** The provider's runtime SDK / endpoint family. Different from the
     *  model families it CAN serve (see `servedFamilies`). E.g., a
     *  Bedrock provider has `provider: 'amazon'` but
     *  `servedFamilies: ['anthropic', 'amazon', 'meta', 'openai']`. */
    provider: string;
    modelCount: number;
    configured: boolean;
    /** Which model families this provider can serve at run-time. Used
     *  to compute the cartesian (model × provider) available to an
     *  agent. Defaults to `[provider]` when omitted (i.e., direct API
     *  providers that only serve their own family). */
    servedFamilies?: string[];
    /** Optional masked API key for display (`sk-prod-•••3742`). */
    apiKeyMasked?: string;
    /** ARN/SSM path of the secret, displayed read-only. */
    credentialRef?: string;
    /** ISO timestamp of last successful auth handshake. */
    lastVerifiedAt?: string;
};
type NodePaletteProps = {
    agents: AgentWithPrompts[];
    tools: WorkflowTool[];
    agentTools?: AgentTool[];
    rules: AgentRule[];
    entities?: WorkflowEntityDefinition[];
    modelProviders?: ModelProvider[];
    onCreateAgent?: () => void;
    onCreateTool?: () => void;
    onCreateAgentTool?: () => void;
    onCreateRule?: () => void;
    onCreateDatasource?: () => void;
    onConfigureProvider?: (providerId: string) => void;
};
declare function NodePalette({ agents, tools, agentTools, rules, entities, modelProviders, onCreateAgent, onCreateTool, onCreateAgentTool, onCreateRule, onCreateDatasource, onConfigureProvider }: NodePaletteProps): react_jsx_runtime.JSX.Element;

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[];
    /** Configured LLM provider connections (account-level credentials).
     *  Forwarded to AgentModal so the agent's "Model" tab can list the
     *  providers/credentials available to bind to. Optional — empty
     *  means no provider has been configured yet (modal shows empty
     *  state pointing the user to Settings). */
    modelProviders?: ModelProvider[];
    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 { type ModelProvider as M, NodePalette as N, type WorkspaceProps as W, Workspace as a };
