@sema-agent/core
Version:
Stateless, task-oriented AI agent core
26 lines (25 loc) • 1.84 kB
TypeScript
/** The deployment's A2A switches. */
export interface A2aDeploymentSwitches {
readonly isolatePeers?: true;
readonly peerTaskFrames?: boolean;
}
/** Whether the deployment declares that its readers read `peer_task` frames — the one question the call's admission and the run's
* notification lane both ask. Absent or `false` = not declared. */
export declare function peerTaskFramesDeclared(deps: {
readonly a2a?: A2aDeploymentSwitches | undefined;
}): boolean;
/** Whether this deployment's run may take `frame`: any frame but a `peer_task` one, which only a deployment that declares
* {@link peerTaskFramesDeclared} takes. The one question every road a frame takes into a run asks — the run's own notification lane,
* the session route's live destination, the turn-open drain of the session's park, the session box's drain. A frame handed in
* directly is refused; one waiting in the session's park or box is left there for a run that reads it. */
export declare function readsTaskFrame(deps: {
readonly a2a?: A2aDeploymentSwitches | undefined;
}, frame: {
readonly task_type: string;
}): boolean;
/** The operator log's word for a `peer_task` frame refused because {@link peerTaskFramesDeclared} said no — wherever it was refused
* (the run's notification lane, the session box's drain: its boundary pass and `ReadInbox`). Classification `peer-task-frame-refused`. */
export declare function peerTaskFrameRefused(taskId: string): Error;
/** The construction door's reading of `RunnerDeps.a2a`: its own members copied once into a frozen copy; `peerTaskFrames` a boolean when
* given — any other value is refused (`config.invalid_argument`), never read as "not declared". */
export declare function receiveA2aDeploymentSwitches(value: unknown, field: string): A2aDeploymentSwitches | undefined;