MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / requestApproval

Function requestApproval

packages/node-sdk/src/rpc.ts:698–723  ·  view source on GitHub ↗
(
    request: ApprovalRequest & { sessionId: string; agentId: string },
  )

Source from the content-addressed store, hash-verified

696 }
697
698 async requestApproval(
699 request: ApprovalRequest & { sessionId: string; agentId: string },
700 ): Promise<ApprovalResponse> {
701 const handler = this.approvalHandlers.get(request.sessionId);
702 if (handler === undefined) {
703 return {
704 decision: 'cancelled',
705 feedback: 'No approval handler registered.',
706 };
707 }
708
709 try {
710 return await handler(request);
711 } catch (error) {
712 this.receiveEvent({
713 type: 'error',
714 sessionId: request.sessionId,
715 agentId: request.agentId,
716 ...makeErrorPayload(ErrorCodes.SESSION_APPROVAL_HANDLER_ERROR, errorMessage(error)),
717 });
718 return {
719 decision: 'cancelled',
720 feedback: 'Approval handler failed.',
721 };
722 }
723 }
724
725 async requestQuestion(
726 request: QuestionRequest & { sessionId: string; agentId: string },

Callers

nothing calls this directly

Calls 4

makeErrorPayloadFunction · 0.90
errorMessageFunction · 0.70
getMethod · 0.65
handlerFunction · 0.50

Tested by

no test coverage detected