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

Function buildElicit

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

Source from the content-addressed store, hash-verified

3614 : defaultElicitationHandler;
3615
3616 const buildElicit = (
3617 address: ToolAddress,
3618 args: unknown,
3619 handler: ElicitationHandler,
3620 ): Elicit => {
3621 return (request: ElicitationRequest) =>
3622 Effect.gen(function* () {
3623 const response: ElicitationResponse = yield* handler({
3624 address,
3625 args,
3626 request,
3627 });
3628 if (response.action !== "accept") {
3629 return yield* new ElicitationDeclinedError({
3630 address,
3631 action: response.action,
3632 });
3633 }
3634 return response;
3635 });
3636 };
3637
3638 // The single source of truth for "will enforceApproval pause this call".
3639 // 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