AUG WorkSpace API 参考

本地控制面:REST(任何语言)、MCP(AI Agent)、 Python SDK、Selenium 适配器。本页由接口注册表生成 —— 端点与工具索引即当前版本的样子。

机器可读契约(与 本页同一个注册表生成): openapi.json(OpenAPI 3.1,Java/Go 客户端可直接生成)、 Postman 集合(导入即用, 变量 baseUrl / apiKey)。权威清单仍是 GET /v1/tools。

概述

控制面默认监听 http://127.0.0.1:8311(可用 AUG_API_HOST / AUG_API_PORT 覆盖;未设 AUG_API_KEY 时只允许回环且只读)。

限流(背压,不是配额):AUG_API_MAX_RPS 由部署者设(缺省 0=不限), 超限回 429 + Retry-After;突发容量 AUG_API_BURST(缺省=每秒上限上取整)、 桶上等待上限 AUG_API_MAX_WAIT_MS(缺省 250)。非回环监听必须设 AUG_API_MAX_RPS, 否则拒绝启动。它保护的是宿主(每个请求都在驱动一台真实浏览器),故不按档案数计。

两种调用面:资源路由(下表,语义化路径)与 POST /v1/call ({"name": "<工具名>", "arguments": {...}},%d 个工具全可达)。 工具清单与入参 schema 也可在 GET /v1/tools 实时取。

鉴权与信封

执行类调用需 Authorization: Bearer <AUG_API_KEY>(常量时间比对)。 无 key = 本机只读:读类可用,执行类回 403 local_readonly(不是静默放行)。

所有响应都是信封:成功 {"ok": true, "result": ...};失败 {"ok": false, "code": "...", "error": "..."}。参数名拼错一律 400 并列出可接受键集(静默按缺省执行是本仓点名的失败模式)。

五分钟上手

控制面**随 App 分发、但不会自动启动**(本版实测:装完 App 后它不会自己监听 8311)。 用 App **自带的那份 Python** 起它最省事(不依赖你机器上装了什么):

⚠️ 下面那个 -B(与 PYTHONDONTWRITEBYTECODE=1)不是装饰,别省。 core/ 与自带运行时都住在已签名的应用包里,而 CPython 缺省会把 .pyc 写回它导入的每个模块旁边 ⇒ 往签名包里新增文件会当场破坏封签: codesign --verify --strict 报 a sealed resource is missing or invalid (实测形态:一次启动写入 130 个 .pyc,分布在包内 stdlib、core/ 与 cryptosite/ 三处)。用系统自带的 python3 指向包内 core/ 也一样会写, 而且版本与包内运行时不一致 —— 两条都别省。

ENGINE="/Applications/AUG WorkSpace.app/Contents/Resources/engine"
export AUG_API_KEY=<你的 Key>
export PYTHONDONTWRITEBYTECODE=1                                   # ← 见上:不写 .pyc 进签名包
"$ENGINE/pyruntime/bin/python3" -B "$ENGINE/core/api_server.py"    # 缺省 127.0.0.1:8311

curl -s localhost:8311/v1/health
curl -s -X POST localhost:8311/v1/profiles -H "Authorization: Bearer $AUG_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"name":"demo","geo":"US","group_id":"我的分组","no_proxy":true}'
curl -s -X POST localhost:8311/v1/profiles/<id>/launch -H "Authorization: Bearer $AUG_API_KEY" \
  -d '{"url":"https://example.com"}'
curl -s localhost:8311/v1/profiles/<id>/status -H "Authorization: Bearer $AUG_API_KEY"
curl -s -X POST localhost:8311/v1/profiles/<id>/type -H "Authorization: Bearer $AUG_API_KEY" \
  -d '{"selector":"#user","text":"alice","human":true,"input":"inline"}'
curl -s localhost:8311/v1/profiles/<id>/cookies -H "Authorization: Bearer $AUG_API_KEY"
curl -s -X DELETE localhost:8311/v1/profiles/<id> -H "Authorization: Bearer $AUG_API_KEY"

⚠️ human:true 有两条通路:input:"hid"(缺省,真实 HID 事件流, 全机串行)与 input:"inline"(进程内投递,多档案可并发)。 批量并发请显式写 inline。

REST 端点(62 条 · 客户面)

方法路径请求体键工具说明
POST/v1/profiles任意(见该工具的 schema)create_profileAPI 建档:不经 GUI 新建 profile(企业接入 A2)
GET/v1/profilesworkspace_id, limit, cursorlist_profiles列出 profile 摘要(代理密码脱敏;含工作区分组)
GET/v1/profiles/(?P<id>[^/]+)include_secretget_profile读取单个 profile 完整数据(代理凭据与身份根密钥脱敏)
GET/v1/profiles/(?P<id>[^/]+)/statustimeoutprofile_status查档案**运行态**:该档的浏览器现在在不在跑、bridge 端口、当前标签页/URL(对应兼容产品的 `browser-profile/active`)
PUT/v1/profiles/(?P<id>[^/]+)notes, totp_secret, passkey, save_password, proxy_settings, passkey_uvupdate_profile回写档案的可变元数据(企业接入清单 §三-7)
DELETE/v1/profiles/(?P<id>[^/]+)(无)delete_profile删除档案(**软删**:移入回收站,可 restore_profile 恢复)
POST/v1/profiles/(?P<id>[^/]+)/restore(无)restore_profile从回收站恢复档案(`Trash/<id>.json` → `Profiles/<id>.json`,与 GUI 回收站的「恢复」同一动作)
GET/v1/trashlimit, cursorlist_trash列出回收站里的档案(软删的档)
DELETE/v1/trash/(?P<id>[^/]+)(无)purge_profile从回收站**彻底删除**档案:引擎 `--dispose` 擦除该档的 WebKit datastore + sidecar(History/Downloads
GET/v1/auditlimitaudit_log查这台机器上的**本地调用审计**(最近 N 条,新的在前):时间/请求 id/工具/成功与否/机读码/耗时/档位
GET/v1/usagedaysusage_report本机用量自查:按**本地日历日**汇总这台机器上的调用(总数 / 成功失败 / 按天 / 按工具 / 按机读码 / 按传输),并把**资源占用**(档案、回收站
GET/v1/webhooks(无)webhook_list列出本机登记的事件回调(本地回调,P3-⑫)
POST/v1/webhooksurl, eventswebhook_register登记一个本地回调:事件发生时 POST 到你给的地址
DELETE/v1/webhooks/(?P<id>[^/]+)(无)webhook_delete删除一个本地回调(幂等:已经不在⇒回 ok 且 already:true)
GET/v1/jobsstate, limitjob_list列出本机 Orchestrator 作业:状态/进度/预算/待审批数
POST/v1/jobstitle, targets, plan, skill_name, skill_version, budget_cap_usd, idempotency_keyjob_create建一个本机 Orchestrator 作业(Team+)
GET/v1/jobs/(?P<id>[^/]+)(无)job_show看单个 Orchestrator 作业的完整状态(含步骤计划/预算/待审批数)
POST/v1/jobs/(?P<id>[^/]+)/cancelcodejob_cancel请求取消一个 Orchestrator 作业
GET/v1/operationsprofile_id, parent_job_id, state, after_revision, limitoperation_list列出统一 OperationReceipt(生命周期、任务步骤、效果与资源状态)
GET/v1/operations/(?P<id>[^/]+)events, after_seqoperation_show查看单个 OperationReceipt;events=true 时连同追加式阶段事件返回
POST/v1/profiles/(?P<id>[^/]+)/launchurl, runtimeProxy, idempotencyKeylaunch_profile启动 profile 浏览器
POST/v1/profiles/(?P<id>[^/]+)/stopidempotencyKeystop_profile优雅关闭本 MCP 进程启动的 profile 浏览器:SIGTERM → 等引擎自存 cookie jar 并确认进程退出后,才注销会话并释放资源租约;5 秒
POST/v1/profiles/(?P<id>[^/]+)/navigateurlnavigate导航 profile 浏览器到 URL
POST/v1/profiles/(?P<id>[^/]+)/evaluatejs, await, frameevaluate在 profile 浏览器执行 JS:缺省返回同步求值结果;await=true 时等 Promise 结算(等价 Selenium executeAsyncS
GET/v1/profiles/(?P<id>[^/]+)/current-url(无)current_url读 profile 当前页 URL(主框架 location.href;等价 Selenium driver.current_url)
GET/v1/profiles/(?P<id>[^/]+)/page-sourcemax_bytespage_source取整页 HTML 源码(document.documentElement.outerHTML,等价 Selenium driver.page_source)
GET/v1/profiles/(?P<id>[^/]+)/screenshotformat, max_width, qualityscreenshot截取 profile 页面当前可视画面(native WKWebView takeSnapshot:所见即真实渲染,不受页面 canvas 加噪影响)
POST/v1/profiles/(?P<id>[^/]+)/clickselector, element_id, index, human, pace, input, frameclick点击 profile 页面元素
POST/v1/profiles/(?P<id>[^/]+)/typeselector, element_id, text, human, speed, input, frametype在 profile 页面元素输入文本
POST/v1/profiles/(?P<id>[^/]+)/keykey, selector, humankey对 profile 页面焦点元素(或 selector 指定元素)派发按键 keydown/keyup(JS,isTrusted=false → 浏览器原生提交
POST/v1/profiles/(?P<id>[^/]+)/hoverselector, element_id, index, pace, framehover拟人悬停 profile 页面首个匹配 selector 元素(真实 HID:CGEvent 移到元素中心 + 停留,isTrusted=true 触发 hov
POST/v1/profiles/(?P<id>[^/]+)/fill_credential(无)fill_credential把本档案在**当前页 host** 下保存的登录凭据填进页面登录表单
POST/v1/profiles/(?P<id>[^/]+)/save_credentialusername, passwordsave_credential把调用方给的登录凭据写进本档案的钥匙串(与浏览器内保存同一条路径、同 host 同用户名合并)
POST/v1/profiles/(?P<id>[^/]+)/waitselector, timeout, intervalwait_for轮询等待 profile 页面首个匹配 selector 出现;超时返回结构化 timeout 错误
GET/v1/profiles/(?P<id>[^/]+)/readselector, frameread读取 profile 页面首个匹配 selector 的文本
GET/v1/profiles/(?P<id>[^/]+)/page-mapmax_elements, text_limit, byte_budgetpage_map导出现页 DOM 结构地图(页面骨架 + ≤200 个可见交互元素的 id/tag/role/text/sel/rect),供 AI 看清页面并寻址
GET/v1/profiles/(?P<id>[^/]+)/historyquery, limithistory查询档案浏览历史(最近访问的网页,url/title/时间戳,最新在前;预热导航不记录)
GET/v1/profiles/(?P<id>[^/]+)/detect-block(无)detect_block探测 profile 当前页风控/验证码信号(recaptcha/hcaptcha/Cloudflare/频率限制等)
GET/v1/profiles/(?P<id>[^/]+)/tabs(无)tabs列出 profile 浏览器当前标签页
POST/v1/profiles/(?P<id>[^/]+)/tabsurlnew_tabprofile 浏览器新建标签页并导航到 URL(缺省 example.com)
POST/v1/profiles/(?P<id>[^/]+)/tabs/(?P<index>\d+)/activate(无)switch_tabprofile 浏览器切换到第 index 个标签页
DELETE/v1/profiles/(?P<id>[^/]+)/tabs/(?P<index>\d+)(无)close_tabprofile 浏览器关闭第 index 个标签页
GET/v1/profiles/(?P<id>[^/]+)/cookies(无)export_cookies_json导出 profile 浏览器全部 cookie 为 JSON(全字段:name,value,domain,path,secure,**httpOnly**,ex
POST/v1/profiles/(?P<id>[^/]+)/cookiescookiesimport_cookies_json按 JSON 注入 cookie(全字段:name,value,domain,path,secure,**httpOnly**,expires(Unix 秒),
PUT/v1/profiles/(?P<id>[^/]+)/cookiescookiesreplace_cookies_json全量替换 cookie(先清空再注入 JSON,全字段;删除/修改/新增实时生效)
POST/v1/profiles/(?P<id>[^/]+)/clear-cacheoriginclear_cache清 profile 浏览器缓存(≈ CDP Network.clearBrowserCache)
POST/v1/profiles/(?P<id>[^/]+)/clear-dataoriginclear_data_for_origin清 profile 浏览器站点数据(≈ CDP Storage.clearDataForOrigin):cookie/localStorage/IndexedD
GET/v1/workspacesinclude_default, with_membersworkspace_list列出工作区(档案分组=企业接入清单 §二-12 `group_id`)
POST/v1/workspacesname, namesworkspace_create新建工作区(=建一个分组;`group_id` 的目标)
PUT/v1/workspaces/(?P<workspace_id>[^/]+)nameworkspace_rename重命名工作区(`default` 桶不可改名)
DELETE/v1/workspaces/(?P<workspace_id>[^/]+)(无)workspace_delete删除工作区(**只删分组本身与归属,不动任何档案本体** —— 与 GUI 一致)
POST/v1/workspaces/batch_deleteworkspace_idsworkspace_delete删除工作区(**只删分组本身与归属,不动任何档案本体** —— 与 GUI 一致)
POST/v1/profiles/(?P<id>[^/]+)/workspacesadd, removeprofile_workspaces查 / 改某个档案的工作区归属(`group_id` 的读写口)
GET/v1/profiles/(?P<id>[^/]+)/workspaces(无)profile_workspaces查 / 改某个档案的工作区归属(`group_id` 的读写口)
POST/v1/profiles/(?P<id>[^/]+)/duplicatenameduplicate_profile基于已有档案克隆一份全新独立身份的新档案(新 UUID 与独立指纹密钥,不共享 Cookie/会话)
POST/v1/profiles/batch/launchids, url, concurrencybatch_launch有界并发批量启动多个档案(每档均走单点策略与容量门控,返回逐档结果)
POST/v1/profiles/batch/stopidsbatch_stop批量停止多个运行中的档案,返回逐档停止回执
GET/v1/profiles/(?P<id>[^/]+)/downloadslimitdownload_list查询单档案或全部档案的隔离下载记录(只读,读取 AUG/Downloads/<id>.json)
POST/v1/proxies/checkid, proxy_url, timeoutproxy_check检测档案或指定代理的真实出口 IP、国家、时区与延迟(脱敏返回,绝不回显代理密码)
GET/v1/runtime/status(无)runtime_status返回宿主 macOS 版本、Mac 原生隔离就绪状态以及本机已缓存的 iOS 按需 CAS 运行时清单
POST/v1/fleet/run任意(见该工具的 schema)fleet_run总代理下发一组作业(fan-out/broadcast/pipeline)
GET/v1/fleet/summaryrun_idfleet_summary看一次总代理运行(run)的汇总:阶段/每档案的作业状态计数

工具索引(75 个 · 客户面)

点开任一条可看它的 inputSchema(与 GET /v1/tools 同源)。

⚠️ 本页按「客户侧」裁剪:只列与「在本机建档 / 启动 / 驱动页面 / 收尾」 直接相关的接口;与本机驱动无关的那些不在此列。 机器权威清单始终是 GET /v1/tools —— 它以接口注册表为准、不裁剪; 照它的名字与 inputSchema 写代码,不会因为本页的取舍而漏掉什么。

audit_log — 查这台机器上的**本地调用审计**(最近 N 条,新的在前):时间/请求 id/工具/成功与否/机读码/耗时/档位。**只落本机、绝不外发**;**不记参数体**(所以查不到「你当时传了什么」,那是刻意的 —— 参数里有

查这台机器上的**本地调用审计**(最近 N 条,新的在前):时间/请求 id/工具/成功与否/机读码/耗时/档位。**只落本机、绝不外发**;**不记参数体**(所以查不到「你当时传了什么」,那是刻意的 —— 参数里有代理密码、cookie、TOTP)。要定位某一次调用,用它响应头里的 `X-Request-Id` 在这个清单里搜 `rid`。

{
 "type": "object",
 "properties": {
  "limit": {
   "type": "integer",
   "description": "最多回几条(1..1000,缺省 100)。注意这与 list_* 的分页参数**不同名同义**:审计是「只要最近 N 条」,没有游标"
  }
 }
}
batch_launch — 有界并发批量启动多个档案(每档均走单点策略与容量门控,返回逐档结果)。

有界并发批量启动多个档案(每档均走单点策略与容量门控,返回逐档结果)。

{
 "type": "object",
 "properties": {
  "ids": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "要启动的档案 ID 列表(1–16 个)"
  },
  "url": {
   "type": "string",
   "description": "可选起始 URL"
  },
  "concurrency": {
   "type": "integer",
   "description": "并发度(1–8,默认 3)"
  }
 },
 "required": [
  "ids"
 ]
}
batch_stop — 批量停止多个运行中的档案,返回逐档停止回执。

批量停止多个运行中的档案,返回逐档停止回执。

{
 "type": "object",
 "properties": {
  "ids": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "要停止的档案 ID 列表(1–32 个)"
  }
 },
 "required": [
  "ids"
 ]
}
clear_cache — 清 profile 浏览器缓存(≈ CDP Network.clearBrowserCache)。origin 缺省 = 清全部 HTTP/内存/Fetch 缓存;给了 origin = 只清该源。**范围不含 cook

清 profile 浏览器缓存(≈ CDP Network.clearBrowserCache)。origin 缺省 = 清全部 HTTP/内存/Fetch 缓存;给了 origin = 只清该源。**范围不含 cookie/localStorage/IndexedDB**——那是 clear_data_for_origin 的事

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "origin": {
   "type": "string",
   "description": "如 https://example.com;缺省=全部"
  }
 },
 "required": [
  "id"
 ]
}
clear_data_for_origin — 清 profile 浏览器站点数据(≈ CDP Storage.clearDataForOrigin):cookie/localStorage/IndexedDB/ServiceWorker/缓存。origin 缺省 =

清 profile 浏览器站点数据(≈ CDP Storage.clearDataForOrigin):cookie/localStorage/IndexedDB/ServiceWorker/缓存。origin 缺省 = 全量。全量清时回执 cleared 为 null(WebKit 该 API 不给条数)

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "origin": {
   "type": "string",
   "description": "如 https://example.com;缺省=全部"
  }
 },
 "required": [
  "id"
 ]
}
click — 点击 profile 页面元素。selector=CSS 选择器;或 element_id=page_map 返回的稳定元素 id(填了则现场重解析为 sel 并覆盖 selector)。human:true → 真实

点击 profile 页面元素。selector=CSS 选择器;或 element_id=page_map 返回的稳定元素 id(填了则现场重解析为 sel 并覆盖 selector)。human:true → 真实 HID 拟人点击:CGEvent Bezier 轨迹+ 档案 persona 鼠标指纹,isTrusted=true 防 BOT,仅单前台 profile;缺省 JS 快速但 isTrusted=false

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "selector": {
   "type": "string",
   "description": "CSS 选择器(与 element_id 二选一)"
  },
  "element_id": {
   "type": "integer",
   "description": "page_map 返回的元素 id(与 selector 二选一;填了覆盖 selector)"
  },
  "index": {
   "type": "integer"
  },
  "human": {
   "type": "boolean",
   "description": "true=拟人点击(真实 HID,isTrusted=true,防 BOT;仅单前台 profile)"
  },
  "pace": {
   "type": "number",
   "description": "0.2-2.0 全局节奏乘数(>1 更快),仅 human:true 生效;缺省 1.0"
  },
  "input": {
   "type": "string",
   "enum": [
    "hid",
    "inline"
   ],
   "description": "仅 human:true 时有意义。`hid`(缺省)=真实 HID 事件流,**全机串行**(多档案并发会排队、超 30s 预算抛 hid_busy);`inline`=**进程内投递**(NSEvent 直投本档 WKWebView,不激活窗口、不占前台)⇒ **多档案可并发**,页面侧 isTrusted 实测仍为 true。⚠️ inline 不含 persona 的错字自纠/停顿,且后台时页面 `document.hasFocus()` 为 false。要并发选 inline"
  },
  "frame": {
   "type": "integer",
   "description": "子帧 index(frames 工具列出;缺省=主帧)。元素在子帧里的 rect 经坐标链折算到主帧视口再走同一条点击链;坐标链任一级对不上(帧失效/帧序不可靠)显式报错,不按猜的坐标点"
  }
 },
 "required": [
  "id"
 ]
}
close_tab — profile 浏览器关闭第 index 个标签页

profile 浏览器关闭第 index 个标签页

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "index": {
   "type": "integer"
  }
 },
 "required": [
  "id",
  "index"
 ]
}
create_profile — API 建档:不经 GUI 新建 profile(企业接入 A2)。支持传入代理(socks5/http+账号密码)/时区/语言/UA/WebRTC策略/音频与画布保护/更严格的画布防关联/标签页画布防关联/预置 coo

API 建档:不经 GUI 新建 profile(企业接入 A2)。支持传入代理(socks5/http+账号密码)/时区/语言/UA/WebRTC策略/音频与画布保护/更严格的画布防关联/标签页画布防关联/预置 cookie/Passkey。与 GUI 建档同一生成路径,落同一 ProfileStore。返回新建的 id 列表。

{
 "type": "object",
 "properties": {
  "count": {
   "type": "integer",
   "description": "新建数量;缺省 1(上限 1000)。count > 1 时不能同时预置 cookies/cookies_json:同一份登录态会被复制到多个档案"
  },
  "name": {
   "type": "string",
   "description": "档案名(传了才覆盖,多档追加 -1/-2 序号)"
  },
  "emoji": {
   "type": "string",
   "description": "档案 emoji(传了才覆盖)"
  },
  "os": {
   "type": "string",
   "enum": [
    "mac",
    "ios"
   ],
   "description": "设备系统;缺省 mac(ios=iPhone/iPad Safari 模拟)"
  },
  "device": {
   "type": "string",
   "description": "iOS 型号(仅 os=ios);必须来自已签名 runtime 的可创建型号集合"
  },
  "ios": {
   "type": "string",
   "description": "iOS 版本(如 26.5/27.0,也可传主版本;仅 os=ios,须与 device 构成精确 runtime 面)"
  },
  "model": {
   "type": "string",
   "description": "Mac 机型(仅 os=mac);未匹配报错不回退"
  },
  "geo": {
   "type": "string",
   "description": "锁定地理层(时区+语言),用于「代理出口跟随」。两种形态:① 两位国家码(`US`,大小写不敏感)→ 该国时区集内加权采样;② IANA 时区(`America/Los_Angeles`)→ 时区**直接锁定**,即「锁定到国家内某个时区」(美国可精确到州级)。⚠️ 认不出的值**直接报错**,不会静默回落;`region`/`city` 不是受支持粒度,要锁地区请传该地区的 IANA 时区"
  },
  "timezone": {
   "type": "string",
   "description": "显式 IANA 时区(如 `America/Los_Angeles`),覆盖 geo 派生值。⚠️ 须与代理出口一致,否则留下「时区↔出口 IP 偏差」tell(pixelscan Timezone spoofed)。⚠️ 认不出的值**直接报错**,不会静默写入档案"
  },
  "languages": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "**页面语言**(`languages[0]` 生效):引擎 native navigator.language + HTTP Accept-Language 头(引擎只取前 2)。缺省 = 按代理出口国推导(LOCALE-PROXY);无代理国线索时取系统 locale"
  },
  "language": {
   "type": "string",
   "description": "**Intl 语言**(单数形态,如 `de-DE`):只影响 §5/§18b/§20 的 Intl locale,不影响 navigator.language 与 HTTP 头。与 languages 分开传时**主语言子标签必须相同**(`en-GB` + `en-US` 可以,`ja-JP` + `de-DE` 报错)——跨基的 (navigator.language, Intl) 对真机不存在,是主动伪造形状。缺省 = 按代理出口国推导(LOCALE-PROXY);无代理国线索时取系统 locale"
  },
  "allow_locale_mismatch": {
   "type": "boolean",
   "description": "LOCALE-PROXY 一致性门:显式 language/languages/timezone 与代理出口国明显矛盾时,默认**拒绝建档**(ToolError)。true = 保留用户显式值并放行,在 spoofSettings 写 localeMismatch=true + localeMismatchDetail,供审计/告警。缺省 false"
  },
  "user_agent": {
   "type": "string",
   "description": "自定义 UA(写引擎 native customUserAgent)。缺省按机型/系统自洽派生"
  },
  "browser_version": {
   "type": "string",
   "description": "指定**该档案的 Safari/WebKit 版本**(企业接入清单 §二-6 的「内核版本」)。⚠️ 只接受真实发放过的版本(如 `27.2` / `26.6.2` / `18.1` / `17.4`),越界**当场 400 并列出允许值** —— 不接受 `152` 这类 **Chrome/Blink 主版本号**:本产品内核是系统 WebKit,没有这个数(硬编个映射=给一个假内核)。**它反过去约束平台**:版本 → 它真实存在过的 macOS 家族(macOS_14↔17.x / macOS_15↔18.x、27.2 / macOS_26↔26.x、27.2 / macOS_27↔27.0、27.2)或 iOS 主版本;与显式 `model`/`ios`/`host` 冲突时**拒**,不把「macOS 14 声称 Safari 26」这种不可能形状写进档案。与 `user_agent`(整串覆盖)**互斥**:同时给时哪一份生效不可预期"
  },
  "no_proxy": {
   "type": "boolean",
   "description": "确切直连:跳过代理池自动分配。传了 proxy 时自动等效。⚠️ 缺省 false = 沿用工厂缺省:本机代理配置里有默认出口时**会自动分配池子出口**并把该出口凭据写进档案——不想要就显式 no_proxy:true"
  },
  "proxy": {
   "type": "object",
   "description": "代理(建号即绑)。transport=native 时 WebKit 直连静态上游;helper 使用兼容 socks_fwd。显式传 = 确切用这个出口,不再自动分配",
   "properties": {
    "type": {
     "type": "string",
     "description": "socks5|http|https"
    },
    "host": {
     "type": "string"
    },
    "port": {
     "type": "integer"
    },
    "username": {
     "type": "string"
    },
    "password": {
     "type": "string"
    },
    "chainProxy": {
     "type": "string",
     "description": "上游链路(存在即走链):socks5:// / socks5h:// / http:// / https://,可带 username:password"
    },
    "transport": {
     "type": "string",
     "enum": [
      "native",
      "helper"
     ],
     "description": "网络路径;缺省自动选择 native(静态代理且无 chain)"
    }
   }
  },
  "webrtc": {
   "type": "string",
   "enum": [
    "disabled",
    "proxy_ip",
    "publicOnly",
    "safari"
   ],
   "description": "WebRTC 策略:disabled=禁用(客户 webrtc=disabled 对应此项);proxy_ip=跟随代理出口(缺省);publicOnly=仅公网候选;safari=显式 Safari 原生 pass-through(可能暴露真实候选)"
  },
  "audio_noise": {
   "type": "boolean",
   "description": "让每个档案的音频结果不同,默认开启。"
  },
  "canvas_noise": {
   "type": "boolean",
   "description": "让每个档案的画布结果不同,默认开启。"
  },
  "page_script_policy": {
   "type": "string",
   "enum": [
    "native-zero-page-script",
    "legacy-js-compatibility"
   ],
   "description": "页面执行策略。native-zero-page-script=强风控站点兼容模式:宿主 WebKit 不注入任何产品页面脚本、handler、accessor 或 Canvas/WebGL/Audio wrapper,代价是关闭逐档页面防关联;legacy-js-compatibility=默认的确定性页面兼容层。Mac 档案下一次启动生效。"
  },
  "strict": {
   "type": "boolean",
   "description": "Mac:按 strict Safari identity 建档。强制 pageScriptPolicy=native-zero-page-script 并复用 strict-capacity 迁移补齐 fontAllowListSHA256;与 legacy-js-compatibility 互斥。缺省 false。"
  },
  "cookies": {
   "type": "string",
   "description": "建档即预置 cookie(Netscape cookies.txt 全文)→ 写 CookieJars/<id>.txt,引擎启动时注入。⚠️ Netscape 列里**没有 sameSite 位**,要带 sameSite 请用 cookies_json。与 cookies_json 互斥。仅 count=1 可用;count > 1 时拒收,避免登录态跨档复制"
  },
  "cookies_json": {
   "type": "array",
   "items": {
    "type": "object"
   },
   "description": "建档即预置 cookie(全字段数组,字段同 import_cookies_json:name/value/domain/path/secure/httpOnly/expires(Unix 秒)/sameSite(lax|strict))→ 写 CookieJars/<id>.json,引擎启动按内容嗅探走 JSON 通道 ⇒ sameSite 生效。同一档案该 jar 之后也按 JSON 回写(cookie 快照不再退化成文本)。与 cookies 互斥;每条须有 name 与 domain。仅 count=1 可用;count > 1 时拒收,避免登录态跨档复制"
  },
  "passkey": {
   "type": "boolean",
   "description": "开启/关闭 passkey(虚拟 authenticator);缺键沿用引擎默认(当前非 trust 档为开),显式 false 写关闭状态"
  },
  "save_password": {
   "type": "boolean",
   "description": "档案级「保存密码询问」开关。**缺省不产键 = 默认**:手动打开时问、API/自动化启动不问;true = 总是问(含 API 会话);false = 从不问(引擎连捕获钩子都不装载)。落 `spoofSettings.savePassword`"
  },
  "probe_egress": {
   "type": "boolean",
   "description": "**建档后经该档案自己的出口探测一次**,把出口的城市质心坐标写回 `spoofSettings.geoLat/geoLng`(以及 `proxySettings.egressIp/egressCountry/lastCheck`)—— 与 GUI 建档时那一步**同源判据**(同一个 `同一个探测实现`),不另立一套。缺省 false=不探测。⚠️ 三条如实边界:① 它走真网络、经该档案的代理,会给建档多加一次往返(同批里**同一个出口 URL 只探一次**,复用结果);② **没有代理的直连档没有「可跟随的出口」** ⇒ `egress.state=skipped-no-proxy`,**不拿本机代理配置里的默认出口去伪造一份与该档实际出口无关的坐标**;③ 探测失败/只拿到 IP 拿不到坐标 ⇒ 不写坐标,`egress.state` 如实回报(绝不凭空补一个「看起来对」的坐标——那正是时区↔出口 tell 的来源)"
  },
  "seed": {
   "type": "integer",
   "description": "RNG 种子(复现用);缺省 OS 熵=不可复现"
  },
  "notes": {
   "type": "string",
   "description": "档案备注(自由的账号元数据,如 2FA secret 的登记说明)。**引擎不消费**——属 GUI 元数据,只落 ProfileStore;运行中要改写用 update_profile"
  },
  "group_id": {
   "type": "string",
   "description": "建档即分组(企业接入清单 §二-12 的 `group_id`):工作区 **名称或 id** 都行,缺省=不分组。语义=本仓的「工作区」(与 GUI 同一份数据),点工作区即可看该区档案表格。⚠️ 名字认不出**当场报错**,**不会**顺手建一个新工作区(静默建组会让调用方以为分到了既有组里);要新建先 workspace_create。⚠️ 它与兼容产品的 `group_id` 有一处差别:本仓归属是**多标签**,一个档案可同时属多个工作区;`default`(「所有 Profile」)不是真实分组,不能作为目标"
  },
  "location": {
   "type": "string",
   "enum": [
    "auto",
    "block"
   ],
   "description": "地理位置面(企业接入清单 §二-10 `location=block`):`auto`=缺省(有出口坐标就按出口坐标回答,§21 claimed-only);`block`=**明确的拒绝语义**:`permissions.query({name:'geolocation'})` 答 `denied`、`getCurrentPosition`/`watchPosition` 一律只走 error 回调(`code=1`),**永不返回坐标** —— 即使该档之前探到了出口坐标也一律不给(探到的坐标会保留在档案里,但被 block 压住)。⚠️ 与 `probe_egress` 同时给时 **block 优先**:不探测、不写坐标,回执里 `egress.state=skipped-blocked`"
  }
 },
 "required": []
}
current_url — 读 profile 当前页 URL(主框架 location.href;等价 Selenium driver.current_url)

读 profile 当前页 URL(主框架 location.href;等价 Selenium driver.current_url)

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  }
 },
 "required": [
  "id"
 ]
}
delete_profile — 删除档案(**软删**:移入回收站,可 restore_profile 恢复)。与 GUI 回收站**同一目录、同一动作**:只把 `Profiles/<id>.json` 搬成 `Trash/<id>.json`,**

删除档案(**软删**:移入回收站,可 restore_profile 恢复)。与 GUI 回收站**同一目录、同一动作**:只把 `Profiles/<id>.json` 搬成 `Trash/<id>.json`,**不删**浏览数据(cookies/历史/密码原样保留,恢复后即可用)——彻底擦除用 purge_profile。本进程(MCP/API)启动的浏览器会先被优雅停止(SIGTERM,引擎自存 cookie jar 后退出);**非本进程启动的**(GUI 起的档)则**拒绝删除**并报出 pid —— 把在跑的档搬走会让 GUI失去对它的引用,请先在 GUI 停止。顺带把云端**登记**注销(让出 `profiles_cap` 名额,best-effort,结果在嵌套的 `cloud` 键里;注销**可逆**且不碰密文与恢复材料)。

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string",
   "description": "profile id"
  }
 },
 "required": [
  "id"
 ]
}
detect_block — 探测 profile 当前页风控/验证码信号(recaptcha/hcaptcha/Cloudflare/频率限制等)

探测 profile 当前页风控/验证码信号(recaptcha/hcaptcha/Cloudflare/频率限制等)

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string",
   "description": "profile id"
  }
 },
 "required": [
  "id"
 ]
}
download_list — 查询单档案或全部档案的隔离下载记录(只读,读取 AUG/Downloads/<id>.json)。

查询单档案或全部档案的隔离下载记录(只读,读取 AUG/Downloads/<id>.json)。

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string",
   "description": "可选档案 ID;省略则汇总全部档案"
  },
  "limit": {
   "type": "integer",
   "description": "返回条数上限(1–200,默认 50)"
  }
 }
}
duplicate_profile — 基于已有档案克隆一份全新独立身份的新档案(新 UUID 与独立指纹密钥,不共享 Cookie/会话)。

基于已有档案克隆一份全新独立身份的新档案(新 UUID 与独立指纹密钥,不共享 Cookie/会话)。

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string",
   "description": "源档案 ID"
  },
  "name": {
   "type": "string",
   "description": "新档案名称(可选,默认源名 + ' 副本')"
  }
 },
 "required": [
  "id"
 ]
}
evaluate — 在 profile 浏览器执行 JS:缺省返回同步求值结果;await=true 时等 Promise 结算(等价 Selenium executeAsyncScript)

在 profile 浏览器执行 JS:缺省返回同步求值结果;await=true 时等 Promise 结算(等价 Selenium executeAsyncScript)

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "js": {
   "type": "string",
   "description": "要执行的 JS。await=true 时**须是表达式**(可为 `(async () => {...})()` 自调用)—— 多语句串会语法报错,不会静默返回 undefined"
  },
  "await": {
   "type": "boolean",
   "description": "true = 等 Promise 结算后返回其值(缺省 false = 同步求值)。⚠️ 同步通道**结算不了 Promise**:`Promise.resolve(1)` 在 await=false 下报 unsupported type,不是返回 1"
  },
  "frame": {
   "type": "integer",
   "description": "子帧 index(frames 工具列出;缺省=主帧)。求值落在**目标帧的 realm**(跨域 / srcdoc / sandbox 同权);索引失效(跨页导航后)引擎显式报错,不会静默落到主帧"
  }
 },
 "required": [
  "id",
  "js"
 ]
}
export_cookies — 导出 profile 浏览器全部 cookie 为 Netscape cookies.txt 文本

导出 profile 浏览器全部 cookie 为 Netscape cookies.txt 文本

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  }
 },
 "required": [
  "id"
 ]
}
export_cookies_json — 导出 profile 浏览器全部 cookie 为 JSON(全字段:name,value,domain,path,secure,**httpOnly**,expires(Unix 秒),**sameSite**,par

导出 profile 浏览器全部 cookie 为 JSON(全字段:name,value,domain,path,secure,**httpOnly**,expires(Unix 秒),**sameSite**,partitionKey。字段边界(WebKit 结构性,非本实现取舍):sameSite 只支持 lax|strict(none 会被内核忽略);partitionKey **不支持**(Foundation 无此表示);httpOnly 双向支持。被丢弃的字段会逐条出现在回执 dropped 里——它与「服务端本来就没设这个属性」在导出侧同形,只有这个回报能区分二者。导入即权威(同身份 name+domain+path):既有 HttpOnly 而写入侧 httpOnly=false 时,**同值** ⇒ 先删后写纠方向(回执 repaired 点名);**值不同** ⇒ 回执 blocked 点名、不删旧值;显式过期(expires 在过去)⇒ 删除该身份旧条目(回执 deleted 点名)——这是清理历史错误 HttpOnly 的标志/删除原语。)

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  }
 },
 "required": [
  "id"
 ]
}
fill_credential — 把本档案在**当前页 host** 下保存的登录凭据填进页面登录表单。凭据**不过桥**:原生从本机钥匙串取出直接填 DOM,响应里只有 filled/username/reason,**永不回密码**。reason ∈

把本档案在**当前页 host** 下保存的登录凭据填进页面登录表单。凭据**不过桥**:原生从本机钥匙串取出直接填 DOM,响应里只有 filled/username/reason,**永不回密码**。reason ∈ no-active-page / no-saved-credential / no-password-field。与浏览器菜单「填充密码」同一条路径;多账号本期取第一条。

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  }
 },
 "required": [
  "id"
 ]
}
fleet_run — 总代理下发一组作业(fan-out/broadcast/pipeline)。**必须声明 AUG_AGENT_ID(总代理)**,且目标须同时满足:在 agent 的 fleet 白名单里 + 该档案 identity

总代理下发一组作业(fan-out/broadcast/pipeline)。**必须声明 AUG_AGENT_ID(总代理)**,且目标须同时满足:在 agent 的 fleet 白名单里 + 该档案 identity 有 active binding。只建作业,不驱动浏览器;审批仍由人做(本工具没有批准能力)。

{
 "type": "object",
 "properties": {
  "mode": {
   "type": "string",
   "description": "fan-out|broadcast|pipeline"
  },
  "skill": {
   "type": "string"
  },
  "skill_version": {
   "type": "string"
  },
  "targets": {
   "type": "array",
   "items": {
    "type": "string"
   }
  },
  "inputs": {
   "type": "object"
  },
  "per_target_inputs": {
   "type": "object",
   "description": "fan-out:{profile_id:{inputs}}"
  },
  "stages": {
   "type": "array",
   "items": {
    "type": "object"
   },
   "description": "pipeline:[{skill,targets,inputs,per_target_inputs}]"
  },
  "name": {
   "type": "string"
  }
 },
 "required": [
  "mode"
 ]
}
fleet_summary — 看一次总代理运行(run)的汇总:阶段/每档案的作业状态计数。

看一次总代理运行(run)的汇总:阶段/每档案的作业状态计数。

{
 "type": "object",
 "properties": {
  "run_id": {
   "type": "string"
  }
 },
 "required": [
  "run_id"
 ]
}
frames — 列出 profile 浏览器**当前页的子帧(iframe)清单**(主帧不列):每项 index/name/url/src/origin。覆盖跨域 iframe / about:srcdoc / sandbox 不透明

列出 profile 浏览器**当前页的子帧(iframe)清单**(主帧不列):每项 index/name/url/src/origin。覆盖跨域 iframe / about:srcdoc / sandbox 不透明源 / 嵌套帧 —— 这些帧里的 DOM 主帧 querySelector 结构性看不见(付款模态、验证码常见形态)。`index` 供 evaluate / read / type / click / hover 的 frame 参数使用;跨页导航后索引全部作废(重新调用本工具枚举);失效索引在下次操作时**显式报错**,不会静默落到主帧。

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  }
 },
 "required": [
  "id"
 ]
}
get_profile — 读取单个 profile 完整数据(代理凭据与身份根密钥脱敏)

读取单个 profile 完整数据(代理凭据与身份根密钥脱敏)

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string",
   "description": "profile id"
  },
  "include_secret": {
   "type": "boolean",
   "description": "连 2FA secret 一起读(缺省 **false**:秘密不进每次读取、不进调用方日志)。秘密不在档案 JSON 里,由 Secrets/<id>.json 读出后并入 `secrets` 键。身份 rootSecret 永不返回"
  }
 },
 "required": [
  "id"
 ]
}
go_back — profile 浏览器后退一页(history API)

profile 浏览器后退一页(history API)

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  }
 },
 "required": [
  "id"
 ]
}
go_forward — profile 浏览器前进一页(history API)

profile 浏览器前进一页(history API)

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  }
 },
 "required": [
  "id"
 ]
}
history — 查询档案浏览历史(最近访问的网页,url/title/时间戳,最新在前;预热导航不记录)

查询档案浏览历史(最近访问的网页,url/title/时间戳,最新在前;预热导航不记录)

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string",
   "description": "profile id"
  },
  "query": {
   "type": "string",
   "description": "可选:按标题/网址过滤"
  },
  "limit": {
   "type": "integer",
   "description": "返回条数(默认 50,最大 500)"
  }
 },
 "required": [
  "id"
 ]
}
hover — 拟人悬停 profile 页面首个匹配 selector 元素(真实 HID:CGEvent 移到元素中心 + 停留,isTrusted=true 触发 hover 态/CSS :hover,防 BOT)。HID 路径=

拟人悬停 profile 页面首个匹配 selector 元素(真实 HID:CGEvent 移到元素中心 + 停留,isTrusted=true 触发 hover 态/CSS :hover,防 BOT)。HID 路径=单前台 profile 依赖,非并发安全;并发自动化勿用(改 JS focus/样式绕过)。selector 或 element_id 二选一

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "selector": {
   "type": "string",
   "description": "CSS 选择器(与 element_id 二选一)"
  },
  "element_id": {
   "type": "integer",
   "description": "page_map 返回的元素 id(与 selector 二选一;填了覆盖 selector)"
  },
  "index": {
   "type": "integer"
  },
  "pace": {
   "type": "number",
   "description": "0.2-2.0 全局节奏乘数(>1 更快);缺省 1.0"
  },
  "frame": {
   "type": "integer",
   "description": "子帧 index(frames 工具列出;缺省=主帧)。元素在子帧里时坐标经链折算;对不上显式报错,不按猜的坐标动"
  }
 },
 "required": [
  "id"
 ]
}
human_click_xy — 拟人点击**视口 CSS 坐标**(跨域 iframe / FunCaptcha 兜底;真实 HID Bezier)。坐标 = 活动标签页左上原点、CSS 像素(与截图/AX 量出的位置同空间;引擎内做 pageZoom

拟人点击**视口 CSS 坐标**(跨域 iframe / FunCaptcha 兜底;真实 HID Bezier)。坐标 = 活动标签页左上原点、CSS 像素(与截图/AX 量出的位置同空间;引擎内做 pageZoom 修正)。用于 selector 打不进的跨域 iframe(验证码/横幅一类):先在截图里量点,再点这里。同 human_click 的单前台约束与全局串行(HID 只打当前前台档案)。

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "x": {
   "type": "number",
   "description": "视口 CSS x(左上原点)"
  },
  "y": {
   "type": "number",
   "description": "视口 CSS y(左上原点)"
  },
  "pace": {
   "type": "number",
   "description": "0.2-2.0 全局节奏乘数(>1 更快);缺省 1.0"
  }
 },
 "required": [
  "id",
  "x",
  "y"
 ]
}
import_cookies — 注入 Netscape cookies.txt 文本到 profile 浏览器;返回成功条数

注入 Netscape cookies.txt 文本到 profile 浏览器;返回成功条数

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "text": {
   "type": "string"
  }
 },
 "required": [
  "id",
  "text"
 ]
}
import_cookies_json — 按 JSON 注入 cookie(全字段:name,value,domain,path,secure,**httpOnly**,expires(Unix 秒),**sameSite**,partitionKey。字段边界

按 JSON 注入 cookie(全字段:name,value,domain,path,secure,**httpOnly**,expires(Unix 秒),**sameSite**,partitionKey。字段边界(WebKit 结构性,非本实现取舍):sameSite 只支持 lax|strict(none 会被内核忽略);partitionKey **不支持**(Foundation 无此表示);httpOnly 双向支持。被丢弃的字段会逐条出现在回执 dropped 里——它与「服务端本来就没设这个属性」在导出侧同形,只有这个回报能区分二者。导入即权威(同身份 name+domain+path):既有 HttpOnly 而写入侧 httpOnly=false 时,**同值** ⇒ 先删后写纠方向(回执 repaired 点名);**值不同** ⇒ 回执 blocked 点名、不删旧值;显式过期(expires 在过去)⇒ 删除该身份旧条目(回执 deleted 点名)——这是清理历史错误 HttpOnly 的标志/删除原语。)

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "cookies": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "value": {
      "type": "string"
     },
     "domain": {
      "type": "string"
     },
     "path": {
      "type": "string"
     },
     "secure": {
      "type": "boolean"
     },
     "httpOnly": {
      "type": "boolean",
      "description": "缺省 false(浏览器里 JS 设的 cookie 即 false)"
     },
     "expires": {
      "type": "number",
      "description": "Unix 秒;0/缺省 = session cookie"
     },
     "sameSite": {
      "type": "string",
      "enum": [
       "lax",
       "strict",
       "Lax",
       "Strict"
      ]
     },
     "partitionKey": {
      "type": "string",
      "description": "会被丢弃(WebKit 无此表示),仅用于如实报出"
     }
    },
    "required": [
     "name",
     "value",
     "domain"
    ]
   }
  }
 },
 "required": [
  "id",
  "cookies"
 ]
}
job_cancel — 请求取消一个 Orchestrator 作业。运行中先返回 stopping;worker 确认当前动作与资源收口后才进入 cancelled。

请求取消一个 Orchestrator 作业。运行中先返回 stopping;worker 确认当前动作与资源收口后才进入 cancelled。

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "code": {
   "type": "string"
  }
 },
 "required": [
  "id"
 ]
}
job_create — 建一个本机 Orchestrator 作业(Team+)。plan = 步骤数组(与 agent_runtime 的 12 工具同名,如 {"action":"navigate","url":…})或给 skill_na

建一个本机 Orchestrator 作业(Team+)。plan = 步骤数组(与 agent_runtime 的 12 工具同名,如 {"action":"navigate","url":…})或给 skill_name(+inputs)从技能注册表取步骤;声明了 agent 身份时,每个目标档案都须已 binding。

{
 "type": "object",
 "properties": {
  "title": {
   "type": "string"
  },
  "targets": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "profile_id 列表(当前版本建议单档)"
  },
  "plan": {
   "type": "array",
   "items": {
    "type": "object"
   },
   "description": "步骤数组;需审批的步加 requires_approval=true"
  },
  "skill_name": {
   "type": "string"
  },
  "skill_version": {
   "type": "string"
  },
  "inputs": {
   "type": "object",
   "description": "技能输入(配 skill_name)"
  },
  "budget_cap_usd": {
   "type": "number"
  },
  "idempotency_key": {
   "type": "string"
  }
 },
 "required": [
  "title",
  "targets"
 ]
}
job_list — 列出本机 Orchestrator 作业:状态/进度/预算/待审批数。**只读本机数据、零外发**;作业执行在本机(Team+),执行器要么走 call_tool,要么 attach GUI 已运行引擎。

列出本机 Orchestrator 作业:状态/进度/预算/待审批数。**只读本机数据、零外发**;作业执行在本机(Team+),执行器要么走 call_tool,要么 attach GUI 已运行引擎。

{
 "type": "object",
 "properties": {
  "state": {
   "type": "string",
   "description": "queued|running|input_required|completed|failed|cancelled"
  },
  "limit": {
   "type": "integer",
   "description": "1..500,缺省 50"
  }
 }
}
job_show — 看单个 Orchestrator 作业的完整状态(含步骤计划/预算/待审批数)。

看单个 Orchestrator 作业的完整状态(含步骤计划/预算/待审批数)。

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  }
 },
 "required": [
  "id"
 ]
}
key — 对 profile 页面焦点元素(或 selector 指定元素)派发按键 keydown/keyup(JS,isTrusted=false → 浏览器原生提交/原生行为不触发)。human:true + key=Ent

对 profile 页面焦点元素(或 selector 指定元素)派发按键 keydown/keyup(JS,isTrusted=false → 浏览器原生提交/原生行为不触发)。human:true + key=Enter → 可信原生 Return(真实 HID CGEvent,isTrusted=true 触发原生提交/确认,仅单前台 profile;其余键走 JS dispatch)

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "key": {
   "type": "string",
   "description": "Enter/Tab/Escape/ArrowUp/ArrowDown/ArrowLeft/ArrowRight/Backspace/Delete/Home/End/PageUp/PageDown/Space"
  },
  "selector": {
   "type": "string",
   "description": "可选:先聚焦该元素再派发;缺省=当前 activeElement"
  },
  "human": {
   "type": "boolean",
   "description": "true=可信原生 Enter(真实 HID Return 触发原生提交;仅 key=Enter 有效、单前台)"
  }
 },
 "required": [
  "id",
  "key"
 ]
}
launch_profile — 启动 profile 浏览器。transport=native 的静态代理由 WebKit 直连上游;legacy/SSH/chainProxy 使用兼容 socks_fwd。无需 GUI。可传 runtimeProxy

启动 profile 浏览器。transport=native 的静态代理由 WebKit 直连上游;legacy/SSH/chainProxy 使用兼容 socks_fwd。无需 GUI。可传 runtimeProxy 做**本次会话的出口覆盖**(档案 JSON 一个字节不动)。API/MCP 启动按**无人值守会话**对待:passkey 的 create/sign 自动应答(不弹系统验身、UV 置位)。成功回执只在进程、Bridge 与首个 tab 都就绪后返回;首导航另以 completed|unconfirmed|not_required 显式报告。

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string",
   "description": "profile id"
  },
  "url": {
   "type": "string",
   "description": "起始 URL,缺省 aug://start(应用内默认起始页)"
  },
  "runtimeProxy": {
   "type": "object",
   "description": "**本次启动的出口覆盖**,不写入档案(清单 §三-7「固定档案池+ 换出口」的正解:池子里的档一个字节不动,每次 launch 传不同出口)。覆盖档案里的 proxySettings;缺省 = 用档案自己的代理。transport=native 时 WebKit 直连该静态出口,helper 时使用兼容 socks_fwd;缺省 helper。⚠️ 三条边界如实:① 只对**本次会话**生效,stop 后失效;② 指纹地理面(spoofSettings 的 timezone/language)**不会**跟随这次覆盖——需要一致就同时改档案或在覆盖值里自洽;③ type 只认 socks5|http|https(ssh 隧道档请改档案)",
   "properties": {
    "type": {
     "type": "string",
     "description": "socks5|http|https"
    },
    "host": {
     "type": "string"
    },
    "port": {
     "type": "integer"
    },
    "username": {
     "type": "string"
    },
    "password": {
     "type": "string"
    },
    "chainProxy": {
     "type": "string",
     "description": "上游链路(存在即走链):socks5:// / socks5h:// / http:// / https://,可带 username:password"
    },
    "transport": {
     "type": "string",
     "enum": [
      "helper",
      "native"
     ],
     "description": "本次覆盖的网络路径;缺省 helper 保持旧语义。native 仅支持无 chainProxy 的静态 SOCKS5/HTTP/HTTPS"
    }
   }
  },
  "idempotencyKey": {
   "type": "string",
   "description": "可选;重复启动请求的安全幂等键。成功回执按同一 operation 重放。"
  }
 },
 "required": [
  "id"
 ]
}
list_profiles — 列出 profile 摘要(代理密码脱敏;含工作区分组)。**分页**:给了 limit 或 cursor 时返回 `{items,total,limit,offset,has_more,next_cursor}`;**

列出 profile 摘要(代理密码脱敏;含工作区分组)。**分页**:给了 limit 或 cursor 时返回 `{items,total,limit,offset,has_more,next_cursor}`;**两个都不给时返回裸数组=全量**(与从前逐字相同;分页是显式选择,绝不静默截断)。企业档最多 1000 个档,一次全拉响应很大 ⇒ 建议 limit<=200 翻页。

{
 "type": "object",
 "properties": {
  "workspace_id": {
   "type": "string",
   "description": "只看某个工作区里的档案(=企业接入清单 §二-12 的 `group_id`):id 或**名称**都行,缺省=全部。⚠️ 不存在的名字**当场报错**,不静默回落成「全部」(静默回落会让调用方以为筛过了)"
  },
  "limit": {
   "type": "integer",
   "description": "本页最多几条(1..500)。给了它就返回分页信封;**不给=全量裸数组**(既有调用零变化)"
  },
  "cursor": {
   "type": "string",
   "description": "上一页响应里的 `next_cursor`,**原样回传**(不透明,不要解析)"
  }
 }
}
list_trash — 列出回收站里的档案(软删的档)。与 GUI 回收站是**同一份内容**。分页语义与 `list_profiles` **逐字相同**(给 limit/cursor 才返回分页信封)。

列出回收站里的档案(软删的档)。与 GUI 回收站是**同一份内容**。分页语义与 `list_profiles` **逐字相同**(给 limit/cursor 才返回分页信封)。

{
 "type": "object",
 "properties": {
  "limit": {
   "type": "integer",
   "description": "本页最多几条(1..500);不给=全量裸数组"
  },
  "cursor": {
   "type": "string",
   "description": "上一页响应里的 `next_cursor`,原样回传"
  }
 }
}
navigate — 导航 profile 浏览器到 URL

导航 profile 浏览器到 URL

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "url": {
   "type": "string"
  }
 },
 "required": [
  "id",
  "url"
 ]
}
new_tab — profile 浏览器新建标签页并导航到 URL(缺省 example.com)

profile 浏览器新建标签页并导航到 URL(缺省 example.com)

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "url": {
   "type": "string"
  }
 },
 "required": [
  "id"
 ]
}
operation_list — 列出统一 OperationReceipt(生命周期、任务步骤、效果与资源状态)。GUI/REST/MCP 共用同一行状态,零云调用。

列出统一 OperationReceipt(生命周期、任务步骤、效果与资源状态)。GUI/REST/MCP 共用同一行状态,零云调用。

{
 "type": "object",
 "properties": {
  "profile_id": {
   "type": "string"
  },
  "parent_job_id": {
   "type": "string"
  },
  "state": {
   "type": "string"
  },
  "after_revision": {
   "type": "integer"
  },
  "limit": {
   "type": "integer"
  }
 }
}
operation_show — 查看单个 OperationReceipt;events=true 时连同追加式阶段事件返回。

查看单个 OperationReceipt;events=true 时连同追加式阶段事件返回。

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "events": {
   "type": "boolean"
  },
  "after_seq": {
   "type": "integer"
  }
 },
 "required": [
  "id"
 ]
}
page_map — 导出现页 DOM 结构地图(页面骨架 + ≤200 个可见交互元素的 id/tag/role/text/sel/rect),供 AI 看清页面并寻址。返回 dict:{url, title, viewport, skel

导出现页 DOM 结构地图(页面骨架 + ≤200 个可见交互元素的 id/tag/role/text/sel/rect),供 AI 看清页面并寻址。返回 dict:{url, title, viewport, skeleton, elements[], truncated}。元素 rect 为视口 CSS px(与 screenshot 同坐标系)。取动作时用 elements[i].id 作为 element_id,或直接用 elements[i].sel 作 selector——两者等效(element_id 每次现场重解析防 stale)。只读布局枚举:不写任何 DOM 属性、不读 canvas、无 marker 符号 → 指纹零暴露

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "max_elements": {
   "type": "integer",
   "description": "元素上限;缺省 200"
  },
  "text_limit": {
   "type": "integer",
   "description": "单元素文本截断;缺省 80"
  },
  "byte_budget": {
   "type": "integer",
   "description": "返回串字节预算;超出尾部渐弃+truncated;缺省 12000"
  }
 },
 "required": [
  "id"
 ]
}
page_source — 取整页 HTML 源码(document.documentElement.outerHTML,等价 Selenium driver.page_source)。返回 {html, bytes, truncated}:**源

取整页 HTML 源码(document.documentElement.outerHTML,等价 Selenium driver.page_source)。返回 {html, bytes, truncated}:**源码可能很大**,给 max_bytes 才截断,且截断必在 truncated 里报出

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "max_bytes": {
   "type": "integer",
   "description": "html 字节上限(UTF-8);缺省 0=不截断(Selenium 等价语义)。截断时 truncated=true 并在 html 尾附告知标记——**静默截断会让调用方把半个页面当成整个页面**"
  }
 },
 "required": [
  "id"
 ]
}
profile_status — 查档案**运行态**:该档的浏览器现在在不在跑、bridge 端口、当前标签页/URL(对应兼容产品的 `browser-profile/active`)。批量给 `ids` 时并发探测(短超时)。⚠️ 判据是**真连一

查档案**运行态**:该档的浏览器现在在不在跑、bridge 端口、当前标签页/URL(对应兼容产品的 `browser-profile/active`)。批量给 `ids` 时并发探测(短超时)。⚠️ 判据是**真连一次 bridge**(连不上=没在跑),不是读某个状态文件 —— 状态文件会撒谎:引擎崩了、被 kill -9、GUI 强退都会留下"看起来在跑"的残迹。

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string",
   "description": "单个档案 id(与 ids 二选一)"
  },
  "ids": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "批量查(与 id 二选一)。批量时并发探测"
  },
  "timeout": {
   "type": "number",
   "description": "单档探测超时秒数,缺省 1.5(连不上很快返回,超时只对\"半死\"的进程有意义)"
  }
 }
}
profile_workspaces — 查 / 改某个档案的工作区归属(`group_id` 的读写口)。**多标签**:一个档案可同时属多个工作区。只给 id = 只读当前归属;给 add/remove = 改。工作区名或 id 都可以。

查 / 改某个档案的工作区归属(`group_id` 的读写口)。**多标签**:一个档案可同时属多个工作区。只给 id = 只读当前归属;给 add/remove = 改。工作区名或 id 都可以。

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string",
   "description": "profile id(须在库中存在)"
  },
  "add": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "要加入的工作区(名或 id),已有的**幂等**跳过"
  },
  "remove": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "要退出的工作区(名或 id),不在里面的**幂等**跳过"
  }
 },
 "required": [
  "id"
 ]
}
proxy_check — 检测档案或指定代理的真实出口 IP、国家、时区与延迟(脱敏返回,绝不回显代理密码)。

检测档案或指定代理的真实出口 IP、国家、时区与延迟(脱敏返回,绝不回显代理密码)。

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string",
   "description": "档案 ID(与 proxy_url 二选一)"
  },
  "proxy_url": {
   "type": "string",
   "description": "代理 URL(socks5:// / http://,与 id 二选一)"
  },
  "timeout": {
   "type": "integer",
   "description": "超时秒数(1–20,默认 10)"
  }
 }
}
purge_profile — 从回收站**彻底删除**档案:引擎 `--dispose` 擦除该档的 WebKit datastore + sidecar(History/Downloads/Sessions/Bookmarks/CookieJars

从回收站**彻底删除**档案:引擎 `--dispose` 擦除该档的 WebKit datastore + sidecar(History/Downloads/Sessions/Bookmarks/CookieJars/Secrets/Passkeys)+ Keychain 密码,然后删掉回收站里的 JSON 与(仅当为空时)该档的数据目录。**不可恢复。**⚠️ 只接受**已在回收站**的档案(先 delete_profile)——刻意不留「一次调用直接抹掉在库档案」的路径,回收站那一步就是撤销窗口。⚠️ 引擎擦除失败/超时时**不删** JSON 并报错:宁可让你重试,也不回一个「已销毁」而实际没擦干净。

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string",
   "description": "回收站里的 profile id"
  }
 },
 "required": [
  "id"
 ]
}
read — 读取 profile 页面首个匹配 selector 的文本

读取 profile 页面首个匹配 selector 的文本

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "selector": {
   "type": "string"
  },
  "frame": {
   "type": "integer",
   "description": "子帧 index(frames 工具列出;缺省=主帧)。读的是**目标帧内**首个匹配元素的文本"
  }
 },
 "required": [
  "id",
  "selector"
 ]
}
reap_orphans — 回收**宿主已死**的孤儿会话(M3/F4,2026-10-02)。客户脚本/MCP 宿主被 kill -9 后,它启动的引擎与 socks5 转发器会被重挂到 launchd 继续跑(占 bridge 端口与 data

回收**宿主已死**的孤儿会话(M3/F4,2026-10-02)。客户脚本/MCP 宿主被 kill -9 后,它启动的引擎与 socks5 转发器会被重挂到 launchd 继续跑(占 bridge 端口与 dataStore;30 档一次崩 ≈6 GB)。本工具读 api_sessions:**只处理记录里带宿主 pid 且该宿主已死**的会话(`host` 缺失的老记录需 force=true);逐个 TERM → 1s → KILL(照参考实现的 kill_exact 形态,先按可执行身份校验再发信号),并从记录中移除。返回逐条动作与跳过原因。

{
 "type": "object",
 "properties": {
  "dry_run": {
   "type": "boolean",
   "description": "只列不杀(默认 false)"
  },
  "force": {
   "type": "boolean",
   "description": "连 host 缺失的老记录也一并回收(默认 false)"
  }
 }
}
replace_cookies — 全量替换 profile 浏览器 cookie(先清空再注入 Netscape cookies.txt 文本;删除/修改/新增实时生效)。用于登录态切换到另一账号而不重启引擎

全量替换 profile 浏览器 cookie(先清空再注入 Netscape cookies.txt 文本;删除/修改/新增实时生效)。用于登录态切换到另一账号而不重启引擎

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "text": {
   "type": "string",
   "description": "Netscape cookies.txt 格式全文"
  }
 },
 "required": [
  "id",
  "text"
 ]
}
replace_cookies_json — 全量替换 cookie(先清空再注入 JSON,全字段;删除/修改/新增实时生效)。用于登录态切换到另一账号而不重启引擎

全量替换 cookie(先清空再注入 JSON,全字段;删除/修改/新增实时生效)。用于登录态切换到另一账号而不重启引擎

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "cookies": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "value": {
      "type": "string"
     },
     "domain": {
      "type": "string"
     },
     "path": {
      "type": "string"
     },
     "secure": {
      "type": "boolean"
     },
     "httpOnly": {
      "type": "boolean",
      "description": "缺省 false(浏览器里 JS 设的 cookie 即 false)"
     },
     "expires": {
      "type": "number",
      "description": "Unix 秒;0/缺省 = session cookie"
     },
     "sameSite": {
      "type": "string",
      "enum": [
       "lax",
       "strict",
       "Lax",
       "Strict"
      ]
     },
     "partitionKey": {
      "type": "string",
      "description": "会被丢弃(WebKit 无此表示),仅用于如实报出"
     }
    },
    "required": [
     "name",
     "value",
     "domain"
    ]
   }
  }
 },
 "required": [
  "id",
  "cookies"
 ]
}
restore_profile — 从回收站恢复档案(`Trash/<id>.json` → `Profiles/<id>.json`,与 GUI 回收站的「恢复」同一动作)。浏览数据本来就没被删,恢复后直接 launch_profile 即可。库中已存在

从回收站恢复档案(`Trash/<id>.json` → `Profiles/<id>.json`,与 GUI 回收站的「恢复」同一动作)。浏览数据本来就没被删,恢复后直接 launch_profile 即可。库中已存在同 id 档案时**拒绝**(覆盖会静默吃掉库里那一份)。顺带把云端**登记**复登(重新占用 `profiles_cap` 名额,与 delete_profile 的注销**对称、可逆**;best-effort,结果在嵌套的 `cloud` 键里)。

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string",
   "description": "profile id"
  }
 },
 "required": [
  "id"
 ]
}
run_task — 在 profile 执行多步确定性任务(步间防 BOT 节奏;失败即停;返回每步结果)

在 profile 执行多步确定性任务(步间防 BOT 节奏;失败即停;返回每步结果)

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string",
   "description": "profile id"
  },
  "steps": {
   "type": "array",
   "items": {
    "type": "object"
   },
   "description": "步骤序列:[{action: navigate|click|type|read|wait|evaluate|tabs|new_tab|switch_tab|close_tab|export_cookies|import_cookies|scroll|key|page_map|screenshot, ...参数, wait_selector?: 执行前等它出现}]. click/type 支持 element_id?:page_map 元素 id(现场重解析防 stale)+ selector 二选一;click 支持 human:true → 真实 HID 拟人点击(防 BOT,只适合单前台 profile,pace?:0.2-2.0);type 支持 human:true → 真实 HID 拟人键入(防 BOT,只适合单前台 profile)+ speed?:0-4;key.key ∈ Enter/Tab/Escape/Arrow*/Backspace/Delete/Home/End/PageUp/PageDown/Space,key 支持 human:true → 可信原生 Enter(真实 HID Return 触发原生提交,仅 key=Enter 有效,单前台);new_tab 显式外部 URL 同 navigate 查 allowedDomains 白名单;page_map 返回结构化元素表;screenshot 返回 {mime,bytes,data_b64}(图过大不进 step 内嵌 image block,要图用独立 screenshot 工具)"
  },
  "delay_ms": {
   "type": "integer",
   "description": "步间延迟毫秒;缺省 400-900 随机(防 BOT 节奏)"
  }
 },
 "required": [
  "id",
  "steps"
 ]
}
runtime_status — 返回宿主 macOS 版本、Mac 原生隔离就绪状态以及本机已缓存的 iOS 按需 CAS 运行时清单。

返回宿主 macOS 版本、Mac 原生隔离就绪状态以及本机已缓存的 iOS 按需 CAS 运行时清单。

{
 "type": "object",
 "properties": {}
}
save_credential — 把调用方给的登录凭据写进本档案的钥匙串(与浏览器内保存同一条路径、同 host 同用户名合并)。**host 由引擎取当前页**——不接受调用方指定,避免把凭据写进与当前页无关的站点条目。密码不回显、不进日志;下次 `f

把调用方给的登录凭据写进本档案的钥匙串(与浏览器内保存同一条路径、同 host 同用户名合并)。**host 由引擎取当前页**——不接受调用方指定,避免把凭据写进与当前页无关的站点条目。密码不回显、不进日志;下次 `fill_credential` 即可使用。

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "username": {
   "type": "string",
   "description": "用户名(可空串:仅存密码)"
  },
  "password": {
   "type": "string",
   "description": "密码(必填;不回显、不进日志)"
  }
 },
 "required": [
  "id",
  "password"
 ]
}
screenshot — 截取 profile 页面当前可视画面(native WKWebView takeSnapshot:所见即真实渲染,不受页面 canvas 加噪影响)。返回 image 内容块(AI 直接看图,配合 page_map 的

截取 profile 页面当前可视画面(native WKWebView takeSnapshot:所见即真实渲染,不受页面 canvas 加噪影响)。返回 image 内容块(AI 直接看图,配合 page_map 的 rect 同系坐标推理)。format 缺省 png;jpeg 可选 quality 0.1-1.0;max_width 限制输出宽度点数(Retina 下 1pt≈2px)

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "format": {
   "type": "string",
   "enum": [
    "png",
    "jpeg"
   ],
   "description": "缺省 png"
  },
  "max_width": {
   "type": "number",
   "description": "输出宽度点数上限(Retina 约 2× px);0/缺省=原尺寸"
  },
  "quality": {
   "type": "number",
   "description": "jpeg 压缩 0.1-1.0;缺省 0.8"
  }
 },
 "required": [
  "id"
 ]
}
scroll — profile 页面滚动(JS window.scrollBy;dy 为 CSS px,负=向上)。供 AI 逐屏翻看长页(page_map 只取可视区交互元素 + 骨架)

profile 页面滚动(JS window.scrollBy;dy 为 CSS px,负=向上)。供 AI 逐屏翻看长页(page_map 只取可视区交互元素 + 骨架)

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "dy": {
   "type": "integer",
   "description": "滚动像素(正=向下)"
  }
 },
 "required": [
  "id",
  "dy"
 ]
}
scroll_state — profile 当前页滚动状态 {y, docH, viewportH}(y=scrollY、docH=documentElement.scrollHeight、viewportH=clientHeight 真实布局)。

profile 当前页滚动状态 {y, docH, viewportH}(y=scrollY、docH=documentElement.scrollHeight、viewportH=clientHeight 真实布局)。判页底/剩余可滚 = docH - viewportH - y

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  }
 },
 "required": [
  "id"
 ]
}
set_window_frame — 移动/缩放 profile 浏览器窗口(contentRect,AppKit 左下原点)

移动/缩放 profile 浏览器窗口(contentRect,AppKit 左下原点)

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "x": {
   "type": "integer"
  },
  "y": {
   "type": "integer"
  },
  "width": {
   "type": "integer"
  },
  "height": {
   "type": "integer"
  }
 },
 "required": [
  "id",
  "x",
  "y",
  "width",
  "height"
 ]
}
stop_profile — 优雅关闭本 MCP 进程启动的 profile 浏览器:SIGTERM → 等引擎自存 cookie jar 并确认进程退出后,才注销会话并释放资源租约;5 秒内未退出返回 process_stop_timeout,不伪

优雅关闭本 MCP 进程启动的 profile 浏览器:SIGTERM → 等引擎自存 cookie jar 并确认进程退出后,才注销会话并释放资源租约;5 秒内未退出返回 process_stop_timeout,不伪装成功。仅作用于 api_sessions 记录(launch_profile 启动)的进程——GUI 启动的档案不在记录,返回 stopped:false,请用 GUI 停止(绝不误伤 GUI 档)。代理档的 socks5 转发器一并停。

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string",
   "description": "profile id"
  },
  "idempotencyKey": {
   "type": "string",
   "description": "可选;重复停止请求的安全幂等键。"
  }
 },
 "required": [
  "id"
 ]
}
switch_tab — profile 浏览器切换到第 index 个标签页

profile 浏览器切换到第 index 个标签页

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "index": {
   "type": "integer"
  }
 },
 "required": [
  "id",
  "index"
 ]
}
tabs — 列出 profile 浏览器当前标签页

列出 profile 浏览器当前标签页

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  }
 },
 "required": [
  "id"
 ]
}
totp_code — 取该档 2FA/TOTP 的**当前验证码**(RFC 6238;配合 update_profile 的 totp_secret 使用)。读 `Secrets/<id>.json`(0600)现算,**绝不回显 secr

取该档 2FA/TOTP 的**当前验证码**(RFC 6238;配合 update_profile 的 totp_secret 使用)。读 `Secrets/<id>.json`(0600)现算,**绝不回显 secret 本体**;返回 `{code, digits, period, remaining, expires_at}`。该档没存 secret ⇒ 具名 404(不是空串、不是 000000)。

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string",
   "description": "档案 id(完整 UUID)"
  }
 },
 "required": [
  "id"
 ]
}
type — 在 profile 页面元素输入文本。selector=CSS 选择器;或 element_id=page_map 返回的元素 id(填了则现场重解析为 sel)。human:true → 真实 HID 拟人键入:CGE

在 profile 页面元素输入文本。selector=CSS 选择器;或 element_id=page_map 返回的元素 id(填了则现场重解析为 sel)。human:true → 真实 HID 拟人键入:CGEvent 逐字 + 档案 persona 指纹,防 BOT,仅单前台 profile;缺省 JS 注入快速但 isTrusted=false

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "selector": {
   "type": "string",
   "description": "CSS 选择器(与 element_id 二选一)"
  },
  "element_id": {
   "type": "integer",
   "description": "page_map 返回的元素 id(与 selector 二选一;填了覆盖 selector)"
  },
  "text": {
   "type": "string"
  },
  "human": {
   "type": "boolean",
   "description": "true=拟人键入(对齐主流自动化 Local API 的 human 语义,防 BOT)"
  },
  "speed": {
   "type": "integer",
   "description": "0-4(HumanPasteSpeed rawValue),仅 human:true 生效;缺省用档案 persona"
  },
  "input": {
   "type": "string",
   "enum": [
    "hid",
    "inline"
   ],
   "description": "仅 human:true 时有意义。`hid`(缺省)=真实 HID 事件流(全机串行,多档案并发排队/超预算报 hid_busy);`inline`=**进程内投递**(NSEvent → 本档窗口,不激活、不占前台)⇒ **多档案可并发**,isTrusted 实测仍为 true。⚠️ inline 不含 persona 的错字自纠/停顿;后台时页面 `document.hasFocus()` 为 false"
  },
  "frame": {
   "type": "integer",
   "description": "子帧 index(frames 工具列出;缺省=主帧)。焦点与「失焦即取消」守卫都落在该帧内(跨域/sandbox 帧同理);索引失效显式报错"
  }
 },
 "required": [
  "id",
  "text"
 ]
}
update_profile — 回写档案的可变元数据(企业接入清单 §三-7)。**每个键都是可选的,但至少要给一个**(`notes`、`passkey`、`page_script_policy`、`proxy_settings` 写档案 JSON;

回写档案的可变元数据(企业接入清单 §三-7)。**每个键都是可选的,但至少要给一个**(`notes`、`passkey`、`page_script_policy`、`proxy_settings` 写档案 JSON;`totp_secret` 写独立 secret 落库,见参数说明)。改的是 ProfileStore 里的档案 JSON,**下次启动生效**——正在运行的档案不会热改内存态。

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string",
   "description": "档案 id(完整 UUID)"
  },
  "notes": {
   "type": "string",
   "description": "备注自由文本;**空串即清空**(本工具以「键是否在场」判有没有给值,故空串是有效意图,不像 create_profile 那样被跳过)"
  },
  "page_script_policy": {
   "type": "string",
   "enum": [
    "native-zero-page-script",
    "legacy-js-compatibility"
   ],
   "description": "Mac 页面执行策略。native-zero-page-script=强风控站点兼容模式:不注入页面脚本/handler/accessor/Canvas/WebGL/Audio wrapper;legacy-js-compatibility=恢复确定性页面兼容层。属高影响切换,下一次启动生效。"
  },
  "totp_secret": {
   "type": "string",
   "description": "2FA/TOTP secret 的**结构化字段**(清单 §三-7 诉求)。**空串即清除**。落盘在 `Secrets/<id>.json`(0600),**不写进档案 JSON**——因此不进云端 config_json、不进 .bak、不被导出/复制带走,也不会被 GUI 重编码剥掉。两条如实边界:① 换机/重登拉档 secret **不随档恢复**(它不在云端副本里);② 取当前验证码用 `totp_code` 工具(RFC 6238 现算,绝不复述 secret)"
  },
  "passkey": {
   "type": "boolean",
   "description": "开/关该档的虚拟 authenticator(写 spoofSettings.passkey)。true=开启;**false=写入显式关闭**(缺键表示引擎默认开,不能用删键表达关闭)。⚠️ 只对**非 trust 档**(envSpoof≠false)有效——原生环境档上结构性不可用,本工具**拒收**并说明原因(不是静默空操作)。下一次启动该档才生效"
  },
  "passkey_uv": {
   "type": [
    "boolean",
    "null"
   ],
   "description": "该档虚拟 authenticator 的**验身要求**(写 spoofSettings.passkeyUV)。三态:**true**=站点要求用户验身时弹真实 Touch ID/Mac 密码(**缺省**);**false**=不弹窗(无人值守自动化;authData 的 UV 位如实不置);**null=回默认**(把键移除)。⚠️ 只对**非 trust 档**有效——trust/真机零注入档上 true/false **具名拒收**(虚拟认证器结构性不激活),null(删键)在任意档都允许。下一次启动该档才生效"
  },
  "save_password": {
   "type": [
    "boolean",
    "null"
   ],
   "description": "改该档的「保存密码询问」开关(写 spoofSettings.savePassword)。三态:true=总是问(含 API/自动化会话);false=从不问(引擎连捕获钩子都不装载);**null=回到默认**(把键从档案移除 —— 默认语义=手动打开时问、API 启动不问)。下一次启动该档才生效"
  },
  "proxy_settings": {
   "type": "object",
   "description": "回写该档代理设置(运维换代理不再需要手改档案 JSON)。白名单键:type / host / port / username / password / chainProxy;**未给的键保持原值**(合并语义)。host 传空串=置空(该档不走代理)。type ∈ socks5/socks5h/http/https。**下一次启动该档才生效**(运行中的档不热切代理)",
   "properties": {
    "type": {
     "type": "string"
    },
    "host": {
     "type": "string"
    },
    "port": {
     "type": "integer"
    },
    "username": {
     "type": "string"
    },
    "password": {
     "type": "string"
    },
    "chainProxy": {
     "type": "string"
    },
    "transport": {
     "type": "string",
     "enum": [
      "native",
      "helper"
     ],
     "description": "native=WebKit 直连静态代理;helper=兼容 socks_fwd;native 不允许 chainProxy"
    }
   },
   "additionalProperties": false
  }
 },
 "required": [
  "id"
 ]
}
upload — 向 profile 页面上传文件(仅 <input type=file>):先 arm 预置文件路径(引擎 /upload/arm),再可信 HID 点击目标元素(真实 CGEvent isTrusted=true →

向 profile 页面上传文件(仅 <input type=file>):先 arm 预置文件路径(引擎 /upload/arm),再可信 HID 点击目标元素(真实 CGEvent isTrusted=true → WebKit 唤起文件面板 → 引擎自动完成选择,一次 arm 只消费一次)。路径须真实存在且引擎机器可达。依赖:单前台 profile + AX 授权(同 human_click)。纯 JS 给 file input 喂路径被 WebKit user-activation 硬禁 → 不做;JS click() 也不会弹面板

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "selector": {
   "type": "string",
   "description": "CSS 选择器,指向 file input(与 element_id 二选一)"
  },
  "element_id": {
   "type": "integer",
   "description": "page_map 返回的元素 id(与 selector 二选一;填了覆盖 selector)"
  },
  "paths": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "上传文件路径数组(全部须真实存在)"
  },
  "index": {
   "type": "integer",
   "description": "匹配元素第 index 个"
  },
  "pace": {
   "type": "number",
   "description": "0.2-2.0 点击节奏乘数;缺省 1.0"
  }
 },
 "required": [
  "id",
  "paths"
 ]
}
usage_report — 本机用量自查:按**本地日历日**汇总这台机器上的调用(总数 / 成功失败 / 按天 / 按工具 / 按机读码 / 按传输),并把**资源占用**(档案、回收站、工作区)一起给你 —— 后者拿去和 `account.st

本机用量自查:按**本地日历日**汇总这台机器上的调用(总数 / 成功失败 / 按天 / 按工具 / 按机读码 / 按传输),并把**资源占用**(档案、回收站、工作区)一起给你 —— 后者拿去和 `account.status()` 的 cap 比,前者就是「这段时间我调了多少」。`days=1` 就是今天(缺省 7,上限 90)。⚠️ 三条如实:① 数字是**下界**(审计只留一代、且可被 `AUG_AUDIT=0` 关掉)—— 报告里的 `coverage.truncated` 为 true 时说明更早的记录已被丢弃;② 只统计**本机**,不含参数体;③ 它**不**读云端,所以能在断网/离线租约期用。

{
 "type": "object",
 "properties": {
  "days": {
   "type": "integer",
   "description": "统计最近几个**本地日历日**(含今天;1..90,缺省 7)"
  }
 }
}
vcam_video — profile 虚拟摄像头切换视频源(side=A|B=前/后侧槽位,也收 front|back;path 视频文件/图片路径;缺省回落侧预选)。跨会话持久(写回 profile 配置),下次启动生效

profile 虚拟摄像头切换视频源(side=A|B=前/后侧槽位,也收 front|back;path 视频文件/图片路径;缺省回落侧预选)。跨会话持久(写回 profile 配置),下次启动生效

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "side": {
   "type": "string",
   "enum": [
    "A",
    "B"
   ],
   "description": "视频槽 A 或 B"
  },
  "path": {
   "type": "string",
   "description": "视频/图片文件路径;缺省=该侧当前预选"
  },
  "index": {
   "type": "integer",
   "description": "该侧多文件序列中的 index;缺省 0"
  }
 },
 "required": [
  "id",
  "side"
 ]
}
wait_for — 轮询等待 profile 页面首个匹配 selector 出现;超时返回结构化 timeout 错误

轮询等待 profile 页面首个匹配 selector 出现;超时返回结构化 timeout 错误

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "selector": {
   "type": "string"
  },
  "timeout": {
   "type": "number",
   "description": "秒,缺省 10"
  },
  "interval": {
   "type": "number",
   "description": "轮询间隔秒,缺省 0.3"
  }
 },
 "required": [
  "id",
  "selector"
 ]
}
webhook_delete — 删除一个本地回调(幂等:已经不在⇒回 ok 且 already:true)。

删除一个本地回调(幂等:已经不在⇒回 ok 且 already:true)。

{
 "type": "object",
 "properties": {
  "id": {
   "type": "string",
   "description": "webhook id"
  }
 },
 "required": [
  "id"
 ]
}
webhook_list — 列出本机登记的事件回调(本地回调,P3-⑫)。**只收回环/私网地址** —— 控制面带着你的 key,允许任意 URL 就等于给了别人一个 SSRF 跳板。

列出本机登记的事件回调(本地回调,P3-⑫)。**只收回环/私网地址** —— 控制面带着你的 key,允许任意 URL 就等于给了别人一个 SSRF 跳板。

{
 "type": "object",
 "properties": {}
}
webhook_register — 登记一个本地回调:事件发生时 POST 到你给的地址。**只收 IP 字面量或 localhost**,且必须是回环/RFC1918/IPv6 ULA(不收域名 —— 收域名要先解析,而解析结果会变=DNS rebind

登记一个本地回调:事件发生时 POST 到你给的地址。**只收 IP 字面量或 localhost**,且必须是回环/RFC1918/IPv6 ULA(不收域名 —— 收域名要先解析,而解析结果会变=DNS rebinding)。

{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "description": "http(s)://<回环或私网 IP>[:port]/path"
  },
  "events": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "只收哪些 kind(缺省=全部)。当前只有 \"tool_call\""
  }
 },
 "required": [
  "url"
 ]
}
workspace_create — 新建工作区(=建一个分组;`group_id` 的目标)。**批量**:`names` 传数组(一次加锁一次写盘),重名/空名/保留名逐条如实报告(`skipped`);单值 `name` 形态与旧版逐字兼容。

新建工作区(=建一个分组;`group_id` 的目标)。**批量**:`names` 传数组(一次加锁一次写盘),重名/空名/保留名逐条如实报告(`skipped`);单值 `name` 形态与旧版逐字兼容。

{
 "type": "object",
 "properties": {
  "name": {
   "type": "string",
   "description": "工作区名(不可为空)"
  },
  "names": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "批量创建的工作区名(与 name 二选一)"
  }
 },
 "required": []
}
workspace_delete — 删除工作区(**只删分组本身与归属,不动任何档案本体** —— 与 GUI 一致)。回执里 `untagged_profiles` 列出因此少了一个分组标记的档案 id。**批量**:`workspace_ids` 传数

删除工作区(**只删分组本身与归属,不动任何档案本体** —— 与 GUI 一致)。回执里 `untagged_profiles` 列出因此少了一个分组标记的档案 id。**批量**:`workspace_ids` 传数组(一次加锁一次写盘);`default`/不存在的 id 进 `refused` 并说明。

{
 "type": "object",
 "properties": {
  "workspace_id": {
   "type": "string"
  },
  "workspace_ids": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "批量删除的工作区 id(与 workspace_id 二选一)"
  }
 },
 "required": []
}
workspace_list — 列出工作区(档案分组=企业接入清单 §二-12 `group_id`)。与 GUI 的工作区页同一份数据。

列出工作区(档案分组=企业接入清单 §二-12 `group_id`)。与 GUI 的工作区页同一份数据。

{
 "type": "object",
 "properties": {
  "include_default": {
   "type": "boolean",
   "description": "是否连 `default`(「所有 Profile」虚拟桶)一起返回;缺省 false"
  },
  "with_members": {
   "type": "boolean",
   "description": "是否连每区成员 id 一起返回;缺省 false(只给 count)"
  }
 }
}
workspace_rename — 重命名工作区(`default` 桶不可改名)。

重命名工作区(`default` 桶不可改名)。

{
 "type": "object",
 "properties": {
  "workspace_id": {
   "type": "string",
   "description": "工作区 id"
  },
  "name": {
   "type": "string"
  }
 },
 "required": [
  "workspace_id",
  "name"
 ]
}

错误码

HTTPcode含义 / 处置
400bad_request参数名/类型/取值不合法,或同时给了互斥项(错误消息里含可接受键集或允许值)
401unauthorized缺/错 Authorization;或 key 未通过云端校验
403local_readonly未设 key 的本机只读模式下调了执行类工具(读类照常)。先在账号中心建 Key 并配 AUG_API_KEY
403tier_required档位不够:自动化接口需 Team 及以上(错误消息里给出当前档位与升级目标)
403lease_required自动化授权未生效:本地引擎在自动化接口上回的码 —— 先经 REST/MCP/SDK 用有效 Key 校验一次(会落下 24 小时离线租约)再驱动;只读接口不受影响。 ⚠️ 这条来自引擎(不是控制面),排查时看响应体的 error(会写明是"没有租约/已过期/本机不匹配/档位不足"哪一种)
404not_found资源不存在(档案/工作区 id 找不到)或路径/工具不存在。与 400 分得开:请求写错是 400
405bad_request方法不对(错误消息会列出该路径接受的方法)
429rate_limited超过宿主设的 AUG_API_MAX_RPS(背压,不是配额)。 按 Retry-After(整数秒)退避后再重试;响应体带 queue_depth(当时在等几个)、 inflight(正在执行几个)、limit_rps、burst。并发批量请把请求同时发出; 持续 429 说明宿主设的上限低于你们的并发数,让部署方调高
200工具层错误执行失败(如档案没在跑)→ {"ok": false, "error": ...},HTTP 仍是 200

时效:文档 vs 已发布

本页描述的是最新一版,而已发布版是 0.1.192 / build 252 ⇒ 本页里的新能力在旧安装版上可能还不存在。两者差在哪,用下面那条自查命令量(不要靠猜)。

自查(30 秒,两条命令):① 你装的是哪一版 —— /usr/libexec/PlistBuddy -c "Print :CFBundleVersion" "/Applications/AUG WorkSpace.app/Contents/Info.plist"; ② 你这一版实际有多少个工具 —— curl -s localhost:8311/v1/tools 数一遍(机器权威清单)。 规则很简单:控制面的工具数就是这一版的真实面;文档与它对不上时,以它为准 (本页由接口注册表生成,可能滞后于你手上那一版)。

怎么用(三步)与四条会踩的坑

  1. 起控制面:装了 App 之后,控制面就是 .app 里的那一份 —— 「AUG WorkSpace.app」/Contents/Resources/engine/core/api_server.py; 用 App 自带的运行时 + -B 起它(缺省 127.0.0.1:8311): AUG_API_KEY=<你的 Key> PYTHONDONTWRITEBYTECODE=1 「AUG WorkSpace.app」/Contents/Resources/engine/pyruntime/bin/python3 -B 「AUG WorkSpace.app」/Contents/Resources/engine/core/api_server.py。 ⚠️ 那个 -B 与「用包内运行时」不是装饰:core/ 与运行时都住在 已签名的应用包里,CPython 缺省会把 .pyc 写回它导入的每个模块旁边 ⇒ 往签名包里新增文件会当场破坏封签(codesign --verify --strict 报 a sealed resource is missing or invalid;实测形态:一次启动写入 130 个 .pyc)。
  2. 建 Key 并配好:在 AUG WorkSpace →(账号)生成 API Key(明文只显示一次, 界面会顺手复制到剪贴板)→ 配到 AUG_API_KEY 或你的 MCP/SDK 客户端。 执行类调用带 Authorization: Bearer <AUG_API_KEY>;不带 key 只有本机只读 (执行类回 403 local_readonly)。自动化接口需 Team 及以上档位; 首次校验通过会落下一份 24 小时离线租约(期间断网可用),过期需联网续一次。
  3. 先问再用:GET /v1/tools 拿清单与入参 schema,GET /v1/health 探活。 不要照抄任何清单(包括本页的工具数)去硬编码 —— 它是**那一刻**的真实面。

其他接法

端口怎么拿(别自己算)

端口是档案数据,不是可以自己推导的常量。 每个档案的控制端口在启动时分配并落盘,此后固定不变。

不要自己按公式算端口去连一个已存在的档案 —— 档案一多就会撞车。撞了以后不止「谁连不上谁」,而是可能连到别人的档案上去。

正确做法只有一个:用 SDK 取。

from aug_sdk import Client
a = Client().browser("你的档案ID")   # 端口由 SDK 从档案里读,不用你管
a.navigate("https://example.com")

任何语言都可以走 REST 直接发请求,但端口同样请从档案数据里读,不要硬编码、不要推导。


bridge:本地 HTTP JSON-RPC

每 profile 浏览器进程启动时内嵌一个 HTTP server,仅绑定 127.0.0.1。 base URL = http://127.0.0.1:<port>(port 见上)。

响应均为 JSON;ok: true 成功,ok: false 时带 error 字段。唯一例外 = /screenshot 返回 raw bytes(image/png|jpeg,非 JSON)。短连接:响应后即关。

鉴权与请求加固

鉴权与请求加固

running/state/pid/bridgePort/tabCount/capability/observedAt;只有调用方已授权时才附带当前 URL。

GUI 启动的子进程通过 0600 一次性 capability 文件取得 token;接口不回显 token。

方法路径请求 body响应
GET/status—{ok, running, state, pid, bridgePort, tabCount, capability, observedAt, url?}(最小、无凭据)
GET/tabs—{ok, tabs: [{title,url,active}]}
GET/cookies/export—{ok, text: <Netscape cookies.txt>, count}
POST/navigate{url}{ok}
POST/evaluate{js}{ok, result}(JS 求值结果,JSON 可序列化值;JS 抛错 → {ok:false,error})
POST/tabs/new{url?}(缺省 example.com){ok}
POST/tabs/switch{index}{ok}
POST/tabs/close{index}{ok}
POST/cookies/import{text: <Netscape cookies.txt>}{ok, imported: <条数>}
POST/cookies/replace{text: <Netscape cookies.txt>}{ok, imported: <条数>}(先清空再注入;切换登录态不重启)
POST/window/frame{x, y, width, height}{ok}(contentRect,AppKit 左下原点;宽高须 >0)
POST/screenshot`{format: png\jpeg, max_width?: 点数, quality?: 0.1-1.0}`raw bytes(image/png 或 image/jpeg;非 JSON)。native WKWebView.takeSnapshot:所见即真实渲染,页面 canvas 加噪只作用于 JS 读回、native 天然免疫。max_width 为逻辑点数(Retina 下 ~2×px)
POST/upload/arm{paths: [绝对路径…]}{ok, armed: <数>}(须全部文件存在否则 400)。预置待上传文件:随后一次可信点击 <input type=file> 唤起面板时自动完成选择(一次性消费即清)。未 arm 的真手点击 → 回退系统文件选择面板

Netscape cookies.txt 7 列:domain flag path secure expires name value。


Python SDK

from aug_sdk import Client
a = Client().browser("你的档案ID")     # 端口按档案数据取,无需手动给
a.navigate("https://example.com")
a.wait_for("h1")
print(a.read("h1"))
a.click("button.submit")
a.type("#email", "[email protected]")   # 脚本注入 value(非真人键入;零痕迹走 Human Paste)
a.export_cookies()                     # -> cookies.txt 文本
a.import_cookies(text)                 # -> 导入条数
a.set_window_frame(x, y, w, h)         # 移动/缩放窗口(contentRect)
png = a.screenshot()                   # native 截图 → PNG bytes(所见即真实渲染)
dom = a.page_map()                     # 结构化页面地图:骨架 + 可见交互元素(id/sel/rect)
a.click(dom["elements"][0]["sel"])     # 用 map 给的 sel 精确点击,不再猜选择器

方法 | 对应 endpoint | 说明 -----|--------------|------ navigate(url) / evaluate(js) / tabs() / new_tab(url?) / switch_tab(i) / close_tab(i) | bridge 同名 | 核心原语 click(sel, index=0) / type(sel, text) / read(sel) / wait_for(sel, timeout) | /evaluate 拼 JS | 派生原语(同步值);SDK 底层 wait_for 超时返回 False,MCP/REST 超时返回结构化 timeout 错误 import_cookies(text, timeout=120) | /cookies/import | timeout 放宽到 120s:引擎侧并发 setCookie + per-cookie 2s 兜底 export_cookies(timeout=15) | /cookies/export | 档案未运行 → ConnectionRefusedError set_window_frame(x,y,w,h) | /window/frame | 一键排列用 replace_cookies(text, timeout=120) | /cookies/replace | 先清空再注入,登录态切换不重启引擎 human_click(sel, i=0, pace=1) / human_type(sel, text, speed?) / human_hover(sel, i=0, pace=1) | HID(CGEvent) | 拟人输入:真实 HID + 档案 persona 指纹,isTrusted=true;单前台依赖 human_key(key, selector?) | HID | 可信原生单键:仅 Enter(映射 Return,触发原生提交);其余键 ValueError → 走 press_key JS dispatch arm_upload(paths) | /upload/arm | 文件上传预置(配合可信点击自动完成;一次性消费) press_key(key, selector?) | /evaluate 派发 KeyboardEvent | key 见工具描述;JS 注入 isTrusted=false scroll(dy) / scroll_state() | /evaluate | window.scrollBy / 滚动高度读数 page_map(...) | /evaluate(只读 DOM 枚举) | 结构化页面感知:骨架 + ≤200 可见交互元素 {id,tag,role,text,sel,rect};不写 DOM/canvas → 指纹零暴露 resolve_sel(element_id) | 重跑 page_map 枚举 | element_id → sel(现场重解析防 stale) wait_nav() | SSE | 等导航加载完成(10s 超时)


MCP:stdio server

MCP server 随 AUG WorkSpace 一起分发,位于应用包内:

「你的 AUG.app」/Contents/Resources/engine/core/mcp_server.py

自测(必须用包内自带的运行时并带 -B:core/ 与运行时都住在已签名的应用包里, CPython 缺省会把 .pyc 写回它导入的每个模块旁边 ⇒ 往签名包里新增文件会当场破坏封签, codesign --verify --strict 报 a sealed resource is missing or invalid;用系统 python3 指向包内也一样会写):

"「你的 AUG.app」/Contents/Resources/engine/pyruntime/bin/python3" -B "<上面的路径>" --smoke

framing

newline-delimited JSON(NDJSON),非 Content-Length(那是 LSP)。客户端逐行读, 每行一个完整 JSON-RPC 2.0 消息。日志一律 stderr(stdout 是协议通道)。

协议

工具

工具说明
list_profiles全部 profile 摘要(代理密码脱敏)
get_profile单个 profile 完整数据(密码脱敏)
launch_profile启动 profile 浏览器;代理 profile 自 spawn 本地 socks5 转发器接上游。只在进程、Bridge 与首个 tab 就绪后返回 ready:true;可选 idempotencyKey
navigate / evaluate / tabs / click / read复用 bridge 能力;档案未运行 → 提示「先 launch_profile」
stop_profile优雅停本 MCP 启动的档:SIGTERM → 确认引擎自存 cookie jar 且进程退出后才释放资源;5 秒内未退出返回 process_stop_timeout。GUI 起档不受影响
operation_list / operation_show查询统一 OperationReceipt;operation_show(events=true) 返回追加式阶段事件
uploadfile input 上传:arm 预置路径 + 可信 HID 点击自动完成(单前台/AX);JS 点击开不了面板

launch_profile 的首导航在 readiness.firstNavigation 中显式为 completed|unconfirmed|not_required。MCP tools/call 同时返回人类可读 content 与机器可读 structuredContent;REST 成功/失败体都带 requestId。错误还带 category、retryClass、retryable、nextActions、messageKey(适用时)。

完整工具清单(现 92 个)以 --smoke(tools/list)为准。


统一 OperationReceipt

GUI、REST、MCP 和任务执行器共用同一份操作回执:

{
  "id": "op_…",
  "kind": "launch",
  "state": "succeeded",
  "phase": "ready",
  "progress": {"done": 7, "total": 7, "unit": "step"},
  "effect": {"state": "committed"},
  "result": {"ready": true},
  "error": null,
  "revision": 7
}

统一 OperationReceipt

GUI、REST、MCP 和任务执行器共用同一份回执。非终态为 queued/preparing/running/awaiting_user/verifying/stopping;终态为 succeeded/failed/inconclusive/cancelled,终态不可改写。

progress 与 effect 分离:effect.state=unknown 表示结果需核验,客户端不得盲目重放。REST 使用 GET /v1/operations 与 GET /v1/operations/{id};MCP 使用 operation_list / operation_show。

安全注意