/** * Unified Integration Interface * * Each integration lives in a single folder with: * - index.ts - Main export * - source.ts - Data fetching logic * - auth.ts - Authentication (optional, if needed) * - README.md - Documentation */ /** * Result from fetching integration data */ export interface IntegrationResult { /** The content in markdown format */ content: string; /** Original source identifier */ source: string; /** Optional title extracted from source */ title?: string; /** Metadata about the fetch */ metadata?: Record; } /** * Options passed to integration fetch */ export interface IntegrationOptions { /** Project name/ID for filtering */ project?: string; /** Label/tag filter */ label?: string; /** Status filter (e.g., 'open', 'in_progress') */ status?: string; /** Maximum items to fetch */ limit?: number; /** Custom headers for HTTP requests */ headers?: Record; } /** * Authentication methods supported by integrations */ export type AuthMethod = 'cli' | 'api-key' | 'oauth' | 'none'; /** * Integration info for registry */ export interface IntegrationInfo { /** Unique identifier */ name: string; /** Human-readable display name */ displayName: string; /** Short description */ description: string; /** Authentication methods supported */ authMethods: AuthMethod[]; /** Whether integration is available (auth configured) */ available: boolean; /** Website URL for the service */ website: string; } /** * Unified Integration Interface * All integrations (github, linear, notion, etc.) implement this */ export interface Integration { /** Unique identifier (e.g., 'github', 'linear') */ name: string; /** Human-readable display name */ displayName: string; /** Short description */ description: string; /** Website URL */ website: string; /** Supported authentication methods */ authMethods: AuthMethod[]; /** * Check if this integration is available * Returns true if at least one auth method works */ isAvailable(): Promise; /** * Check which auth method is currently configured * Returns null if none are configured */ getConfiguredAuthMethod(): Promise; /** * Fetch data from this integration * @param identifier - Integration-specific identifier (repo, project, URL, etc.) * @param options - Additional options for the fetch */ fetch(identifier: string, options?: IntegrationOptions): Promise; /** * Get help text for using this integration */ getHelp(): string; /** * Get info for registry display */ getInfo(): Promise; } /** * Input for creating a task on GitHub/Linear */ export interface TaskCreateInput { title: string; description?: string; labels?: string[]; /** Priority: 1=Urgent, 2=High, 3=Medium, 4=Low */ priority?: number; assignee?: string; project?: string; } /** * Input for updating a task */ export interface TaskUpdateInput { status?: string; comment?: string; labels?: string[]; priority?: number; assignee?: string; } /** * Reference to a task on any platform */ export interface TaskReference { id: string; /** Display identifier: "#123" (GitHub) or "RAL-42" (Linear) */ identifier: string; title: string; url: string; status: string; source: 'github' | 'linear'; priority?: number; labels?: string[]; } /** * Writable Integration Interface * Extends Integration with task management (create, update, close, comment) */ export interface WritableIntegration extends Integration { createTask(input: TaskCreateInput, options?: IntegrationOptions): Promise; updateTask(id: string, input: TaskUpdateInput, options?: IntegrationOptions): Promise; closeTask(id: string, comment?: string, options?: IntegrationOptions): Promise; addComment(id: string, body: string, options?: IntegrationOptions): Promise; listTasks(options?: IntegrationOptions): Promise; readonly supportsWrite: true; } /** * Type guard: check if an integration supports write operations */ export declare function isWritableIntegration(integration: Integration): integration is WritableIntegration; /** * Base class for integrations * Provides common functionality */ export declare abstract class BaseIntegration implements Integration { abstract name: string; abstract displayName: string; abstract description: string; abstract website: string; abstract authMethods: AuthMethod[]; /** * Check if integration is available * Override for custom availability checks */ isAvailable(): Promise; /** * Get which auth method is configured * Override in subclasses for custom logic */ getConfiguredAuthMethod(): Promise; /** * Fetch data - must be implemented by subclass */ abstract fetch(identifier: string, options?: IntegrationOptions): Promise; /** * Get help text */ abstract getHelp(): string; /** * Get info for registry */ getInfo(): Promise; /** * Check if CLI tool is available * Override in subclasses that support CLI auth */ protected isCliAvailable(): Promise; /** * Check if API key is configured */ protected hasApiKey(): Promise; /** * Check if OAuth token is stored */ protected hasOAuthToken(): Promise; /** * Get credentials from config */ protected getCredentials(): Promise | null>; /** * Get API key from credentials * @param key - The credential key to get (default: 'apiKey') */ protected getApiKey(key?: string): Promise; /** * Create a standardized error message */ protected error(message: string): never; } //# sourceMappingURL=base.d.ts.map