/** * Claude Code Connector * Specialized subprocess connector for Claude Code CLI */ import type { TrajectoryStep } from '../../../types/index.js'; import { SubprocessConnector } from '../../../services/connectors/subprocess/SubprocessConnector.js'; import type { ConnectorAuth, ConnectorRequest, ConnectorProgressCallback, SubprocessConfig } from '../../../services/connectors/types.js'; /** * MCP server definition for Claude Code --mcp-config flag */ export interface ClaudeCodeMCPServer { command: string; args?: string[]; env?: Record; } /** * Configuration options for Claude Code connector * Passed via agent.connectorConfig in agent-health.config.ts */ export interface ClaudeCodeConnectorConfig { env?: Record; dangerouslySkipPermissions?: boolean; allowedTools?: string[]; disallowedTools?: string[]; appendSystemPrompt?: string; systemPrompt?: string; /** Path to a standard MCP config JSON file (passed to --mcp-config) */ mcpConfigPath?: string; /** Inline MCP server definitions (used when mcpConfigPath is not set) */ mcpServers?: Record; strictMcpConfig?: boolean; usePromptArg?: boolean; workingDir?: string; timeout?: number; additionalArgs?: string[]; } /** * Claude Code CLI Connector * Invokes Claude Code as a subprocess for agent evaluation */ export declare class ClaudeCodeConnector extends SubprocessConnector { readonly type: "claude-code"; readonly name = "Claude Code CLI"; traceContext: { propagateEnv: boolean; serviceName: string; }; private outputBuffer; private thinkingBuffer; private textBuffer; private isInThinking; /** * Claude Code's `session_id` (present on every stream-json event). Captured * for Strategy D trace correlation — it equals the `session.id` attribute * Claude Code stamps on its OTel spans. Surfaced to the report via * {@link extraResultMetadata}. */ private sessionId?; constructor(config?: Partial); /** * Build prompt for Claude Code * Structures the input to get the best RCA results */ buildPayload(request: ConnectorRequest): string; /** * Parse Claude Code streaming output (stream-json format) * Each line is a JSON object with type and content */ protected parseStreamingOutput(chunk: string, trajectory: TrajectoryStep[], onProgress?: ConnectorProgressCallback): void; /** * Parse a single JSON event from stream-json output */ private parseJsonEvent; /** * Parse final output for Claude Code */ parseResponse(data: { stdout: string; stderr: string; exitCode: number; }): TrajectoryStep[]; /** * Reset state for new execution */ private resetState; /** * Flush remaining buffers when the subprocess stream ends. */ protected onBeforeStreamEnd(trajectory: TrajectoryStep[], onProgress?: ConnectorProgressCallback): void; /** * Build CLI args from ClaudeCodeConnectorConfig */ private buildConfigArgs; /** * Override execute to reset state and apply connectorConfig */ execute(endpoint: string, request: ConnectorRequest, auth: ConnectorAuth, onProgress?: ConnectorProgressCallback, onRawEvent?: (event: any) => void): Promise; /** * Health check - verify claude command exists */ healthCheck(endpoint: string, auth: ConnectorAuth): Promise; /** * Surface the captured Claude Code `session_id` so the runner can persist it * as `report.sessionId` for Strategy D trace correlation. */ protected extraResultMetadata(): Record; } /** * Create a Claude Code connector with specific Bedrock configuration */ export declare function createBedrockClaudeCodeConnector(): ClaudeCodeConnector; /** * Default instance for convenience */ export declare const claudeCodeConnector: ClaudeCodeConnector; //# sourceMappingURL=ClaudeCodeConnector.d.ts.map