Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

790 B
Raw Blame
import { createReplicaState, type ReplicaState } from '@/libs/replica';
import type {
  CompareHistoryItemsOutput,
  ListHistoryOutput,
} from '@/server/routers/lambda/_schema/documentHistory';

export interface DocumentHistoryState {
  /** Head-vs-version diffs, keyed by `documentHistoryCompareKey`. */
  historyCompareMap: Record<string, CompareHistoryItemsOutput>;
  historyCompareReplica: ReplicaState<CompareHistoryItemsOutput>;
  /** Version list per document. */
  historyListMap: Record<string, ListHistoryOutput>;
  historyListReplica: ReplicaState<ListHistoryOutput>;
}

export const initialDocumentHistoryState: DocumentHistoryState = {
  historyCompareMap: {},
  historyCompareReplica: createReplicaState(),
  historyListMap: {},
  historyListReplica: createReplicaState(),
};