import type { ModelMessage, TextStreamPart, ToolSet, TypedToolResult } from "ai"; type ToolResponsePart = Extract["content"][number]; type InlineToolResultPart = Extract; import type { TurnPosition } from "#harness/session-machine/view.js"; import type { HarnessEmitFn, HarnessToolLookup } from "#harness/types.js"; /** * Result of consuming one step's `fullStream`. * * Inline results avoid duplicate post-step events. Approval-resume * authorization results also route back to the park detector. */ interface EmittedStreamContent { readonly emittedActionCallIds: ReadonlySet; readonly handledInlineToolResultCallIds: ReadonlySet; readonly invalidInputToolCallIds: ReadonlySet; readonly inlineAuthorizationResults: readonly TypedToolResult[]; readonly trailingInlineToolResultParts: readonly InlineToolResultPart[]; } interface StreamActionEmissionOptions { readonly excludedActionToolNames: ReadonlySet; /** * A child's or schedule's turn is held while its tasks work, so a text step * can't end it: the step reports `"tool-calls"` and channels don't post it * as the reply. */ readonly hidesHeldText?: boolean; readonly tools: HarnessToolLookup; readonly unsettledActionToolNames?: Map; } /** * Consumes the AI SDK `fullStream` and emits real-time text and reasoning * events. * * Emits local tool events in source order. Provider calls that arrive in one * stream batch into one request event before their first result. A result * without a streamed call resumes a call from an earlier step. */ export declare function emitStreamContent(emitFn: HarnessEmitFn, state: TurnPosition, fullStream: AsyncIterable>, options?: StreamActionEmissionOptions): Promise; export {};