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

Function makeElicitingEngine

packages/hosts/mcp/src/tool-server.test.ts:198–216  ·  view source on GitHub ↗
(
  request: FormElicitation | UrlElicitation,
  formatResult: (response: {
    action: string;
    content?: Record<string, unknown>;
    meta?: { readonly persist?: string };
  }) => unknown = (r) => r.action,
)

Source from the content-addressed store, hash-verified

196
197/** Build an engine whose execute triggers one elicitation and returns the handler's result. */
198const makeElicitingEngine = (
199 request: FormElicitation | UrlElicitation,
200 formatResult: (response: {
201 action: string;
202 content?: Record<string, unknown>;
203 meta?: { readonly persist?: string };
204 }) => unknown = (r) => r.action,
205): ExecutionEngine =>
206 makeStubEngine({
207 execute: (_code, { onElicitation }) =>
208 Effect.gen(function* () {
209 const response = yield* onElicitation({
210 address: STUB_TOOL_ADDRESS,
211 args: {},
212 request,
213 });
214 return { result: formatResult(response) };
215 }),
216 });
217
218// ---------------------------------------------------------------------------
219// Explicit native elicitation mode

Callers 1

Calls 2

onElicitationFunction · 0.85
makeStubEngineFunction · 0.70

Tested by

no test coverage detected