@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
47 lines • 2.3 kB
TypeScript
import type { Client } from "@modelcontextprotocol/sdk/client/index.js";
import type { ExtensionUIContext } from "../../types.ts";
/** Declared empty on purpose: maximum server compatibility (form mode only). */
export declare const MCP_CLIENT_ELICITATION_CAPABILITY: {
readonly elicitation: {};
};
export declare function mcpClientCapabilities(elicitationEnabled?: boolean): {
elicitation?: Record<string, never>;
};
export declare const MCP_ELICITATION_TIMEOUT_MS: number;
type ElicitationUi = Pick<ExtensionUIContext, "input" | "select">;
export type McpElicitationUiProvider = (() => ElicitationUi | undefined) & {
readonly eligible?: () => boolean;
readonly enforced?: () => boolean;
readonly subscribe?: (listener: () => void) => () => void;
};
export interface McpElicitationUiOwner {
getMcpElicitationUi(): ElicitationUi | undefined;
}
export interface ElicitationResponse {
action: "accept" | "decline" | "cancel";
content?: Record<string, string | number | boolean>;
[key: string]: unknown;
}
interface ElicitProperty {
type?: string;
title?: string;
description?: string;
enum?: unknown[];
}
/** Legacy classic-session seam. Session-owned services pass themselves directly. */
export declare function setMcpElicitationUiProvider(provider: McpElicitationUiProvider | undefined): void;
export declare function legacyMcpFormEligible(provider: McpElicitationUiProvider | undefined, enabled: boolean): boolean;
/**
* Wire the elicitation/create handler onto a fresh client. Async because the
* request schema comes from the lazily loaded SDK; the caller (`buildMcpClient`
* in `transport-sdk.ts`) awaits it before any connect, so a mid-call
* elicitation still cannot race registration.
*/
export declare function configureMcpElicitation(client: Client, owner?: McpElicitationUiOwner | McpElicitationUiProvider | undefined, timeoutMs?: number, elicitationEnabled?: boolean): Promise<void>;
/** Exported for tests: drive the form directly with a scripted UI. */
export declare function runElicitationForm(ui: ElicitationUi, message: string, requestedSchema: {
properties?: Record<string, ElicitProperty>;
required?: string[];
}, timeoutMs?: number): Promise<ElicitationResponse>;
export {};
//# sourceMappingURL=elicitation.d.ts.map