UNPKG

@struktoai/mirage-core

Version:

A Unified Virtual Filesystem For AI Agents

39 lines • 2.22 kB
import type { GCalAccessor } from '../../accessor/gcal.ts'; import { Delta, type JsonValue, type PathSpec } from '../../types.ts'; import type { DeltaHook } from '../../events/base.ts'; /** * The files an event is: one per day it covers that the mount's scope holds, * named as the bucket listing names it. A bucket whose listing leaves the * event out (it falls outside the mount's time range) holds none of it. * Mirrors Python's `event_paths`. */ export declare function eventPaths(accessor: GCalAccessor, base: string, event: Record<string, JsonValue>, tz: string, freeBusy: boolean): string[]; /** * Checkpointed delta over Calendar's incremental sync. Each calendar's * checkpoint holds its sync token and, by event id, the files the event is and * its `updated` stamp. An event names no file itself (its files follow from its * start, its title and the days it covers), so the files it was are what the * checkpoint remembers: an event moved or renamed is its old files leaving and * its new ones appearing, and a deleted one comes back `cancelled`, which * leaves every file it was. A token Calendar no longer honors (410) is answered * by listing the calendar whole and comparing each event's stamp, so nothing is * lost or reported twice. A calendar added to or removed from the account is * its directory appearing or leaving, and its own details changed are its * calendar.json, which the checkpoint keeps as it was rendered. The checkpoint * also keeps the zone days are bucketed in: when it moves, every event's files * may move, so each calendar is synced whole again. Mirrors Python's * GCalDeltaHook. */ export declare class GCalDeltaHook implements DeltaHook { private readonly accessor; constructor(accessor: GCalAccessor); pull(root: PathSpec, checkpoint: string | null): Promise<Delta>; /** * One calendar's events since its last sync, recorded as changes to its * files, and its state after them. Mirrors Python's `_sync`. */ private sync; } /** Build the Calendar delta hook (`GCalDeltaHook`). Mirrors Python's `build_delta_hook`. */ export declare function buildDeltaHook(accessor: GCalAccessor): DeltaHook; //# sourceMappingURL=events.d.ts.map