/** * InterchangeNode → SemanticNode Converter * * Converts the expression-level InterchangeNode AST (from core/semantic parsers) * into the command-level SemanticNode IR used by LSE, MCP tools, and domain DSLs. * * This bridges the two IR pipelines in the monorepo: * - Pipeline A (InterchangeNode): full expression trees, 16 node types * - Pipeline B (SemanticNode): command-level semantics, opaque expression values * * Expression subtrees are intentionally collapsed to ExpressionValue { raw: string } * — LSE deliberately abstracts away expression-level detail. * * Uses structural typing for the input to avoid a dependency on the core package. */ import type { SemanticNode, SemanticValue } from '../core/types'; /** * Minimal interface matching InterchangeNode's structural shape. * Uses the `type` discriminant for dispatch. Additional fields are * accessed dynamically — this keeps the framework free of core imports. */ interface INode { readonly type: string; readonly [key: string]: unknown; } /** * Convert an InterchangeNode (expression-level AST) to a SemanticNode (command-level IR). * * Handles all 16 InterchangeNode types: * - Command/event nodes map to corresponding SemanticNode kinds * - Control flow nodes (if, repeat, foreach, while) map to conditional/loop kinds * - Expression nodes are wrapped as `get` commands with the value as patient role * * @param node - An InterchangeNode (or structurally compatible object) * @returns A SemanticNode suitable for LSE rendering, protocol JSON, or MCP tools */ export declare function fromInterchangeNode(node: INode): SemanticNode; /** * Convert an InterchangeNode to a SemanticValue. * * Simple nodes map directly to typed SemanticValue variants. * Complex expression nodes are collapsed to ExpressionValue { raw: string }. */ export declare function convertValue(node: INode): SemanticValue; /** * Recursively render an InterchangeNode expression tree to a string. * Used to collapse complex expressions into ExpressionValue.raw. */ export declare function renderExpr(node: INode): string; export {}; //# sourceMappingURL=from-interchange.d.ts.map