
import { ReactNode } from 'react';
import { WorkflowObject, WorkflowNode, ContextMenuItem, IRepositories } from '../types';

export interface EditorAiToolSpec {
  name: string;
  description: string;
  parameters: Record<string, unknown>;
}
export interface EditorToolResult {
  ok: boolean;
  result?: unknown;
  rejected?: boolean;
  reason?: string;
}
export interface EditorAiCapability {
  kind: string;
  targetId?: string;
  guidelines: string;
  tools: EditorAiToolSpec[];
  invoke: (toolName: string, args: Record<string, unknown>) => Promise<EditorToolResult>;
}

export interface WorkflowEditorProps {
  initialData: WorkflowObject;
  onSave?: (data: WorkflowObject) => void;
  onLoadRequest?: () => void;
  additionalCanvasMenuItems?: ContextMenuItem[];
  additionalNodeMenuItems?: (node: WorkflowNode) => ContextMenuItem[];
  onAiCapabilityReady?: (cap: EditorAiCapability | null) => void;
}

declare const WorkflowEditorWrapper: React.FC<WorkflowEditorProps>;
declare const RepositoryProvider: React.FC<{ children: ReactNode; repositories: IRepositories }>;
declare const MockRepository: IRepositories;

export default WorkflowEditorWrapper;
export { RepositoryProvider, MockRepository };
export type { WorkflowObject, WorkflowNode, ContextMenuItem, IRepositories };
