@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
27 lines • 1.49 kB
TypeScript
import type { RedirectResult } from '../../../../context/session_context.ts';
import type { SessionState } from '../../../session/session.ts';
import type { BuiltinCall } from '../types.ts';
/** Render a mask the way `umask -S` does: the bits it leaves on. */
export declare function symbolicUmask(mask: number): string;
/**
* The mask a `umask` operand names, or the error bash prints for it.
* An all-digit operand is octal, refused with `octal number out of
* range` when it holds an 8 or 9 and clamped to 0777 when octal but too
* large; anything else is a symbolic clause list applied to the
* permissions the current mask leaves on. The two symbolic refusals are
* told apart: a letter outside `ugoa` where an operator was expected is
* `invalid symbolic mode operator`, one outside `rwx` after it is
* `invalid symbolic mode character`.
*/
export declare function parseUmask(text: string, current: number): number | string;
/**
* Print or set the session's file-creation mask. Octal by default,
* symbolic under `-S`, re-readable under `-p`; with one operand it is
* set for the rest of the shell (a subshell gets its own copy). Extra
* operands are ignored, an unknown option is exit 2, a bad mode exit 1
* with the mask unchanged.
*/
export declare function handleUmask(args: string[], session: SessionState): RedirectResult;
/** The `umask` arm. */
export declare function umaskBuiltin(call: BuiltinCall): Promise<RedirectResult>;
//# sourceMappingURL=umask.d.ts.map