/** * Raw URL Source Adapter (SMI-591) * * Fetches skills from arbitrary HTTP/HTTPS URLs. * Useful for custom registries or standalone skill files. */ import { BaseSourceAdapter } from './BaseSourceAdapter.js'; import type { SourceConfig, SourceLocation, SourceRepository, SourceSearchOptions, SourceSearchResult, SkillContent, SourceHealth } from './types.js'; /** * Registry entry for a skill URL */ export interface SkillUrlEntry { /** Unique identifier */ id: string; /** Human-readable name */ name: string; /** Full URL to the SKILL.md file */ url: string; /** Optional description */ description?: string; /** Optional author */ author?: string; /** Optional tags for searching */ tags?: string[]; } /** * Configuration for Raw URL adapter */ export interface RawUrlSourceConfig extends SourceConfig { /** Predefined list of skill URLs to index */ skillUrls?: SkillUrlEntry[]; /** URL to a JSON registry file containing skill entries */ registryUrl?: string; /** Request timeout in milliseconds */ timeout?: number; } /** * Raw URL Source Adapter * * Fetches skill files from arbitrary HTTP/HTTPS URLs. * Can work with: * - A predefined list of skill URLs * - A JSON registry file containing skill entries * - Direct URL locations * * @example * ```typescript * const adapter = new RawUrlSourceAdapter({ * id: 'custom-registry', * name: 'Custom Registry', * type: 'raw-url', * baseUrl: 'https://example.com', * enabled: true, * skillUrls: [ * { id: '1', name: 'My Skill', url: 'https://example.com/skill.md' } * ] * }) * * await adapter.initialize() * const content = await adapter.fetchSkillContent({ * owner: 'example.com', * repo: 'my-skill', * path: 'https://example.com/skill.md' * }) * ``` */ export declare class RawUrlSourceAdapter extends BaseSourceAdapter { private skillUrls; private readonly timeout; constructor(config: RawUrlSourceConfig); /** * Initialize adapter - load registry if configured */ protected doInitialize(): Promise; /** * Load skill entries from a remote JSON registry */ private loadRegistry; /** * Check if the source is reachable */ protected doHealthCheck(): Promise>; /** * Search for skills in the configured registry */ search(options?: SourceSearchOptions): Promise; /** * Get repository (skill entry) by location */ getRepository(location: SourceLocation): Promise; /** * Fetch skill content from a URL */ fetchSkillContent(location: SourceLocation): Promise; /** * Add a skill URL to the registry */ addSkillUrl(entry: SkillUrlEntry): void; /** * Remove a skill URL from the registry */ removeSkillUrl(id: string): boolean; /** * Get all registered skill URLs */ getSkillUrls(): SkillUrlEntry[]; /** * Convert a registry entry to SourceRepository */ private entryToRepository; /** * Fetch with timeout */ private fetchWithTimeout; /** * Generate a deterministic ID from a URL */ private generateId; /** * Generate SHA hash for content */ private generateSha; } /** * Factory function for creating Raw URL adapters */ export declare function createRawUrlAdapter(config: RawUrlSourceConfig): RawUrlSourceAdapter; //# sourceMappingURL=RawUrlSourceAdapter.d.ts.map