/** @internal Reset flag — for testing only */ export declare function _resetRateLimitWarned(): void; /** * Print a yellow warning when a GitHub API response indicates rate limiting. * Only prints once per CLI invocation to avoid noise. */ export declare function warnRateLimitOnce(res: Response): void; export type GitHubDiscoveryFailureCode = "unauthorized" | "missing" | "rate_limited" | "transient"; export interface GitHubDiscoveryFailure { code: GitHubDiscoveryFailureCode; status?: number; message: string; } export interface GitHubDiscoveryOptions { /** Explicit GitHub token for tests/sandbox flows. Omit to use the CLI keychain. */ token?: string | null; /** Fetch implementation for tests. Defaults to the shared GitHub fetch helper. */ fetchImpl?: typeof fetch; } export interface GitHubDiscoveryResult { skills: DiscoveredSkill[]; error?: GitHubDiscoveryFailure; } export declare function classifyGitHubFailure(res: Pick): GitHubDiscoveryFailure; /** @internal Reset cache — for testing only */ export declare function _resetBranchCache(): void; export declare function getDefaultBranch(owner: string, repo: string, options?: GitHubDiscoveryOptions): Promise; export declare function getBranchHeadSha(owner: string, repo: string, branch: string, options?: GitHubDiscoveryOptions): Promise; /** * Check whether a GitHub repo exists. Returns false only on 404. * Fails open on network errors or rate limits (returns true). */ export declare function checkRepoExists(owner: string, repo: string, options?: GitHubDiscoveryOptions): Promise; export interface DiscoveredSkill { name: string; path: string; rawUrl: string; description?: string; /** Raw URLs of agents/*.md files inside this skill directory. */ agentRawUrls?: Record; } /** * Extract a short description from SKILL.md content. * * Skips: blank lines, lines starting with `#`, YAML frontmatter delimiters (`---`). * Returns the first content line, truncated to 80 chars. * Returns undefined if no content line is found. */ export declare function extractDescription(content: string): string | undefined; export declare function fetchGitHubFileText(owner: string, repo: string, branch: string, path: string, options?: GitHubDiscoveryOptions): Promise; /** * Discover all SKILL.md files in a GitHub repo using the Trees API. * * Matches: * - Root `SKILL.md` (name = repo) * - `skills/{name}/SKILL.md` (name = directory name, one level deep only) * - `plugins/{non-specweave}/skills/{name}/SKILL.md` (non-framework plugin skills) * * After discovery, fetches content for each skill in parallel (3s timeout) * to populate the `description` field. * * Returns empty array on any API error (caller falls back to single-skill fetch). */ export declare function discoverSkills(owner: string, repo: string, options?: GitHubDiscoveryOptions): Promise; export declare function discoverSkillsDetailed(owner: string, repo: string, options?: GitHubDiscoveryOptions): Promise;