@sema-agent/core
Version:
Stateless, task-oriented AI agent core
28 lines (27 loc) • 2.1 kB
TypeScript
/**
* ONE presence rule for a RETIRED key on a caller-supplied bag (a deps object, an options object): the key is
* PRESENT iff ordinary property lookup answers a defined value — prototype and non-enumerable members included,
* exactly what the former direct read of the seat honored; an explicit `undefined` reads as absence, as every
* optional seat reads. Every retired-key door reads through here so no door grows its own idea of "present";
* each composes its own refusal from the answer. A table row is `{ key: replacement }` — the sentence that says
* what replaced the seat, quoted in the refusal. A dotted key names a member of a member bag (`attachments.x`),
* read the same way one step at a time; a step that is not an object or a function holds nothing. A step spelled
* `name[]` names an array member and reads every element it holds (`skills[].manifest`: any element carrying it).
*/
/** The first retired key present on `bag`, in table order, or undefined when none is. */
export declare function retiredKeyOf(bag: object, table: Readonly<Record<string, string>>): {
key: string;
replacement: string;
} | undefined;
/**
* The retired-key door: a retired seat still wired by a deployment is refused BY NAME (`config.deps_retired_key`
* on a deps bag, `config.spec_retired_key` on a `TaskSpec`) instead of vanishing silently — a seat that is silently
* dropped reads to the caller as wired. `owner` is the bag's type name for the sentence (`RunnerDeps`,
* `RunWorkflowToolDeps`, `TaskSpec`).
*/
export declare function assertNoRetiredKeys(bag: object, table: Readonly<Record<string, string>>, owner: string): void;
/** The RETIRED `TaskSpec` keys, each with the sentence that names its replacement — the table the spec door reads
* ({@link assertNoRetiredKeys} with owner `TaskSpec`). A caller still writing one of these is refused by name
* (`config.spec_retired_key`), never read as absence: a mode a caller believes it declared must not silently run
* as another. */
export declare const RETIRED_TASK_SPEC_KEYS: Readonly<Record<string, string>>;