import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { type AuditEntry } from "@danielblomma/cortex-core/audit/writer"; export declare const name = "cortex-enterprise"; export declare const version: string; type ToolExecutionEvent = { phase: "start" | "success" | "error"; tool: string; timestamp: string; input: Record; query?: string; query_length?: number; result_count?: number; estimated_tokens_saved?: number; entities_returned?: string[]; rules_applied?: string[]; duration_ms?: number; error?: string; }; type SessionCallRecord = { tool: string; query?: string; resultCount: number; time: string; outcome?: "success" | "error"; duration_ms?: number; error?: string; }; type SessionEvent = { phase: "start" | "end"; timestamp: string; duration_ms?: number; tool_calls?: number; successful_tool_calls?: number; failed_tool_calls?: number; calls?: SessionCallRecord[]; }; export declare function shutdown(): void; /** * Telemetry hook called by cortex core after each tool execution. * Wired up via the CortexPlugin.onToolCall interface. */ export declare function onToolCall(toolName: string, resultCount: number, tokensSaved: number): void; export declare function onToolEvent(event: ToolExecutionEvent): void; /** * Unified entry point for enterprise-tool activity. Replaces the previous * `auditWriter.log({...})` pattern: records the same audit entry AND bumps * the telemetry collector so dashboard counters move. Callers pass the * existing audit-shape object plus an optional `tokens_saved` (defaults 0). */ export type ToolActivity = AuditEntry & { tokens_saved?: number; }; export declare function recordToolActivity(activity: ToolActivity): void; /** * Session-end hook called by cortex core on shutdown. * Awaited with a timeout — this is the reliable telemetry push path. */ export declare function onSessionEnd(): Promise; export declare function onSessionEvent(event: SessionEvent): Promise; export declare function register(server: McpServer): Promise; export {}; //# sourceMappingURL=index.d.ts.map