@sema-agent/core
Version:
Stateless, task-oriented AI agent core
33 lines (32 loc) • 2.81 kB
TypeScript
import type { RunnerDeps } from "../types.js";
import type { PlaintextOrigins } from "@sema-agent/primitives";
/** The consolidation seat as `RunnerDeps` declares it. */
export type ConsolidationDriverSeat = NonNullable<RunnerDeps["memoryConsolidationDriver"]>;
/** The consolidation seat's refusal (`config.memory_consolidation_driver`). */
export declare function consolidationSeatRefusal(message: string): Error & {
code: string;
};
/** A bare chat function names no model, and the run and its archive must not record a guess: the explicit id written beside it. */
export declare function bareChatRefusal(model: unknown): Error;
/** Whether a model id is an explicit one (a non-blank string no alias screen reads as re-pointable). */
export declare const explicitModelId: (model: unknown) => model is string;
/**
* The swap door's OWN FROZEN SNAPSHOT of a candidate consolidation seat (step one): `undefined` stays `undefined` (the swap clears the
* seat); anything else must be a plain record of the seat's five members — every other member refused by name — each read once (the
* receipt law, `receiveMembers`). An endpoint triple is read as `new Runner` reads it ({@link endpointTripleOf}: its three members each
* read once into a copy, any other member taken unread); `contract` is copied whole; a chat FUNCTION is host code and is held by
* reference (it cannot be copied). Nothing of the caller's object is read again: a later change to it does not move the seat. A member
* holding `undefined` is an absent one.
*/
export declare function receiveConsolidationDriverSeat(value: unknown, field: string, moment: string): ConsolidationDriverSeat | undefined;
/**
* Screen a consolidation seat by the screens its FIRST USE applies (step three), with no effect: an endpoint triple passes the endpoint
* seat's own screen (`screenOpenAiCompatChatSeat`: root, plaintext over `plaintextOrigins` — the Runner's list, the one the start reads —,
* key, explicit model id: the judgment `openAiCompatChatSeat` makes at the run's start, without taking the key in or building a chat), a
* chat function needs the explicit model id beside it
* ({@link explicitModelId}), and the knobs pass the driver's knob screen (`screenConsolidationDriverKnobs`). A seat with no `chat` names
* the role chain, whose resolution is the one judge's (`readConsolidationSeat`). A refusal shows a model id by its redacted shape
* (`describeRejectedValue`) and a knob by its number; a refused request root is shown as the start shows it (`displayUrlOf`: its path as
* written), so a root whose path carries the key shows it (KL-f6w1-r5-d).
*/
export declare function screenConsolidationDriverSeat(seat: ConsolidationDriverSeat | undefined, field: string, plaintextOrigins: PlaintextOrigins | undefined): void;