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

Function makeElicitingEngine

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

116
117/** Build an engine whose execute triggers one elicitation and returns the handler's result. */
118const makeElicitingEngine = (
119 request: FormElicitation | UrlElicitation,
120 formatResult: (response: { action: string; content?: Record<string, unknown> }) => unknown = (
121 r,
122 ) => r.action,
123): ExecutionEngine =>
124 makeStubEngine({
125 execute: (_code, { onElicitation }) =>
126 Effect.gen(function* () {
127 const response = yield* onElicitation({
128 address: STUB_TOOL_ADDRESS,
129 args: {},
130 request,
131 });
132 return { result: formatResult(response) };
133 }),
134 });
135
136// ---------------------------------------------------------------------------
137// Explicit native elicitation mode

Callers 1

Calls 1

makeStubEngineFunction · 0.85

Tested by

no test coverage detected