/**
 * Content Fetcher
 *
 * Fetches raw SKILL.md content from GitHub repos
 * via raw.githubusercontent.com. Tries main, then master branch.
 */
const BRANCHES = ['main', 'master'];
export class ContentFetcher {
    constructor(options) {
        this.token = options?.token;
    }
    async fetchSkillContent(repoFullName, skillPath) {
        for (const branch of BRANCHES) {
            try {
                const url = `https://raw.githubusercontent.com/${repoFullName}/${branch}/${skillPath}`;
                const headers = {};
                if (this.token) {
                    headers.Authorization = `token ${this.token}`;
                }
                const response = await fetch(url, { headers });
                if (response.ok) {
                    return await response.text();
                }
            }
            catch {
                // Branch fetch failed — try next
            }
        }
        return null;
    }
}
//# sourceMappingURL=content-fetcher.js.map