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

Function buildElicit

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

Source from the content-addressed store, hash-verified

4073 : defaultElicitationHandler;
4074
4075 const buildElicit = (
4076 address: ToolAddress,
4077 args: unknown,
4078 handler: ElicitationHandler,
4079 ): Elicit => {
4080 return (request: ElicitationRequest) =>
4081 Effect.gen(function* () {
4082 const response: ElicitationResponse = yield* handler({
4083 address,
4084 args,
4085 request,
4086 });
4087 if (response.action !== "accept") {
4088 return yield* new ElicitationDeclinedError({
4089 address,
4090 action: response.action,
4091 });
4092 }
4093 return response;
4094 });
4095 };
4096
4097 // The single source of truth for "will enforceApproval pause this call".
4098 // 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