/** * Git Connector Implementation * * Wraps existing Git operations to implement the Connector interface. * Enables extraction of achievements from Git commit history through * the pluggable connector architecture. * * This connector maintains all existing Git functionality including: * - Branch whitelisting from source configuration * - Commit hash caching to avoid re-processing * - Batch processing support for LLM integration * - Statistics tracking and progress reporting */ import type { Connector, ConnectorConfig, ConnectorData } from './types'; /** * Git Connector - Implements Connector interface for Git repositories. * * Transforms Git commits into the standardized ConnectorData format * for integration with the achievement extraction pipeline. * * @example * const git = new GitConnector(); * await git.initialize({ * type: 'git', * sourceId: '550e8400-e29b-41d4-a716-446655440000', * projectId: 'f47ac10b-58cc-4372-a567-0e02b2c3d479', * gitPath: '/Users/ed/Code/my-project', * branchWhitelist: ['main', 'develop'], * }); * * const commits = await git.fetch({ since: new Date('2025-11-01') }); * console.log(`Fetched ${commits.length} commits`); */ export declare class GitConnector implements Connector { private config; private cache; private sourceId; /** * Get the connector type identifier. * @returns 'git' - Always returns the git connector type */ get type(): 'git'; /** * Initialize the connector with Git configuration. * * Validates that the configuration is for Git type, stores the configuration, * initializes the commit cache, and prepares for data fetching. * * @param config - Connector configuration with git-specific fields * @throws Error if config.type is not 'git' or initialization fails * * @example * await connector.initialize({ * type: 'git', * sourceId: 'uuid-here', * projectId: 'uuid-here', * gitPath: '/path/to/repo', * branchWhitelist: ['main'], * }); */ initialize(config: ConnectorConfig): Promise; /** * Fetch commits from the Git repository. * * Extracts commits from the configured repository, optionally filtered by * date range and branch whitelist. Uses cache to avoid re-processing * previously seen commits. * * @param options - Fetch options for filtering and control * @param options.since - Fetch commits after this date * @param options.until - Fetch commits before this date * @param options.limit - Maximum number of commits to fetch * @param options.skipCache - If true, bypass cache and fetch all commits * @returns Array of ConnectorData items representing commits * @throws Error if repository is not accessible or fetch fails * * @example * const commits = await connector.fetch({ * since: new Date('2025-11-01'), * limit: 100, * skipCache: false, * }); */ fetch(options?: { since?: Date; until?: Date; limit?: number; skipCache?: boolean; }): Promise; /** * Validate that the Git repository is accessible and properly configured. * * Checks that the repository path exists and is a valid Git repository. * Used during setup to verify source configuration before extraction. * * @returns true if repository is valid and accessible, false otherwise * * @example * if (await connector.validate()) { * console.log('Repository is ready for extraction'); * } else { * console.warn('Repository configuration invalid'); * } */ validate(): Promise; /** * Clear the commit cache for this source. * * Removes all cached commits for this specific source ID, forcing * a complete re-fetch on the next extraction. Useful for manual * refresh or troubleshooting. * * @throws Error if cache clearing fails * * @example * await connector.clearCache(); * const commits = await connector.fetch({ skipCache: true }); */ clearCache(): Promise; } //# sourceMappingURL=git-connector.d.ts.map