MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / buildElicit

Function buildElicit

packages/core/sdk/src/executor.ts:6127–6147  ·  view source on GitHub ↗
(
      address: ToolAddress,
      args: unknown,
      handler: ElicitationHandler,
    )

Source from the content-addressed store, hash-verified

6125 : defaultElicitationHandler;
6126
6127 const buildElicit = (
6128 address: ToolAddress,
6129 args: unknown,
6130 handler: ElicitationHandler,
6131 ): Elicit => {
6132 return (request: ElicitationRequest) =>
6133 Effect.gen(function* () {
6134 const response: ElicitationResponse = yield* handler({
6135 address,
6136 args,
6137 request,
6138 });
6139 if (response.action !== "accept") {
6140 return yield* new ElicitationDeclinedError({
6141 address,
6142 action: response.action,
6143 });
6144 }
6145 return response;
6146 });
6147 };
6148
6149 // The single source of truth for "will enforceApproval pause this call".
6150 // Read before pre-approval arg validation so the extra validation pass

Callers 2

executeFunction · 0.85
invokeWithFunction · 0.85

Calls 1

handlerFunction · 0.50

Tested by

no test coverage detected