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

Function buildElicit

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

Source from the content-addressed store, hash-verified

3531 : defaultElicitationHandler;
3532
3533 const buildElicit = (
3534 address: ToolAddress,
3535 args: unknown,
3536 handler: ElicitationHandler,
3537 ): Elicit => {
3538 return (request: ElicitationRequest) =>
3539 Effect.gen(function* () {
3540 const response: ElicitationResponse = yield* handler({
3541 address,
3542 args,
3543 request,
3544 });
3545 if (response.action !== "accept") {
3546 return yield* new ElicitationDeclinedError({
3547 address,
3548 action: response.action,
3549 });
3550 }
3551 return response;
3552 });
3553 };
3554
3555 // The single source of truth for "will enforceApproval pause this call".
3556 // Read before pre-approval arg validation so the extra validation pass

Callers 1

executeFunction · 0.85

Calls 1

handlerFunction · 0.50

Tested by

no test coverage detected