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

Function buildElicit

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

Source from the content-addressed store, hash-verified

4186 : defaultElicitationHandler;
4187
4188 const buildElicit = (
4189 address: ToolAddress,
4190 args: unknown,
4191 handler: ElicitationHandler,
4192 ): Elicit => {
4193 return (request: ElicitationRequest) =>
4194 Effect.gen(function* () {
4195 const response: ElicitationResponse = yield* handler({
4196 address,
4197 args,
4198 request,
4199 });
4200 if (response.action !== "accept") {
4201 return yield* new ElicitationDeclinedError({
4202 address,
4203 action: response.action,
4204 });
4205 }
4206 return response;
4207 });
4208 };
4209
4210 // The single source of truth for "will enforceApproval pause this call".
4211 // 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