(
request: FormElicitation | UrlElicitation,
formatResult: (response: { action: string; content?: Record<string, unknown> }) => unknown = (
r,
) => r.action,
)
| 196 | |
| 197 | /** Build an engine whose execute triggers one elicitation and returns the handler's result. */ |
| 198 | const 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 |
no test coverage detected