import { type InvocationEnvelope, type InvocationEnvelopeError, type InvocationEnvelopeGate, type InvocationEnvelopeSource, type InvocationEnvelopeTrace } from "./invocationEnvelope.js";
export type StreamInvocationFrameKind = "open" | "chunk" | "done" | "error";
export type StreamInvocationFrameInput = {
    kind: StreamInvocationFrameKind;
    data?: unknown;
    eventId?: string;
};
export type StreamInvocationFrame = {
    kind: StreamInvocationFrameKind;
    data?: unknown;
    eventId?: string;
    sequence: number;
};
export type StreamInvocationSurfaceRequest = {
    runtimeId: string;
    streamId: string;
    targetId: string;
    source: InvocationEnvelopeSource;
    channel?: "agent" | "tool" | "model" | "interface";
    frames?: readonly StreamInvocationFrameInput[];
    runtimeReady?: boolean;
    requestedScopes?: readonly string[];
    allowedScopes?: readonly string[];
    contract?: InvocationEnvelopeGate;
    governance?: InvocationEnvelopeGate;
    trace?: InvocationEnvelopeTrace;
};
export type StreamInvocationSurfaceErrorCode = InvocationEnvelopeError["code"] | "MISSING_STREAM_ID";
export type StreamInvocationSurfaceError = {
    code: StreamInvocationSurfaceErrorCode;
    message: string;
    boundary: InvocationEnvelopeError["boundary"] | "stream";
};
export type StreamInvocationSurfaceView = {
    invocationType: "stream";
    runtimeId: string;
    streamId: string;
    targetId: string;
    channel?: "agent" | "tool" | "model" | "interface";
    envelope: InvocationEnvelope;
    frames: readonly StreamInvocationFrame[];
    status: "open" | "streaming" | "done" | "failed";
    dispatch: "dry-run";
    opensLiveTransport: false;
    providerRawShapeExposed: false;
    unsafeSideEffects: false;
};
export type StreamInvocationSurfaceResult = {
    ok: true;
    surface: StreamInvocationSurfaceView;
    events: readonly string[];
} | {
    ok: false;
    error: StreamInvocationSurfaceError;
    events: readonly string[];
};
export declare function createStreamInvocationSurface(request: StreamInvocationSurfaceRequest): StreamInvocationSurfaceResult;
