fix(remote): resolve remembered explicit-port endpoints
- Resolve bare remote hosts through the remote registry when one explicit port is stored. - Preserve bare host behavior when no unique explicit-port registry match exists. - Route requested remote targets through the new registry resolver. - Add registry tests for unique and ambiguous explicit-port matches. - Bump package and extension versions to 0.16.6.
This commit is contained in:
@@ -5,8 +5,8 @@ import uuid
|
||||
from typing import Any
|
||||
|
||||
from browser_cli import transport
|
||||
from browser_cli.endpoints import _normalize_endpoint
|
||||
from browser_cli.errors import BrowserNotConnected
|
||||
from browser_cli.remote.registry import resolve_remote_endpoint
|
||||
|
||||
def base_message(command: str, args: dict | None) -> dict:
|
||||
return {"id": str(uuid.uuid4()), "command": command, "args": args or {}}
|
||||
@@ -14,7 +14,7 @@ def base_message(command: str, args: dict | None) -> dict:
|
||||
def requested_target(profile: str | None, remote: str | None) -> tuple[str | None, str | None]:
|
||||
requested_profile = profile or os.environ.get("BROWSER_CLI_PROFILE")
|
||||
remote_endpoint = remote or os.environ.get("BROWSER_CLI_REMOTE")
|
||||
return requested_profile, _normalize_endpoint(remote_endpoint) if remote_endpoint else None
|
||||
return requested_profile, resolve_remote_endpoint(remote_endpoint) if remote_endpoint else None
|
||||
|
||||
def encode_payload(msg: dict) -> bytes:
|
||||
return json.dumps(msg).encode("utf-8")
|
||||
|
||||
Reference in New Issue
Block a user