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