import { MoodleClient } from "./client.js"; /** * Set of Web Services function names discovered on the Moodle instance. * Used at runtime by tools to check whether a required API is available, * rather than hardcoding version strings or build-time assumptions. */ export interface MoodleCapabilities { /** All available wsfunction names */ functions: Set; /** Core version string (e.g. "2024042200") */ version?: string; /** Release tag (e.g. "4.1.5 (Build: 20231204)") */ release?: string; /** Moodle site name */ siteName?: string; /** Authenticated username */ username?: string; /** Authenticated user id */ userId?: number; /** Whether the token belongs to a site administrator */ isSiteAdmin?: boolean; /** When the capability probe last completed */ probedAt: Date; } export interface ProbeOptions { allowDegraded?: boolean; } /** * Probe the Moodle instance for available Web Services functions. * Called once at startup — results are shared across all tool handlers. */ export declare function probeCapabilities(client: MoodleClient, options?: ProbeOptions): Promise; /** * Check whether a given wsfunction is available on the connected instance. */ export declare function hasCapability(caps: MoodleCapabilities, functionName: string): boolean; /** * Return the first available function name from a list of acceptable alternatives. * Use this when multiple Moodle WS functions can satisfy a tool requirement. * * NOTE: Currently capability == Moodle Web Services function name. * If we add non-WS data sources later, this should become a semantic * capability registry with WS being one resolver. */ export declare function resolveCapability(caps: MoodleCapabilities, candidates: string[]): string | null; //# sourceMappingURL=capabilities.d.ts.map