UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

20 lines (19 loc) • 1.73 kB
/** * WHAT A LOST WORKING-DIRECTORY WALK STILL CARRIES BESIDE ITS DENY FLOOR. Once the walk (`WorkdirThread`) lost track it places no * word; beside its deny floor it carries the twin walk — the same text WITHOUT the lines it could not follow, walked on through * every later move it can follow ({@link twinsAfter}): what `PWD` / `OLDPWD` would hold had those lines not been written, the * names' floor past the loss ({@link twinFloor}, #5076) — the reading a relative word past the loss already gets (KL-1403-b). * Never a place the walk stands. */ import type { BaseCandidate, ShiftAt } from "./shell-read-workdir.js"; /** The twin walk's step at segment `si`: a move it can follow moves its candidates as the walk moves its own (`movedFrom`) — the * move may fail, an `&&` run proves it; a line it cannot follow either is left out of the twin (the twin is the text without such * lines), save a literal `eval` text or a move past `max`, past which the twin is not read (`undefined`). */ export declare function twinsAfter(twins: readonly BaseCandidate[] | undefined, si: number, at: ShiftAt, movedFrom: (c: BaseCandidate, at: ShiftAt) => readonly BaseCandidate[] | "lost", max: number): readonly BaseCandidate[] | undefined; /** The names' floor for a reader whose `&&` run starts at `andRunStart`: what `PWD` / `OLDPWD` hold — or may hold * (`oldFloor`) — on the candidates it reaches that spell them, the twin walk's past a loss, the walk's own else. */ export declare function twinFloor(twins: readonly BaseCandidate[] | undefined, andRunStart: number): { readonly PWD: readonly string[]; readonly OLDPWD: readonly string[]; readonly DIRSTACK: readonly (readonly string[])[]; } | undefined;