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

Function buildElicit

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

Source from the content-addressed store, hash-verified

3267 : defaultElicitationHandler;
3268
3269 const buildElicit = (
3270 address: ToolAddress,
3271 args: unknown,
3272 handler: ElicitationHandler,
3273 ): Elicit => {
3274 return (request: ElicitationRequest) =>
3275 Effect.gen(function* () {
3276 const response: ElicitationResponse = yield* handler({
3277 address,
3278 args,
3279 request,
3280 });
3281 if (response.action !== "accept") {
3282 return yield* new ElicitationDeclinedError({
3283 address,
3284 action: response.action,
3285 });
3286 }
3287 return response;
3288 });
3289 };
3290
3291 // The single source of truth for "will enforceApproval pause this call".
3292 // Read before pre-approval arg validation so the extra validation pass

Callers 1

executeFunction · 0.85

Calls 1

handlerFunction · 0.50

Tested by

no test coverage detected