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

Function makeElicitingEngine

packages/hosts/mcp/src/tool-server.test.ts:198–214  ·  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

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: { action: string; content?: Record<string, unknown> }) => unknown = (
201 r,
202 ) => r.action,
203): ExecutionEngine =>
204 makeStubEngine({
205 execute: (_code, { onElicitation }) =>
206 Effect.gen(function* () {
207 const response = yield* onElicitation({
208 address: STUB_TOOL_ADDRESS,
209 args: {},
210 request,
211 });
212 return { result: formatResult(response) };
213 }),
214 });
215
216// ---------------------------------------------------------------------------
217// Explicit native elicitation mode

Callers 1

Calls 1

makeStubEngineFunction · 0.70

Tested by

no test coverage detected