def _parse_path(self, path: str) -> List[Union[str, int]]:
        """Parse a JSON pointer path into components."""
        if not path.startswith("/"):
            raise ValueError("Path must start with '/'")

        if path == "/":
            return []

        parts = []
        for part in path[1:].split("/"):
            # Unescape JSON pointer characters
            part = part.replace("~1", "/").replace("~0", "~")

            # Try to convert to int if it looks like an array index
            if part.isdigit():
                parts.append(int(part))
            else:
                parts.append(part)

        return parts
Parse a JSON pointer path into components.
llama-index-integrations/tools/llama-index-tools-artifact-editor/llama_index/tools/artifact_editor/base.py