"""Performance and background-jobs namespace: ``b.perf.*``.""" from __future__ import annotations from browser_cli.sdk.base import Namespace, sdk_command class PerfNS(Namespace): """Inspect the performance profile and manage background jobs.""" @sdk_command("perf.status", default={}) def status(self) -> dict: """Return current performance profile, throttle info, and running jobs.""" @sdk_command("perf.set_profile", lambda self, profile: {"profile": profile}, default={}) def set_profile(self, profile: str) -> dict: """Set the global extension performance profile.""" @sdk_command("jobs.status", lambda self, job_id: {"jobId": job_id}, default={}) def job_status(self, job_id: str) -> dict: """Return status/progress for a background job.""" @sdk_command("jobs.cancel", lambda self, job_id: {"jobId": job_id}, default={}) def job_cancel(self, job_id: str) -> dict: """Request cancellation for a background job."""