MCPcopy Create free account
hub / github.com/MiniMax-AI/Mini-Agent / replace_doc_path

Method replace_doc_path

mini_agent/tools/skill_loader.py:151–160  ·  view source on GitHub ↗
(match)

Source from the content-addressed store, hash-verified

149 # Pattern 2: Direct markdown/document references (forms.md, reference.md, etc.)
150 # Matches phrases like "see reference.md" or "read forms.md"
151 def replace_doc_path(match):
152 prefix = match.group(1) # e.g., "see ", "read "
153 filename = match.group(2) # e.g., "reference.md"
154 suffix = match.group(3) # e.g., punctuation
155
156 abs_path = skill_dir / filename
157 if abs_path.exists():
158 # Add helpful instruction for Agent
159 return f"{prefix}`{abs_path}` (use read_file to access){suffix}"
160 return match.group(0)
161
162 # Match patterns like: "see reference.md" or "read forms.md"
163 pattern_docs = r"(see|read|refer to|check)\s+([a-zA-Z0-9_-]+\.(?:md|txt|json|yaml))([.,;\s])"

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected