class_docstr: Convert msg spec V4 to V5
class_docstr_tok: ["Convert","msg","spec","V4","to","V5"]
docstr: Handle a complete reply.
docstr_tok: ["Handle","a","complete","reply","."]
code: def complete_reply(self, msg: Dict[str, Any]) -> Dict[str, Any]:
      """Handle a complete reply."""
      # complete_reply needs more context than we have to get cursor_start and end.
      # use special end=null to indicate current cursor position and negative offset
      # for start relative to the cursor.
      # start=None indicates that start == end (accounts for no -0).
      content = msg["content"]
      new_content = msg["content"] = {"status": "ok"}
      new_content["matches"] = content["matches"]
      if content["matched_text"]:
          new_content["cursor_start"] = -len(content["matched_text"])
      else:
          # no -0, use None to indicate that start == end
          new_content["cursor_start"] = None
      new_content["cursor_end"] = None
      new_content["metadata"] = {}
      return msg
  
imports: import json
  import re
  from typing import Any, Dict, List, Tuple
  from ._version import protocol_version_info
label_desc: Use image node_id 6 for calling the V4toV5 obj's underlying member method code with example usage: obj.complete_reply(msg) and returns: msg