UNPKG

@struktoai/mirage-core

Version:

A Unified Virtual Filesystem For AI Agents

36 lines • 1.58 kB
import type { Accessor } from '../../../accessor/base.ts'; import type { LineFacts, PathSpec } from '../../../types.ts'; import type { AggregateFn, CommandFn } from '../../config.ts'; import type { FlagView } from '../../spec/flag_view.ts'; export type FactsFn = (fl: FlagView, operands: readonly (string | PathSpec)[]) => LineFacts; /** * A generic builder: its name, how its runs register, and its handler, an * ordinary command handler that reads and writes only through the session's * files (`commandFiles(ctx, paths)`). Mirrors Python's `GenericCommand`. */ export interface GenericCommand<A extends Accessor = Accessor> { name: string; fn: CommandFn<A>; write?: boolean; aggregate?: AggregateFn; read?: boolean; /** * The command hands on what it reads (`cat`, `head -c`), so its input keeps * the producer's chunks instead of the 16 KiB pieces a scan reads. It then * writes a pipe in the writes the producer made, and a write the reader's * close cuts short is its SIGPIPE, as in Python, which passes every chunk * through. A scan inside such a command splits its own input. */ passThrough?: boolean; /** * The command only reads its operands while its output drains (`comm`, * `fold`), so a cross-mount run hands that output on live. */ streams?: boolean; /** * What a line of it does: one answer no option changes, or the function * that reads it off the line. Absent is `new LineFacts()`. */ facts?: LineFacts | FactsFn; } //# sourceMappingURL=adapter.d.ts.map