### dev.bat usage examples Source: https://github.com/black-ant/ant-browser/blob/master/bat/README.md Shows how to run dev.bat in default, live, and limited modes. Default mode builds Wails bindings and frontend/dist, then starts Wails with static resources. Live mode uses Vite dev server, limited mode adds memory limits. ```bat bat\dev.bat bat\dev.bat live bat\dev.bat limited ``` -------------------------------- ### POST /api/automation/scripts/run - Request body example Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/api-contract.md Example JSON body for running a script. scriptId is required; selector and params are optional. Omitting selector or params is equivalent to setting useScriptSelector=true or useScriptParams=true respectively. ```json { "scriptId": "news-query-txt", "selector": { "code": "BUYER_001" }, "params": { "keyword": "OpenAI", "limit": 10 } } ``` -------------------------------- ### Windows publish commands Source: https://github.com/black-ant/ant-browser/blob/master/README.md Commands to generate Windows installers or portable ZIP packages. Omit -WindowsFormat to default to INSTALLER. Output goes to publish\output\. ```powershell bat\publish.bat zip bat\publish.bat both bat\publish.bat -Target WINDOWS -WindowsFormat INSTALLER bat\publish.bat -Target WINDOWS -WindowsFormat PORTABLE bat\publish.bat -Target WINDOWS -WindowsFormat BOTH ``` -------------------------------- ### Windows output artifact Source: https://github.com/black-ant/ant-browser/blob/master/bat/README.md The output installer file for Windows. ```text publish\output\AntBrowser-Setup-.exe ``` -------------------------------- ### dev.sh usage examples for Linux/POSIX Source: https://github.com/black-ant/ant-browser/blob/master/bat/README.md Shows how to run the shell script for development on Linux or other POSIX environments. Default mode is stable; Windows development should use bat\dev.bat. ```bash ./scripts/dev.sh ./scripts/dev.sh live ./scripts/dev.sh help ``` -------------------------------- ### POST /api/runtime/status - Query instance status by selector Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/api-contract.md Accepts a selector body identical to the runtime/session selector. Does not start a new instance, does not wait for ready, only returns current status. ```text POST /api/runtime/status ``` -------------------------------- ### POST /api/runtime/session Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/api-contract.md Prepares a browser session that can be taken over. It waits for the instance to become debug-ready, optionally starts URLs, and returns connection details like the CDP URL. ```APIDOC ## POST /api/runtime/session ### Description Prepares a browser session that can be taken over. It waits for the instance to become debug-ready, optionally starts URLs, and returns connection details like the CDP URL. ### Method POST ### Endpoint /api/runtime/session ### Parameters #### Request Body - **selector** (object) - Required - Target instance selection criteria. Supports fields: code, key, profileId, profileName, keyword, keywords, tag, tags, groupId, matchMode. - **timeoutMs** (number) - Optional - Timeout for waiting until debugReady=true. Default: 45000, min: 1000, max: 120000. - **startUrls** (array of strings) - Optional - Additional URLs to open at launch. - **skipDefaultStartUrls** (boolean) - Optional - Whether to skip the instance's default start URLs. - **launchArgs** (array of strings) - Optional - Temporary launch arguments appended at startup. ### Request Example { "selector": { "code": "BUYER_001" }, "timeoutMs": 45000, "startUrls": ["https://example.com"], "skipDefaultStartUrls": true, "launchArgs": ["--window-size=1400,900"] } ### Response #### Success Response (200 OK) - Ready - **ok** (boolean) - Indicates request success. - **ready** (boolean) - True if session is ready. - **waitTimedOut** (boolean) - True if timeout expired. - **retryable** (boolean) - Whether the operation can be retried. - **profileId** (string) - Profile identifier. - **profileName** (string) - Profile name. - **launchCode** (string) - Launch code. - **running** (boolean) - Whether the browser is running. - **debugPort** (number) - Debug port. - **debugReady** (boolean) - Whether debug is ready. - **active** (boolean) - Whether the session is active. - **cdpUrl** (string) - CDP URL for connection. - **directDebugUrl** (string) - Direct debug URL (diagnostic). - **timeoutMs** (number) - Timeout used. #### Response Example (200 OK) { "ok": true, "ready": true, "waitTimedOut": false, "retryable": false, "profileId": "profile-123", "profileName": "Amazon US", "launchCode": "BUYER_001", "running": true, "debugPort": 9333, "debugReady": true, "active": true, "cdpUrl": "http://127.0.0.1:19876", "directDebugUrl": "http://127.0.0.1:9333", "timeoutMs": 45000 } #### Success Response (202 Accepted) - Started but not ready - **ok** (boolean) - Indicates request success. - **ready** (boolean) - False. - **waitTimedOut** (boolean) - True. - **retryable** (boolean) - True. - **profileId** (string) - Profile identifier. - **launchCode** (string) - Launch code. - **running** (boolean) - Whether the browser is running. - **debugReady** (boolean) - False. - **active** (boolean) - False. - **runtimeWarning** (string) - Warning message. - **cdpUrl** (string) - Empty string. - **directDebugUrl** (string) - Empty string. - **timeoutMs** (number) - Timeout used. #### Response Example (202 Accepted) { "ok": true, "ready": false, "waitTimedOut": true, "retryable": true, "profileId": "profile-123", "launchCode": "BUYER_001", "running": true, "debugReady": false, "active": false, "runtimeWarning": "debug pending", "cdpUrl": "", "directDebugUrl": "", "timeoutMs": 45000 } ### Error Responses - **400 Bad Request** - Possible messages: "selector is required", "invalid request body", "matchMode must be unique or first for runtime control". - **404 Not Found** - Possible messages: "launch code not found", "profile not found". - **409 Conflict** - Selector matches multiple instances and matchMode=first is not declared. - **401 Unauthorized** - API Key is incorrect or missing. ``` -------------------------------- ### POST /api/automation/scripts/run - Success response Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/api-contract.md Example success response with run details including status, summary, and timing. ```json { "ok": true, "run": { "id": "run-1", "scriptId": "news-query-txt", "scriptName": "查询新闻并写 TXT", "scriptType": "playwright-cdp", "status": "success", "summary": "已抓取 10 条新闻并写入 TXT", "error": "", "resultText": "{...}", "startedAt": "2026-04-08T10:00:00Z", "finishedAt": "2026-04-08T10:00:12Z", "durationMs": 12034 } } ``` -------------------------------- ### publish.bat interactive usage Source: https://github.com/black-ant/ant-browser/blob/master/bat/README.md Starts the publish entry and prompts to choose Windows (W), Linux (L), or both (B). ```bat bat\publish.bat ``` -------------------------------- ### GET /api/automation/scripts Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/api-contract.md Lists all available automation scripts. ```APIDOC ## GET /api/automation/scripts ### Description Lists all available automation scripts. ### Method GET ### Endpoint /api/automation/scripts ### Parameters No parameters are documented in the source. ### Request Example Not provided in the source. ### Response Not specified in the source. ``` -------------------------------- ### GET /api/runtime/active Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/api-contract.md Queries the current active instance on the unified CDP entry point. Returns which instance is currently attached to the LaunchServer unified entry. ```APIDOC ## GET /api/runtime/active ### Description Queries the current active instance on the unified CDP entry point. Returns which instance is currently attached to the LaunchServer unified entry. ### Method GET ### Endpoint /api/runtime/active ``` -------------------------------- ### GET /api/automation/scripts Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/api-contract.md Lists automation scripts metadata. Returns an array of script items with basic information, excluding scriptText. ```APIDOC ## GET /api/automation/scripts ### Description Lists automation scripts metadata. Returns an array of script items with basic information, excluding scriptText. ### Method GET ### Endpoint /api/automation/scripts ### Response #### Success Response - **ok** (boolean) - Indicates success. - **count** (number) - Number of scripts returned. - **items** (array) - List of script metadata objects. - **id** (string) - Script ID. - **name** (string) - Script name. - **type** (string) - Script type. - **status** (string) - Script status. - **entryFile** (string) - Entry file name. - **tags** (array) - Tags associated with the script. - **selector** (object) - Selector for the script. - **params** (object) - Parameters for the script. - **notes** (string) - Additional notes. #### Response Example { "ok": true, "count": 1, "items": [ { "id": "news-query-txt", "name": "查询新闻并写 TXT", "type": "playwright-cdp", "status": "ready", "entryFile": "index.cjs", "tags": ["Playwright", "新闻"], "selector": { "code": "BUYER_001" }, "params": { "keyword": "OpenAI", "limit": 10 }, "notes": "..." } ] } ``` -------------------------------- ### GET /api/automation/scripts/{scriptId} Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/api-contract.md Retrieves details for a specific automation script by its ID. ```APIDOC ## GET /api/automation/scripts/{scriptId} ### Description Retrieves details for a specific automation script by its ID. ### Method GET ### Endpoint /api/automation/scripts/{scriptId} ### Parameters #### Path Parameters - **scriptId** (string) - Required - The ID of the script to retrieve. ### Request Example GET /api/automation/scripts/news-query-txt ### Response Not specified in the source. ``` -------------------------------- ### publish.bat non-interactive usage Source: https://github.com/black-ant/ant-browser/blob/master/bat/README.md Shows how to call publish.bat without interaction, including version override with -Version. The version overrides package names, NSIS installer version, and wails.json productVersion. ```bat bat\publish.bat W bat\publish.bat L bat\publish.bat B bat\publish.bat W -Version 1.8.0 bat\publish.bat B -Version 1.8.0 ``` -------------------------------- ### GET /api/automation/scripts - List automation scripts Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/api-contract.md Returns a list of automation script metadata. The response includes ok, count, and items array. Each item contains id, name, type, status, entryFile, tags, selector, params, and notes. Does not return scriptText. ```text GET /api/automation/scripts ``` ```json { "ok": true, "count": 1, "items": [ { "id": "news-query-txt", "name": "查询新闻并写 TXT", "type": "playwright-cdp", "status": "ready", "entryFile": "index.cjs", "tags": ["Playwright", "新闻"], "selector": { "code": "BUYER_001" }, "params": { "keyword": "OpenAI", "limit": 10 }, "notes": "..." } ] } ``` -------------------------------- ### POST /api/runtime/status Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/api-contract.md Queries the status of an instance by selector without starting a new instance or waiting for ready. The request body is the same as the selector part of runtime/session. ```APIDOC ## POST /api/runtime/status ### Description Queries the status of an instance by selector without starting a new instance or waiting for ready. The request body is the same as the selector part of runtime/session. ### Method POST ### Endpoint /api/runtime/status ### Request Body - **selector** (object) - Required - Selector to identify the instance. ``` -------------------------------- ### GET /api/automation/scripts/{scriptId} - Query single script details Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/api-contract.md Returns detailed metadata for a single script. Includes packageFormat, manifestVersion, and source in addition to the list fields. Does not return scriptText. ```text GET /api/automation/scripts/{scriptId} ``` ```json { "ok": true, "item": { "id": "news-query-txt", "name": "查询新闻并写 TXT", "description": "测试脚本", "type": "playwright-cdp", "status": "ready", "entryFile": "index.cjs", "tags": ["Playwright", "新闻"], "selector": { "code": "BUYER_001" }, "params": { "keyword": "OpenAI", "limit": 10 }, "notes": "...", "createdAt": "2026-04-08T10:00:00Z", "updatedAt": "2026-04-08T11:00:00Z", "packageFormat": "ant-automation-script", "manifestVersion": 1, "source": { "type": "git", "uri": "https://example.com/repo.git", "ref": "main", "path": "", "importedAt": "2026-04-08T10:00:00Z" } } } ``` -------------------------------- ### GET /api/automation/scripts/runs Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/api-contract.md Retrieves the most recent script run records. The limit query parameter controls the number of records returned, with a default of 20 and a maximum of 200. ```APIDOC ## GET /api/automation/scripts/runs ### Description Retrieves the most recent script run records. The limit query parameter controls the number of records returned, with a default of 20 and a maximum of 200. ### Method GET ### Endpoint /api/automation/scripts/runs ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of records to return. Default is 20, minimum is 1, maximum is 200. ### Request Example GET /api/automation/scripts/runs?limit=20 ### Response #### Success Response (200) Returns a list of recent run records. The exact structure is not specified in the source. #### Response Example Not provided in the source. ``` -------------------------------- ### GET /api/automation/scripts/{scriptId} Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/api-contract.md Retrieves detailed metadata for a single automation script by its ID. Includes additional fields like packageFormat, manifestVersion, and source, but still excludes scriptText. ```APIDOC ## GET /api/automation/scripts/{scriptId} ### Description Retrieves detailed metadata for a single automation script by its ID. Includes additional fields like packageFormat, manifestVersion, and source, but still excludes scriptText. ### Method GET ### Endpoint /api/automation/scripts/{scriptId} ### Parameters #### Path Parameters - **scriptId** (string) - Required - The ID of the script to retrieve. ### Response #### Success Response - **ok** (boolean) - Indicates success. - **item** (object) - The script metadata object. - **id** (string) - Script ID. - **name** (string) - Script name. - **description** (string) - Script description. - **type** (string) - Script type. - **status** (string) - Script status. - **entryFile** (string) - Entry file name. - **tags** (array) - Tags associated with the script. - **selector** (object) - Selector for the script. - **params** (object) - Parameters for the script. - **notes** (string) - Additional notes. - **createdAt** (string) - Creation timestamp. - **updatedAt** (string) - Last update timestamp. - **packageFormat** (string) - Package format of the script. - **manifestVersion** (number) - Manifest version. - **source** (object) - Source information. - **type** (string) - Source type. - **uri** (string) - Source URI. - **ref** (string) - Source reference. - **path** (string) - Source path. - **importedAt** (string) - Import timestamp. #### Response Example { "ok": true, "item": { "id": "news-query-txt", "name": "查询新闻并写 TXT", "description": "测试脚本", "type": "playwright-cdp", "status": "ready", "entryFile": "index.cjs", "tags": ["Playwright", "新闻"], "selector": { "code": "BUYER_001" }, "params": { "keyword": "OpenAI", "limit": 10 }, "notes": "...", "createdAt": "2026-04-08T10:00:00Z", "updatedAt": "2026-04-08T11:00:00Z", "packageFormat": "ant-automation-script", "manifestVersion": 1, "source": { "type": "git", "uri": "https://example.com/repo.git", "ref": "main", "path": "", "importedAt": "2026-04-08T10:00:00Z" } } } ``` -------------------------------- ### GET /api/runtime/active - Query current active instance Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/api-contract.md Returns the currently active target on the unified CDP entry. Use to check if an active target exists and which instance is attached to the LaunchServer unified entry. ```text GET /api/runtime/active ``` -------------------------------- ### POST /api/runtime/session 请求 Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/api-contract.md 准备可接管会话的请求,包含 selector、timeoutMs、startUrls、skipDefaultStartUrls 和 launchArgs 字段。timeoutMs 默认 45000ms,最小 1000ms,最大 120000ms。 ```json { "selector": { "code": "BUYER_001" }, "timeoutMs": 45000, "startUrls": ["https://example.com"], "skipDefaultStartUrls": true, "launchArgs": ["--window-size=1400,900"] } ``` -------------------------------- ### Windows packaging project paths Source: https://github.com/black-ant/ant-browser/blob/master/bat/README.md Lists input, temporary, and output paths used by the Windows packaging branch. ```text 输入: - build\bin\ant-chrome.exe - publish\config.init.yaml - bin\xray.exe - bin\sing-box.exe 临时目录: - publish\staging\ 输出: - publish\output\AntBrowser-Setup-.exe ``` -------------------------------- ### POST /api/runtime/session Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/api-contract.md Creates a runtime session for browser takeover. Returns a CDP URL when ready, or a 202 status when not ready. ```APIDOC ## POST /api/runtime/session ### Description Creates a runtime session for browser takeover. Returns a CDP URL when ready, or a 202 status when not ready. ### Method POST ### Endpoint /api/runtime/session ### Parameters No parameters are documented in the source. ### Request Example Not provided in the source. ### Response #### Success Response (200) - **ready** (boolean) - Indicates if the session is ready. - **cdpUrl** (string) - The CDP URL to use for takeover when ready. #### Response Example Not provided in the source. #### Success Response (202) - **ready** (boolean) - Indicates if the session is not ready. #### Response Example Not provided in the source. ``` -------------------------------- ### 成功响应:已就绪 (200 OK) Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/api-contract.md 当实例已就绪时返回 200 OK,包含 ready=true、debugReady=true、cdpUrl 和 directDebugUrl。优先使用 cdpUrl,directDebugUrl 仅作诊断。 ```text 200 OK ``` ```json { "ok": true, "ready": true, "waitTimedOut": false, "retryable": false, "profileId": "profile-123", "profileName": "Amazon US", "launchCode": "BUYER_001", "running": true, "debugPort": 9333, "debugReady": true, "active": true, "cdpUrl": "http://127.0.0.1:19876", "directDebugUrl": "http://127.0.0.1:9333", "timeoutMs": 45000 } ``` -------------------------------- ### NSIS lookup order Source: https://github.com/black-ant/ant-browser/blob/master/bat/README.md Lists the environment variables and paths used to locate makensis.exe for Windows packaging. ```text MAKENSIS_PATH -> 直接指向 makensis.exe NSIS_PATH -> NSIS 目录或 makensis.exe NSIS_HOME -> NSIS 安装目录 PATH -> where makensis.exe ``` -------------------------------- ### build.bat usage Source: https://github.com/black-ant/ant-browser/blob/master/bat/README.md Builds build\bin\ant-chrome.exe. Fails if core entry files (go.mod, main.go, wails.json) are missing to avoid reusing stale artifacts. ```bat bat\build.bat ``` -------------------------------- ### Docker commands for Linux build Source: https://github.com/black-ant/ant-browser/blob/master/bat/README.md Commands to build and run the Linux builder via Docker Desktop. Requires Docker Desktop with Linux container engine. ```text docker build -f publish/linux/linux-builder.Dockerfile -t ant-browser-linux-builder:local publish/linux docker run --rm -v :/workspace -w /workspace ant-browser-linux-builder:local ^ bash -c "bash publish/linux/publish-linux.sh --arch " ``` -------------------------------- ### Development proxy environment variables Source: https://github.com/black-ant/ant-browser/blob/master/bat/README.md Lists environment variables for injecting HTTP(S) proxy for npm/Node/Go download traffic, setting NO_PROXY, and overriding GOPROXY (default https://goproxy.cn,direct). ```text DEV_PROXY_URL -> 为 npm / Node / Go 下载流量注入 HTTP(S) 代理 DEV_NO_PROXY -> 设置 NO_PROXY / no_proxy DEV_GOPROXY -> 覆盖 GOPROXY;未设置时默认使用 https://goproxy.cn,direct ``` -------------------------------- ### Browser kernel directory structure Source: https://github.com/black-ant/ant-browser/blob/master/README.md Recommended directory layout for manually prepared browser kernels, requiring chrome.exe in the kernel directory. ```text chrome/ chrom-142/ chrome.exe ... ``` -------------------------------- ### Windows 安装脚本(自动探测 OpenClaw 路径) Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw/MANUAL.zh-CN.md 在 Windows 上安装 ant-chrome-openclaw skill,自动探测 OpenClaw 路径并设置默认配置文件。需在项目根目录执行。 ```powershell pwsh -File skills/ant-chrome-openclaw/scripts/install_ant_chrome_openclaw.ps1 ` -SetDefaultProfile ``` -------------------------------- ### Windows 安装脚本(显式指定路径) Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw/MANUAL.zh-CN.md 当自动探测不到 OpenClaw 路径时,显式指定目标 skills 目录和配置文件。需在项目根目录执行。 ```powershell pwsh -File skills/ant-chrome-openclaw/scripts/install_ant_chrome_openclaw.ps1 ` -TargetSkillsDir "C:\path\to\openclaw\skills" ` -ConfigFile "C:\path\to\openclaw\openclaw.json" ` -SetDefaultProfile ``` -------------------------------- ### Linux 安装脚本(显式指定路径) Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw/MANUAL.zh-CN.md 当自动探测不到 OpenClaw 路径时,显式指定目标 skills 目录和配置文件。需在项目根目录执行。 ```bash bash skills/ant-chrome-openclaw/scripts/install_ant_chrome_openclaw.sh \ --target-skills-dir /path/to/openclaw/skills \ --config-file /path/to/openclaw/openclaw.json \ --set-default-profile ``` -------------------------------- ### Default NSIS fallback paths Source: https://github.com/black-ant/ant-browser/blob/master/bat/README.md Default fallback locations for makensis.exe. ```text C:\Program Files (x86)\NSIS\makensis.exe C:\Program Files\NSIS\makensis.exe ``` -------------------------------- ### 执行脚本接口 Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/script-compat.md 用于执行指定脚本,请求体包含 scriptId、selector、params 等字段。后端会映射到 AutomationScriptRunWithOptions,并转换 selector 和 params 字段。 ```text POST /api/automation/scripts/run ``` ```json { "scriptId": "news-query-txt", "selector": { "code": "BUYER_001" }, "params": { "keyword": "OpenAI", "limit": 10 }, "useScriptSelector": false, "useScriptParams": false } ``` -------------------------------- ### 停止实例 Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw/MANUAL.zh-CN.md 停止指定 launchCode 对应的实例。 ```text 使用 ant-chrome-openclaw skill。 停止 launchCode=BUYER_001 对应的实例。 ``` -------------------------------- ### Linux 安装脚本(自动探测 OpenClaw 路径) Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw/MANUAL.zh-CN.md 在 Linux 上安装 ant-chrome-openclaw skill,自动探测 OpenClaw 路径并设置默认配置文件。需在项目根目录执行。 ```bash bash skills/ant-chrome-openclaw/scripts/install_ant_chrome_openclaw.sh \ --set-default-profile ``` -------------------------------- ### 成功响应:启动了但未 ready (202 Accepted) Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/api-contract.md 当实例已启动但尚未 ready 时返回 202 Accepted,包含 ready=false、waitTimedOut=true、retryable=true 和 runtimeWarning。OpenClaw 应稍后重试 runtime/session 或使用 runtime/status 观察状态。 ```text 202 Accepted ``` ```json { "ok": true, "ready": false, "waitTimedOut": true, "retryable": true, "profileId": "profile-123", "launchCode": "BUYER_001", "running": true, "debugReady": false, "active": false, "runtimeWarning": "debug pending", "cdpUrl": "", "directDebugUrl": "", "timeoutMs": 45000 } ``` -------------------------------- ### Linux publish commands Source: https://github.com/black-ant/ant-browser/blob/master/README.md Commands to build Linux packages for amd64 or arm64 architectures using the publish-linux.sh script. ```bash bash publish/linux/publish-linux.sh --arch amd64 bash publish/linux/publish-linux.sh --arch arm64 ``` -------------------------------- ### 执行脚本接口(重复) Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/script-compat.md 用于本地执行现成脚本,透传 selector/params,返回运行结果、日志和产物路径。 ```text POST /api/automation/scripts/run ``` -------------------------------- ### macOS publish commands Source: https://github.com/black-ant/ant-browser/blob/master/README.md Commands to build unsigned macOS packages for amd64 or arm64. Must run on a native macOS host with matching architecture. ```bash bash publish/mac/publish-mac.sh --arch amd64 bash publish/mac/publish-mac.sh --arch arm64 ``` -------------------------------- ### recover-profiles.ps1 apply with repair Source: https://github.com/black-ant/ant-browser/blob/master/bat/README.md Applies recovery and creates a __repair_ copy for risky directories, then points new config to the copy. Use when old directories come from backup restore and may have cross-kernel residual state. ```powershell pwsh -File bat/recover-profiles.ps1 -AppRoot 'E:\software\Ant Browser' -Apply -RepairRisky ``` -------------------------------- ### recover-profiles.ps1 apply mode Source: https://github.com/black-ant/ant-browser/blob/master/bat/README.md Applies the recovery by writing to app.db. Backs up current database to data\recovery-backups\ first. Close Ant Browser before running. ```powershell pwsh -File bat/recover-profiles.ps1 -AppRoot 'E:\software\Ant Browser' -Apply ``` -------------------------------- ### Runtime script storage structure Source: https://github.com/black-ant/ant-browser/blob/master/README.md Shows how scripts are stored at runtime under data/automation/scripts// with a config directory for internal persistence. ```text data/automation/scripts// ├── config ├── index.cjs └── 其他辅助文件 ``` -------------------------------- ### 执行预置脚本(指定实例) Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw/MANUAL.zh-CN.md 当脚本未绑定目标实例或需要覆盖默认参数时,补充指定实例和启动条件。 ```text 使用 ant-chrome-openclaw skill。 直接执行预置脚本 news-query-txt。 目标实例用 Code G6AN4Q 的“默认实例”。 如果没启动就先启动。 参数用脚本默认值。 ``` -------------------------------- ### OpenClaw 一句话指令示例 Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/script-compat.md 展示 OpenClaw 如何用一句话描述执行脚本的任务。 ```text 执行脚本 news-query-txt,目标实例 BUYER_001,参数 keyword=OpenAI ``` -------------------------------- ### OpenClaw 转成 JSON 请求体 Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/script-compat.md OpenClaw 将用户指令整理为 scriptId、selector、params 后,POST 给 Ant Browser。 ```json { "scriptId": "news-query-txt", "selector": { "code": "BUYER_001" }, "params": { "keyword": "OpenAI" } } ``` -------------------------------- ### Automation script package directory structure Source: https://github.com/black-ant/ant-browser/blob/master/README.md Shows the directory layout for a single automation script package, including automation.script.json, index.cjs, and auxiliary files. ```text / ├── automation.script.json ├── index.cjs └── 其他辅助文件 ``` -------------------------------- ### 提问前缀:使用 ant-chrome-openclaw skill Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw/MANUAL.zh-CN.md 每次提问开头必须写这段文字,然后直接写目标。 ```text 使用 ant-chrome-openclaw skill。 ``` -------------------------------- ### recover-profiles.ps1 preview mode Source: https://github.com/black-ant/ant-browser/blob/master/bat/README.md Runs the script in preview mode (no database write) to inspect recovery candidates. ```powershell pwsh -File bat/recover-profiles.ps1 -AppRoot 'E:\software\Ant Browser' ``` -------------------------------- ### 接管浏览器实例接口 Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/script-compat.md 用于接管一个已可调试的浏览器实例,返回可接管的 cdpUrl。 ```text POST /api/runtime/session ``` -------------------------------- ### 执行预置脚本(简短版) Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw/MANUAL.zh-CN.md 直接执行预置脚本 news-query-txt,适用于脚本已绑定目标实例和默认参数的情况。 ```text 使用 ant-chrome-openclaw skill。 直接执行预置脚本 news-query-txt。 ``` -------------------------------- ### 只查,不要切换 Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw/MANUAL.zh-CN.md 检查当前 active 实例和指定实例状态,但不自动切换,先告知用户。 ```text 使用 ant-chrome-openclaw skill。 先检查当前 active 实例和 BUYER_001 的运行状态。 如果当前 active 不是 BUYER_001,不要自动切换,先告诉我。 ``` -------------------------------- ### selector 字段示例 Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/api-contract.md 展示大多数运行时接口支持的 selector 字段,包括 code、key、profileId、profileName、keyword、keywords、tag、tags、groupId 和 matchMode。matchMode 在运行时控制中仅建议使用 unique 或 first,不适用于 runtime/session、runtime/status、runtime/stop。 ```json { "selector": { "code": "BUYER_001", "key": "buyer-001", "profileId": "profile-123", "profileName": "Amazon US", "keyword": "amazon-us", "keywords": ["amazon-us", "checkout"], "tag": "电商", "tags": ["电商", "北美"], "groupId": "group-sales", "matchMode": "unique" } } ``` -------------------------------- ### 最近结果接口 Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/script-compat.md 用于获取最近执行结果,支持 limit 参数。 ```text GET /api/automation/scripts/runs?limit=20 ``` -------------------------------- ### 启动并接管实例 Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw/MANUAL.zh-CN.md 启动指定实例,确认 debugReady=true 后接管浏览器并打开网址。 ```text 使用 ant-chrome-openclaw skill。 启动实例 BUYER_001。 确认 debugReady=true 后接管浏览器,并打开 https://example.com ``` -------------------------------- ### 列出脚本接口 Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/script-compat.md 用于获取可执行脚本列表,返回 scriptId、名称、类型、默认 selector 和默认 params。 ```text GET /api/automation/scripts ``` -------------------------------- ### 覆盖默认参数 Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw/MANUAL.zh-CN.md 执行预置脚本时覆盖 keyword 和 limit 参数,其他保持默认。 ```text 使用 ant-chrome-openclaw skill。 直接执行预置脚本 news-query-txt。 目标实例继续用脚本默认绑定。 把 keyword 改成 OpenAI Agents,limit 改成 5,其他参数保持默认。 ``` -------------------------------- ### Common environment variables for publish.bat Source: https://github.com/black-ant/ant-browser/blob/master/bat/README.md Environment variables to avoid pausing after execution, suitable for CI or script calls. ```text NO_PAUSE=1 -> 运行结束不 pause(适合 CI 或脚本调用) CI=1 -> 同样不 pause ``` -------------------------------- ### POST /api/automation/scripts/run Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/api-contract.md Executes an automation script by its ID, with optional selector and parameters. Returns the run result including status, summary, and timing information. ```APIDOC ## POST /api/automation/scripts/run ### Description Executes an automation script by its ID, with optional selector and parameters. Returns the run result including status, summary, and timing information. ### Method POST ### Endpoint /api/automation/scripts/run ### Parameters #### Request Body - **scriptId** (string) - Required - The ID of the script to run. - **selector** (object) - Optional - A JSON object used to select the script context. If omitted, it is equivalent to `useScriptSelector=true`. - **params** (object) - Optional - A JSON object containing parameters for the script. If omitted, it is equivalent to `useScriptParams=true`. - **useScriptSelector** (boolean) - Optional - If explicitly set to `false`, `selector` must be provided. - **useScriptParams** (boolean) - Optional - If explicitly set to `false`, `params` must be provided. ### Request Example { "scriptId": "news-query-txt", "selector": { "code": "BUYER_001" }, "params": { "keyword": "OpenAI", "limit": 10 } } ### Response #### Success Response (200) - **ok** (boolean) - Indicates success. - **run** (object) - The run result. - **id** (string) - Run ID. - **scriptId** (string) - Script ID. - **scriptName** (string) - Script name. - **scriptType** (string) - Script type. - **status** (string) - Run status. - **summary** (string) - Summary of the run. - **error** (string) - Error message if any. - **resultText** (string) - Result text. - **startedAt** (string) - Start timestamp. - **finishedAt** (string) - Finish timestamp. - **durationMs** (number) - Duration in milliseconds. #### Response Example { "ok": true, "run": { "id": "run-1", "scriptId": "news-query-txt", "scriptName": "查询新闻并写 TXT", "scriptType": "playwright-cdp", "status": "success", "summary": "已抓取 10 条新闻并写入 TXT", "error": "", "resultText": "{...}", "startedAt": "2026-04-08T10:00:00Z", "finishedAt": "2026-04-08T10:00:12Z", "durationMs": 12034 } } ### Error Responses - **400** - Bad request. Possible messages: `scriptId is required`, `selector must be a JSON object`, `params must be a JSON object`. - **500** - Internal server error. Possible causes: script execution failure, automation runtime unavailable. ``` -------------------------------- ### Linux output directory Source: https://github.com/black-ant/ant-browser/blob/master/bat/README.md Output directory for Linux artifacts. ```text publish\output\ ``` -------------------------------- ### Memory control environment variables Source: https://github.com/black-ant/ant-browser/blob/master/bat/README.md Lists environment variables that control memory limits for the frontend dev watcher. Defaults: FRONTEND_NODE_RSS_HARD_LIMIT_MB=0 (warn only), FRONTEND_PROCESS_MEMORY_LIMIT_MB=512 in limited mode. ```text FRONTEND_PROCESS_MEMORY_LIMIT_MB FRONTEND_NODE_MAX_OLD_SPACE_SIZE_MB FRONTEND_NODE_MAX_SEMI_SPACE_SIZE_MB FRONTEND_NODE_RSS_WARN_MB FRONTEND_NODE_RSS_HARD_LIMIT_MB FRONTEND_NODE_RSS_HARD_LIMIT_HITS FRONTEND_NODE_RSS_AUTO_RESTART FRONTEND_NODE_RSS_RESTART_DELAY_MS FRONTEND_NODE_RSS_RESTART_MAX_COUNT FRONTEND_NODE_RSS_RESTART_WINDOW_MS FRONTEND_NODE_MEMORY_POLL_MS FRONTEND_DISABLE_HMR ``` -------------------------------- ### POST /api/runtime/stop - Stop an instance Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/api-contract.md Stops a running instance. The request body includes a selector. Successful response includes stopped=true, running=false, debugReady=false. ```text POST /api/runtime/stop ``` ```json { "selector": { "code": "BUYER_001" } } ``` -------------------------------- ### 只接管当前实例 Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw/MANUAL.zh-CN.md 检查当前 active 实例,如果是 BUYER_001 则直接接管,不切换。 ```text 使用 ant-chrome-openclaw skill。 先检查当前 active 实例。 如果已经是 BUYER_001,就直接接管,不要切换到别的实例。 ``` -------------------------------- ### POST /api/runtime/stop Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/api-contract.md Stops the runtime session after browser takeover is complete. ```APIDOC ## POST /api/runtime/stop ### Description Stops the runtime session after browser takeover is complete. ### Method POST ### Endpoint /api/runtime/stop ### Parameters No parameters are documented in the source. ### Request Example Not provided in the source. ### Response Not specified in the source. ``` -------------------------------- ### 脚本执行示例:优先使用 code 作为 selector Source: https://github.com/black-ant/ant-browser/blob/master/docs/audits/automation-target-id-vs-code-report.zh-CN.md 在文档和 API 示例中,优先使用 selector.code 字段,而不是默认展示 profileId。该示例展示了如何通过 code 指定目标实例。 ```json { "scriptId": "news-query-txt", "useScriptSelector": false, "selector": { "code": "BUYER_001" } } ``` -------------------------------- ### POST /api/runtime/stop Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/api-contract.md Stops an instance identified by a selector. The success response includes stopped=true, running=false, and debugReady=false. ```APIDOC ## POST /api/runtime/stop ### Description Stops an instance identified by a selector. The success response includes stopped=true, running=false, and debugReady=false. ### Method POST ### Endpoint /api/runtime/stop ### Request Body - **selector** (object) - Required - Selector to identify the instance. ### Request Example { "selector": { "code": "BUYER_001" } } ### Response #### Success Response - **stopped** (boolean) - Indicates the instance was stopped. - **running** (boolean) - Indicates the instance is no longer running. - **debugReady** (boolean) - Indicates debug readiness is false. ``` -------------------------------- ### 用户指令示例 Source: https://github.com/black-ant/ant-browser/blob/master/skills/ant-chrome-openclaw-automation-plan/references/script-compat.md 展示用户如何用自然语言描述执行脚本的需求。 ```text 用户:用 BUYER_001 执行新闻抓取脚本,关键词 OpenAI,保存结果 ```