UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

32 lines (31 loc) • 2.24 kB
import { type ReceiptMode } from "./mods/kernel/receive.js"; /** How a refusal names the object being received. */ export interface OwnPropertyReceiptWords { /** The object, e.g. `RunnerDeps`. */ readonly subject: string; /** One of its properties, e.g. `seat`. */ readonly unit: string; /** When the one read happens, e.g. `at new Runner`. */ readonly moment: string; } /** The receipt's coded refusal. */ export declare function receiptRefusal(message: string): Error & { code: "config.invalid_argument"; }; /** The receipt's first look, before ANY reflection on the object (a door that must look at the caller's object before * the receipt — a retired-name door reading its prototype chain — calls this first): a Proxy is refused. */ export declare function refuseProxy(given: object, words: OwnPropertyReceiptWords): void; /** The configuration receipt's mode of the one receipt: the top record read, each getter once, its members as given (a declared list's * own read too: the list itself, each element once, the elements as given). */ export declare const CONFIG_RECEIPT_MODE: ReceiptMode; /** * The declaration receipt's mode of the one receipt — a declaration the engine judges and then holds (an MCP server's or an A2A peer's * entry, a `toolAxes` record, a lock declaration) received as plain data held to the engine's one depth for a caller's value, * {@link MODS_VALUE_DEPTH} levels of records and lists below the declaration itself (the bound a mods handler's answer is held to): every * own string-keyed member read once off its captured descriptor (a getter called once, enumerable or not), every level copied, anything * that is not data refused (a Proxy at any level, a function, a bigint, an object of another prototype, a structure that contains * itself, a container nested deeper — a shared one measured where it sits each time it is met), every copied container frozen. */ export declare const DECLARATION_RECEIPT_MODE: ReceiptMode; /** Read `given` by the receipt law (module note): the plain copy, every own member taken once from its captured descriptor. */ export declare function receiveOwnProperties<T extends object>(given: T, words: OwnPropertyReceiptWords): T;