import { PiHostUiRequest, PiHostUiResponse } from "../types.js"; import { RespondToToolApprovalOptions, ToolCallMessagePart } from "@assistant-ui/react"; //#region src/runtime/hostUi.d.ts export interface SplitHostUiRequests { /** Requests the supervisor correlated to a single executing tool that an * approval can answer, keyed by `toolCallId`. Projected onto the tool-call * part as its approval. */ toolAssociated: Map; /** Everything else — rendered through the side channel. */ freeStanding: PiHostUiRequest[]; } export declare const splitHostUiRequests: (requests: readonly PiHostUiRequest[]) => SplitHostUiRequests; /** A `confirm` request maps to a boolean. Cancel = `approved: false` = deny * (Pi collapses cancel/timeout into `false`). */ export declare const responseForApproval: (requestId: string, approved: boolean) => PiHostUiResponse; /** A tool-associated request as the tool call's approval: `confirm` asks for a * decision, `select` for one of its options (option ids are indexes), and * `input`/`editor` for a text answer. A request the approval cannot answer (a * `select` without choices, or a kind this client does not know) has none and * stays on the side channel. */ export declare const approvalForRequest: (request: PiHostUiRequest) => ToolCallMessagePart["approval"]; /** Maps an answer to the approval a tool-associated request projects as onto * the Pi response. A refusal dismisses a `select`/`input`/`editor` request; any * other answer has to carry the option or text the request asked for. */ export declare const responseForToolApproval: (request: PiHostUiRequest, response: RespondToToolApprovalOptions) => PiHostUiResponse; /** Shape the UI may hand back when resolving a `select`/`input`/`editor` * request by value: a bare string, or an object carrying a value / a dismissal. */ export type PiInterruptAnswer = string | { value?: string | null; dismissed?: boolean; } | null | undefined; /** `select`/`input`/`editor` map to `string | undefined`. A concrete string is a * chosen value; anything else (null/undefined/`{dismissed}`) resolves the * request as dismissed-without-value. */ export declare const responseForInterrupt: (requestId: string, answer: PiInterruptAnswer) => PiHostUiResponse; /** Generic answer → response, dispatching on the request kind. Used by the side * channel where a single handler answers any pending request. */ export declare const responseForRequest: (request: PiHostUiRequest, answer: boolean | PiInterruptAnswer) => PiHostUiResponse; //#endregion //# sourceMappingURL=hostUi.d.ts.map