@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
27 lines • 2.16 kB
TypeScript
import type { PostgresAccessor } from '../../accessor/postgres.ts';
import type { ByteSource } from '../../io/types.ts';
import type { DirListing, FileStat, PathSpec } from '../../types.ts';
import { BaseVFS } from '../base.ts';
import type { Handed } from '../types.ts';
export declare const VFS_MD = "```text\n{prefix}\n database.json # cross-schema graph and sizes\n <schema>/ # a Postgres schema (namespace)\n tables/<table>/\n schema.json # column types, PK/FK, indexes\n semantic.json # descriptions, roles, sample values\n rows.jsonl # data (size-guarded)\n views/<view>/\n schema.json\n semantic.json\n rows.jsonl\n```\n\n- Read `database.json` first to plan joins.\n- Read `semantic.json` to learn what a table means: it splits columns\n into dimensions (group by), time_dimensions and facts (aggregate), and\n carries COMMENTs, enum domains and example values.\n- Reading `rows.jsonl` is refused for a table above the configured row\n or byte threshold. Use `head`, `tail` or `wc`, which ask SQL for only\n what they need, or `grep`, which fetches only the matching rows when\n SQL can find every match.";
/**
* Postgres's functions over its accessor, which the node and browser
* packages build over their own transport.
*/
export declare class PostgresVFS extends BaseVFS<PostgresAccessor> {
readonly handed: {
readonly read: readonly ["parent"];
readonly stat: readonly ["entry"];
};
readdir(path: PathSpec): Promise<FileStat[] | DirListing>;
read(path: PathSpec, handed?: Handed): Promise<ByteSource>;
stat(path: PathSpec, handed?: Handed): Promise<FileStat>;
linesContaining(path: PathSpec, text: string, opts: {
ignoreCase: boolean;
}): Promise<ByteSource | null>;
firstLines(path: PathSpec, n: number): Promise<Uint8Array | null>;
lastLines(path: PathSpec, n: number): Promise<Uint8Array | null>;
lineCount(path: PathSpec): Promise<number | null>;
follow(path: PathSpec, n: number, interval: number): Promise<AsyncIterable<Uint8Array> | null>;
}
//# sourceMappingURL=postgres.d.ts.map