UNPKG

@struktoai/mirage-core

Version:

A Unified Virtual Filesystem For AI Agents

32 lines • 1.92 kB
import type { RedirectResult } from '../../../../context/session_context.ts'; import type { ByteSource } from '../../../../io/types.ts'; import type { ShellVar } from '../../../../shell/variable.ts'; import { type SessionState } from '../../../session/session.ts'; import type { BuiltinCall, ExecuteStringFn } from '../types.ts'; /** * What `env` runs and the environment it runs it in, read off its words: * the command's words, the environment in `environ` order, whether `-i` * cleared it and whether `-0` was given; or the message for words env * refuses. Mirrors the Python `env_child`. */ export declare function envChild(args: string[], session: SessionState): [string[], Record<string, string>, boolean, boolean] | string; /** * The session's variables as `env`'s command sees them. Only the scalars * are replaced: arrays were never part of the env the old two-container * store swapped, and bash does not put one in a child's environment * either. A still-unfetched managed entry is a scalar in waiting, so it * is replaced too: surviving the swap would let the inner line fetch and * read a name `-i` or `-u` just cleared. * * Built through `varsFromEnv`, the one conversion from an embedder's * process environment to session records, so the export attribute is * stamped in exactly one place rather than restated here. Seeded plain, * `env -i FOO=bar printenv FOO` printed nothing, since the process view a * command reads carries only exported names. Mirrors the Python * `env_vars`. */ export declare function envVars(session: SessionState, base: Record<string, string>): Record<string, ShellVar>; export declare function handleEnv(executeFn: ExecuteStringFn, args: string[], session: SessionState, stdin?: ByteSource | null): Promise<RedirectResult>; /** The `env` arm. */ export declare function envBuiltin(call: BuiltinCall): Promise<RedirectResult>; //# sourceMappingURL=env.d.ts.map