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

Function makeElicitingEngine

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

131
132/** Build an engine whose execute triggers one elicitation and returns the handler's result. */
133const makeElicitingEngine = (
134 request: FormElicitation | UrlElicitation,
135 formatResult: (response: { action: string; content?: Record<string, unknown> }) => unknown = (
136 r,
137 ) => r.action,
138): ExecutionEngine =>
139 makeStubEngine({
140 execute: (_code, { onElicitation }) =>
141 Effect.gen(function* () {
142 const response = yield* onElicitation({
143 address: STUB_TOOL_ADDRESS,
144 args: {},
145 request,
146 });
147 return { result: formatResult(response) };
148 }),
149 });
150
151// ---------------------------------------------------------------------------
152// Explicit native elicitation mode

Callers 1

Calls 1

makeStubEngineFunction · 0.85

Tested by

no test coverage detected