agentfootprint
Version:
The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.
24 lines • 1.01 kB
JavaScript
/**
* requestOfRun — the ONE reader of a runner's `options.request`.
*
* Every runner's `run()` / `resume()` reads the incoming request here, at its
* door and before anything moves: a value `requestContext()` did not build is
* refused by name. What it returns goes to exactly two places — the agent's
* own run (`Agent.runRequest`) or the run a composition opens for its members
* (`memberRun.ts · openParentRun`). It is never written to state, and the
* engine is handed the options without it (`RunnerBase · runSignalOf`).
*
* Pattern: guard + accessor. Role: core, run input.
*/
import { assertRequestContext } from '../identity/requestContext.js';
/**
* The sealed request a runner's options carry, or `undefined`.
*
* @throws TypeError (naming `door`) when `request` is not a sealed request.
*/
export function requestOf(options, door) {
const request = options?.request;
assertRequestContext(request, door);
return request;
}
//# sourceMappingURL=requestOfRun.js.map