@ferricstore/ferricstore
    Preparing search index...

    Interface Session

    Interface representing a persistent session store for conversation history.

    interface Session {
        addItems(items: AgentInputItem[]): 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)

    Implemented by

    Index
    • Optionally preserve reasoning item IDs when persisting generated output.

      Some remote session stores require provider-assigned reasoning identities to accept stored reasoning items, even when model replay should omit those IDs.

      Returns boolean

    • 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>