From 151927ac005a91d2960a754ce4d5c41859045dd3 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Wed, 3 Jun 2026 20:18:31 +0800 Subject: [PATCH] feat(automation): add OrcaClient.open() wrapper for file.open --- tools/automation/orca_automation.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/automation/orca_automation.py b/tools/automation/orca_automation.py index ad2de899ef..4dbd81fb8b 100644 --- a/tools/automation/orca_automation.py +++ b/tools/automation/orca_automation.py @@ -81,6 +81,16 @@ class OrcaClient: # keys: "ctrl+s" or ["ctrl", "s"] return self._call("input.key", {"keys": keys}) + def open(self, paths) -> dict: + """Load one or more files into the running instance at runtime. + + `paths` is a single absolute path string or a list of them. Paths are read + from the host filesystem by the server (localhost-only). Returns + {"ok": True, "loaded": }. Raises OrcaError 1007 on load failure.""" + if isinstance(paths, str): + paths = [paths] + return self._call("file.open", {"paths": list(paths)}) + def wait_for(self, target: dict, state: str = "visible", value: Optional[str] = None, timeout_ms: int = 5000, poll_ms: int = 100) -> dict: