/** Neutral skill scan status. Mirrors ProviderSkillInfo.status / the webui contract SkillStatus. */ type SkillScanStatus = "checking" | "active" | "rejected" | "deleted"; /** Terminal classification of a scan poll: keep waiting, succeeded, or terminally failed. */ type ScanPhase = "pending" | "ready" | "failed"; declare const SCAN_SKILL_TIMEOUT_MS = 360000; declare const SCAN_FILE_TIMEOUT_MS = 120000; declare const SCAN_POLL_INTERVAL_MS = 8000; /** Exponential-backoff poll schedule (SDK apply path: tighter first poll, capped growth). */ interface ScanBackoff { initial: number; factor: number; max: number; } declare const SKILL_SCAN_BACKOFF: ScanBackoff; declare const FILE_SCAN_BACKOFF: ScanBackoff; declare function skillStatusFromString(raw: unknown): SkillScanStatus; declare function classifyFileScan(status: string | undefined): ScanPhase; declare function classifySkillScan(status: string | undefined): ScanPhase; interface PollUntilOptions { /** Fetch the current state once. Called immediately, then after each interval. */ poll: () => Promise; /** Map a polled value to its scan phase. */ classify: (value: T) => ScanPhase; /** Give up after this many ms (measured from the first poll). */ timeoutMs: number; /** Fixed delay between polls, or an exponential-backoff schedule. */ interval: number | ScanBackoff; /** Build the error thrown when classify returns "failed" (terminal rejection). */ onFailed: (value: T) => Error; /** Build the error thrown when timeoutMs elapses (receives the last polled value, if any). */ onTimeout: (last: T | undefined) => Error; } /** * Generic content-scan poll loop: poll → resolve on "ready", throw onFailed on "failed", throw * onTimeout once the deadline passes, otherwise sleep and retry. */ declare function pollUntil(opts: PollUntilOptions): Promise; export { FILE_SCAN_BACKOFF, type PollUntilOptions, SCAN_FILE_TIMEOUT_MS, SCAN_POLL_INTERVAL_MS, SCAN_SKILL_TIMEOUT_MS, SKILL_SCAN_BACKOFF, type ScanBackoff, type ScanPhase, type SkillScanStatus, classifyFileScan, classifySkillScan, pollUntil, skillStatusFromString };