@sema-agent/core
Version:
Stateless, task-oriented AI agent core
26 lines (25 loc) • 2.07 kB
TypeScript
/**
* Who may clear an ask that demands a person — the rule {@link import("./tool-policy.js").AskRequest.requiresRealApproval}
* states ("a person, not a configuration"), in one place for every station that settles such an ask. Two allows
* are a configuration: the blanket `onAsk: "allow"` seat, and an approver's allow it reports as the deployment's
* policy (`settledBy: "policy"` / `hostDecision.decidedBy: "policy"`). A person's allow clears the ask; the policy
* may still refuse it.
*/
import type { Checkpoint } from "./checkpoint-store.js";
import type { OrgGateVerdict } from "./hooks.js";
import type { AskRequest, PermissionResult, ResolvedAsk } from "./tool-policy.js";
/** The synchronous seat's refusal of a configuration's allow: one settlement word for both forms
* (`blanket_allow_refused`, nobody's — no person decided), a sentence that says which configuration it was. */
export declare function unjudgedAllowRefused(req: AskRequest, by: "blanket" | "policy"): Extract<ResolvedAsk, {
action: "deny";
}>;
/** A durable row demands a person when its gate carries the real-approval bit (the gate's own, which every resume
* check reads; the pending action's `requiresRealApproval` is its display twin). */
export declare function rowDemandsAPerson(cp: Checkpoint): boolean;
/** A question a durable decide is held against, in each form a station holds one: the parked row, a policy's
* re-check of an approver's edit, and the organization's CURRENT verdict about the call. */
export type HeldQuestion = Checkpoint | PermissionResult | OrgGateVerdict;
/** Whether a durable decide made by `decidedBy` cannot answer the held question: a question demanding a person is not
* the policy's to answer. One predicate for every station that holds a decide against such a question — the resume
* entry (the row, an edit's re-check, the org's current verdict) and the execution belt (the last two, re-read). */
export declare function policyCannotAnswer(question: HeldQuestion, decidedBy: "person" | "sla_timeout" | "policy"): boolean;