export interface CachedResponse { id: string; tool: string; timestamp: Date; fullOutput: string; stderr: string; exitCode: number; command: string; metadata: Record; } declare class ResponseCache { private cache; private readonly maxAge; private readonly maxEntries; constructor(); store(data: Omit): string; get(id: string): CachedResponse | undefined; getRecentByTool(tool: string, limit?: number): CachedResponse[]; delete(id: string): boolean; clear(): void; private cleanup; /** * List all non-expired cached responses (most recent first). * Used by the MCP resources layer to enumerate available `xcmcp://response/{id}` resources. */ list(): CachedResponse[]; getStats(): { totalEntries: number; byTool: Record; }; /** * Load persisted state from disk */ private loadPersistedState; /** * Persist state to disk with debouncing */ private saveStateTimeout; private persistStateDebounced; } export declare const responseCache: ResponseCache; /** URI scheme/prefix for cached responses exposed as MCP resources. */ export declare const RESPONSE_RESOURCE_PREFIX = "xcmcp://response/"; /** Build the resource URI for a cached response id. */ export declare function responseResourceUri(cacheId: string): string; /** * Build an MCP `resource_link` content block for a cached response. * Lets spec-aware clients fetch the full output via the resources API instead of * round-tripping through a *-get-details tool call. The opaque cache id is preserved * elsewhere in the response for older clients. */ export declare function responseResourceLink(cacheId: string, tool: string, description: string): { type: 'resource_link'; uri: string; name: string; description: string; mimeType: string; }; export declare function extractBuildSummary(output: string, stderr: string, exitCode: number): { success: boolean; exitCode: number; errorCount: number; warningCount: number; duration: number | undefined; target: string | undefined; hasErrors: boolean; hasWarnings: boolean; firstError: string; buildSizeBytes: number; }; export declare function extractTestSummary(output: string, stderr: string, exitCode: number): { success: boolean; exitCode: number; testsRun: number; passed: boolean; resultSummary: string[]; }; interface SimulatorDeviceForSummary { isAvailable: boolean; state: string; name: string; udid: string; lastUsed?: Date; } interface CachedSimulatorList { devices: Record; lastUpdated: Date; } export declare function extractSimulatorSummary(cachedList: CachedSimulatorList): { totalDevices: number; availableDevices: number; bootedDevices: number; deviceTypes: string[]; commonRuntimes: string[]; lastUpdated: Date; cacheAge: string; bootedList: { name: string; udid: string; state: string; runtime: string; }[]; recentlyUsed: { name: string; udid: string; lastUsed: string; }[]; }; interface SimulatorSummary { totalDevices: number; availableDevices: number; bootedDevices: number; deviceTypes: string[]; commonRuntimes: string[]; lastUpdated: Date; cacheAge: string; bootedList: Array<{ name: string; udid: string; state: string; runtime: string; }>; recentlyUsed: Array<{ name: string; udid: string; lastUsed: string; }>; } interface SimulatorFilters { deviceType?: string; runtime?: string; availability?: string; } export declare function createProgressiveSimulatorResponse(summary: SimulatorSummary, cacheId: string, filters: SimulatorFilters): { cacheId: string; summary: { totalDevices: number; availableDevices: number; bootedDevices: number; deviceTypes: string[]; commonRuntimes: string[]; lastUpdated: string; cacheAge: string; }; quickAccess: { bootedDevices: { name: string; udid: string; state: string; runtime: string; }[]; recentlyUsed: { name: string; udid: string; lastUsed: string; }[]; recommendedForBuild: { name: string; udid: string; state: string; runtime: string; }[] | { name: string; udid: string; lastUsed: string; }[]; }; nextSteps: string[]; availableDetails: string[]; smartFilters: { commonDeviceTypes: string[]; commonRuntimes: string[]; suggestedFilters: string; }; }; export {}; //# sourceMappingURL=response-cache.d.ts.map