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