import { type McpToolAci, type McpToolExposure, type McpPublicApiContract } from '../types/sparkContracts';
/** MCP tool name prefix — derived from the server name `'smartperfetto'`.
 * `claudeMcpServer.ts` exports the same constant; both files agree
 * because both import from this module. The SDK consumes prefixed
 * names in its `allowedTools` array; the MCP protocol itself uses
 * short names. */
export declare const MCP_NAME_PREFIX = "mcp__smartperfetto__";
/** One tool stored in the registry. The `tool` object is the
 * SDK-shaped descriptor returned by `tool(...)` from
 * `@anthropic-ai/claude-agent-sdk`; `name` is the short name MCP uses
 * natively. */
export interface McpToolDefinition {
    /** Short MCP tool name (no prefix). */
    name: string;
    /** SDK tool descriptor — passed unmodified to `createSdkMcpServer`. */
    tool: unknown;
    /** Exposure level — drives stdio / A2A filtering downstream. */
    exposure: McpToolExposure;
    /** Human-readable summary surfaced via `getAci()`. Optional during
     * M0 because most existing tools already carry their own description
     * inside the SDK tool object; M1 populates this as it migrates the
     * description text to a stable place. */
    summary?: string;
    /** Required env vars or capability flags. */
    requires?: string[];
}
export interface ToolRequestScope {
    sessionId: string;
    hasCodebaseAccess: boolean;
    capabilities?: string[];
}
/**
 * Filter the registry contents by one or more exposure levels.
 *
 * Useful for stdio adapter (`['public']`) or admin-only paths
 * (`['internal']`). The default `claudeMcpServer.ts` consumer takes
 * everything, including internal session-protocol tools, because the
 * Claude SDK is the agent itself and is the legitimate caller of
 * those tools.
 */
export declare function filterByExposure(defs: readonly McpToolDefinition[], exposures: readonly McpToolExposure[]): McpToolDefinition[];
/** Derive the SDK `allowedTools` array — short names with the
 * SmartPerfetto prefix. Order is preserved so callers that care
 * about deterministic ordering get it. */
export declare function buildAllowedTools(defs: readonly McpToolDefinition[]): string[];
/**
 * The McpToolRegistry collects tool definitions and emits the views
 * the existing `claudeMcpServer.ts` consumer needs (SDK server +
 * allowedTools list) plus the views M1 will need (stdio dispatcher,
 * ACI snapshot for `McpPublicApiContract`).
 *
 * Stateful registration order matters — the SDK uses array order to
 * match `allowedTools[i]` to `tools[i]`. `register()` appends; later
 * calls cannot reorder the registry.
 */
export declare class McpToolRegistry {
    private readonly entries;
    /** Add a tool to the registry. Does NOT prevent duplicates by
     * name; callers control ordering and uniqueness explicitly so the
     * existing conditional registration patterns
     * (`if (writeAnalysisNote) registry.register(...)`) keep working. */
    register(def: McpToolDefinition): void;
    /** Convenience for the existing call sites that pass `(tool,
     * name)` — keeps the migration patch in `claudeMcpServer.ts`
     * minimal. */
    registerSdk(tool: unknown, name: string, exposure: McpToolExposure, extras?: Pick<McpToolDefinition, 'summary' | 'requires'>): void;
    /** Read-only view of every entry in registration order. */
    list(): readonly McpToolDefinition[];
    listForRequest(scope: ToolRequestScope): McpToolDefinition[];
    /** Build the SDK's in-process MCP server. The SDK names the server
     * `smartperfetto` to align with `MCP_NAME_PREFIX`; that linkage is
     * preserved here. */
    buildSdkServer(opts?: {
        name?: string;
        version?: string;
        scope?: ToolRequestScope;
    }): import("@anthropic-ai/claude-agent-sdk").McpSdkServerConfigWithInstance;
    /** Allowed-tools array prefixed for the SDK call site. Matches the
     * exact format `claudeMcpServer.ts` returned before the refactor. */
    buildAllowedTools(scope?: ToolRequestScope): string[];
    /** Snapshot of the registry as `McpToolAci[]` — drives the future
     * `McpPublicApiContract.tools` field once M1 populates summary /
     * inputSchema / examples per tool. M0 emits a minimal ACI with
     * just name + qualified name + exposure; the description / schema
     * fields stay optional so older snapshots remain readable. */
    getAci(scope?: ToolRequestScope): McpToolAci[];
    /** Build a minimal `McpPublicApiContract` for export / inspection.
     * `agentCards` is empty for now (Plan 41 M2 populates it once A2A
     * is opt-in enabled). */
    buildPublicApiContract(opts?: {
        serverVersion?: string;
        protocolVersion?: string;
        scope?: ToolRequestScope;
    }): McpPublicApiContract;
    /** Number of registered tools — useful in tests. */
    size(): number;
    probeCapabilities(scope: ToolRequestScope): {
        codeAwareAvailable: boolean;
        reason?: 'feature_disabled' | 'no_codebase_configured' | 'no_permission' | 'consent_required_but_missing';
    };
}
//# sourceMappingURL=mcpToolRegistry.d.ts.map