import { B as TextChunkMode, c as ChannelStreamingConfig, n as BlockStreamingChunkConfig, r as BlockStreamingCoalesceConfig, s as ChannelStreamingCommandTextMode, u as ChannelStreamingProgressConfig, z as StreamingMode } from "./types.base-BSBlTq-x.js";

//#region src/channels/streaming.d.ts
type StreamingCompatEntry = {
  streaming?: unknown;
  streamMode?: unknown;
  chunkMode?: unknown;
  blockStreaming?: unknown;
  draftChunk?: unknown;
  blockStreamingCoalesce?: unknown;
  nativeStreaming?: unknown;
};
declare const DEFAULT_PROGRESS_DRAFT_LABELS: readonly ["Working", "Shelling", "Scuttling", "Clawing", "Pinching", "Molting", "Bubbling", "Tiding", "Reefing", "Cracking", "Sifting", "Brining", "Nautiling", "Krilling", "Barnacling", "Lobstering", "Tidepooling", "Pearling", "Snapping", "Surfacing"];
declare const DEFAULT_PROGRESS_DRAFT_INITIAL_DELAY_MS = 5000;
declare function isChannelProgressDraftWorkToolName(name: string | null | undefined): boolean;
declare function isPotentialTruncatedFinal(finalText: string): boolean;
declare function selectLongerFinalText(params: {
  finalText: string;
  candidateTexts: readonly (string | undefined)[];
}): string | undefined;
declare function resolveTranscriptBackedChannelFinalText(params: {
  finalText: string;
  resolveCandidateText: () => Promise<string | undefined>;
}): Promise<string>;
type ChannelProgressLineOptions = {
  markdown?: boolean;
  detailMode?: "explain" | "raw";
  commandText?: ChannelStreamingCommandTextMode;
};
type ChannelProgressDraftRenderMode = "text" | "rich";
type ChannelProgressDraftLineInput = {
  event: "tool";
  itemId?: string;
  toolCallId?: string;
  name?: string;
  phase?: string;
  args?: Record<string, unknown>;
} | {
  event: "item";
  itemId?: string;
  itemKind?: string;
  title?: string;
  name?: string;
  phase?: string;
  status?: string;
  summary?: string;
  progressText?: string;
  meta?: string;
} | {
  event: "plan";
  phase?: string;
  title?: string;
  explanation?: string;
  steps?: string[];
} | {
  event: "approval";
  phase?: string;
  title?: string;
  command?: string;
  reason?: string;
  message?: string;
} | {
  event: "command-output";
  itemId?: string;
  toolCallId?: string;
  phase?: string;
  title?: string;
  name?: string;
  status?: string;
  exitCode?: number | null;
} | {
  event: "patch";
  itemId?: string;
  toolCallId?: string;
  phase?: string;
  title?: string;
  name?: string;
  added?: string[];
  modified?: string[];
  deleted?: string[];
  summary?: string;
};
type ChannelProgressDraftLineKind = ChannelProgressDraftLineInput["event"];
type ChannelProgressDraftLine = {
  id?: string;
  kind: ChannelProgressDraftLineKind;
  text: string;
  label: string;
  icon?: string;
  detail?: string;
  status?: string;
  toolName?: string;
  prefix?: boolean;
};
declare function formatChannelProgressDraftLine(input: ChannelProgressDraftLineInput, options?: ChannelProgressLineOptions): string | undefined;
declare function resolveChannelProgressDraftLineOptions(entry: StreamingCompatEntry | null | undefined, options?: ChannelProgressLineOptions): ChannelProgressLineOptions;
declare function buildChannelProgressDraftLineForEntry(entry: StreamingCompatEntry | null | undefined, input: ChannelProgressDraftLineInput, options?: ChannelProgressLineOptions): ChannelProgressDraftLine | undefined;
declare function formatChannelProgressDraftLineForEntry(entry: StreamingCompatEntry | null | undefined, input: ChannelProgressDraftLineInput, options?: ChannelProgressLineOptions): string | undefined;
declare function buildChannelProgressDraftLine(input: ChannelProgressDraftLineInput, options?: ChannelProgressLineOptions): ChannelProgressDraftLine | undefined;
declare function createChannelProgressDraftGate(params: {
  onStart: () => void | Promise<void>;
  initialDelayMs?: number;
  setTimeoutFn?: typeof setTimeout;
  clearTimeoutFn?: typeof clearTimeout;
}): {
  readonly hasStarted: boolean;
  readonly workEvents: number;
  noteWork(): Promise<boolean>;
  startNow(): Promise<void>;
  cancel(): void;
};
declare function getChannelStreamingConfigObject(entry: StreamingCompatEntry | null | undefined): ChannelStreamingConfig | undefined;
declare function resolveChannelStreamingChunkMode(entry: StreamingCompatEntry | null | undefined): TextChunkMode | undefined;
declare function resolveChannelStreamingBlockEnabled(entry: StreamingCompatEntry | null | undefined): boolean | undefined;
declare function resolveChannelStreamingBlockCoalesce(entry: StreamingCompatEntry | null | undefined): BlockStreamingCoalesceConfig | undefined;
declare function resolveChannelStreamingPreviewChunk(entry: StreamingCompatEntry | null | undefined): BlockStreamingChunkConfig | undefined;
declare function resolveChannelStreamingPreviewToolProgress(entry: StreamingCompatEntry | null | undefined, defaultValue?: boolean): boolean;
declare function resolveChannelStreamingProgressCommentary(entry: StreamingCompatEntry | null | undefined, defaultValue?: boolean): boolean;
declare function resolveChannelStreamingPreviewCommandText(entry: StreamingCompatEntry | null | undefined, defaultValue?: ChannelStreamingCommandTextMode): ChannelStreamingCommandTextMode;
declare function resolveChannelStreamingPreviewNativeToolProgress(entry: StreamingCompatEntry | null | undefined, defaultValue?: boolean): boolean;
declare function resolveChannelStreamingPreviewNativeToolProgressAllowFrom(entry: StreamingCompatEntry | null | undefined): Array<string | number> | undefined;
declare function resolveChannelStreamingSuppressDefaultToolProgressMessages(entry: StreamingCompatEntry | null | undefined, options?: {
  draftStreamActive?: boolean;
  previewToolProgressEnabled?: boolean;
  previewStreamingEnabled?: boolean;
}): boolean;
declare function resolveChannelStreamingNativeTransport(entry: StreamingCompatEntry | null | undefined): boolean | undefined;
declare function resolveChannelPreviewStreamMode(entry: StreamingCompatEntry | null | undefined, defaultMode: "off" | "partial"): StreamingMode;
declare function resolveChannelProgressDraftConfig(entry: StreamingCompatEntry | null | undefined): ChannelStreamingProgressConfig;
declare function resolveChannelProgressDraftLabel(params: {
  entry?: StreamingCompatEntry | null;
  seed?: string;
  random?: () => number;
}): string | undefined;
declare function resolveChannelProgressDraftMaxLines(entry: StreamingCompatEntry | null | undefined, defaultValue?: number): number;
declare function resolveChannelProgressDraftMaxLineChars(entry: StreamingCompatEntry | null | undefined, defaultValue?: number): number;
declare function resolveChannelProgressDraftRender(entry: StreamingCompatEntry | null | undefined, defaultValue?: ChannelProgressDraftRenderMode): ChannelProgressDraftRenderMode;
declare function normalizeChannelProgressDraftLineIdentity(line: string | ChannelProgressDraftLine | undefined): string;
declare function mergeChannelProgressDraftLine<TLine extends string | ChannelProgressDraftLine>(lines: TLine[], line: TLine, params: {
  maxLines: number;
}): TLine[];
declare function formatChannelProgressDraftText(params: {
  entry?: StreamingCompatEntry | null;
  lines: Array<string | ChannelProgressDraftLine>;
  seed?: string;
  random?: () => number;
  formatLine?: (line: string) => string;
  bullet?: string;
}): string;
//#endregion
export { resolveChannelStreamingNativeTransport as A, resolveChannelProgressDraftLineOptions as C, resolveChannelStreamingBlockCoalesce as D, resolveChannelProgressDraftRender as E, resolveChannelStreamingPreviewToolProgress as F, resolveChannelStreamingProgressCommentary as I, resolveChannelStreamingSuppressDefaultToolProgressMessages as L, resolveChannelStreamingPreviewCommandText as M, resolveChannelStreamingPreviewNativeToolProgress as N, resolveChannelStreamingBlockEnabled as O, resolveChannelStreamingPreviewNativeToolProgressAllowFrom as P, resolveTranscriptBackedChannelFinalText as R, resolveChannelProgressDraftLabel as S, resolveChannelProgressDraftMaxLines as T, isPotentialTruncatedFinal as _, ChannelProgressLineOptions as a, resolveChannelPreviewStreamMode as b, StreamingCompatEntry as c, createChannelProgressDraftGate as d, formatChannelProgressDraftLine as f, isChannelProgressDraftWorkToolName as g, getChannelStreamingConfigObject as h, ChannelProgressDraftRenderMode as i, resolveChannelStreamingPreviewChunk as j, resolveChannelStreamingChunkMode as k, buildChannelProgressDraftLine as l, formatChannelProgressDraftText as m, ChannelProgressDraftLineInput as n, DEFAULT_PROGRESS_DRAFT_INITIAL_DELAY_MS as o, formatChannelProgressDraftLineForEntry as p, ChannelProgressDraftLineKind as r, DEFAULT_PROGRESS_DRAFT_LABELS as s, ChannelProgressDraftLine as t, buildChannelProgressDraftLineForEntry as u, mergeChannelProgressDraftLine as v, resolveChannelProgressDraftMaxLineChars as w, resolveChannelProgressDraftConfig as x, normalizeChannelProgressDraftLineIdentity as y, selectLongerFinalText as z };