/** * Input validation utilities for CLI arguments. * Prevents path traversal and injection attacks. */ /** * Validate an owner or repo name segment. * Only allows word chars, dots, and hyphens. */ export declare function validateRepoSegment(segment: string): boolean; export interface ParsedGitHubSource { owner: string; repo: string; /** Branch/ref from a /tree//... or /blob//... deep link. */ ref?: string; /** Repo-relative skill directory from a deep link ("" = repo root). */ skillPath?: string; } /** * Parse a GitHub source — accepts both `owner/repo` shorthand and full GitHub URLs. * Handles .git suffix and trailing slashes. URLs deep-linking a skill * (/tree// or /blob//<...>/SKILL.md) also carry `ref` * and `skillPath` so callers install ONLY that skill, not the whole repo. * Returns null for invalid or non-GitHub input. */ export declare function parseGitHubSource(source: string): ParsedGitHubSource | null; /** * Validate a skill name. * Rejects path traversal (../, ..\) and null bytes. */ export declare function validateSkillName(name: string): boolean; export type IdentifierFormat = { type: "owner-repo"; owner: string; repo: string; } | { type: "owner-repo-skill"; owner: string; repo: string; skill: string; } | { type: "url"; } | { type: "flat"; name: string; }; /** * Classify a source identifier into its format type. * Used for UX messaging and guardrails — does NOT validate existence. * * - `owner/repo` → owner-repo * - `owner/repo/skill` → owner-repo-skill * - URLs (http://, github.com/) → url * - Everything else → flat (ambiguous, registry lookup) */ export declare function classifyIdentifier(source: string): IdentifierFormat;