import type { PermissionPromptDecision, PermissionPromptRequest } from '../permissions/prompt.js'; /** * The MCP `elicitation/create` request, already parsed out of the raw JSON-RPC * params. `message` is the human-facing prompt the server wants answered; * `requestedSchema` is the JSON Schema of the structured content it expects * (retained verbatim so a surface can render a form and so nothing is * fabricated). `rawParams` is the untouched params object for provenance. */ export interface McpElicitationRequest { readonly serverName: string; readonly message: string; readonly requestedSchema?: Record | undefined; readonly rawParams?: unknown | undefined; } /** * The MCP elicitation response. `action` follows the spec's tri-state; the * broker is an approve/deny channel, so an approval maps to `accept` (carrying * any surface-provided `content` from the decision's modifiedArgs) and a denial * maps to `decline`. `cancel` is reserved for the request being cancelled or * expired out from under us. */ export interface McpElicitationOutcome { readonly action: 'accept' | 'decline' | 'cancel'; readonly content?: Record | undefined; } /** Resolves an elicitation request to an outcome (the broker-backed handler). */ export type McpElicitationHandler = (request: McpElicitationRequest) => Promise; /** Parse a raw JSON-RPC `elicitation/create` params object into a typed request. */ export declare function parseElicitationParams(serverName: string, params: unknown): McpElicitationRequest; /** * Build the broker-backed elicitation handler. Every incoming elicitation * becomes a `PermissionPromptRequest` in the `delegate` category (an MCP server * asking the operator to act is a delegation, not a filesystem/exec/network * op), attributed to the server, and is resolved by `requestApproval`. Approve * → `accept`; deny/cancel/expire → `decline`. */ export declare function createMcpElicitationApprovalHandler(requestApproval: (input: { readonly request: PermissionPromptRequest; readonly metadata?: Record | undefined; }) => Promise): McpElicitationHandler; //# sourceMappingURL=elicitation.d.ts.map