import type { AgentsSession } from "../session/types.js"; import type { RunEvent } from "./schema.js"; /** Parse a stream of raw SSE text chunks into typed run events. */ export declare function parseRunEvents(chunks: AsyncIterable): AsyncIterable; export interface StreamRunInput { spaceId: string; /** chatv2 `graphType` — an agent slug (standard) or flow id (workflow). */ graphType: string; message: string; signal?: AbortSignal; } /** Trigger a run against an existing space and yield its events. */ export declare const streamRun: (session: AgentsSession, input: StreamRunInput) => AsyncIterable; export interface RunAgentInput { /** Slug of the agent to run. */ agentSlug: string; message: string; /** Space title — defaults to a generated one. */ title?: string; signal?: AbortSignal; } export interface RunHandle { /** The space created for this run (spaces have no delete endpoint). */ spaceId: string; events: AsyncIterable; } /** * Create a space for an agent and stream a run against it. Each call * creates a new space — they accumulate, the BFF exposes no space delete. */ export declare const runAgent: (session: AgentsSession, input: RunAgentInput) => Promise;