UNPKG

@adonis-agora/agent

Version:

Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.

20 lines • 1.24 kB
import type { StreamFrame } from '../spi/token-stream-sink.js'; import { type AgUiSourceFrame } from './core/index.js'; /** * One frame of this package's sink as the frame the local AG-UI encoder reads. The typed `approval` / `elicitation` frames carry what the * stream vocabulary leaves optional — the PARKED run, the tool and its arguments — so an interrupt * addresses a delegated sub-agent's own run. */ export declare function toAgUiFrame(frame: StreamFrame): AgUiSourceFrame; /** * A library run's stream as the local encoder's frames. A hand-rolled iterator rather than a * generator: the AG-UI driver lets go of a parked stream while a read is still pending, and a * generator would queue that `return()` behind the read that never comes — the sink's subscription * has to be released at once. * * Each frame is tagged ({@link withFrameSeq}) with the run's own sequence number through it — the * SSE `id:` the native stream (`chat/:runId/stream`) gives its last event — so the AG-UI route can * number its events the way a native re-attach (`?after=`) counts. */ export declare function agUiFrames(frames: AsyncIterable<StreamFrame>): AsyncIterable<AgUiSourceFrame>; //# sourceMappingURL=frames.d.ts.map