UNPKG

@struktoai/mirage-core

Version:

A Unified Virtual Filesystem For AI Agents

43 lines • 4.39 kB
import { GCalAccessor } from '../../accessor/gcal.ts'; import type { DeltaHook } from '../../events/base.ts'; import type { FileStat, PathSpec } from '../../types.ts'; import { type DirListing } from '../../types.ts'; import { BaseVFS } from '../base.ts'; import type { RedactedSchema } from '../secrets.ts'; import type { ConfigState, Handed } from '../types.ts'; import { GCalConfig } from './config.ts'; export declare const VFS_MD = "```text\n{prefix}\n primary/\n calendar.json\n {bucket}/\n <eventId>__{day}0900-1030_Team_Standup.gcal.json\n Engineering__team@group.calendar.google.com/\n {bucket}/\n ...\n```\n\nReading the tree:\n\n- `ls {prefix}/` lists the calendars. The primary one is always spelled\n `primary`; every other directory ends in `__<calendarId>`.\n- `ls {prefix}/primary/` lists buckets with events from all available\n history through today +90 days unless `end_time` is configured.\n `start_time`/`end_time` restrict this mount, including direct paths,\n date globs and event reads. A date glob such as\n `ls {prefix}/primary/2027-03-*` selects its own listing range within\n that scope, beyond the default future horizon.\n{layout}\n- `cat` an event for the unmodified Calendar API payload, including\n attendees, description, location and the original start and end with\n offsets.\n- `calendar.json` carries the calendar's `accessRole` and, in\n `bucketTimeZone`, the zone the buckets are cut in. That zone is\n mount-wide, so every calendar's `{bucket}/` covers the same hours.\n- On a calendar shared as free/busy only, Google returns no titles at\n all, so events render as `busy`.\n\nActing on it:\n\n- On a `write` path, `rm` an event file to delete that event for every\n attendee.\n- Everything else goes through the `gws calendar` CLI, which takes the\n ids the tree renders.\n- A written event must carry an explicit UTC offset or `timeZone`; an\n ambiguous local time is not interpreted for you."; export declare const DAY_VFS_MD = "- A bucket is one local day, named by its date. A well-formed date\n inside the configured scope is a directory even when it holds no\n events. Dates outside the scope are absent.\n- A file name is `<eventId>__<HHMM-HHMM>_<Title>.gcal.json`. The times\n are clamped to that day, so an event running through it reads\n `0000-2400`. A multi-day event appears under every day it covers."; export declare const BUCKET_VFS_MD = "- A bucket is {days} local days, named by its first and last day on a\n fixed grid where 7-day buckets run Monday to Sunday. A bucket on the\n grid inside the configured scope is a directory even when it holds no\n events; a bare date, a span off the grid and a bucket outside the\n scope are absent. A glob matches the name, so `2027-03-*` finds the\n buckets that open in March.\n- A file name is `<eventId>__<YYYY-MM-DD>_<HHMM-HHMM>_<Title>.gcal.json`,\n dated with its day. The times are clamped to that day, so an event\n running through it reads `0000-2400`. A multi-day event appears once\n for each day of the bucket it covers."; export declare class GCalVFS extends BaseVFS { readonly handed: { readonly stat: readonly ["entry"]; readonly unlink: readonly ["entry"]; }; readonly name: string; readonly cachesReads: boolean; readonly indexTtl: number; vfsMd: string; readonly wholeWordSearch: boolean; readonly searchable: readonly string[]; readonly config: GCalConfig; readonly accessor: GCalAccessor; constructor(options: Omit<GCalConfig, 'bucketDays'> & Partial<Pick<GCalConfig, 'bucketDays'>>); readdir(path: PathSpec): Promise<FileStat[] | DirListing>; read(path: PathSpec): Promise<Uint8Array>; readMany(paths: PathSpec[], limit: number): Promise<Map<string, Uint8Array>>; deltaHook(): DeltaHook; /** * Whether this VFS answers `name`; with no walk limit it reads every * file rather than ask the service's search. */ supports(name: string): boolean; filesContaining(path: PathSpec, text: string, opts: { wholeWord: boolean; ignoreCase: boolean; }): Promise<PathSpec[] | null>; stat(path: PathSpec, handed?: Handed): Promise<FileStat>; unlink(path: PathSpec, handed?: Handed): Promise<void>; getState(): Promise<ConfigState<RedactedSchema<typeof GCalConfig>>>; } //# sourceMappingURL=gcal.d.ts.map