import { SmrtObject, SmrtObjectOptions } from '@happyvertical/smrt-core'; import { CreateIssueInput, CreatePRInput, IRepository, RepositoryProviderType, SearchFilters, SyncOptions } from '../types'; import { Issue } from './Issue'; import { PullRequest } from './PullRequest'; export interface RepositoryOptions extends SmrtObjectOptions { owner?: string; name?: string; fullName?: string; description?: string; defaultBranch?: string; isPrivate?: boolean; providerType?: RepositoryProviderType; baseUrl?: string; tokenConfigKey?: string; tenantId?: string | null; } export declare class Repository extends SmrtObject { /** * Tenant ID for multi-tenant isolation */ tenantId: string | null; /** * Repository owner (organization or user) */ owner: string; /** * Repository name */ name: string; /** * Full name in owner/repo format */ fullName: string; /** * Repository description */ description: string; /** * Default branch name */ defaultBranch: string; /** * Whether repository is private */ isPrivate: boolean; /** * Repository provider type */ providerType: RepositoryProviderType; /** * Base URL for self-hosted instances (GitHub Enterprise, GitLab self-hosted, etc.) */ baseUrl: string; /** * Environment variable name or config key for token resolution * The token is NOT stored - only the key name is persisted */ tokenConfigKey: string; /** * Last sync timestamp */ lastSyncedAt: Date | null; /** * Transient: Cached repository client (not persisted) */ private _client?; constructor(options?: RepositoryOptions); /** * Get the repository client, resolving token from config * * Token resolution order: * 1. Environment variable matching tokenConfigKey * 2. Module config value matching tokenConfigKey * * @returns Repository client for API operations * @throws Error if token cannot be resolved */ getClient(): Promise; /** * Clear the cached client (useful after token refresh) */ clearClient(): void; /** * Sync repository metadata from the provider * * @param options - Sync options * @returns This repository with updated fields */ sync(options?: SyncOptions): Promise; /** * Get issues from this repository * * @param filters - Optional search filters * @returns Array of Issue objects (SMRT models) */ getIssues(filters?: SearchFilters): Promise; /** * Get pull requests from this repository * * @param filters - Optional search filters * @returns Array of PullRequest objects (SMRT models) */ getPullRequests(filters?: SearchFilters): Promise; /** * Create a new issue in this repository * * @param data - Issue creation data * @returns Created Issue (SMRT model) */ createIssue(data: CreateIssueInput): Promise; /** * Create a new pull request in this repository * * @param data - PR creation data * @returns Created PullRequest (SMRT model) */ createPullRequest(data: CreatePRInput): Promise; /** * Check if this repository has any open issues matching criteria * * @param criteria - Natural language description of what to check * @returns True if matching issues exist */ hasOpenIssuesMatching(criteria: string): Promise; /** * Generate a summary of repository activity * * @returns AI-generated summary */ summarizeActivity(): Promise; /** * Get repository by owner and name * * @param owner - Repository owner * @param name - Repository name * @param options - Additional options * @returns Repository or null if not found */ static getByFullName(owner: string, name: string, options?: SmrtObjectOptions): Promise; } //# sourceMappingURL=Repository.d.ts.map