import type { McpProfile } from './transport.ts';
type ResourcesType = Map<string, {
    Resource: unknown;
    path: string;
    exportTypes: unknown;
    hasSubPaths: boolean;
    relativeURL: string;
}> & {
    getMatch?: (path: string, exportType?: string) => {
        Resource: unknown;
        path: string;
    } | undefined;
};
type OpenApiGenerator = (resources: ResourcesType, serverHttpURL: string) => unknown;
export interface AuthedUser {
    username?: string;
    role?: {
        role?: string;
        permission?: {
            super_user?: boolean;
            structure_user?: boolean;
            operations?: string[];
            [database: string]: boolean | string[] | undefined | {
                describe?: boolean;
                read?: boolean;
                tables?: {
                    [table: string]: undefined | {
                        read?: boolean;
                        describe?: boolean;
                        attribute_permissions?: unknown;
                    };
                };
            };
        };
    };
}
/** Public shape returned by `resources/list`. */
export interface ResourceDescriptor {
    uri: string;
    name: string;
    description?: string;
    mimeType?: string;
}
/** Public shape inside `resources/read` `contents[]`. */
export interface ResourceContent {
    uri: string;
    mimeType?: string;
    text?: string;
    blob?: string;
}
/** Public shape returned by `resources/templates/list`. */
export interface ResourceTemplate {
    uriTemplate: string;
    name: string;
    description?: string;
    mimeType?: string;
}
/** Test seam: replace the Resources registry the module reads. */
export declare function _setResourcesForTest(r: ResourcesType | undefined): void;
/** Test seam: replace the openapi generator. */
export declare function _setOpenApiGeneratorForTest(fn: OpenApiGenerator | undefined): void;
/** Test seam: replace the inferred application HTTP URL prefix. */
export declare function _setHttpUrlPrefixForTest(prefix: string | undefined): void;
export interface ListResourcesArgs {
    user: AuthedUser;
    profile: McpProfile;
    cursor?: string;
    limit?: number;
}
export interface ListResourcesResult {
    resources: ResourceDescriptor[];
    nextCursor?: string;
}
export declare function listResources(args: ListResourcesArgs): ListResourcesResult;
export declare function listResourceTemplates(profile: McpProfile): ResourceTemplate[];
export interface ReadResourceArgs {
    uri: string;
    user: AuthedUser;
    profile: McpProfile;
}
export interface ReadResourceOk {
    ok: true;
    contents: ResourceContent[];
}
export interface ReadResourceFail {
    ok: false;
    reason: string;
}
export declare function readResource(args: ReadResourceArgs): Promise<ReadResourceOk | ReadResourceFail>;
export {};
