/**
 * Activity adapter contract.
 *
 * Each adapter is a pure function that reads Automerge docs from syncServer
 * and returns activity entries. No side effects, no module imports.
 */

import type { ActivityCacheEntry } from '../schemas';

export interface AdapterContext {
	/** SyncServer instance for reading docs */
	syncServer: { getDoc<T>(docId: string): any; listDocs(): string[] };
	/** Space slug */
	space: string;
	/** Only return entries newer than this timestamp */
	since: number;
	/** Base URL for generating links (e.g. https://demo.rspace.online) */
	baseUrl: string;
}

export type AdapterFn = (ctx: AdapterContext) => ActivityCacheEntry[];
