Wraps a Provider so models that write tool calls as plain text
(instead of using the API's native tool calling) still drive the agent loop.
Only a step that returns no native tool calls is inspected; recognized calls
are lifted out of the text into real tool-call parts and the step's
finishReason becomes 'tool-calls'. Everything else (approvals, schema
validation, Unknown tool errors) then happens in loop.ts exactly as for
a native call. Still one model step per call.
Wraps a Provider so models that write tool calls as plain text (instead of using the API's native tool calling) still drive the agent loop.
Only a step that returns no native tool calls is inspected; recognized calls are lifted out of the text into real
tool-callparts and the step'sfinishReasonbecomes'tool-calls'. Everything else (approvals, schema validation,Unknown toolerrors) then happens inloop.tsexactly as for a native call. Still one model step per call.