/**
 * RustStrategy - Warm-up strategy for Rust 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 RustStrategy {
    constructor(fs) {
        this.language = 'rust';
        this.fs = fs;
    }
    async detectProjectRoot(startDir) {
        const cargoPath = await this.fs.findUp('Cargo.toml', startDir);
        if (cargoPath) {
            this.projectRoot = getDirectory(cargoPath);
            return this.projectRoot;
        }
        return null;
    }
    async getFilesToOpen(projectRoot) {
        const files = await this.fs.glob('*.rs', projectRoot);
        return files.slice(0, MAX_FILES);
    }
}
//# sourceMappingURL=rust.js.map