@gork-labs/secondbrain-mcp
Version:
Second Brain MCP Server - Agent team orchestration with dynamic tool discovery
36 lines (35 loc) • 1.19 kB
TypeScript
import { SubAgentResponse } from './types.js';
export interface ParseRetryOptions {
maxRetries?: number;
retryCallback?: (originalContent: string, attempt: number) => Promise<string>;
}
/**
* Enhanced response parser with automatic retry and format correction
*/
export declare class ResponseParser {
private static readonly DEFAULT_MAX_RETRIES;
/**
* Parse sub-agent response with retry mechanism
*/
static parseWithRetry(responseText: string, chatmodeName: string, options?: ParseRetryOptions): Promise<SubAgentResponse>;
/**
* Parse content without retry (original behavior)
*/
static parseContent(responseText: string, chatmodeName: string): SubAgentResponse;
/**
* Attempt automatic format correction on malformed responses
*/
private static attemptFormatCorrection;
/**
* Create fallback response when all parsing attempts fail
*/
private static createFallbackResponse;
/**
* Extract analysis-like content from plain text
*/
private static extractAnalysisFromText;
/**
* Extract recommendations from plain text
*/
private static extractRecommendationsFromText;
}