@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
41 lines • 2.45 kB
TypeScript
import type { RedirectResult } from '../../../../context/session_context.ts';
import { type ByteSource } from '../../../../io/types.ts';
import type { CallStack } from '../../../../shell/call_stack.ts';
import type { ExecuteFn } from '../../../expand/types.ts';
import type { SessionState } from '../../../session/session.ts';
import type { BuiltinCall } from '../types.ts';
/** `true`: succeed and print nothing. */
export declare function handleTrue(): RedirectResult;
/** `:`: succeed and print nothing (the null command). */
export declare function handleColon(): RedirectResult;
/** `false`: fail with 1 and print nothing. */
export declare function handleFalse(): RedirectResult;
/**
* Return from a function or sourced script, with bash's checks. bash reads
* the status before it looks for a function to leave, so a bad one is
* reported even where `return` then refuses; a pushed frame (a function's or
* a sourced file's) is what returns.
*/
export declare function handleReturn(args: readonly string[], session: SessionState, callStack?: CallStack | null): RedirectResult;
/**
* Exit the shell, with bash's argument checks, running its EXIT action
* first, where `exit` was called: a function's locals and `$1` are still in
* scope, as they are for bash's. `stdin` is the shell's input, which the
* action reads; `callStack` holds the frames `exit` was called in.
*/
export declare function handleExit(args: readonly string[], session: SessionState, executeFn?: ExecuteFn | null, stdin?: ByteSource | null, callStack?: CallStack | null): Promise<RedirectResult>;
/** The `true` arm. */
export declare function trueBuiltin(_call: BuiltinCall): Promise<RedirectResult>;
/** The `:` arm. */
export declare function colonBuiltin(_call: BuiltinCall): Promise<RedirectResult>;
/** The `false` arm. */
export declare function falseBuiltin(_call: BuiltinCall): Promise<RedirectResult>;
/** The `return` arm. */
export declare function returnBuiltin(call: BuiltinCall): Promise<RedirectResult>;
/** The `exit` arm. */
export declare function exitBuiltin(call: BuiltinCall): Promise<RedirectResult>;
/** The `break` arm: unwinds the enclosing loops by throwing. */
export declare function breakBuiltin(call: BuiltinCall): Promise<RedirectResult>;
/** The `continue` arm: unwinds to the next iteration by throwing. */
export declare function continueBuiltin(call: BuiltinCall): Promise<RedirectResult>;
//# sourceMappingURL=control.d.ts.map