UNPKG

@struktoai/mirage-core

Version:

A Unified Virtual Filesystem For AI Agents

42 lines • 2.28 kB
import { type CommandSpec, UsageStyle } from '../../../../commands/spec/types.ts'; import type { RedirectResult } from '../../../../context/session_context.ts'; import { type MountRegistry } from '../../../mount/registry.ts'; import type { SessionState } from '../../../session/session.ts'; import type { BuiltinCall } from '../types.ts'; import type { ManPage } from './types.ts'; /** The page of a shell builtin, from the spec `help` shows it by: its epilog is the exit status. */ export declare function builtinPage(name: string): ManPage; /** * The page of a command, from its spec. The synopsis is the program's own * first `--help` line where mirage keeps one, else the line the spec's slots * spell. */ export declare function specPage(name: string, spec: CommandSpec): ManPage; /** * The page of one node of an installed CLI, named after its path with * hyphens (`git-commit`). The synopsis, the options and the operands are the * ones the node's `--help` prints, in the root's dialect. */ export declare function cliPage(head: string, path: readonly string[], node: CommandSpec, style: UsageStyle): ManPage; /** * Every page a name has, in the order `man` prefers them: an installed CLI's, * then a builtin's, then a mounted command's. */ export declare function pagesOf(name: string, registry: MountRegistry): ManPage[]; /** The page a name opens, the first of `pagesOf`. */ export declare function findPage(name: string, registry: MountRegistry): ManPage | null; /** * A page laid out as man prints it with justification and hyphenation off: a * header, NAME, each section with its text indented and its tags hanging, * and a footer. Lines stop one short of the terminal width. */ export declare function renderPage(page: ManPage, width: number): string; /** * Run `man`: show the pages asked for, or their summary lines. Status 16 * when a page is missing, as man-db answers, after the pages it did find; 1 * for a command line it refuses. $MANWIDTH or $COLUMNS sets the width. */ export declare function handleMan(args: readonly string[], registry: MountRegistry, session: SessionState): Promise<RedirectResult>; /** The `man` arm. */ export declare function manBuiltin(call: BuiltinCall): Promise<RedirectResult>; //# sourceMappingURL=man.d.ts.map