import { type ConversationRunChunkMirror, type HostedConversationRunChunkMirrorOptions } from "../conversation/run-chunk-mirror.js"; type Fetch = typeof globalThis.fetch; /** Internal failure raised when the control plane cannot issue an exact-child writer token. */ export declare class HostedChildRunEventWriterTokenExchangeError extends Error { readonly classification: "aborted" | "timeout" | "failed"; constructor(classification?: "aborted" | "timeout" | "failed"); } /** * Opaque authority for appending events to one exact hosted run. * * The credential is retained in module-private state and is not exposed as a * property of the capability. A capability can mint authority only for a * persisted direct child run. */ export interface HostedRunEventWriterCapability { /** Exchange this run's authority for an exact direct-child capability. */ mintChildRunEventWriterCapability(childRunId: string, abortSignal?: AbortSignal): Promise; } type VerifiedRequestWriterState = { token: string; projectId: string; runId: string; /** Explicit trusted-host or test transport retained with verified ingress. */ fetch?: Fetch; }; /** Retain verified ingress authority without adding it to the parsed request contract. */ export declare function registerHostedRunEventWriterToken(request: object, input: VerifiedRequestWriterState): void; /** Create the opaque exact-run capability associated with a verified parsed request. */ export declare function createHostedRunEventWriterCapabilityForRequest(request: object, input: Omit[0], "runEventAppendToken">): HostedRunEventWriterCapability | undefined; /** Allow identity-preserving request clones to reuse a verified writer during preparation. */ export declare function runWithVerifiedHostedRunEventWriterRequest(request: object, operation: () => T | Promise): Promise; /** * Create an exact-run event-writer capability from a credential verified by * trusted ingress. General user API tokens are not run-event credentials. * The returned frozen object does not expose or serialize the credential. */ export declare function createHostedRunEventWriterCapability(input: { /** Trusted Veryfront API base URL used for child-capability exchange. */ apiUrl: string; /** Exact run authorized by `runEventAppendToken`. */ runId: string; /** Exact-run append credential obtained from trusted ingress. */ runEventAppendToken: string; /** Bounded child-capability exchange timeout. */ timeoutMs?: number; /** Explicit trusted-host or test transport; tenant code must omit this seam. */ fetch?: Fetch; }): HostedRunEventWriterCapability; /** Build a durable mirror from private capability state without exposing its credential. */ export declare function createHostedConversationRunChunkMirrorFromCapability(capability: HostedRunEventWriterCapability | undefined, input: Omit & { /** Exact durable run for which the caller is preparing a mirror. */ expectedRunId: string; }): ConversationRunChunkMirror | undefined; /** Return the capability installed only while internal tool closures are assembled. */ export declare function getActiveHostedRunEventWriterCapability(): HostedRunEventWriterCapability | undefined; /** Run a bounded internal scope with privately bound exact-run authority. */ export declare function runWithHostedRunEventWriterCapability(capability: HostedRunEventWriterCapability | undefined, operation: () => T): T; export {}; //# sourceMappingURL=child-run-event-writer-token.d.ts.map