UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

14 lines (13 loc) • 1 kB
/** * The engine reads a host's abort signal STRUCTURALLY — `aborted`, `reason`, and the `abort` event — while * `AbortSignal.any` takes Node's own class alone (it brand-checks). A host's signal reaches an engine composition only * through this one follower: Node's own signal is returned as it is; any other is followed by an engine-minted native * one, aborted with the host's `reason` (at once when the host's signal is already aborted). The follower acts on the * host's `aborted`, not on the event alone: an `abort` event dispatched on a signal that still reads `aborted: false` * aborts nothing (as on Node's own signal) and the listener stays. The listener comes off at the first genuine abort or * at `release`; `release` does nothing for a native signal or one that was already aborted. */ export declare function nativeSignalOf(signal: Pick<AbortSignal, "aborted" | "reason" | "addEventListener" | "removeEventListener">): { readonly signal: AbortSignal; release(): void; };