• Format a single path for LLM context

    Converts a path array into a human-readable string showing the containment hierarchy from parent to child (reversed from the graph traversal order).

    Parameters

    • path: any

      Array of path nodes from child to parent

    • index: number

      Path index for numbering in output

    Returns string

    Formatted path string in format: "Path N:: parent|type=X|id=Y -> child|type=Z|id=W"

    // Input: [functionNode, classNode, moduleNode]
    // Output: "Path 0:: module|type=module_node|id=123 -> class|type=class_node|id=456 -> function|type=function_node|id=789"