import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { ToolHistoryReader } from "@mono-agent/agent-harness"; import type { ToolPolicyInput } from "@mono-agent/agent-harness"; import * as z from "zod/v4"; import type { RuntimeOptionsExtension } from "./runtime-option-extensions.js"; export declare const SESSION_HISTORY_MCP_SERVER_NAME = "mono-agent-session-history"; export declare const SESSION_HISTORY_TOOL_NAME = "SessionHistory"; declare const SESSION_HISTORY_INPUT_SCHEMA: z.ZodObject<{ action: z.ZodOptional>; query: z.ZodOptional; tools: z.ZodOptional>; states: z.ZodOptional>>; runIds: z.ZodOptional>; fromMs: z.ZodOptional; toMs: z.ZodOptional; includeIsolated: z.ZodOptional; limit: z.ZodOptional; recordId: z.ZodOptional; toolCallId: z.ZodOptional; chunkBytes: z.ZodOptional; cursor: z.ZodOptional; }, z.core.$strict>; type SessionHistoryInput = z.infer; type SessionHistoryToolPolicy = Pick; export interface SessionHistoryBinding { readonly reader: ToolHistoryReader; readonly conversationId: string; readonly logicalConversationId: string; readonly runId: string; } export interface SessionHistoryRuntimeExtensionOptions { readonly historyRoot: string; readonly rollover?: "none" | "daily"; readonly onUnavailable?: (error: unknown) => void; } /** Resolve canonical, legacy, MCP-prefixed, and server-wildcard policy spellings. */ export declare function isSessionHistoryToolAllowed(policy: SessionHistoryToolPolicy | undefined): boolean; export declare function createSessionHistoryServer(binding: SessionHistoryBinding): McpServer; export declare function createSessionHistoryRuntimeExtension(options: SessionHistoryRuntimeExtensionOptions): RuntimeOptionsExtension; /** @internal Exported for focused authorization and cursor tests. */ export declare function handleSessionHistoryRequest(binding: SessionHistoryBinding, input: SessionHistoryInput): { content: { type: "text"; text: string; }[]; structuredContent: { action: "search" | "get"; error: { code: string; message: string; }; untrusted: true; notice: string; }; isError: boolean; } | { content: { readonly type: "text"; readonly text: string; }[]; structuredContent: { action: "get"; tombstone: { readonly recordId: string; readonly reason: string; readonly removedAtMs: number; }; untrusted: true; notice: string; }; } | { content: { readonly type: "text"; readonly text: string; }[]; structuredContent: { action: "get"; record: { nextCursor?: string; truncated: boolean; originalBytes: number; retainedBytes: number; recovered: boolean; isolated: boolean; artifactReferences: readonly import("@mono-agent/agent-harness").ToolHistoryArtifactReference[]; chunk: unknown; chunkOffset: number; detailCode?: string; failureKind?: string; state?: import("@mono-agent/runtime-adapter").RuntimeToolLifecycleTerminalState; recordId: string; runId: string; toolCallId: string; toolName: string; phase: "result" | "invocation"; sequence: number; }; untrusted: true; notice: string; }; } | { content: { readonly type: "text"; readonly text: string; }[]; structuredContent: { untrusted: true; notice: string; nextCursor?: string; action: "search"; items: { isolated: boolean; recovered: boolean; preview: unknown; truncated: boolean; artifactReferences: readonly import("@mono-agent/agent-harness").ToolHistoryArtifactReference[]; untrusted: true; endedAtMs?: number; startedAtMs: number; state?: import("@mono-agent/runtime-adapter").RuntimeToolLifecycleTerminalState; endSequence?: number; runId: string; toolCallId: string; toolName: string; startSequence: number; resultRecordId?: string; recordId: string; }[]; count: number; hasMore: boolean; }; }; export {}; //# sourceMappingURL=session-history.d.ts.map