refactor: reorganize client transport and extension internals
- Split client, native, remote, serve, markdown, and SDK internals into focused packages with direct imports. - Move local and remote transport framing/protocol helpers behind clearer module boundaries. - Break up the extension injected DOM logic into a separate content dispatch bundle and dedicated content modules. - Add explicit client handling for passive remote discovery without noisy PQ warnings. - Keep behavior covered with updated unit, integration, and extension tests.
This commit is contained in:
+14
-10
@@ -1,19 +1,23 @@
|
||||
"""Performance and background-jobs namespace: ``b.perf.*``."""
|
||||
from __future__ import annotations
|
||||
|
||||
from browser_cli.sdk.base import Namespace
|
||||
from browser_cli.sdk.base import Namespace, sdk_command
|
||||
|
||||
class PerfNS(Namespace):
|
||||
"""Inspect the performance profile and manage background jobs."""
|
||||
"""Inspect the performance profile and manage background jobs."""
|
||||
|
||||
def status(self) -> dict:
|
||||
return self._c._cmd("perf.status", {}) or {}
|
||||
@sdk_command("perf.status", default={})
|
||||
def status(self) -> dict:
|
||||
"""Return current performance profile, throttle info, and running jobs."""
|
||||
|
||||
def set_profile(self, profile: str) -> dict:
|
||||
return self._c._cmd("perf.set_profile", {"profile": profile}) or {}
|
||||
@sdk_command("perf.set_profile", lambda self, profile: {"profile": profile}, default={})
|
||||
def set_profile(self, profile: str) -> dict:
|
||||
"""Set the global extension performance profile."""
|
||||
|
||||
def job_status(self, job_id: str) -> dict:
|
||||
return self._c._cmd("jobs.status", {"jobId": job_id}) or {}
|
||||
@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."""
|
||||
|
||||
def job_cancel(self, job_id: str) -> dict:
|
||||
return self._c._cmd("jobs.cancel", {"jobId": job_id}) or {}
|
||||
@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."""
|
||||
|
||||
Reference in New Issue
Block a user