/** * Unified Skill Registry * * Manages skills from 3 sources: * - MAMA: Built-in templates + user-installed (~/.mama/skills/mama/) * - Cowork: GitHub anthropics/knowledge-work-plugins * - External: GitHub URL-based plugins (~/.mama/skills/external/) * * Provides install/uninstall/toggle/search across all sources. */ export type SkillSource = 'mama' | 'cowork' | 'external'; export interface CatalogSkill { id: string; name: string; description: string; source: SkillSource; installed: boolean; enabled: boolean; /** Remote path for download */ remotePath?: string; metadata?: Record; } export declare class SkillRegistry { private catalogCache; private treeCache; constructor(); /** * Get all installed skills (local files) */ getInstalled(): Promise; /** * Get catalog from a remote source (cached 1 hour) */ getCatalog(source?: SkillSource | 'all'): Promise; /** * Search across installed + catalog skills */ search(query: string, source?: SkillSource | 'all'): Promise; /** * Install a skill/plugin from remote source (full directory) * * Uses Git Tree API (1 request) to list files, then downloads each * from raw.githubusercontent.com (no API rate limit). */ install(source: SkillSource, name: string): Promise<{ success: boolean; path: string; files: number; }>; /** * Install a plugin from a GitHub URL * * Supports: * - https://github.com/{owner}/{repo} * - https://github.com/{owner}/{repo}/tree/{branch}/{subpath} * * Reuses getRepoTree() + fetchRawGitHub() for efficient download. */ installFromUrl(url: string): Promise<{ success: boolean; path: string; files: number; name: string; }>; /** * Parse GitHub URL into components */ private parseGitHubUrl; /** * Uninstall a skill */ uninstall(source: SkillSource, name: string): Promise; /** * Toggle skill enabled/disabled */ toggle(source: SkillSource, name: string, enabled: boolean): Promise; /** * Get SKILL.md content for a skill (local or remote) */ getContent(source: SkillSource, name: string): Promise; /** * Save skill content to disk and register in state */ save(name: string, content: string, source?: SkillSource): Promise<{ id: string; path: string; }>; /** * Clear catalog cache */ clearCache(source?: SkillSource): void; /** * Get repo file tree (cached 1 hour, single API call) */ private getRepoTree; private findSkillFile; private parseSkillHeader; private fetchCoworkCatalog; private static readonly MCP_CONFIG_PATH; /** * Merge .mcp.json from a skill directory into the global MCP config. * Tags each server entry with `_installedBy` for tracking. */ mergeMcpConfig(skillDir: string, skillKey: string): Promise; /** * Remove MCP server entries installed by a specific skill. */ removeMcpConfig(skillKey: string): Promise; /** * Migrate existing installed plugins: merge any .mcp.json that hasn't been merged yet. * Called once at server startup. */ migrateExistingMcpConfigs(): Promise; private loadMcpConfig; private saveMcpConfig; } //# sourceMappingURL=skill-registry.d.ts.map