MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / handleElicitation

Method handleElicitation

source code/cli/structuredIO.ts:696–723  ·  view source on GitHub ↗

* Sends an elicitation request to the SDK consumer and returns the response.

(
    serverName: string,
    message: string,
    requestedSchema?: Record<string, unknown>,
    signal?: AbortSignal,
    mode?: 'form' | 'url',
    url?: string,
    elicitationId?: string,
  )

Source from the content-addressed store, hash-verified

694 * Sends an elicitation request to the SDK consumer and returns the response.
695 */
696 async handleElicitation(
697 serverName: string,
698 message: string,
699 requestedSchema?: Record<string, unknown>,
700 signal?: AbortSignal,
701 mode?: 'form' | 'url',
702 url?: string,
703 elicitationId?: string,
704 ): Promise<ElicitResult> {
705 try {
706 const result = await this.sendRequest<ElicitResult>(
707 {
708 subtype: 'elicitation',
709 mcp_server_name: serverName,
710 message,
711 mode,
712 url,
713 elicitation_id: elicitationId,
714 requested_schema: requestedSchema,
715 },
716 SDKControlElicitationResponseSchema(),
717 signal,
718 )
719 return result
720 } catch {
721 return { action: 'cancel' as const }
722 }
723 }
724
725 /**
726 * Creates a SandboxAskCallback that forwards sandbox network permission

Callers 2

drainCommandQueueFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected