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

Function buildElicit

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

Source from the content-addressed store, hash-verified

4232 : defaultElicitationHandler;
4233
4234 const buildElicit = (
4235 address: ToolAddress,
4236 args: unknown,
4237 handler: ElicitationHandler,
4238 ): Elicit => {
4239 return (request: ElicitationRequest) =>
4240 Effect.gen(function* () {
4241 const response: ElicitationResponse = yield* handler({
4242 address,
4243 args,
4244 request,
4245 });
4246 if (response.action !== "accept") {
4247 return yield* new ElicitationDeclinedError({
4248 address,
4249 action: response.action,
4250 });
4251 }
4252 return response;
4253 });
4254 };
4255
4256 // The single source of truth for "will enforceApproval pause this call".
4257 // 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