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

Function list_remote

scripts/skill_manager.py:120–168  ·  view source on GitHub ↗

列出所有已添加的远程 skills

()

Source from the content-addressed store, hash-verified

118
119
120def list_remote() -> bool:
121 """列出所有已添加的远程 skills"""
122 if not OCLAW_HOME.exists():
123 print('❌ OCLAW_HOME 不存在')
124 return False
125
126 remote_skills = []
127
128 for ws_dir in OCLAW_HOME.glob('workspace-*'):
129 agent_id = ws_dir.name.replace('workspace-', '')
130 skills_dir = ws_dir / 'skills'
131 if not skills_dir.exists():
132 continue
133
134 for skill_dir in skills_dir.iterdir():
135 if not skill_dir.is_dir():
136 continue
137 skill_name = skill_dir.name
138 source_json = skill_dir / '.source.json'
139
140 if not source_json.exists():
141 continue
142
143 try:
144 source_info = json.loads(source_json.read_text())
145 remote_skills.append({
146 'agent': agent_id,
147 'skill': skill_name,
148 'source': source_info.get('sourceUrl', 'N/A'),
149 'desc': source_info.get('description', ''),
150 'added': source_info.get('addedAt', 'N/A'),
151 })
152 except Exception:
153 pass
154
155 if not remote_skills:
156 print('📭 暂无远程 skills')
157 return True
158
159 print(f'📋 共 {len(remote_skills)} 个远程 skills:\n')
160 print(f'{"Agent":<12} | {"Skill 名称":<20} | {"描述":<30} | 添加时间')
161 print('-' * 100)
162
163 for sk in remote_skills:
164 desc = (sk['desc'] or sk['source'])[:30].ljust(30)
165 print(f"{sk['agent']:<12} | {sk['skill']:<20} | {desc} | {sk['added'][:10]}")
166
167 print()
168 return True
169
170
171def update_remote(agent_id: str, name: str) -> bool:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected