import { TSchema } from '@sinclair/typebox'; interface RemnicPiConfig { remnicDaemonUrl: string; authToken?: string; namespace?: string; recallMode: "auto" | "minimal" | "full" | "graph_mode" | "no_recall"; recallTopK: number; recallBudgetChars: number; recallEnabled: boolean; observeEnabled: boolean; observeSkipExtraction: boolean; compactionEnabled: boolean; mcpToolsEnabled: boolean; statusEnabled: boolean; requestTimeoutMs: number; startupRequestTimeoutMs: number; } interface LoadConfigOptions { configPath?: string; env?: NodeJS.ProcessEnv; } interface RecallResponse { context?: string; results?: Array<{ id?: string; content?: string; score?: number; category?: string; }>; count?: number; } interface ObserveMessagePart { ordinal?: number; kind: "text" | "tool_call" | "tool_result" | "patch" | "file_read" | "file_write" | "step_start" | "step_finish" | "snapshot" | "retry"; payload: Record; toolName?: string | null; filePath?: string | null; createdAt?: string | null; } interface ObserveMessage { role: "user" | "assistant"; content: string; sourceFormat?: "pi"; rawContent?: unknown; parts?: ObserveMessagePart[]; } interface McpTool { name: string; description?: string; inputSchema?: Record; } declare class RemnicClient { private readonly config; private requestId; constructor(config: RemnicPiConfig); health(options?: RequestOptions): Promise>; recall(query: string, sessionKey: string, cwd: string): Promise; recallExplain(sessionKey: string): Promise>; observe(sessionKey: string, cwd: string, messages: ObserveMessage[]): Promise>; storeMemory(content: string, sessionKey: string): Promise>; lcmSearch(query: string, sessionKey: string, limit?: number): Promise>; lcmCompactionFlush(sessionKey: string): Promise>; lcmCompactionRecord(sessionKey: string, tokensBefore: number, tokensAfter: number): Promise>; contextCheckpoint(sessionKey: string, context: string): Promise>; mcpListTools(options?: RequestOptions): Promise; mcpTool(name: string, args: Record): Promise>; private request; private mcpRequest; } interface RequestOptions { timeoutMs?: number; } declare function textFromMessage(message: unknown): string; type PiApi = { on(event: string, handler: (event: any, ctx: any) => unknown | Promise): void; registerCommand(name: string, options: { description?: string; handler: (args: string, ctx: any) => Promise; }): void; registerTool(tool: Record): void; appendEntry(customType: string, data?: T): void; }; interface RemnicPiExtensionOptions extends LoadConfigOptions { config?: RemnicPiConfig; } declare function createRemnicPiExtension(options?: RemnicPiExtensionOptions): (pi: PiApi) => Promise; declare function remnicPiExtension(pi: PiApi): Promise; declare function toPiToolParametersSchema(inputSchema: unknown): TSchema; declare function stripSessionOwnedSchemaFields(inputSchema: unknown): Record; declare function stripSessionOwnedRuntimeFields(value: unknown): unknown; declare function observeMessages(ctx: any, client: RemnicClient, rawMessages: unknown[], observedHashes: Set, liveObservedReplayKeys?: Map): Promise; declare function buildCompactionSummary(preparation: any): string; export { type RemnicPiExtensionOptions, buildCompactionSummary, createRemnicPiExtension, remnicPiExtension as default, observeMessages, stripSessionOwnedRuntimeFields, stripSessionOwnedSchemaFields, textFromMessage, toPiToolParametersSchema };