MCPcopy
hub / github.com/cft0808/edict / remove_remote

Function remove_remote

scripts/skill_manager.py:198–218  ·  view source on GitHub ↗

移除远程 skill

(agent_id: str, name: str)

Source from the content-addressed store, hash-verified

196
197
198def remove_remote(agent_id: str, name: str) -> bool:
199 """移除远程 skill"""
200 if not safe_name(agent_id) or not safe_name(name):
201 print(f'❌ 错误:agent_id 或 skill 名称含非法字符')
202 return False
203
204 workspace = OCLAW_HOME / f'workspace-{agent_id}' / 'skills' / name
205 source_json = workspace / '.source.json'
206
207 if not source_json.exists():
208 print(f'❌ 技能不存在或不是远程 skill: {name}')
209 return False
210
211 try:
212 import shutil
213 shutil.rmtree(workspace)
214 print(f'✅ 技能 {name} 已从 {agent_id} 移除')
215 return True
216 except Exception as e:
217 print(f'❌ 移除失败:{e}')
218 return False
219
220
221# 支持通过环境变量或本地配置指定自定义 Hub 地址

Callers 1

mainFunction · 0.85

Calls 1

safe_nameFunction · 0.90

Tested by

no test coverage detected