/** * On-Demand Asset Fetching * Derives asset URLs from skill's raw_url without database storage */ /** * Asset entry from index.jsonl manifest */ export interface AssetEntry { id: string; name: string; category?: string; section?: string; subsection?: string; } /** * Asset file metadata */ export interface AssetFile { name: string; path: string; size?: number; rawUrl: string; } /** * Get base URL for a skill's assets from its raw_url * * @example * // raw_url: https://raw.githubusercontent.com/owner/repo/main/skills/my-skill/SKILL.md * // returns: https://raw.githubusercontent.com/owner/repo/main/skills/my-skill */ export declare function getSkillBaseUrl(rawUrl: string): string; /** * Construct full asset URL from base URL and relative path * * @example * getAssetUrl('https://.../tailwind-ui', 'assets/buttons.html') * // returns: https://.../tailwind-ui/assets/buttons.html */ export declare function getAssetUrl(baseUrl: string, assetPath: string): string; /** * Parse repo info from raw_url * * @example * parseRawUrl('https://raw.githubusercontent.com/owner/repo/main/path/SKILL.md') * // returns: { owner: 'owner', repo: 'repo', branch: 'main', path: 'path' } */ export declare function parseRawUrl(rawUrl: string): { owner: string; repo: string; branch: string; path: string; } | null; /** * Fetch asset manifest (index.jsonl) if skill has one * Returns array of asset entries or null if no manifest exists */ export declare function fetchAssetManifest(baseUrl: string): Promise; /** * List assets using GitHub Contents API (fallback when no manifest) * Note: Rate limited (60 req/hour unauthenticated) */ export declare function listAssetsFromGitHub(owner: string, repo: string, skillPath: string, token?: string): Promise; /** * Fetch individual asset content from GitHub raw URL */ export declare function fetchAsset(assetUrl: string): Promise; /** * Fetch asset as binary (for images, etc) */ export declare function fetchAssetBinary(assetUrl: string): Promise; /** * Get all assets for a skill using best available method * 1. Try manifest (index.jsonl) - no rate limits * 2. Fallback to GitHub API - rate limited */ export declare function getSkillAssets(rawUrl: string, githubToken?: string): Promise<{ assets: AssetEntry[] | AssetFile[]; source: 'manifest' | 'github-api' | 'none'; }>; /** * Construct asset URL from manifest entry */ export declare function getAssetUrlFromEntry(baseUrl: string, entry: AssetEntry, format?: 'html' | 'jsx' | 'vue'): string; //# sourceMappingURL=assets.d.ts.map