/** * Autopilot API Client * * Extended API client for autopilot-specific operations. */ import type { McpConfig } from '../../config/index.js'; import type { Ticket, Epic, Specification, TicketStatus, ImplementationContext } from '../../types/index.js'; import type { TicketContext, ParsedDiscovery, DiscoveryType, DiscoverySeverity } from '../types.js'; /** * Extended ticket completion options for autopilot */ export interface ExtendedCompletionOptions { summary: string; actualHours?: number; testsPassed?: boolean; filesCreated?: string[]; filesModified?: string[]; filesDeleted?: string[]; tokensUsed?: { inputTokens: number; outputTokens: number; }; costUsd?: number; durationMs?: number; commitSha?: string; modelUsed?: string; } /** * Autopilot run state for sync */ export interface AutopilotRunState { runId: string; specificationId: string; projectId: string; status: string; totalTickets?: number; completedTickets: Array<{ ticketId: string; title?: string; }>; failedTickets: Array<{ ticketId: string; reason?: string; }>; skippedTickets: Array<{ ticketId: string; reason?: string; }>; currentEpicId?: string; currentTicketId?: string; workerCount?: number; activeWorkers?: number; totalCostUsd: number; totalInputTokens?: number; totalOutputTokens?: number; pausedAt?: string; pauseReason?: string; lastError?: string; errorCount?: number; } /** * Extended API client for autopilot operations */ export declare class AutopilotApiClient { private client; constructor(config: McpConfig); /** * Get specification by ID */ getSpecification(specificationId: string): Promise; /** * Get all epics for a specification */ getEpics(specificationId: string): Promise; /** * Get all tickets for an epic */ getTickets(epicId: string): Promise; /** * Get ticket by ID */ getTicket(ticketId: string): Promise; /** * Get ticket dependencies */ getTicketDependencies(ticketId: string): Promise<{ blockedBy: Array<{ id: string; title: string; status: TicketStatus; }>; blocks: Array<{ id: string; title: string; status: TicketStatus; }>; }>; /** * Get full implementation context for a ticket */ getImplementationContext(ticketId: string): Promise; /** * Get ticket context for implementation */ getTicketContext(ticketId: string): Promise; /** * Update ticket status */ updateTicketStatus(ticketId: string, status: TicketStatus, options?: { progress?: number; blockReason?: string; }): Promise; /** * Complete a work session for a ticket (replaces raw completeTicket) */ completeWorkSession(ticketId: string, options: ExtendedCompletionOptions): Promise; /** * Mark ticket as failed/blocked */ failTicket(ticketId: string, reason: string): Promise; /** * Start a work session for a ticket (replaces raw startTicket) */ startWorkSession(ticketId: string): Promise; /** * Record test results for a ticket */ recordTestResults(ticketId: string, results: { testType: string; passed: boolean; totalTests: number; passedTests: number; failedTests: number; errorDetails?: string; durationMs?: number; }): Promise; /** * Link a commit to a ticket */ linkCommit(ticketId: string, commit: { sha: string; url: string; title: string; }): Promise; /** * Get all tickets for a specification (across all epics) */ getAllTicketsForSpec(specificationId: string): Promise; /** * Get ready tickets (dependencies satisfied) */ getReadyTickets(specificationId: string): Promise; /** * Sync autopilot state to API (for tracking and webapp monitoring) */ syncAutopilotState(state: AutopilotRunState): Promise; /** * Create a new autopilot run */ createAutopilotRun(options: { runId: string; specificationId: string; projectId: string; config?: Record; workerCount?: number; totalTickets?: number; }): Promise<{ runId: string; } | null>; /** * Complete an autopilot run */ completeAutopilotRun(options: { runId: string; status: 'completed' | 'failed' | 'aborted'; durationMs: number; lastError?: string; }): Promise; /** * Create a discovery from parsed AI output */ createDiscovery(discovery: { ticketId: string; specificationId: string; type: DiscoveryType; severity: DiscoverySeverity; title: string; description: string; }): Promise<{ id: string; } | null>; /** * Create multiple discoveries from parsed AI output */ createDiscoveries(ticketId: string, specificationId: string, discoveries: ParsedDiscovery[]): Promise<{ created: number; failed: number; }>; /** * Validate API key */ validateApiKey(): Promise; /** * Create client from McpConfig */ static create(config: McpConfig): AutopilotApiClient; /** * Create from API key */ static fromApiKey(apiKey: string, options?: { apiUrl?: string; }): AutopilotApiClient; } /** * Create an autopilot API client from config */ export declare function createAutopilotApiClient(config: McpConfig): AutopilotApiClient; //# sourceMappingURL=autopilot-api-client.d.ts.map