@sema-agent/core
Version:
Stateless, task-oriented AI agent core
20 lines (19 loc) • 2.09 kB
TypeScript
/**
* The throw of the inherited chain's refusal (the checkpoint screen's `chainRung`, always a `CheckpointError`) after the decision's
* bindings and the run's identity, and the one fact the parked-resume drive's stop path reads from it. For a decision the resume
* validated as refusing what it decides on (a `policy_ask` `deny`, a `dry_run_review` or `plan_review` `reject`) the throw is a COPY
* of the refusal (`copyOfCheckpointError`: its code, message, detail and cause) marked with the card's token: the mark belongs to this
* throw, never to the refusal, which a host's policy or a cache may hand out again on another card or on a later approve of the same
* card. Any other decision throws the refusal itself. Either way the caller is thrown a `CheckpointError` with the refusal's code.
*/
import { CheckpointError } from "../checkpoint-features.js";
/** What the ladder throws for the chain's `refusal` on the card `token`, the decision refusing or not. */
export declare function thrownChainRefusal(refusal: CheckpointError, token: string, decisionRefuses: boolean): CheckpointError;
/** The token of the card whose chain refused a validated refusing decision, when `e` is that throw — a layer the chain function could
* not rebuild or read the way the row was written (`reading_changed`, the row's own chain arm among them), a chain that is not the
* row's (`resume.parent_constraint_*`, every reason), a layer that cannot be installed where its record says it was, a malformed
* entry, a rung that threw — else `undefined`. Taken: the mark is read once and is gone after it. */
export declare function takeDeniedChainRefusalToken(e: unknown): string | undefined;
/** A value thrown while the chain was rebuilt or judged, as the chain's one refusal type: a `CheckpointError` as it is; anything else
* refused by `refused` (handed what was thrown, named never quoted: its error name or `typeof`), the thrown value its `cause`. */
export declare function chainRefusalOfThrown(e: unknown, refused: (thrownWhat: string) => CheckpointError): CheckpointError;