UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

25 lines (24 loc) • 1.93 kB
/** The table cannot be had: the slot holds a value that is not the engine's table (a deployment reset it), or the slot cannot be written. Registrations would be lost * and a renamed mount would read as a clean one — so this is a refusal (`config.tool_face_control`, `detail.reason: "registry_occupied"`), never a fresh table. */ export declare class DelegationRegistryOccupied extends Error { readonly code: "config.tool_face_control"; readonly detail: { reason: "registry_occupied"; }; constructor(why: string, lanes?: boolean); } /** Binds `name` — and, when the factory's mount has one, its background lane — to `tool.execute` (the function that carries the * delegation out) and returns the tool. An occupied slot refuses the tool's construction. */ export declare function bindDelegationName<T extends { readonly execute: unknown; }>(name: string, tool: T, lane?: { readonly background: boolean; }): T; /** A product's wrapper around a bound `execute` is the same delegation: it answers to the name its source did, with the same lane. */ export declare function carryDelegationName(source: unknown, product: unknown): void; /** Whether the delegation tool this roster entry carries has a background lane, read from its `execute` as the name is ({@link * declaredDelegationNameOf}; only the factory binds a lane, beside the name); `false` for any other tool. An occupied table throws. */ export declare function delegationHasBackgroundLane(tool: unknown): boolean; /** The name the delegation tool this roster entry carries declared — or `undefined` (not a delegation tool the factory made, or its `execute` was wrapped by the host). * An entry whose members cannot be read reads as undeclared (the roster snapshot refuses it); an occupied table throws {@link DelegationRegistryOccupied}. */ export declare function declaredDelegationNameOf(tool: unknown): string | undefined;