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