eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
32 lines (31 loc) • 1.36 kB
TypeScript
import type { HandleMessageStreamEvent } from "#protocol/message.js";
import type { ClientRedirectPolicy } from "#client/types.js";
/**
* Internal configuration for following a durable event stream.
*/
interface FollowStreamInput {
readonly host: string;
readonly resolveHeaders: () => Promise<Headers>;
readonly redirect?: ClientRedirectPolicy;
readonly sessionId: string;
readonly signal?: AbortSignal;
readonly startIndex: number;
}
/**
* Follows a session's durable event stream from an absolute cursor,
* transparently reconnecting whenever the transport ends.
*
* Transport endings reconnect from the advanced cursor. Progress resets the
* idle budget; repeated empty streams eventually stop the follow. Callers own
* boundary handling. Negative tail-relative cursors use one connection because
* they cannot be advanced safely.
*/
export declare function followStreamIterable(input: FollowStreamInput): AsyncGenerator<HandleMessageStreamEvent>;
/**
* Opens one stream response body, retrying transient failures with capped
* exponential backoff (~35s total): brief network outages and the short
* propagation window where a just-acknowledged session may not yet be
* readable from the stream route.
*/
export declare function openStreamBody(input: FollowStreamInput): Promise<ReadableStream<Uint8Array>>;
export {};