"""YiSaiQi adapter template for CONTRACT_CREATE flowchart nodes. This file is a mapping template. In the YiSaiQi designer, replace each method body with the platform's native browser activities: open webpage, input text, click element, select dropdown, upload file, read text, and screenshot. """ from __future__ import annotations class YiSaiQiBrowserAdapter: def open_url(self, url: str) -> None: """Flowchart node: 浏览器打开网页.""" raise NotImplementedError("Map to YiSaiQi browser open-url activity") def fill_first(self, selectors: list[str], value: str) -> None: """Flowchart node: 按候选定位器依次查找,找到后输入文本.""" raise NotImplementedError(f"Map to YiSaiQi input-text activity: {selectors=} {value=}") def click_first(self, selectors: list[str]) -> None: """Flowchart node: 按候选定位器依次查找,找到后点击.""" raise NotImplementedError(f"Map to YiSaiQi click activity: {selectors=}") def wait_for_text(self, text: str, timeout_seconds: int = 15) -> None: """Flowchart node: 等待页面出现指定文本.""" raise NotImplementedError(f"Map to YiSaiQi wait-text activity: {text=} {timeout_seconds=}") def select_first(self, selectors: list[str], value: str) -> None: """Flowchart node: 下拉框选择.""" raise NotImplementedError(f"Map to YiSaiQi select activity: {selectors=} {value=}") def upload_file_first(self, selectors: list[str], file_path: str) -> None: """Flowchart node: 文件上传.""" raise NotImplementedError(f"Map to YiSaiQi upload-file activity: {selectors=} {file_path=}") def read_first(self, selectors: list[str], value_name: str) -> str: """Flowchart node: 读取页面文本/输入框值并写入流程变量.""" raise NotImplementedError(f"Map to YiSaiQi read-text activity: {selectors=} {value_name=}") def screenshot(self, name: str) -> str: """Flowchart node: 截图存证,返回文件路径.""" raise NotImplementedError(f"Map to YiSaiQi screenshot activity: {name=}")