import type { OpenAPIPath } from '@redocly/openapi-docs/src/types';
import type { ApiFunctionsContext, ApiFunctionsContextMethods, PageStaticData } from '@redocly/config';
import type { CallToolResult, RequestId, RequestInfo, RequestMeta } from '@redocly/mcp-typescript-sdk/types.js';
import type { AuthInfo } from '@redocly/mcp-typescript-sdk/server/types.js';
import type { OpenAPIServer } from '@redocly/openapi-docs/lib/types/open-api.js';
import type { McpErrorCodes, McpServerType } from './constants';
import type { McpToolSchema } from '../../types';
type ObjectValues<T> = T[keyof T];
export type McpServerType = ObjectValues<typeof McpServerType>;
export type McpErrorCodeTypes = ObjectValues<typeof McpErrorCodes>;
export type ApiDescriptionInfo = {
    name: string;
    relativePath: string;
    description?: string;
    version?: string;
    servers?: OpenAPIServer[];
};
export type GraphqlDescriptionInfo = {
    name: string;
    relativePath: string;
    description?: string;
};
export type McpDocsStaticDataPropsConfig = {
    mcpDocsServerName: string;
    apiDescriptionsMap: Record<string, ApiDescriptionInfo>;
    graphqlDescriptions: GraphqlDescriptionInfo[];
};
export type McpDocsStaticData = PageStaticData & {
    props: {
        config: McpDocsStaticDataPropsConfig;
        serverOutDir?: string;
        tools?: McpToolSchema[];
    };
};
export type McpPath = {
    'x-mcp'?: XMcpConfig;
} & OpenAPIPath;
export type XMcpConfig = {
    docs?: {
        hide?: boolean;
    };
};
export type McpEndpoint = {
    'x-mcp'?: XMcpConfig;
    [key: string]: any;
};
export type McpMode = 'tools' | 'code';
export type McpPluginConfig = {
    readonly hide: boolean;
    readonly docs: {
        readonly hide: boolean;
        readonly name: string;
        readonly ignore: readonly string[];
    };
};
export type DocsServerDependencies = {
    apiDescriptionsMap: Record<string, ApiDescriptionInfo>;
    readonly name: string;
};
export type McpUserInfo = {
    email?: string;
    name?: string;
    sub?: string;
    aud?: string | string[];
    client_id?: string;
    scope?: string;
    iat?: number;
    exp?: number;
    [key: string]: any;
};
export type SemanticSearchResult = {
    title: string;
    url: string;
    content: string;
};
export type McpToolWorkerResponse = CallToolResult;
export type McpToolExtra = {
    sessionId?: string;
    authInfo?: AuthInfo;
    requestId: RequestId;
    requestInfo?: RequestInfo;
    _meta?: RequestMeta;
};
export type McpToolContext = Omit<ApiFunctionsContext, 'telemetry' | 'getKv' | keyof ApiFunctionsContextMethods> & {
    apiDescriptionsMap: Record<string, ApiDescriptionInfo>;
    graphqlDescriptions: GraphqlDescriptionInfo[];
    products?: string[];
    accessToken?: string;
    metadata?: Record<string, unknown>;
};
export type McpToolHandler<TArgs extends Record<string, unknown> = Record<string, unknown>> = (args: TArgs, context: McpToolContext, extra: McpToolExtra) => Promise<McpToolWorkerResponse>;
export type McpToolIsAvailable = (context: McpToolContext) => boolean | Promise<boolean>;
export type McpToolHandlerExtended<TArgs extends Record<string, unknown> = Record<string, unknown>> = {
    execute: McpToolHandler<TArgs>;
    isAvailable?: McpToolIsAvailable;
};
export type McpToolExecutionParams = {
    toolName: string;
    args: Record<string, unknown>;
    context: McpToolContext;
    extra: McpToolExtra;
};
export {};
//# sourceMappingURL=types.d.ts.map