import type { CreateElicitationResponse, ElicitationSchema } from "@agentclientprotocol/sdk"; import type { RpcExtensionUIRequest, RpcExtensionUIResponse } from "../rpc/rpc-types.ts"; /** * Extension dialogs as ACP form elicitations. * * T3 v0.1.6 renders a form only from `requestedSchema.properties`: a string enum becomes single * choice, a boolean becomes `"true"`/`"false"` rows, and any other property is free text. It * ignores `required`, `default`, `oneOf`, `items`, masking and schema-level titles, and it has no * decline control and no timeout. So only the four dialog methods below map, each as exactly one * property; multiselect, secret inputs and dialogs without an answer stay cancelled by the * adapter. Answers arrive as strings and are validated here before they reach the child. * * Never attach `_meta.codex_approval_kind` or use a `mcp_tool_call_approval_` request id: T3 * auto-accepts that shape before rendering a form. */ /** T3 only uses the property key to return the answer; the dialog text lives in title/description. */ export declare const ELICITATION_ANSWER_KEY = "answer"; export interface ElicitationForm { /** Human-readable request; T3 falls back to it when a property has no description. */ message: string; requestedSchema: ElicitationSchema; } /** The form T3 should render, or undefined when the dialog must keep the plain cancellation. */ export declare function buildElicitationForm(dialog: RpcExtensionUIRequest): ElicitationForm | undefined; /** * Selesai's own dialog timeout in milliseconds, mirroring the child: zero or absent means none, * which is the only case for an editor dialog because it carries no timeout field. */ export declare function elicitationTimeoutMs(dialog: RpcExtensionUIRequest): number | undefined; /** * Turn an elicitation response into the child's answer. Anything that is not an exact answer for * this dialog method — decline, cancel, a missing field, a wrong type or an option that was not * offered — becomes one cancelled response. */ export declare function parseElicitationAnswer(dialog: RpcExtensionUIRequest, response: CreateElicitationResponse): RpcExtensionUIResponse;