import { SmrtObject, SmrtObjectOptions } from '@happyvertical/smrt-core'; import { IncorporateFeedbackOptions, IncorporateFeedbackResult, IRepository, SyncOptions } from '../types'; import { Comment } from './Comment'; import { Repository } from './Repository'; export interface IssueOptions extends SmrtObjectOptions { repositoryId?: string; number?: number; nodeId?: string; title?: string; body?: string; state?: 'open' | 'closed'; author?: string; labels?: string[]; assignees?: string[]; commentsCount?: number; lastSyncedAt?: Date | null; originalBody?: string; synthesisCount?: number; tenantId?: string | null; } export declare class Issue extends SmrtObject { /** * Tenant ID for multi-tenant isolation */ tenantId: string | null; /** * Repository this issue belongs to */ repositoryId?: string; /** * Issue number (provider-specific) */ number: number; /** * Node ID for GraphQL operations (GitHub Projects API) */ nodeId: string; /** * Issue title */ title: string; /** * Issue body/description */ body: string; /** * Issue state */ state: 'open' | 'closed'; /** * Author's login/username */ author: string; /** * Labels attached to the issue */ labels: string[]; /** * Assignee logins */ assignees: string[]; /** * Number of comments on the issue */ commentsCount: number; /** * Last sync timestamp */ lastSyncedAt: Date | null; /** * Original body before any AI synthesis (for rollback) */ originalBody: string; /** * Number of times feedback has been incorporated */ synthesisCount: number; /** * Transient: Cached repository (not persisted) * Protected so PullRequest can access it */ protected _repository?: Repository; /** * Transient: Cached client (not persisted) */ protected _client?: IRepository; constructor(options?: IssueOptions); /** * Get the repository this issue belongs to */ getRepository(): Promise; /** * Get the repository client for API operations */ getClient(): Promise; /** * Clear cached repository and client */ clearCache(): void; /** * Sync issue data from the provider * * @param options - Sync options * @returns This issue with updated fields */ sync(options?: SyncOptions): Promise; /** * Get comments on this issue * * @returns Array of Comment objects (SMRT models) */ getComments(): Promise; /** * Add a comment to this issue * * @param body - Comment body text * @returns Created Comment (SMRT model) */ addComment(body: string): Promise; /** * Incorporate feedback from comments into the issue body * * This is the core "Living Spec" functionality: * 1. Reads all comments on the issue * 2. Uses AI to synthesize comments with the current body * 3. Optionally updates the issue with the synthesized content * * @param options - Feedback incorporation options * @returns Result with synthesized content and status */ incorporateFeedback(options?: IncorporateFeedbackOptions): Promise; private runPromptWithResolvedAI; /** * Sends a fully-resolved instruction string to the given AI client. * * `incorporateFeedback()` curates the entire prompt (issue body + comments) * via the resolved prompt template, so this path deliberately does NOT inject * the object's own field data — that would duplicate the body. The `this.do()` * fallback path passes `includeData: false` for the same reason, keeping both * `incorporateFeedback()` paths consistent (#1567). */ private sendPromptMessage; private isExplicitAiClientOption; /** * Rollback to the original body before AI synthesis * * @returns Result with success status */ rollback(): Promise<{ success: boolean; message: string; }>; /** * AI-powered: Check if this issue needs review * * @returns True if the issue likely needs attention */ needsReview(): Promise; /** * AI-powered: Check if the issue is a bug report */ isBugReport(): Promise; /** * AI-powered: Check if the issue is a feature request */ isFeatureRequest(): Promise; /** * AI-powered: Generate suggested labels based on content * * @returns Array of suggested label names */ suggestLabels(): Promise; /** * Close this issue */ close(): Promise; /** * Add labels to this issue * * @param labels - Label names to add */ addLabels(labels: string[]): Promise; /** * Remove a label from this issue * * @param label - Label name to remove */ removeLabel(label: string): Promise; /** * Assign users to this issue * * @param assignees - User logins to assign */ assign(assignees: string[]): Promise; /** * Get issue URL */ getUrl(): string; } //# sourceMappingURL=Issue.d.ts.map