UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

24 lines (23 loc) • 1.39 kB
/** * The resolver's reading of an approver's `readRootGrant` (`AskOutcome`) against the card it answered. It only * READS: widening a run's read roots is that run's own station's act, and the resolver holds no run. */ import type { ReadRootGrantCandidate } from "./types.js"; /** `granted` ⇔ an `allow` whose grant is byte-equal to the request's `readRootCandidate.dir` (the candidate rides * back whole, `covers` included); otherwise `rejected` with ONE reason, the card's `offered` dir when it had one, * and the `requested` grant when it was a string (verbatim host text — a notice bounds it). */ export type ReadRootGrantScreen = { readonly verdict: "granted"; readonly candidate: ReadRootGrantCandidate; } | { readonly verdict: "rejected"; readonly reason: "on_refusal" | "not_a_string" | "no_candidate" | "mismatch"; readonly offered?: string; readonly requested?: string; }; /** Screen one grant read; `{}` when the answer carried none. */ export declare function readRootGrantSeat(grant: unknown, candidate: ReadRootGrantCandidate | undefined, allowed: boolean): { readRootGrant?: ReadRootGrantScreen; }; /** An engine-owned copy of a card's offer (one read per member), taken before an approver can touch the object. */ export declare function ownReadRootCandidate(c: ReadRootGrantCandidate | undefined): ReadRootGrantCandidate | undefined;