UNPKG

@struktoai/mirage-core

Version:

A Unified Virtual Filesystem For AI Agents

71 lines • 4.53 kB
import { BoxAccessor } from '../../accessor/box.ts'; import type { ConditionSupport, ReplaceRequest } from '../../cache/types.ts'; import { type DeltaHook } from '../../events/index.ts'; import type { ByteSource } from '../../io/types.ts'; import type { CapacityResult, DirListing, FileStat, PathSpec } from '../../types.ts'; import { BaseVFS } from '../base.ts'; import type { RedactedSchema } from '../secrets.ts'; import type { ConfigState, Handed } from '../types.ts'; import { BoxConfig } from './config.ts'; export declare const VFS_MD = "```text\n{prefix}\n <folder>/ # the Box folder hierarchy, mirrored\n <name>.boxnote # Box Note: raw ProseMirror-style JSON\n <name>.boxcanvas # Box Canvas: raw canvas JSON\n <name>.gdoc # Box's Google Workspace files, stored as\n <name>.gsheet # Office Open XML (docx, xlsx, pptx):\n <name>.gslides # opaque binary\n <file> # PDFs, images and the rest: raw bytes\n```\n\n- Every item is served as its raw bytes; pipe the JSON ones to `jq`.\n- This is a remote mount: prefer targeted reads over full scans.\n- Box names folders by numeric id (the root is `0`). The path-to-id\n mapping is cached, so a nested directory costs one API call per level\n on first access. `ls` the parent before constructing a path."; export declare class BoxVFS extends BaseVFS { get conditionSupport(): ConditionSupport; readonly name: string; readonly cachesReads: boolean; readonly sizesAlwaysKnown: boolean; readonly readRevalidatable: boolean; readonly indexTtl: number; readonly handed: { readonly readdir: readonly ["entry"]; readonly read: readonly ["entry"]; readonly stat: readonly ["entry", "index"]; readonly checksum: readonly ["entry"]; readonly exists: readonly ["entry"]; readonly write: readonly ["entry", "parent"]; readonly create: readonly ["entry", "parent"]; readonly mkdir: readonly ["parent"]; readonly unlink: readonly ["entry"]; readonly rmdir: readonly ["entry"]; readonly rmR: readonly ["entry"]; readonly rename: readonly ["entry", "dstParent", "dstEntry"]; readonly copy: readonly ["entry", "dstParent", "dstEntry"]; readonly dirCopy: readonly ["entry", "dstParent", "dstEntry"]; readonly truncate: readonly ["entry", "parent"]; readonly filesContaining: readonly ["entry"]; }; vfsMd: string; readonly wholeWordSearch: boolean; readonly config: BoxConfig; readonly accessor: BoxAccessor; constructor(config: BoxConfig); readonly readsRanges: boolean; readdir(path: PathSpec, handed?: Handed): Promise<FileStat[] | DirListing>; read(path: PathSpec, handed?: Handed, offset?: number, size?: number | null): Promise<ByteSource> | AsyncIterable<Uint8Array>; stat(path: PathSpec, handed?: Handed): Promise<FileStat>; checksum(path: PathSpec, algorithm: string, handed?: Handed): Promise<string | null>; exists(path: PathSpec, handed?: Handed): Promise<boolean>; write(path: PathSpec, data: ByteSource, signal?: AbortSignal, handed?: Handed): Promise<FileStat | null>; _replace(request: ReplaceRequest, signal?: AbortSignal, handed?: Handed): Promise<FileStat | null>; create(path: PathSpec, handed?: Handed): Promise<FileStat | null>; mkdir(path: PathSpec, parents?: boolean, handed?: Handed): Promise<FileStat | null>; unlink(path: PathSpec, handed?: Handed): Promise<void>; rmdir(path: PathSpec, handed?: Handed): Promise<void>; rmR(path: PathSpec, handed?: Handed): Promise<void>; rename(src: PathSpec, dst: PathSpec, handed?: Handed): Promise<FileStat | null>; copy(src: PathSpec, dst: PathSpec, _signal?: AbortSignal, handed?: Handed): Promise<FileStat | null>; dirCopy(src: PathSpec, dst: PathSpec, handed?: Handed): Promise<FileStat | null>; truncate(path: PathSpec, length: number, noCreate?: boolean, handed?: Handed): Promise<void>; /** * 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; }, handed?: Handed): Promise<PathSpec[] | null>; capacity(): Promise<CapacityResult>; deltaHook(): DeltaHook; getState(): Promise<ConfigState<RedactedSchema<typeof BoxConfig>>>; } //# sourceMappingURL=box.d.ts.map