@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
39 lines • 2.84 kB
TypeScript
import type { RedirectResult } from '../../../context/session_context.ts';
import { type CallerDispatchFn } from '../../../context/session_context.ts';
import { type ByteSource } from '../../../io/types.ts';
import type { EntryGate, HandOff } from '../../../policy/types.ts';
import type { CallStack } from '../../../shell/call_stack.ts';
import type { JobConsole } from '../../../shell/console/index.ts';
import type { JobTable } from '../../../shell/job_table/index.ts';
import type { ParseScope } from '../../../shell/parse/scope.ts';
import { PathSpec } from '../../../types.ts';
import type { EvaluationContext } from '../../evaluation.ts';
import type { ExecuteFn } from '../../expand/types.ts';
import type { Namespace } from '../../mount/namespace/namespace.ts';
import { type MountRegistry } from '../../mount/registry.ts';
import { type SessionState } from '../../session/session.ts';
import { type ExecuteNodeFn } from './types.ts';
/**
* Fetch the managed names the tree a mount serves under `name` reads. The
* line's fill covers installed CLIs only: which mount's tree a head word
* reaches is known only when the command runs, after any `cd` before it on the
* line. The names are fetched ahead of the command's admission, as an
* installed CLI's are, so the gate walks the tree under the values the run
* reads; an env-filled required option would otherwise stop that walk short
* of the leaf, and a writing leaf would read as a reader. A name the
* invocation assigns (`TOKEN=x tok`, `skip`) is the invocation's, so it is
* never fetched. A failed fetch throws SecretsError. Resolves to whether a
* value was fetched, which changes how the words read. Mirrors Python's
* `fill_tree_env`.
*/
export declare function fillTreeEnv(name: string, args: readonly string[], session: SessionState, registry: MountRegistry, skip?: ReadonlySet<string>): Promise<boolean>;
/**
* The dispatch a command's own ops go through: every op it issues is made by
* the command, its admission gate included, so a rule scoped to the command
* reaches the entries below its operands, and a CLI's own reads and every
* mount run below (one run, a fan-out or a cross-mount) included. Mirrors
* Python's made_by_command.
*/
export declare function madeByCommand(dispatch: CallerDispatchFn, admission: EntryGate | null): CallerDispatchFn;
export declare function handleCommand(executeNode: ExecuteNodeFn, dispatch: CallerDispatchFn, registry: MountRegistry, parts: readonly (string | PathSpec)[], context: EvaluationContext, stdin?: ByteSource | null, callStack?: CallStack | null, jobTable?: JobTable | null, namespace?: Namespace, executeFn?: ExecuteFn, handed?: HandOff | null, signal?: AbortSignal, sink?: JobConsole, parser?: ParseScope, admission?: EntryGate | null): Promise<RedirectResult>;
//# sourceMappingURL=command.d.ts.map