/** * Agent Spec Adapter — Bidirectional conversion between FlowDrop and Agent Spec * * Converts between FlowDrop's StandardWorkflow format and Oracle's Open Agent Spec * JSON format. Handles the key structural differences: * - Unified edges (FlowDrop) ↔ control-flow + data-flow edges (Agent Spec) * - Node IDs (FlowDrop) ↔ node names (Agent Spec) * - Visual positions (FlowDrop) ↔ no positions (Agent Spec) * * @see https://github.com/oracle/agent-spec */ import type { AgentSpecFlow } from '../../types/agentspec.js'; import type { StandardWorkflow } from '../WorkflowAdapter.js'; export declare class AgentSpecAdapter { /** * Convert a FlowDrop StandardWorkflow to an Agent Spec Flow. * * Handles: * - Node conversion with config → node attributes * - Edge splitting into control-flow and data-flow * - Position preservation in metadata * - Gateway branch → from_branch mapping */ toAgentSpec(workflow: StandardWorkflow): AgentSpecFlow; /** * Export a FlowDrop StandardWorkflow as Agent Spec JSON string. */ exportJSON(workflow: StandardWorkflow): string; /** * Convert an Agent Spec Flow to a FlowDrop StandardWorkflow. * * Handles: * - Auto-layout (Agent Spec has no positions) * - Edge merging (control-flow + data-flow → unified edges) * - Node type mapping via registry * - Component type preservation in extensions */ fromAgentSpec(agentSpecFlow: AgentSpecFlow): StandardWorkflow; /** * Import an Agent Spec flow from a JSON string. */ importJSON(json: string): StandardWorkflow; /** * Resolve a stable name for a FlowDrop node in Agent Spec. * Uses the node's config instanceTitle, label, or falls back to ID. */ private resolveNodeName; /** * Convert a FlowDrop StandardNode to an Agent Spec node. */ private convertNodeToAgentSpec; /** * Add Agent Spec type-specific attributes from FlowDrop config. */ private addNodeSpecificAttributes; /** * Resolve Agent Spec component type from a FlowDrop node. */ private resolveComponentType; /** * Convert an Agent Spec node to a FlowDrop StandardNode. * * Uses lightweight component type defaults for trigger ports and visual styling. * Does NOT depend on the full node type registry — works with any component_type, * including custom/unknown types (falls back to sensible defaults). */ private convertNodeFromAgentSpec; /** * Extract FlowDrop config values from Agent Spec node-specific attributes. */ private extractConfigFromAgentSpec; /** * Get the data type of a source port from a FlowDrop node. */ private getSourcePortDataType; /** * Convert a FlowDrop trigger edge to an Agent Spec ControlFlowEdge. */ private convertToControlFlowEdge; /** * Convert a FlowDrop data edge to an Agent Spec DataFlowEdge. */ private convertToDataFlowEdge; /** * Convert an Agent Spec ControlFlowEdge to a FlowDrop edge. */ private convertFromControlFlowEdge; /** * Convert an Agent Spec DataFlowEdge to a FlowDrop edge. */ private convertFromDataFlowEdge; /** * Find the start node name from converted Agent Spec nodes. */ private findStartNodeName; }