import { B4_STEP_EVENT_NAME, type B4ToolStep, type ToolDisplay, type ToolDisplayIcon, type ToolDisplaySource } from "@b4run/sdk"; import type { RunnableConfig } from "@langchain/core/runnables"; /** The name of the AG-UI `CUSTOM` event (and the LangChain custom event) a step travels as; owned by `@b4run/sdk`. */ export { B4_STEP_EVENT_NAME }; /** What one `b4.step` dispatch carries, before the adapter adds identity. */ export interface StepPayload { readonly icon?: ToolDisplayIcon; readonly label?: string; readonly sources?: readonly ToolDisplaySource[]; } /** The versioned live step, including the call identity required by CUSTOM events. */ export type StepEventData = B4ToolStep & { readonly toolCallId: string; }; /** The step as a call begins: icon plus the `running` sentence. Never throws. */ export declare function describeRunning(display: ToolDisplay, input: unknown, toolName: string): Omit; /** The step as a call returns: icon, the `done` sentence, and its sources. Never throws. */ export declare function describeDone(display: ToolDisplay, input: unknown, output: unknown, toolName: string): StepPayload; /** * The step as a denied call returns (`status: "denied"`): the icon alone. The * denial text is the model's result, not a thing the tool did, so `done` and * `sources` are never asked to describe it — they would read it as output (a * "48 hits" label for a 48-character reason). */ export declare function describeDenied(display: ToolDisplay): StepPayload; /** * The step for a tool that threw: the icon and the `failed` sentence, given * the error text. There is no output for `done` to describe, so without * `failed` the label is the client's fallback. Without a display, bare. * Never throws. */ export declare function describeFailed(display: ToolDisplay | undefined, input: unknown, error: string, toolName: string): StepPayload; /** Stream one step over LangChain's custom-event channel; a failure never fails the tool. */ export declare function dispatchStep(config: RunnableConfig | undefined, data: StepEventData): Promise; //# sourceMappingURL=tool-display.d.ts.map