UNPKG

@adonis-agora/agent

Version:

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

19 lines • 932 B
/** * Wrap a {@link SinkWriter} so a DELEGATED run forwards its frames into its top-level ancestor's * stream but never closes it. * * Forwarding is what makes a sub-agent visible at all: its own runId is not a stream anyone * subscribed to, so a question set it parks on would otherwise be written where nobody reads it. * The ancestor owns the stream's lifecycle across however many delegations it spans, so the child's * `end()` is a no-op — ending the shared stream mid-parent-run would cut the human off. It does * {@link SinkWriter.flush} what the child wrote, so nothing of the delegate's is still held back when * its parent (possibly on another replica) writes the next frame. */ export function childSinkWriter(inner) { return { write: (chunk) => inner.write(chunk), // The top-level run owns end(). end: () => inner.flush?.(), }; } //# sourceMappingURL=token-stream-sink.js.map