@ferricstore/ferricstore
    Preparing search index...

    Interface SessionHistoryRewriteAwareSession

    Interface representing a persistent session store for conversation history.

    interface SessionHistoryRewriteAwareSession {
        addItems(items: AgentInputItem[]): Promise<void>;
        applyHistoryMutations(
            args: SessionHistoryRewriteArgs,
        ): void | Promise<void>;
        clearSession(): Promise<void>;
        getItems(limit?: number): Promise<AgentInputItem[]>;
        getSessionId(): Promise<string>;
        popItem(): Promise<AgentInputItem | undefined>;
        prepareHistoryItemForModelInput?(item: AgentInputItem): AgentInputItem;
        prepareHistoryItemsForPersistenceComparison?(
            items: AgentInputItem[],
        ): AgentInputItem[];
        preserveReasoningItemIdsForPersistence?(): boolean;
        replaceHistoryWithCompaction?(items: AgentInputItem[]): Promise<void>;
    }

    Hierarchy (View Summary)

    • Session
      • SessionHistoryRewriteAwareSession

    Implemented by

    Index
    • Optionally replace the logical session history with a compaction marker and its retained suffix without resetting the session identity.

      Implementations may append the replacement when their backend treats the leading compaction item as the authoritative replay boundary. If this method is absent, the runner falls back to clearing and rebuilding the session with rollback protection.

      Parameters

      Returns Promise<void>