UNPKG

@struktoai/mirage-core

Version:

A Unified Virtual Filesystem For AI Agents

32 lines • 1.62 kB
import type { DropboxAccessor } from '../../accessor/dropbox.ts'; import { Delta, type PathSpec } from '../../types.ts'; import type { DeltaHook } from '../../events/base.ts'; /** * What changed under a Dropbox event root since the last cursor, for the * consumer to call when Dropbox pings. * * Dropbox's push (a webhook, or `list_folder/longpoll` answering `changes`) * names only the account, so each ping is answered by one * `list_folder/continue` from the stored cursor. A baseline takes a cursor at * the present with `get_latest_cursor` and lists nothing. * * A row names its path, so a delete is a DELETE where it was, and a move is * its old path deleted and its new rows. A row does not say whether a file was * made or replaced, so the checkpoint keeps each path a pull has reported with * its `content_hash`: a path seen before is an UPDATE, or nothing when its * content did not change, and any other is a CREATE. A cursor Dropbox resets * answers UNKNOWN on the event root and a fresh cursor; a root Dropbox cannot * find has no cursor, and the pull that finds it again reports the root * UNKNOWN. * * Mirrors Python `DropboxDeltaHook` (`core/dropbox/events.py`). */ export declare class DropboxDeltaHook implements DeltaHook { private readonly accessor; constructor(accessor: DropboxAccessor); /** A cursor at the root's present, '' when Dropbox cannot find it. */ private latest; pull(root: PathSpec, checkpoint: string | null): Promise<Delta>; } export declare function buildDeltaHook(accessor: DropboxAccessor): DeltaHook; //# sourceMappingURL=events.d.ts.map