#!/usr/bin/env node
/**
 * Hippo Memory MCP Server
 *
 * Exposes hippo memory as MCP tools over stdio transport.
 * Uses the programmatic API directly (no child process spawning).
 *
 * Usage: hippo mcp (or npx hippo-memory mcp)
 */
/** Test-only: reset the module-level recall-history Map. Call from beforeEach. */
export declare function __resetSessionRecallHistoryMcp(): void;
interface McpRequest {
    jsonrpc: '2.0';
    id: number | string;
    method: string;
    params?: Record<string, unknown>;
}
interface McpResponse {
    jsonrpc: '2.0';
    id: number | string;
    result?: unknown;
    error?: {
        code: number;
        message: string;
    };
}
export type { McpRequest, McpResponse };
/**
 * Optional execution context threaded from a non-stdio transport. When the
 * HTTP transport in src/server.ts calls handleMcpRequest, it knows the
 * server's bound hippoRoot and the auth-resolved tenantId/actor. Passing
 * those through here lets executeTool skip the findHippoRoot() walk and
 * the env-based resolveTenantId({}) fallback — both of which would
 * otherwise produce the wrong store and the wrong tenant for HTTP callers.
 *
 * Stdio callers pass nothing; behavior stays unchanged for that path.
 */
export interface McpContext {
    hippoRoot: string;
    tenantId: string;
    actor: string;
    /**
     * Per-client key for state isolation under HTTP-MCP. For stdio: 'stdio-${pid}'
     * (one process = one client). For HTTP-SSE / HTTP MCP: hash(bearer + remoteAddr)
     * built by src/server.ts when constructing McpContext for the request.
     * Optional for backwards compatibility; defaults to `${tenantId}:default`.
     */
    clientKey?: string;
}
/**
 * Transport-agnostic MCP dispatcher. Both the stdio loop (below) and the
 * HTTP/SSE transport in src/server.ts route every incoming JSON-RPC message
 * through this single function. Returns null for notifications (no response
 * expected) and a McpResponse otherwise. Errors thrown by `executeTool` are
 * the caller's problem — wrap with try/catch on the transport side.
 */
export declare function handleMcpRequest(req: McpRequest, ctx?: McpContext): Promise<McpResponse | null>;
/**
 * Wire stdin/stdout to the dispatcher. Idempotent — only the entrypoint
 * (cli.ts `hippo mcp`, or running this file directly) should call this.
 * src/server.ts imports `handleMcpRequest` without invoking this, so the
 * HTTP daemon does not steal stdin or exit when its parent closes a pipe.
 */
export declare function startStdioLoop(): void;
//# sourceMappingURL=server.d.ts.map