framework
Version:
The (AI) Framework: turnkey, zero-config AI orchestration that wraps a coding-agent CLI (Claude Code) as a black box and takes you from an idea to a running app. Vite for AI.
33 lines • 1.5 kB
TypeScript
/**
* A replayable, multi-consumer stream of events: buffer every event, hand out live async
* iterators, and replay history from an offset (tail=N replay).
*
* Absorbed from `@gemstack/ai-autopilot` when that package was deleted (A2). Its element type
* used to default to the supervisor's event; the only caller here passes `FrameworkEvent`, so
* the parameter is now required.
*/
export declare class EventStream<E> {
private readonly buffer;
private readonly waiters;
private closed;
/** Append an event. Wire this in as an `onEvent` sink. Ignored once closed. */
readonly push: (event: E) => void;
/** Alias for {@link push}, reads well at the `onEvent:` call site. */
get sink(): (event: E) => void;
/** Events buffered so far, from `fromOffset` (default 0) — Flue-style tail replay. */
history(fromOffset?: number): E[];
/** Number of events buffered. */
get length(): number;
/** True once {@link close} has run. */
get isClosed(): boolean;
/** End the stream: live iterators drain their backlog, then finish. Idempotent. */
close(): void;
/**
* A fresh async iterator that replays every buffered event, then yields new
* ones as they arrive, and finishes once the stream is closed and drained.
* Independent iterators each keep their own cursor, so late consumers still
* see the full history.
*/
[](): AsyncIterableIterator<E>;
}
//# sourceMappingURL=event-stream.d.ts.map