/** * Compatibility layer for the new AST structure * Maps old AST usage patterns to new formal AST */ import type * as AST from '@rcs-lang/ast'; import type { IASTNode } from '@rcs-lang/core'; /** * Old BaseNode type for compatibility */ export interface BaseNode { type: string; range?: AST.Range; text?: string; children?: BaseNode[]; parent?: BaseNode | null; } /** * Old AST node types for compatibility */ export type ASTNode = IASTNode; export interface AgentNode extends BaseNode { type: 'agent_definition'; name?: string; displayName?: string; brandName?: string; description?: string; flows: FlowNode[]; } export interface FlowNode extends BaseNode { type: 'flow_definition'; name?: string; states: StateNode[]; } export interface MessageNode extends BaseNode { type: 'message_definition'; name?: string; messageType?: string; content?: ValueNode; } export interface StateNode extends BaseNode { type: 'state_definition'; name?: string; transitions: TransitionNode[]; } export interface TransitionNode extends BaseNode { type: 'transition'; from?: string; to: string; } export interface ValueNode extends BaseNode { type: string; } export interface StringNode extends BaseNode { type: 'string'; value?: string; } export type Range = AST.Range; /** * Walk AST recursively */ export declare function walkAST(node: BaseNode | ASTNode, callback: (node: BaseNode | ASTNode) => void): void; /** * Check if node is new AST format */ export declare function isNewAST(node: any): boolean; /** * Convert new AST to old format for language service */ export declare function convertNewASTToOld(ast: AST.RclFile | IASTNode): ASTNode; /** * Convert IASTNode to BaseNode for compatibility */ export declare function toBaseNode(node: IASTNode | AST.RclFile | any): BaseNode; //# sourceMappingURL=ast-compatibility.d.ts.map