UNPKG

@codai/memorai-core

Version:

Simplified advanced memory engine - no tiers, just powerful semantic search with persistence

150 lines 3.57 kB
export interface GitHubTreeItem { type?: string; mode?: string; path?: string; sha?: string; size?: number; url?: string; } export interface GitHubLabel { id?: number; node_id?: string; url?: string; name?: string; description?: string | null; color?: string | null; default?: boolean; } export interface GitHubUser { login: string; id: number; avatar_url?: string; html_url?: string; } export interface GitHubReview { id: number; node_id: string; user: GitHubUser | null; state: string; body: string; submitted_at?: string; } export interface GitHubComment { id: number; node_id: string; url: string; body?: string; body_text?: string; body_html?: string; html_url: string; user: GitHubUser | null; created_at: string; updated_at: string; } export interface GitHubFile { filename: string; status: string; additions: number; deletions: number; changes: number; blob_url?: string; patch?: string; } export interface GitHubIntegrationConfig { token: string; owner: string; repo: string; branches?: string[]; fileExtensions?: string[]; includePaths?: string[]; excludePaths?: string[]; } export interface CodeContext { filePath: string; content: string; language: string; lastModified: Date; author: string; commitHash: string; commitMessage: string; functions: string[]; classes: string[]; imports: string[]; } export interface IssueContext { number: number; title: string; body: string; state: string; labels: string[]; assignees: string[]; createdAt: Date; updatedAt: Date; comments: Array<{ author: string; body: string; createdAt: Date; }>; } export interface PullRequestContext { number: number; title: string; body: string; state: string; head: string; base: string; author: string; reviewers: string[]; changedFiles: Array<{ filename: string; status: string; additions: number; deletions: number; }>; createdAt: Date; updatedAt: Date; } export declare class GitHubIntegration { private octokit; private config; constructor(config: GitHubIntegrationConfig); /** * Extract code context from repository files */ extractCodeContext(): Promise<CodeContext[]>; /** * Extract context from repository issues */ extractIssueContext(): Promise<IssueContext[]>; /** * Extract context from pull requests */ extractPullRequestContext(): Promise<PullRequestContext[]>; private extractFileContext; private extractSingleIssueContext; private extractSinglePullRequestContext; private shouldProcessFile; private detectLanguage; private extractFunctions; private extractClasses; private extractImports; /** * Generate memory entries from extracted contexts */ generateCodeMemories(contexts: CodeContext[]): Array<{ content: string; type: string; metadata: Record<string, unknown>; }>; generateIssueMemories(contexts: IssueContext[]): Array<{ content: string; type: string; metadata: Record<string, unknown>; }>; generatePullRequestMemories(contexts: PullRequestContext[]): Array<{ content: string; type: string; metadata: Record<string, unknown>; }>; } //# sourceMappingURL=GitHubIntegration.d.ts.map