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

Function buildElicit

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

Source from the content-addressed store, hash-verified

5624 : defaultElicitationHandler;
5625
5626 const buildElicit = (
5627 address: ToolAddress,
5628 args: unknown,
5629 handler: ElicitationHandler,
5630 ): Elicit => {
5631 return (request: ElicitationRequest) =>
5632 Effect.gen(function* () {
5633 const response: ElicitationResponse = yield* handler({
5634 address,
5635 args,
5636 request,
5637 });
5638 if (response.action !== "accept") {
5639 return yield* new ElicitationDeclinedError({
5640 address,
5641 action: response.action,
5642 });
5643 }
5644 return response;
5645 });
5646 };
5647
5648 // The single source of truth for "will enforceApproval pause this call".
5649 // 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