import { Config } from "../config/schema.js"; /** * Structured logger for the MCP server. * * IMPORTANT: this server can run over stdio transport. * Stdout is reserved for the MCP JSON-RPC stream and must never be used for logs. * Write logs to stderr (or files) only. * * Tool-call logs are the primary data source for v2 tool design. * Every call records: tool name, args, success/failure, duration, result size. * * Logs are written as JSONL to a file, one line per event. */ export type LogLevel = "debug" | "info" | "warn" | "error"; export declare function initLogging(config: Config): void; export declare function log(level: LogLevel, message: string, data?: unknown): void; export declare const logger: { debug(message: string, data?: unknown): void; info(message: string, data?: unknown): void; warn(message: string, data?: unknown): void; error(message: string, data?: unknown): void; }; export type StatusEvent = { type: "startup_begin"; serverName: string; serverVersion: string; } | { type: "config_loaded"; configPath: string; serverId: string; serverName: string; serverVersion: string; } | { type: "identity_ready"; serverId: string; serverName: string; serverVersion: string; } | { type: "token_loaded"; } | { type: "moodle_probe_begin"; moodleUrl: string; } | { type: "moodle_probe_ok"; capabilityCount: number; } | { type: "moodle_probe_failed"; code: "moodle_unreachable" | "capability_probe_failed"; stage: "moodle_probe"; message: string; } | { type: "cache_warm_ok"; } | { type: "cache_warm_failed"; reason: string; } | { type: "plugin_loaded"; pluginId: string; pluginVersion: string; entryPath: string; toolCount: number; } | { type: "plugin_skipped"; reasonCode: "path_missing" | "package_invalid" | "entry_missing" | "load_failed" | "export_missing" | "manifest_invalid" | "tools_invalid" | "capability_missing" | "initialize_failed"; message: string; entryPath?: string; pluginId?: string; } | { type: "ready"; toolCount: number; pluginCount: number; } | { type: "shutdown_begin"; signal: string; } | { type: "fatal"; code: "config_invalid" | "config_unwritable" | "token_missing" | "moodle_unreachable" | "capability_probe_failed" | "plugin_load_failed" | "server_start_failed"; stage: "config" | "token" | "moodle_probe" | "plugins" | "server_connect" | "startup"; message: string; }; export declare function emitStatus(event: StatusEvent): void; /** * Log a tool invocation with timing and outcome. * This is the primary telemetry that feeds v2 tool design. */ export interface ToolCallLogEntry { event: "tool_call"; tool: string; args: unknown; success: boolean; durationMs: number; resultSize?: number; error?: string; ts: string; } export declare function logToolCall(entry: Omit): void; //# sourceMappingURL=index.d.ts.map