AiWebCommands extension
Registers the :ai command on a LocalCommandRegistry for a browser
embedder.
Unlike the native addAiCommand (which loads ~/.omnyshell/ai.yaml via
dart:io), the web client builds the AiConfig itself (e.g. from
localStorage and/or the Hub's advertised default) and supplies the
httpClient — typically a HubHttpClient, which routes provider calls
through the Hub so the browser need not reach AI APIs directly. This helper
just wires the provider, a default command_shield, and the AiCommand, so
the web app does not depend on command_shield/provider_factory directly.
Methods
-
addAiCommand(
{required AiConfig config, required Client httpClient, AgentStyle style = const AgentStyle(), void onModeChanged(AgentMode mode)?, void onLanguageChanged(String? language)?}) → void -
Available on LocalCommandRegistry, provided by the AiWebCommands extension
Registers a live:aicommand usingconfigandhttpClient.