/**
 * PythonStrategy - Warm-up strategy for Python projects
 *
 * @see spec.md US-001: Language-Aware Warm-up
 * @satisfies AC-US1-01, AC-US1-02
 */
const MAX_FILES = 10;
/**
 * Get directory from file path (cross-platform)
 */
function getDirectory(filePath) {
    const lastSlash = Math.max(filePath.lastIndexOf('/'), filePath.lastIndexOf('\\'));
    return lastSlash > 0 ? filePath.substring(0, lastSlash) : filePath;
}
export class PythonStrategy {
    constructor(fs) {
        this.language = 'python';
        this.fs = fs;
    }
    async detectProjectRoot(startDir) {
        // Try pyproject.toml first (modern Python)
        const pyprojectPath = await this.fs.findUp('pyproject.toml', startDir);
        if (pyprojectPath) {
            this.projectRoot = getDirectory(pyprojectPath);
            return this.projectRoot;
        }
        // Try requirements.txt (common)
        const requirementsPath = await this.fs.findUp('requirements.txt', startDir);
        if (requirementsPath) {
            this.projectRoot = getDirectory(requirementsPath);
            return this.projectRoot;
        }
        // Try setup.py (legacy)
        const setupPath = await this.fs.findUp('setup.py', startDir);
        if (setupPath) {
            this.projectRoot = getDirectory(setupPath);
            return this.projectRoot;
        }
        return null;
    }
    async getFilesToOpen(projectRoot) {
        const files = await this.fs.glob('*.py', projectRoot);
        return files.slice(0, MAX_FILES);
    }
}
//# sourceMappingURL=python.js.map