@sema-agent/core
Version:
Stateless, task-oriented AI agent core
28 lines (27 loc) • 1.58 kB
TypeScript
/**
* The content-ask BINDING vocabulary: the leak bound the routing lane checks against and the one entry shape the
* binding table holds. It lived in the question-face phase (which mints the table) while the routing lane was still
* orchestrator code; the lane is a phase now, and a phase reaching SIDEWAYS into a sibling for a constant and a type
* is the wrong reading — both phases reach DOWN for them here.
*/
import type { QuestionAnswer } from "../ask-question.js";
export declare const CONTENT_ASK_BINDING_CAP = 32;
/** One gate-routed content-ask outcome, keyed by the call id it was produced for (see the table's own note). */
export type ContentAskBinding = ({
kind: "answered";
answer: QuestionAnswer;
} | {
kind: "failed";
error: unknown;
}) & {
/** Digest of the exact question batch this outcome belongs to. The call id alone is not enough
* to redeem a binding: it comes from the model/provider and can repeat, so an entry that
* outlived its call (its call was allowed but never executed) could otherwise be handed to a
* LATER call that happens to reuse the id. Matching on the batch as well means an outcome can
* only ever be delivered for the question it was produced for. */
questionsHash: string;
/** The engine-minted per-delivery identity (see AskQuestionRequest.deliveryId) — carried so a
* stranded-answer disclosure names DELIVERIES, not call ids: call ids can repeat, and a
* disclosure keyed on them would collapse two lost answers into one. */
deliveryId: string;
};