UNPKG

@bobmatnyc/ai-code-review

Version:

A TypeScript-based tool for automated code reviews using AI models from Google Gemini, Anthropic Claude, and OpenRouter

57 lines (56 loc) 2.13 kB
/** * @fileoverview SerpAPI helper for searching for dependency information * * This module provides utilities to search for information about dependencies * using the SerpAPI service. */ import { PackageInfo } from './packageAnalyzer'; /** * Interface for dependency security information */ export interface DependencySecurityInfo { packageName: string; packageVersion?: string; vulnerabilities: { description: string; severity: 'critical' | 'high' | 'medium' | 'low' | 'unknown'; affectedVersions?: string; fixedVersions?: string; url?: string; }[]; recommendedVersion?: string; deprecationInfo?: string; packageHealth?: { lastUpdated?: string; status?: 'active' | 'maintained' | 'deprecated' | 'abandoned' | 'unknown'; stars?: number; popularity?: string; }; sources: string[]; } /** * Check if SerpAPI is configured correctly * @returns True if SerpAPI is available, false otherwise */ export declare function hasSerpApiConfig(): boolean; /** * Search for security information about a package * @param packageInfo The package information to search for * @param ecosystem The package ecosystem (npm, composer, pip, gem) * @returns Security information about the package */ export declare function searchPackageSecurity(packageInfo: PackageInfo, ecosystem: 'npm' | 'composer' | 'pip' | 'gem'): Promise<DependencySecurityInfo | null>; /** * Search for multiple packages in batch * @param packages The packages to search for * @param ecosystem The package ecosystem * @param limit The maximum number of packages to search for * @returns Security information for the packages */ export declare function batchSearchPackageSecurity(packages: PackageInfo[], ecosystem: 'npm' | 'composer' | 'pip' | 'gem', limit?: number): Promise<DependencySecurityInfo[]>; /** * Format security information for display * @param securityInfo The security information to format * @returns Formatted security information */ export declare function formatSecurityInfo(securityInfo: DependencySecurityInfo[]): string;