@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
36 lines • 2.02 kB
TypeScript
import type { RedirectResult } from '../../../../context/session_context.ts';
import type { ByteSource } from '../../../../io/types.ts';
import type { DispatchFn } from '../../../../runtime/types.ts';
import type { EvaluationContext } from '../../../evaluation.ts';
import type { MountRegistry } from '../../../mount/registry.ts';
import type { BuiltinCall, ExecuteStringFn } from '../types.ts';
/** GNU's report of a command xargs finds nothing to run for. */
export declare function xargsMissing(name: string): string;
/**
* Run a command with words read from stdin (GNU xargs).
*
* The words are appended to the initial arguments, or with -I each input
* line takes the place of the string in them. Options act in the order
* given: -I, -L and -n cancel each other with GNU's warning, and --help or
* --version answers where it stands. The spec declares every option GNU's
* table has, so an abbreviated long option resolves exactly as GNU's does.
*
* The limits are GNU's on a Linux system with an 8 MiB stack: the
* environment counts against ARG_MAX (2 MiB) as GNU measures it, and a
* command line holds 128 KiB unless -s says otherwise. There is no
* terminal, so -p and -o fail the way GNU does without one.
*
* GNU xargs execs the command directly, so every input word must reach it
* as exactly one argv token. The inner line is built with shellJoin: a
* plain join would be re-parsed by the shell, splitting words with
* whitespace and executing $(...) found in input.
*/
export declare function handleXargs(executeFn: ExecuteStringFn, args: readonly string[], context: EvaluationContext, stdin: ByteSource | null, options?: {
/** The op dispatcher, which reads -a's file. */
dispatch?: DispatchFn | null;
/** Where command names are looked up; absent runs every name. */
registry?: MountRegistry | null;
}): Promise<RedirectResult>;
/** The `xargs` arm. */
export declare function xargsBuiltin(call: BuiltinCall): Promise<RedirectResult>;
//# sourceMappingURL=xargs.d.ts.map