skill-dir-manager.js
857 Bytes
/**
* skill-dir-manager.js — Agent/Skill 目录管理
*
* 提供核心系统 Agent 的集合,用于在 Master prompt 中过滤展示的 Agent 列表。
* 所有在 agents.json 中定义的 Agent 均视为核心 Agent。
*/
const path = require('path');
const fs = require('fs');
// 核心系统 Agent 名称集合(排除 master / gateway)
const CORE_SKILLS = new Set();
// 从 agents.json 加载
try {
const agentsPath = path.resolve(__dirname, '../config/agents.json');
if (fs.existsSync(agentsPath)) {
const agents = JSON.parse(fs.readFileSync(agentsPath, 'utf-8'));
for (const name of Object.keys(agents)) {
if (name !== 'master' && name !== 'gateway') {
CORE_SKILLS.add(name);
}
}
}
} catch { /* 忽略,使用空集合 */ }
module.exports = { CORE_SKILLS };