"""Extension-control namespace: ``b.extension.*``.""" from __future__ import annotations from browser_cli.sdk.base import Namespace, sdk_command class ExtensionNS(Namespace): """Control the browser-cli extension itself.""" @sdk_command("extension.info", default={}) def info(self) -> dict: """Return extension version, runtime metadata, and capabilities.""" @sdk_command("extension.capabilities", default=[]) def capabilities(self) -> list[str]: """Return feature capability strings advertised by the extension.""" @sdk_command("extension.reload") def reload(self) -> None: """Reload the browser-cli extension service worker. Schedules a ``chrome.runtime.reload()`` inside the extension and returns immediately. The extension restarts ~200 ms later and reconnects via the keepalive alarm within ~25 seconds. """