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

Function makeElicitingEngine

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 1

makeStubEngineFunction · 0.70

Tested by

no test coverage detected