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

Function buildElicit

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

Source from the content-addressed store, hash-verified

4160 : defaultElicitationHandler;
4161
4162 const buildElicit = (
4163 address: ToolAddress,
4164 args: unknown,
4165 handler: ElicitationHandler,
4166 ): Elicit => {
4167 return (request: ElicitationRequest) =>
4168 Effect.gen(function* () {
4169 const response: ElicitationResponse = yield* handler({
4170 address,
4171 args,
4172 request,
4173 });
4174 if (response.action !== "accept") {
4175 return yield* new ElicitationDeclinedError({
4176 address,
4177 action: response.action,
4178 });
4179 }
4180 return response;
4181 });
4182 };
4183
4184 // The single source of truth for "will enforceApproval pause this call".
4185 // 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