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

Function buildElicit

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

Source from the content-addressed store, hash-verified

4894 : defaultElicitationHandler;
4895
4896 const buildElicit = (
4897 address: ToolAddress,
4898 args: unknown,
4899 handler: ElicitationHandler,
4900 ): Elicit => {
4901 return (request: ElicitationRequest) =>
4902 Effect.gen(function* () {
4903 const response: ElicitationResponse = yield* handler({
4904 address,
4905 args,
4906 request,
4907 });
4908 if (response.action !== "accept") {
4909 return yield* new ElicitationDeclinedError({
4910 address,
4911 action: response.action,
4912 });
4913 }
4914 return response;
4915 });
4916 };
4917
4918 // The single source of truth for "will enforceApproval pause this call".
4919 // 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