import { type OmkToolPrefixSpec } from "./tool-registry-contract.js";
export interface ImmutablePrefixInput {
    readonly systemPrompt: string;
    readonly toolSpecs?: readonly OmkToolPrefixSpec[];
    readonly fewShots?: readonly string[];
    readonly pinnedMemory?: readonly string[];
}
export interface ImmutablePrefixHashes {
    readonly systemPromptHash: string;
    readonly toolSpecsHash: string;
    readonly fewShotsHash: string;
    readonly pinnedMemoryHash: string;
    readonly prefixHash: string;
}
export interface ImmutablePrefix {
    readonly schemaVersion: 1;
    readonly systemPrompt: string;
    readonly toolSpecs: readonly OmkToolPrefixSpec[];
    readonly fewShots: readonly string[];
    readonly pinnedMemory: readonly string[];
    readonly hashes: ImmutablePrefixHashes;
}
export type AppendOnlyLogRole = "user" | "assistant" | "tool" | "system";
export interface AppendOnlyLogEntry {
    readonly role: AppendOnlyLogRole;
    readonly content: string;
    readonly createdAt?: string;
    readonly name?: string;
}
export interface VolatileScratch {
    readonly notes?: readonly string[];
    readonly planState?: unknown;
    readonly diagnostics?: readonly CacheDiagnostic[];
}
export type CacheDiagnosticLevel = "info" | "warning";
export type CacheDiagnosticCode = "prefix_initialized" | "prefix_changed" | "system_prompt_changed" | "tool_specs_changed" | "few_shots_changed" | "pinned_memory_changed" | "scratch_reset";
export interface CacheDiagnostic {
    readonly level: CacheDiagnosticLevel;
    readonly code: CacheDiagnosticCode;
    readonly message: string;
    readonly previousHash?: string;
    readonly currentHash?: string;
}
export interface OmkSessionState {
    readonly schemaVersion: 1;
    readonly prefix: ImmutablePrefix;
    readonly log: readonly AppendOnlyLogEntry[];
    readonly scratch: VolatileScratch;
    readonly diagnostics: readonly CacheDiagnostic[];
}
export declare function buildImmutablePrefix(input: ImmutablePrefixInput): ImmutablePrefix;
export declare function createOmkSessionState(input: ImmutablePrefixInput): OmkSessionState;
export declare function appendLogEntry(state: OmkSessionState, entry: AppendOnlyLogEntry): OmkSessionState;
export declare function resetScratch(state: OmkSessionState, scratch?: VolatileScratch): OmkSessionState;
export declare function diffImmutablePrefix(previous: ImmutablePrefix, next: ImmutablePrefix): CacheDiagnostic[];
