UNPKG

@struktoai/mirage-core

Version:

A Unified Virtual Filesystem For AI Agents

27 lines • 1.32 kB
import type { GitHubAccessor } from '../../accessor/github.ts'; import { type FileEvent, type JsonValue, type PathSpec } from '../../types.ts'; /** * Map one GitHub `push` webhook delivery onto mount paths. * * The consumer owns the receiver (a repository webhook for `push`) and passes * the event name from the `X-GitHub-Event` header with the JSON body. Nothing * here runs a loop. A mount reads one ref of one repository, so only a push to * that ref maps to anything. * * Each pushed commit lists the paths it added, removed and modified, so a * path's change is its first and last action across the push: one added and * then removed within the push never existed outside it and maps to nothing. * A forced push, a branch created or deleted, and a push at GitHub's commit cap * do not say what changed between the old head and the new one, so the whole * mount is UNKNOWN. Each event evicts the root listing above it, so the next * read fetches the new head's tree. * * Mirrors Python `GitHubEventHook` (`core/github/events.py`). */ export declare class GitHubEventHook { private readonly accessor; constructor(accessor: GitHubAccessor); toEvents(root: PathSpec, eventName: string, payload: JsonValue): Promise<readonly FileEvent[]>; private map; } //# sourceMappingURL=events.d.ts.map