The tools namespace
Defining a tool
Controlling the loop
tools.register are offered to every generation. Tools passed in
options.tools apply to that call alone.
capabilities().tools reports { registry: true, parallel: false, cancellation: true }, so
tools run one at a time but a run can be cancelled.
Executors run in JavaScript
Your executor is ordinary app code on the JS thread. It hasfetch, storage, and native
modules. It does not have the DOM. Keep it fast: the generation is paused while it runs,
and a slow executor reads to the user as a hung model.