@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
34 lines • 1.8 kB
TypeScript
import { DifyAccessor } from '../../accessor/dify.ts';
import { type ByteSource } from '../../io/types.ts';
import type { DirListing, FileStat, PathSpec, SearchQuery } from '../../types.ts';
import { BaseVFS } from '../base.ts';
import type { ConfigState, Handed } from '../types.ts';
import { redactDifyConfig, resolveDifyConfig, type DifyConfig } from './config.ts';
export declare const VFS_MD = "- A Dify knowledge base, mounted read only.\n- Every file is plain text assembled from the document's Dify segments,\n whatever its original extension.\n- `cat`, `head`, `tail`, `grep`, `find`, `ls` and `wc` work on these\n files.";
export interface DifyVFSOptions {
config: DifyConfig;
}
export declare class DifyVFS extends BaseVFS {
readonly name: string;
readonly cachesReads: boolean;
readonly supportsSnapshot: boolean;
vfsMd: string;
readonly handed: {
readonly readdir: readonly ["entry"];
readonly read: readonly ["entry"];
readonly stat: readonly ["entry"];
};
readonly config: ReturnType<typeof resolveDifyConfig>;
readonly accessor: DifyAccessor;
constructor(options: DifyVFSOptions | DifyConfig);
getState(): ConfigState<ReturnType<typeof redactDifyConfig>> & {
needs_override: true;
};
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>;
search(path: PathSpec, query: SearchQuery): Promise<[string, string][] | null>;
searchMany(paths: PathSpec[], query: SearchQuery): Promise<[string, string][] | null>;
}
//# sourceMappingURL=dify.d.ts.map