#!/usr/bin/env node
/**
 * Marketplace Scanner Worker
 *
 * Standalone script that scans GitHub for community Claude Code skills
 * and feeds them through the submission queue for security verification.
 *
 * Usage:
 *   node marketplace-scanner-worker.js <jobId> <projectPath>
 *
 * The worker reads job configuration from:
 *   .specweave/state/jobs/<jobId>/config.json
 *
 * And updates progress to:
 *   .specweave/state/background-jobs.json
 *
 * Marketplace config defaults from .specweave/config.json under marketplace.scanner:
 * {
 *   "marketplace": {
 *     "scanner": {
 *       "intervalMinutes": 60,
 *       "searchTopics": ["claude-code-skill", "specweave-plugin"],
 *       "searchFilenames": ["SKILL.md"],
 *       "maxResultsPerScan": 100,
 *       "autoScanOnDiscover": true,
 *       "autoTier2": false,
 *       "githubToken": ""
 *     }
 *   }
 * }
 */
interface WorkerJobConfig {
    jobId: string;
    projectPath: string;
    searchTopics: string[];
    searchFilenames: string[];
    maxResultsPerScan: number;
    intervalMinutes: number;
    startedAt: string;
    checkpoint?: {
        lastCursor: string;
        seenRepos: string[];
    };
}
interface RateLimitInfo {
    remaining: number;
    reset: number;
}
/**
 * Search GitHub for repos matching topics or filenames
 */
export declare function scanGitHub(config: WorkerJobConfig, githubToken: string, log: (msg: string) => void): Promise<{
    repos: Array<{
        fullName: string;
        htmlUrl: string;
        description: string | null;
        owner: string;
        stars: number;
        lastUpdated: string;
    }>;
    rateLimit: RateLimitInfo;
    nextCursor: string;
    budgetSkipped?: boolean;
}>;
/**
 * Replace sleep function (for testing)
 */
export declare function _setSleepFn(fn: (ms: number) => Promise<void>): void;
/**
 * Reset sleep function to default
 */
export declare function _resetSleepFn(): void;
export {};
//# sourceMappingURL=marketplace-scanner-worker.d.ts.map