import { fileURLToPath } from 'node:url';
import path from 'node:path';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

export const PACKAGE_ROOT = path.resolve(__dirname, '../..');

export function getSkillsDir() {
  return path.join(PACKAGE_ROOT, 'skills');
}

export function getSkillSrcDir(skillName) {
  return path.join(getSkillsDir(), skillName, 'src');
}

export function getSkillJsonPath(skillName) {
  return path.join(getSkillsDir(), skillName, 'skill.json');
}

export function getAgentsDir() {
  return path.join(PACKAGE_ROOT, 'agents');
}

export function getAgentDir(agentId) {
  return path.join(getAgentsDir(), agentId);
}

export function getAgentConfigPath(agentId) {
  return path.join(getAgentDir(agentId), '.config.json');
}
