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

Method replace_dir_path

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

Source from the content-addressed store, hash-verified

135 # Pattern 1: Directory-based paths (scripts/, references/, assets/)
136 # See https://agentskills.io/specification#optional-directories
137 def replace_dir_path(match):
138 prefix = match.group(1) # e.g., "python " or "`"
139 rel_path = match.group(2) # e.g., "scripts/with_server.py"
140
141 abs_path = skill_dir / rel_path
142 if abs_path.exists():
143 return f"{prefix}{abs_path}"
144 return match.group(0)
145
146 pattern_dirs = r"(python\s+|`)((?:scripts|references|assets)/[^\s`\)]+)"
147 content = re.sub(pattern_dirs, replace_dir_path, content)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected