/** * Background Job Launcher * * Spawns clone and marketplace-scan workers as detached processes that * survive terminal close. Progress is tracked under .specweave/state/jobs/. */ import { Logger } from '../../utils/logger.js'; import type { BackgroundJob } from './types.js'; /** * Set the logger for this module */ export declare function setJobLauncherLogger(logger: Logger): void; export interface LaunchResult { job: BackgroundJob; /** PID of background process (undefined if foreground) */ pid?: number; /** Whether running in background */ isBackground: boolean; /** Whether all repos were already cloned (pre-flight skip) */ skippedPreFlight?: boolean; } export interface CloneLaunchOptions { /** Project path */ projectPath: string; /** Repositories to clone with URLs */ repositories: Array<{ owner: string; name: string; path: string; cloneUrl: string; }>; /** Run in foreground (blocking) instead of background */ foreground?: boolean; } /** * Launch a clone job * * @param options Launch configuration * @returns Job info and process details */ export declare function launchCloneJob(options: CloneLaunchOptions): Promise; export interface MarketplaceScanLaunchOptions { /** Project path */ projectPath: string; /** GitHub topics to search for */ searchTopics: string[]; /** Filenames to search for in repos */ searchFilenames: string[]; /** Maximum results per scan cycle */ maxResultsPerScan?: number; /** Minutes between scan cycles */ intervalMinutes?: number; /** Run in foreground (blocking) instead of background */ foreground?: boolean; } /** * Launch a marketplace scan job * * Scans GitHub for community Claude Code skills and feeds them * through the submission queue for security verification. * * @param options Launch configuration * @returns Job info and process details */ export declare function launchMarketplaceScanJob(options: MarketplaceScanLaunchOptions): Promise; /** * Check if a background job is still running */ export declare function isJobRunning(projectPath: string, jobId: string): boolean; /** * Kill a background job */ export declare function killJob(projectPath: string, jobId: string): boolean; /** * Get worker log output */ export declare function getJobLog(projectPath: string, jobId: string, tailLines?: number): string; /** * Get job result (after completion) */ export declare function getJobResult(projectPath: string, jobId: string): any | null; /** * Get orphaned jobs without modifying them (for display) */ export declare function getOrphanedJobs(projectPath: string): BackgroundJob[]; /** * Detect and handle orphaned jobs * P2 FIX: Jobs marked as "running" but worker is dead * * Returns list of orphaned jobs that were fixed */ export declare function detectOrphanedJobs(projectPath: string): BackgroundJob[]; /** * Clean up old job directories */ export declare function cleanupOldJobs(projectPath: string, keepDays?: number): void; //# sourceMappingURL=job-launcher.d.ts.map