import { n as RuntimeEnv } from "./runtime-BPmgxFyD.js"; import { i as LivePreviewFinalizerResultKind, n as LivePreviewFinalizerDraft } from "./live-D79_8AeJ.js"; //#region src/channels/draft-preview-finalizer.d.ts /** * @deprecated Use `LivePreviewFinalizerDraft` from `klaw/plugin-sdk/channel-message`. */ type DraftPreviewFinalizerDraft = LivePreviewFinalizerDraft; /** * @deprecated Use `LivePreviewFinalizerResult` from `klaw/plugin-sdk/channel-message`. */ type DraftPreviewFinalizerResult = Exclude; /** * @deprecated Use `deliverFinalizableLivePreview` from `klaw/plugin-sdk/channel-message`. */ declare function deliverFinalizableDraftPreview(params: { kind: "tool" | "block" | "final"; payload: TPayload; draft?: DraftPreviewFinalizerDraft; buildFinalEdit: (payload: TPayload) => TEdit | undefined; editFinal: (id: TId, edit: TEdit) => Promise; deliverNormally: (payload: TPayload) => Promise; onPreviewFinalized?: (id: TId) => Promise | void; onNormalDelivered?: () => Promise | void; logPreviewEditFailure?: (error: unknown) => void; }): Promise; //#endregion //#region src/channels/draft-stream-loop.d.ts type DraftStreamLoop = { update: (text: string) => void; flush: () => Promise; stop: () => void; resetPending: () => void; resetThrottleWindow: () => void; waitForInFlight: () => Promise; }; declare function createDraftStreamLoop(params: { throttleMs: number; isStopped: () => boolean; sendOrEditStreamMessage: (text: string) => Promise; onBackgroundFlushError?: (err: unknown) => void; }): DraftStreamLoop; //#endregion //#region src/channels/draft-stream-controls.d.ts type FinalizableDraftStreamState = { stopped: boolean; final: boolean; }; type StopAndClearMessageIdParams = { stopForClear: () => Promise; readMessageId: () => T | undefined; clearMessageId: () => void; }; type ClearFinalizableDraftMessageParams = StopAndClearMessageIdParams & { isValidMessageId: (value: unknown) => value is T; deleteMessage: (messageId: T) => Promise; onDeleteSuccess?: (messageId: T) => void; warn?: (message: string) => void; warnPrefix: string; }; type FinalizableDraftLifecycleParams = Omit, "stopForClear"> & { throttleMs: number; state: FinalizableDraftStreamState; sendOrEditStreamMessage: (text: string) => Promise; }; declare function createFinalizableDraftStreamControls(params: { throttleMs: number; isStopped: () => boolean; isFinal: () => boolean; markStopped: () => void; markFinal: () => void; sendOrEditStreamMessage: (text: string) => Promise; }): { loop: DraftStreamLoop; update: (text: string) => void; stop: () => Promise; seal: () => Promise; discardPending: () => Promise; stopForClear: () => Promise; }; declare function createFinalizableDraftStreamControlsForState(params: { throttleMs: number; state: FinalizableDraftStreamState; sendOrEditStreamMessage: (text: string) => Promise; }): { loop: DraftStreamLoop; update: (text: string) => void; stop: () => Promise; seal: () => Promise; discardPending: () => Promise; stopForClear: () => Promise; }; declare function takeMessageIdAfterStop(params: StopAndClearMessageIdParams): Promise; declare function clearFinalizableDraftMessage(params: ClearFinalizableDraftMessageParams): Promise; declare function createFinalizableDraftLifecycle(params: FinalizableDraftLifecycleParams): { clear: () => Promise; loop: DraftStreamLoop; update: (text: string) => void; stop: () => Promise; seal: () => Promise; discardPending: () => Promise; stopForClear: () => Promise; }; //#endregion //#region src/channels/transport/stall-watchdog.d.ts type StallWatchdogTimeoutMeta = { idleMs: number; timeoutMs: number; }; type ArmableStallWatchdog = { arm: (atMs?: number) => void; touch: (atMs?: number) => void; disarm: () => void; stop: () => void; isArmed: () => boolean; }; declare function createArmableStallWatchdog(params: { label: string; timeoutMs: number; checkIntervalMs?: number; abortSignal?: AbortSignal; runtime?: RuntimeEnv; onTimeout: (meta: StallWatchdogTimeoutMeta) => void; }): ArmableStallWatchdog; //#endregion export { clearFinalizableDraftMessage as a, createFinalizableDraftStreamControlsForState as c, createDraftStreamLoop as d, DraftPreviewFinalizerDraft as f, FinalizableDraftStreamState as i, takeMessageIdAfterStop as l, deliverFinalizableDraftPreview as m, StallWatchdogTimeoutMeta as n, createFinalizableDraftLifecycle as o, DraftPreviewFinalizerResult as p, createArmableStallWatchdog as r, createFinalizableDraftStreamControls as s, ArmableStallWatchdog as t, DraftStreamLoop as u };