import { NewSessionRequest } from '@agentclientprotocol/sdk';
import { McpServerConfig } from '@anthropic-ai/claude-agent-sdk';
import { LocalMcpServerScope, LocalMcpServerDescriptor } from '@posthog/shared';
import { L as Logger } from '../../../logger-RC7sPv0S.js';
import '../../../types.js';
import '@posthog/shared/domain-types';

interface ClaudeJsonMcpServerEntry {
    name: string;
    scope: LocalMcpServerScope;
    config: McpServerConfig;
}
/**
 * Reads the user's MCP servers from ~/.claude.json: the top-level `mcpServers`
 * section plus, when `cwd` is given, the `projects[cwd].mcpServers` section. A
 * project-scoped server replaces a user-scoped one with the same name,
 * matching how Claude Code merges the two sections.
 */
declare function loadUserClaudeJsonMcpServerEntries(cwd?: string, logger?: Logger, homeDir?: string): ClaudeJsonMcpServerEntry[];
declare function loadUserClaudeJsonMcpServers(cwd: string, logger?: Logger, homeDir?: string): Record<string, McpServerConfig>;
declare function sanitizeHeaders(headers: unknown): Record<string, string> | undefined;
/**
 * A raw ~/.claude.json entry parsed into a normalized transport, including the
 * stdio `env` that the relay executor needs to spawn the process (the
 * host-agnostic {@link LocalMcpTransport} deliberately drops it as secrets).
 * Both the descriptor normalizer ({@link toTransport}) and the relay's SDK
 * transport builder read entries through here, so they can't drift on how a
 * legacy bare-`url` or type-less entry is interpreted.
 */
type ParsedClaudeJsonTransport = {
    kind: "http" | "sse";
    url: string;
    headers?: Record<string, string>;
} | {
    kind: "stdio";
    command: string;
    args?: string[];
    env?: Record<string, string>;
} | {
    kind: "unknown";
};
declare function parseClaudeJsonTransport(config: McpServerConfig): ParsedClaudeJsonTransport;
/**
 * The user's ~/.claude.json MCP servers as host-agnostic descriptors
 * (`@posthog/shared`), with the raw config normalized per transport and stdio
 * `env` values dropped — they routinely hold secrets consumers of the
 * descriptor shape have no use for.
 */
declare function loadUserClaudeJsonMcpServerDescriptors(cwd?: string, logger?: Logger, homeDir?: string): LocalMcpServerDescriptor[];
declare function parseMcpServers(params: Pick<NewSessionRequest, "mcpServers">, logger?: Logger): Record<string, McpServerConfig>;

export { type ClaudeJsonMcpServerEntry, type ParsedClaudeJsonTransport, loadUserClaudeJsonMcpServerDescriptors, loadUserClaudeJsonMcpServerEntries, loadUserClaudeJsonMcpServers, parseClaudeJsonTransport, parseMcpServers, sanitizeHeaders };
