{
 "openapi": "3.1.0",
 "info": {
  "title": "AUG WorkSpace 本机控制面 API",
  "version": "0.1.193+253",
  "description": "本机控制面（缺省 http://127.0.0.1:8311）。**机器权威清单是 `GET /v1/tools`**（本页按客户面裁剪；以它为准写代码不会漏）。鉴权：`Authorization: Bearer <AUG_API_KEY>`；自动化接口需 Team 及以上档位。"
 },
 "servers": [
  {
   "url": "http://127.0.0.1:8311",
   "description": "本机控制面（可用 AUG_API_HOST / AUG_API_PORT 覆盖）"
  }
 ],
 "components": {
  "securitySchemes": {
   "bearerAuth": {
    "type": "http",
    "scheme": "bearer",
    "description": "AUG_API_KEY（在 AUG WorkSpace 账号中心生成）"
   }
  },
  "schemas": {
   "Error": {
    "type": "object",
    "required": [
     "ok",
     "code",
     "error"
    ],
    "properties": {
     "ok": {
      "type": "boolean",
      "const": false
     },
     "code": {
      "type": "string",
      "description": "机读码；HTTP 状态与它一一对应（见每条的 description）"
     },
     "error": {
      "type": "string",
      "description": "人读说明（含该修什么）"
     },
     "request_id": {
      "type": "string",
      "description": "本次调用的排障锚点（与响应头 X-Request-Id 同值；报障请带上）"
     }
    }
   }
  }
 },
 "paths": {
  "/v1/profiles": {
   "post": {
    "operationId": "create_profile_post",
    "summary": "API 建档：不经 GUI 新建 profile（企业接入 A2）",
    "description": "API 建档：不经 GUI 新建 profile（企业接入 A2）。支持传入代理(socks5/http+账号密码)/时区/语言/UA/WebRTC策略/音频与画布保护/更严格的画布防关联/标签页画布防关联/预置 cookie/Passkey。与 GUI 建档同一生成路径，落同一 ProfileStore。返回新建的 id 列表。",
    "tags": [
     "profiles"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "create_profile"
   },
   "get": {
    "operationId": "list_profiles_get",
    "summary": "列出 profile 摘要（代理密码脱敏；含工作区分组）",
    "description": "列出 profile 摘要（代理密码脱敏；含工作区分组）。**分页**：给了 limit 或 cursor 时返回 `{items,total,limit,offset,has_more,next_cursor}`；**两个都不给时返回裸数组=全量**（与从前逐字相同；分页是显式选择，绝不静默截断）。企业档最多 1000 个档，一次全拉响应很大 ⇒ 建议 limit<=200 翻页。",
    "tags": [
     "profiles"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "list_profiles",
    "parameters": [
     {
      "name": "workspace_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "只看某个工作区里的档案（＝企业接入清单 §二-12 的 `group_id`）：id 或**名称**都行，缺省=全部。⚠️ 不存在的名字**当场报错**，不静默回落成「全部」（静默回落会让调用方以为筛过了）"
      },
      "description": "只看某个工作区里的档案（＝企业接入清单 §二-12 的 `group_id`）：id 或**名称**都行，缺省=全部。⚠️ 不存在的名字**当场报错**，不静默回落成「全部」（静默回落会让调用方以为筛过了）"
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "description": "本页最多几条（1..500）。给了它就返回分页信封；**不给＝全量裸数组**（既有调用零变化）"
      },
      "description": "本页最多几条（1..500）。给了它就返回分页信封；**不给＝全量裸数组**（既有调用零变化）"
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "上一页响应里的 `next_cursor`，**原样回传**（不透明，不要解析）"
      },
      "description": "上一页响应里的 `next_cursor`，**原样回传**（不透明，不要解析）"
     }
    ]
   }
  },
  "/v1/profiles/{id}": {
   "get": {
    "operationId": "get_profile_get",
    "summary": "读取单个 profile 完整数据（代理凭据与身份根密钥脱敏）",
    "description": "读取单个 profile 完整数据（代理凭据与身份根密钥脱敏）",
    "tags": [
     "profiles"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "get_profile",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "include_secret",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "description": "连 2FA secret 一起读（缺省 **false**：秘密不进每次读取、不进调用方日志）。秘密不在档案 JSON 里，由 Secrets/<id>.json 读出后并入 `secrets` 键。身份 rootSecret 永不返回"
      },
      "description": "连 2FA secret 一起读（缺省 **false**：秘密不进每次读取、不进调用方日志）。秘密不在档案 JSON 里，由 Secrets/<id>.json 读出后并入 `secrets` 键。身份 rootSecret 永不返回"
     }
    ]
   },
   "put": {
    "operationId": "update_profile_put",
    "summary": "回写档案的可变元数据（企业接入清单 §三-7）",
    "description": "回写档案的可变元数据（企业接入清单 §三-7）。**每个键都是可选的，但至少要给一个**（`notes`、`passkey`、`page_script_policy`、`proxy_settings` 写档案 JSON；`totp_secret` 写独立 secret 落库，见参数说明）。改的是 ProfileStore 里的档案 JSON，**下次启动生效**——正在运行的档案不会热改内存态。",
    "tags": [
     "profiles"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "update_profile",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "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"
        ]
       }
      }
     }
    }
   },
   "delete": {
    "operationId": "delete_profile_delete",
    "summary": "删除档案（**软删**：移入回收站，可 restore_profile 恢复）",
    "description": "删除档案（**软删**：移入回收站，可 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` 键里；注销**可逆**且不碰密文与恢复材料）。",
    "tags": [
     "profiles"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "delete_profile",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/v1/profiles/{id}/status": {
   "get": {
    "operationId": "profile_status_get",
    "summary": "查档案**运行态**：该档的浏览器现在在不在跑、bridge 端口、当前标签页/URL（对应兼容产品的 `browser-profile/active`）",
    "description": "查档案**运行态**：该档的浏览器现在在不在跑、bridge 端口、当前标签页/URL（对应兼容产品的 `browser-profile/active`）。批量给 `ids` 时并发探测（短超时）。⚠️ 判据是**真连一次 bridge**（连不上=没在跑），不是读某个状态文件 —— 状态文件会撒谎：引擎崩了、被 kill -9、GUI 强退都会留下\"看起来在跑\"的残迹。",
    "tags": [
     "profiles"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "profile_status",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "timeout",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number",
       "description": "单档探测超时秒数，缺省 1.5（连不上很快返回，超时只对\"半死\"的进程有意义）"
      },
      "description": "单档探测超时秒数，缺省 1.5（连不上很快返回，超时只对\"半死\"的进程有意义）"
     }
    ]
   }
  },
  "/v1/profiles/{id}/restore": {
   "post": {
    "operationId": "restore_profile_post",
    "summary": "从回收站恢复档案（`Trash/<id>.json` → `Profiles/<id>.json`，与 GUI 回收站的「恢复」同一动作）",
    "description": "从回收站恢复档案（`Trash/<id>.json` → `Profiles/<id>.json`，与 GUI 回收站的「恢复」同一动作）。浏览数据本来就没被删，恢复后直接 launch_profile 即可。库中已存在同 id 档案时**拒绝**（覆盖会静默吃掉库里那一份）。顺带把云端**登记**复登（重新占用 `profiles_cap` 名额，与 delete_profile 的注销**对称、可逆**；best-effort，结果在嵌套的 `cloud` 键里）。",
    "tags": [
     "profiles"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "restore_profile",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {},
        "required": [
         "id"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/trash": {
   "get": {
    "operationId": "list_trash_get",
    "summary": "列出回收站里的档案（软删的档）",
    "description": "列出回收站里的档案（软删的档）。与 GUI 回收站是**同一份内容**。分页语义与 `list_profiles` **逐字相同**（给 limit/cursor 才返回分页信封）。",
    "tags": [
     "trash"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "list_trash",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "description": "本页最多几条（1..500）；不给＝全量裸数组"
      },
      "description": "本页最多几条（1..500）；不给＝全量裸数组"
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "上一页响应里的 `next_cursor`，原样回传"
      },
      "description": "上一页响应里的 `next_cursor`，原样回传"
     }
    ]
   }
  },
  "/v1/trash/{id}": {
   "delete": {
    "operationId": "purge_profile_delete",
    "summary": "从回收站**彻底删除**档案：引擎 `--dispose` 擦除该档的 WebKit datastore ＋ sidecar（History/Downloads",
    "description": "从回收站**彻底删除**档案：引擎 `--dispose` 擦除该档的 WebKit datastore ＋ sidecar（History/Downloads/Sessions/Bookmarks/CookieJars/Secrets/Passkeys）＋ Keychain 密码，然后删掉回收站里的 JSON 与（仅当为空时）该档的数据目录。**不可恢复。**⚠️ 只接受**已在回收站**的档案（先 delete_profile）——刻意不留「一次调用直接抹掉在库档案」的路径，回收站那一步就是撤销窗口。⚠️ 引擎擦除失败/超时时**不删** JSON 并报错：宁可让你重试，也不回一个「已销毁」而实际没擦干净。",
    "tags": [
     "trash"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "purge_profile",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/v1/audit": {
   "get": {
    "operationId": "audit_log_get",
    "summary": "查这台机器上的**本地调用审计**（最近 N 条，新的在前）：时间/请求 id/工具/成功与否/机读码/耗时/档位",
    "description": "查这台机器上的**本地调用审计**（最近 N 条，新的在前）：时间/请求 id/工具/成功与否/机读码/耗时/档位。**只落本机、绝不外发**；**不记参数体**（所以查不到「你当时传了什么」，那是刻意的 —— 参数里有代理密码、cookie、TOTP）。要定位某一次调用，用它响应头里的 `X-Request-Id` 在这个清单里搜 `rid`。",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "audit_log",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "description": "最多回几条（1..1000，缺省 100）。注意这与 list_* 的分页参数**不同名同义**：审计是「只要最近 N 条」，没有游标"
      },
      "description": "最多回几条（1..1000，缺省 100）。注意这与 list_* 的分页参数**不同名同义**：审计是「只要最近 N 条」，没有游标"
     }
    ]
   }
  },
  "/v1/usage": {
   "get": {
    "operationId": "usage_report_get",
    "summary": "本机用量自查：按**本地日历日**汇总这台机器上的调用（总数 / 成功失败 / 按天 / 按工具 / 按机读码 / 按传输），并把**资源占用**（档案、回收站",
    "description": "本机用量自查：按**本地日历日**汇总这台机器上的调用（总数 / 成功失败 / 按天 / 按工具 / 按机读码 / 按传输），并把**资源占用**（档案、回收站、工作区）一起给你 —— 后者拿去和 `account.status()` 的 cap 比，前者就是「这段时间我调了多少」。`days=1` 就是今天（缺省 7，上限 90）。⚠️ 三条如实：① 数字是**下界**（审计只留一代、且可被 `AUG_AUDIT=0` 关掉）—— 报告里的 `coverage.truncated` 为 true 时说明更早的记录已被丢弃；② 只统计**本机**，不含参数体；③ 它**不**读云端，所以能在断网/离线租约期用。",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "usage_report",
    "parameters": [
     {
      "name": "days",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "description": "统计最近几个**本地日历日**（含今天；1..90，缺省 7）"
      },
      "description": "统计最近几个**本地日历日**（含今天；1..90，缺省 7）"
     }
    ]
   }
  },
  "/v1/webhooks": {
   "get": {
    "operationId": "webhook_list_get",
    "summary": "列出本机登记的事件回调（本地回调，P3-⑫）",
    "description": "列出本机登记的事件回调（本地回调，P3-⑫）。**只收回环/私网地址** —— 控制面带着你的 key，允许任意 URL 就等于给了别人一个 SSRF 跳板。",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "webhook_list"
   },
   "post": {
    "operationId": "webhook_register_post",
    "summary": "登记一个本地回调：事件发生时 POST 到你给的地址",
    "description": "登记一个本地回调：事件发生时 POST 到你给的地址。**只收 IP 字面量或 localhost**，且必须是回环/RFC1918/IPv6 ULA（不收域名 —— 收域名要先解析，而解析结果会变＝DNS rebinding）。",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "webhook_register",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "url": {
          "type": "string",
          "description": "http(s)://<回环或私网 IP>[:port]/path"
         },
         "events": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "description": "只收哪些 kind（缺省＝全部）。当前只有 \"tool_call\""
         }
        },
        "required": [
         "url"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/webhooks/{id}": {
   "delete": {
    "operationId": "webhook_delete_delete",
    "summary": "删除一个本地回调（幂等：已经不在⇒回 ok 且 already:true）",
    "description": "删除一个本地回调（幂等：已经不在⇒回 ok 且 already:true）。",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "webhook_delete",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/v1/jobs": {
   "get": {
    "operationId": "job_list_get",
    "summary": "列出本机 Orchestrator 作业：状态/进度/预算/待审批数",
    "description": "列出本机 Orchestrator 作业：状态/进度/预算/待审批数。**只读本机数据、零外发**；作业执行在本机（Team+），执行器要么走 call_tool，要么 attach GUI 已运行引擎。",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "job_list",
    "parameters": [
     {
      "name": "state",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "queued|running|input_required|completed|failed|cancelled"
      },
      "description": "queued|running|input_required|completed|failed|cancelled"
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "description": "1..500，缺省 50"
      },
      "description": "1..500，缺省 50"
     }
    ]
   },
   "post": {
    "operationId": "job_create_post",
    "summary": "建一个本机 Orchestrator 作业（Team+）",
    "description": "建一个本机 Orchestrator 作业（Team+）。plan = 步骤数组（与 agent_runtime 的 12 工具同名，如 {\"action\":\"navigate\",\"url\":…}）或给 skill_name（+inputs）从技能注册表取步骤；声明了 agent 身份时，每个目标档案都须已 binding。",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "job_create",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "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"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/jobs/{id}": {
   "get": {
    "operationId": "job_show_get",
    "summary": "看单个 Orchestrator 作业的完整状态（含步骤计划/预算/待审批数）",
    "description": "看单个 Orchestrator 作业的完整状态（含步骤计划/预算/待审批数）。",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "job_show",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/v1/jobs/{id}/cancel": {
   "post": {
    "operationId": "job_cancel_post",
    "summary": "请求取消一个 Orchestrator 作业",
    "description": "请求取消一个 Orchestrator 作业。运行中先返回 stopping；worker 确认当前动作与资源收口后才进入 cancelled。",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "job_cancel",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "code": {
          "type": "string"
         }
        },
        "required": [
         "id"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/operations": {
   "get": {
    "operationId": "operation_list_get",
    "summary": "列出统一 OperationReceipt（生命周期、任务步骤、效果与资源状态）",
    "description": "列出统一 OperationReceipt（生命周期、任务步骤、效果与资源状态）。GUI/REST/MCP 共用同一行状态，零云调用。",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "operation_list",
    "parameters": [
     {
      "name": "profile_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "parent_job_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "state",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "after_revision",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      }
     }
    ]
   }
  },
  "/v1/operations/{id}": {
   "get": {
    "operationId": "operation_show_get",
    "summary": "查看单个 OperationReceipt；events=true 时连同追加式阶段事件返回",
    "description": "查看单个 OperationReceipt；events=true 时连同追加式阶段事件返回。",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "operation_show",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "events",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean"
      }
     },
     {
      "name": "after_seq",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      }
     }
    ]
   }
  },
  "/v1/profiles/{id}/launch": {
   "post": {
    "operationId": "launch_profile_post",
    "summary": "启动 profile 浏览器",
    "description": "启动 profile 浏览器。transport=native 的静态代理由 WebKit 直连上游；legacy/SSH/chainProxy 使用兼容 socks_fwd。无需 GUI。可传 runtimeProxy 做**本次会话的出口覆盖**（档案 JSON 一个字节不动）。API/MCP 启动按**无人值守会话**对待：passkey 的 create/sign 自动应答（不弹系统验身、UV 置位）。成功回执只在进程、Bridge 与首个 tab 都就绪后返回；首导航另以 completed|unconfirmed|not_required 显式报告。",
    "tags": [
     "profiles"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "launch_profile",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "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"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/profiles/{id}/stop": {
   "post": {
    "operationId": "stop_profile_post",
    "summary": "优雅关闭本 MCP 进程启动的 profile 浏览器：SIGTERM → 等引擎自存 cookie jar 并确认进程退出后，才注销会话并释放资源租约；5 秒",
    "description": "优雅关闭本 MCP 进程启动的 profile 浏览器：SIGTERM → 等引擎自存 cookie jar 并确认进程退出后，才注销会话并释放资源租约；5 秒内未退出返回 process_stop_timeout，不伪装成功。仅作用于 api_sessions 记录（launch_profile 启动）的进程——GUI 启动的档案不在记录，返回 stopped:false，请用 GUI 停止（绝不误伤 GUI 档）。代理档的 socks5 转发器一并停。",
    "tags": [
     "profiles"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "stop_profile",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "idempotencyKey": {
          "type": "string",
          "description": "可选；重复停止请求的安全幂等键。"
         }
        },
        "required": [
         "id"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/profiles/{id}/navigate": {
   "post": {
    "operationId": "navigate_post",
    "summary": "导航 profile 浏览器到 URL",
    "description": "导航 profile 浏览器到 URL",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "navigate",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "url": {
          "type": "string"
         }
        },
        "required": [
         "id",
         "url"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/profiles/{id}/evaluate": {
   "post": {
    "operationId": "evaluate_post",
    "summary": "在 profile 浏览器执行 JS：缺省返回同步求值结果；await=true 时等 Promise 结算（等价 Selenium executeAsyncS",
    "description": "在 profile 浏览器执行 JS：缺省返回同步求值结果；await=true 时等 Promise 结算（等价 Selenium executeAsyncScript）",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "evaluate",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "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"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/profiles/{id}/current-url": {
   "get": {
    "operationId": "current_url_get",
    "summary": "读 profile 当前页 URL（主框架 location.href；等价 Selenium driver.current_url）",
    "description": "读 profile 当前页 URL（主框架 location.href；等价 Selenium driver.current_url）",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "current_url",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/v1/profiles/{id}/page-source": {
   "get": {
    "operationId": "page_source_get",
    "summary": "取整页 HTML 源码（document.documentElement.outerHTML，等价 Selenium driver.page_source）",
    "description": "取整页 HTML 源码（document.documentElement.outerHTML，等价 Selenium driver.page_source）。返回 {html, bytes, truncated}：**源码可能很大**，给 max_bytes 才截断，且截断必在 truncated 里报出",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "page_source",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "max_bytes",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "description": "html 字节上限（UTF-8）；缺省 0=不截断（Selenium 等价语义）。截断时 truncated=true 并在 html 尾附告知标记——**静默截断会让调用方把半个页面当成整个页面**"
      },
      "description": "html 字节上限（UTF-8）；缺省 0=不截断（Selenium 等价语义）。截断时 truncated=true 并在 html 尾附告知标记——**静默截断会让调用方把半个页面当成整个页面**"
     }
    ]
   }
  },
  "/v1/profiles/{id}/screenshot": {
   "get": {
    "operationId": "screenshot_get",
    "summary": "截取 profile 页面当前可视画面（native WKWebView takeSnapshot：所见即真实渲染，不受页面 canvas 加噪影响）",
    "description": "截取 profile 页面当前可视画面（native WKWebView takeSnapshot：所见即真实渲染，不受页面 canvas 加噪影响）。返回 image 内容块（AI 直接看图，配合 page_map 的 rect 同系坐标推理）。format 缺省 png；jpeg 可选 quality 0.1-1.0；max_width 限制输出宽度点数（Retina 下 1pt≈2px）",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "screenshot",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "format",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "缺省 png"
      },
      "description": "缺省 png"
     },
     {
      "name": "max_width",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number",
       "description": "输出宽度点数上限（Retina 约 2× px）；0/缺省=原尺寸"
      },
      "description": "输出宽度点数上限（Retina 约 2× px）；0/缺省=原尺寸"
     },
     {
      "name": "quality",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number",
       "description": "jpeg 压缩 0.1-1.0；缺省 0.8"
      },
      "description": "jpeg 压缩 0.1-1.0；缺省 0.8"
     }
    ]
   }
  },
  "/v1/profiles/{id}/click": {
   "post": {
    "operationId": "click_post",
    "summary": "点击 profile 页面元素",
    "description": "点击 profile 页面元素。selector=CSS 选择器；或 element_id=page_map 返回的稳定元素 id（填了则现场重解析为 sel 并覆盖 selector）。human:true → 真实 HID 拟人点击：CGEvent Bezier 轨迹+ 档案 persona 鼠标指纹，isTrusted=true 防 BOT，仅单前台 profile；缺省 JS 快速但 isTrusted=false",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "click",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "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"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/profiles/{id}/type": {
   "post": {
    "operationId": "type_post",
    "summary": "在 profile 页面元素输入文本",
    "description": "在 profile 页面元素输入文本。selector=CSS 选择器；或 element_id=page_map 返回的元素 id（填了则现场重解析为 sel）。human:true → 真实 HID 拟人键入：CGEvent 逐字 + 档案 persona 指纹，防 BOT，仅单前台 profile；缺省 JS 注入快速但 isTrusted=false",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "type",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "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"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/profiles/{id}/key": {
   "post": {
    "operationId": "key_post",
    "summary": "对 profile 页面焦点元素（或 selector 指定元素）派发按键 keydown/keyup（JS，isTrusted=false → 浏览器原生提交",
    "description": "对 profile 页面焦点元素（或 selector 指定元素）派发按键 keydown/keyup（JS，isTrusted=false → 浏览器原生提交/原生行为不触发）。human:true + key=Enter → 可信原生 Return（真实 HID CGEvent，isTrusted=true 触发原生提交/确认，仅单前台 profile；其余键走 JS dispatch）",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "key",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "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"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/profiles/{id}/hover": {
   "post": {
    "operationId": "hover_post",
    "summary": "拟人悬停 profile 页面首个匹配 selector 元素（真实 HID：CGEvent 移到元素中心 + 停留，isTrusted=true 触发 hov",
    "description": "拟人悬停 profile 页面首个匹配 selector 元素（真实 HID：CGEvent 移到元素中心 + 停留，isTrusted=true 触发 hover 态/CSS :hover，防 BOT）。HID 路径=单前台 profile 依赖，非并发安全；并发自动化勿用（改 JS focus/样式绕过）。selector 或 element_id 二选一",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "hover",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "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"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/profiles/{id}/fill_credential": {
   "post": {
    "operationId": "fill_credential_post",
    "summary": "把本档案在**当前页 host** 下保存的登录凭据填进页面登录表单",
    "description": "把本档案在**当前页 host** 下保存的登录凭据填进页面登录表单。凭据**不过桥**：原生从本机钥匙串取出直接填 DOM，响应里只有 filled/username/reason，**永不回密码**。reason ∈ no-active-page / no-saved-credential / no-password-field。与浏览器菜单「填充密码」同一条路径；多账号本期取第一条。",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "fill_credential",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {},
        "required": [
         "id"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/profiles/{id}/save_credential": {
   "post": {
    "operationId": "save_credential_post",
    "summary": "把调用方给的登录凭据写进本档案的钥匙串（与浏览器内保存同一条路径、同 host 同用户名合并）",
    "description": "把调用方给的登录凭据写进本档案的钥匙串（与浏览器内保存同一条路径、同 host 同用户名合并）。**host 由引擎取当前页**——不接受调用方指定，避免把凭据写进与当前页无关的站点条目。密码不回显、不进日志；下次 `fill_credential` 即可使用。",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "save_credential",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "username": {
          "type": "string",
          "description": "用户名（可空串：仅存密码）"
         },
         "password": {
          "type": "string",
          "description": "密码（必填；不回显、不进日志）"
         }
        },
        "required": [
         "id",
         "password"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/profiles/{id}/wait": {
   "post": {
    "operationId": "wait_for_post",
    "summary": "轮询等待 profile 页面首个匹配 selector 出现；超时返回结构化 timeout 错误",
    "description": "轮询等待 profile 页面首个匹配 selector 出现；超时返回结构化 timeout 错误",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "wait_for",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "selector": {
          "type": "string"
         },
         "timeout": {
          "type": "number",
          "description": "秒，缺省 10"
         },
         "interval": {
          "type": "number",
          "description": "轮询间隔秒，缺省 0.3"
         }
        },
        "required": [
         "id",
         "selector"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/profiles/{id}/read": {
   "get": {
    "operationId": "read_get",
    "summary": "读取 profile 页面首个匹配 selector 的文本",
    "description": "读取 profile 页面首个匹配 selector 的文本",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "read",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "selector",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "frame",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "description": "子帧 index（frames 工具列出；缺省=主帧）。读的是**目标帧内**首个匹配元素的文本"
      },
      "description": "子帧 index（frames 工具列出；缺省=主帧）。读的是**目标帧内**首个匹配元素的文本"
     }
    ]
   }
  },
  "/v1/profiles/{id}/page-map": {
   "get": {
    "operationId": "page_map_get",
    "summary": "导出现页 DOM 结构地图（页面骨架 + ≤200 个可见交互元素的 id/tag/role/text/sel/rect），供 AI 看清页面并寻址",
    "description": "导出现页 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 符号 → 指纹零暴露",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "page_map",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "max_elements",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "description": "元素上限；缺省 200"
      },
      "description": "元素上限；缺省 200"
     },
     {
      "name": "text_limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "description": "单元素文本截断；缺省 80"
      },
      "description": "单元素文本截断；缺省 80"
     },
     {
      "name": "byte_budget",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "description": "返回串字节预算；超出尾部渐弃+truncated；缺省 12000"
      },
      "description": "返回串字节预算；超出尾部渐弃+truncated；缺省 12000"
     }
    ]
   }
  },
  "/v1/profiles/{id}/history": {
   "get": {
    "operationId": "history_get",
    "summary": "查询档案浏览历史（最近访问的网页，url/title/时间戳，最新在前；预热导航不记录）",
    "description": "查询档案浏览历史（最近访问的网页，url/title/时间戳，最新在前；预热导航不记录）",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "history",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "query",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "可选：按标题/网址过滤"
      },
      "description": "可选：按标题/网址过滤"
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "description": "返回条数（默认 50，最大 500）"
      },
      "description": "返回条数（默认 50，最大 500）"
     }
    ]
   }
  },
  "/v1/profiles/{id}/detect-block": {
   "get": {
    "operationId": "detect_block_get",
    "summary": "探测 profile 当前页风控/验证码信号（recaptcha/hcaptcha/Cloudflare/频率限制等）",
    "description": "探测 profile 当前页风控/验证码信号（recaptcha/hcaptcha/Cloudflare/频率限制等）",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "detect_block",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/v1/profiles/{id}/tabs": {
   "get": {
    "operationId": "tabs_get",
    "summary": "列出 profile 浏览器当前标签页",
    "description": "列出 profile 浏览器当前标签页",
    "tags": [
     "tabs"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "tabs",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "post": {
    "operationId": "new_tab_post",
    "summary": "profile 浏览器新建标签页并导航到 URL（缺省 example.com）",
    "description": "profile 浏览器新建标签页并导航到 URL（缺省 example.com）",
    "tags": [
     "tabs"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "new_tab",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "url": {
          "type": "string"
         }
        },
        "required": [
         "id"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/profiles/{id}/tabs/{index}/activate": {
   "post": {
    "operationId": "switch_tab_post",
    "summary": "profile 浏览器切换到第 index 个标签页",
    "description": "profile 浏览器切换到第 index 个标签页",
    "tags": [
     "tabs"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "switch_tab",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "index",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {},
        "required": [
         "id",
         "index"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/profiles/{id}/tabs/{index}": {
   "delete": {
    "operationId": "close_tab_delete",
    "summary": "profile 浏览器关闭第 index 个标签页",
    "description": "profile 浏览器关闭第 index 个标签页",
    "tags": [
     "tabs"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "close_tab",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "index",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ]
   }
  },
  "/v1/profiles/{id}/cookies": {
   "get": {
    "operationId": "export_cookies_json_get",
    "summary": "导出 profile 浏览器全部 cookie 为 JSON（全字段：name,value,domain,path,secure,**httpOnly**,ex",
    "description": "导出 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 的标志/删除原语。）",
    "tags": [
     "cookies"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "export_cookies_json",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "post": {
    "operationId": "import_cookies_json_post",
    "summary": "按 JSON 注入 cookie（全字段：name,value,domain,path,secure,**httpOnly**,expires(Unix 秒),",
    "description": "按 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 的标志/删除原语。）",
    "tags": [
     "cookies"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "import_cookies_json",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "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"
        ]
       }
      }
     }
    }
   },
   "put": {
    "operationId": "replace_cookies_json_put",
    "summary": "全量替换 cookie（先清空再注入 JSON，全字段；删除/修改/新增实时生效）",
    "description": "全量替换 cookie（先清空再注入 JSON，全字段；删除/修改/新增实时生效）。用于登录态切换到另一账号而不重启引擎",
    "tags": [
     "cookies"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "replace_cookies_json",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "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"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/profiles/{id}/clear-cache": {
   "post": {
    "operationId": "clear_cache_post",
    "summary": "清 profile 浏览器缓存（≈ CDP Network.clearBrowserCache）",
    "description": "清 profile 浏览器缓存（≈ CDP Network.clearBrowserCache）。origin 缺省 = 清全部 HTTP/内存/Fetch 缓存；给了 origin = 只清该源。**范围不含 cookie/localStorage/IndexedDB**——那是 clear_data_for_origin 的事",
    "tags": [
     "data"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "clear_cache",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "origin": {
          "type": "string",
          "description": "如 https://example.com；缺省=全部"
         }
        },
        "required": [
         "id"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/profiles/{id}/clear-data": {
   "post": {
    "operationId": "clear_data_for_origin_post",
    "summary": "清 profile 浏览器站点数据（≈ CDP Storage.clearDataForOrigin）：cookie/localStorage/IndexedD",
    "description": "清 profile 浏览器站点数据（≈ CDP Storage.clearDataForOrigin）：cookie/localStorage/IndexedDB/ServiceWorker/缓存。origin 缺省 = 全量。全量清时回执 cleared 为 null（WebKit 该 API 不给条数）",
    "tags": [
     "data"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "clear_data_for_origin",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "origin": {
          "type": "string",
          "description": "如 https://example.com；缺省=全部"
         }
        },
        "required": [
         "id"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/workspaces": {
   "get": {
    "operationId": "workspace_list_get",
    "summary": "列出工作区（档案分组＝企业接入清单 §二-12 `group_id`）",
    "description": "列出工作区（档案分组＝企业接入清单 §二-12 `group_id`）。与 GUI 的工作区页同一份数据。",
    "tags": [
     "workspaces"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "workspace_list",
    "parameters": [
     {
      "name": "include_default",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "description": "是否连 `default`（「所有 Profile」虚拟桶）一起返回；缺省 false"
      },
      "description": "是否连 `default`（「所有 Profile」虚拟桶）一起返回；缺省 false"
     },
     {
      "name": "with_members",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "description": "是否连每区成员 id 一起返回；缺省 false（只给 count）"
      },
      "description": "是否连每区成员 id 一起返回；缺省 false（只给 count）"
     }
    ]
   },
   "post": {
    "operationId": "workspace_create_post",
    "summary": "新建工作区（＝建一个分组；`group_id` 的目标）",
    "description": "新建工作区（＝建一个分组；`group_id` 的目标）。**批量**：`names` 传数组（一次加锁一次写盘），重名/空名/保留名逐条如实报告（`skipped`）；单值 `name` 形态与旧版逐字兼容。",
    "tags": [
     "workspaces"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "workspace_create",
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "description": "工作区名（不可为空）"
         },
         "names": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "description": "批量创建的工作区名（与 name 二选一）"
         }
        }
       }
      }
     }
    }
   }
  },
  "/v1/workspaces/{workspace_id}": {
   "put": {
    "operationId": "workspace_rename_put",
    "summary": "重命名工作区（`default` 桶不可改名）",
    "description": "重命名工作区（`default` 桶不可改名）。",
    "tags": [
     "workspaces"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "workspace_rename",
    "parameters": [
     {
      "name": "workspace_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         }
        },
        "required": [
         "workspace_id",
         "name"
        ]
       }
      }
     }
    }
   },
   "delete": {
    "operationId": "workspace_delete_delete",
    "summary": "删除工作区（**只删分组本身与归属，不动任何档案本体** —— 与 GUI 一致）",
    "description": "删除工作区（**只删分组本身与归属，不动任何档案本体** —— 与 GUI 一致）。回执里 `untagged_profiles` 列出因此少了一个分组标记的档案 id。**批量**：`workspace_ids` 传数组（一次加锁一次写盘）；`default`/不存在的 id 进 `refused` 并说明。",
    "tags": [
     "workspaces"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "workspace_delete",
    "parameters": [
     {
      "name": "workspace_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/v1/workspaces/batch_delete": {
   "post": {
    "operationId": "workspace_delete_post",
    "summary": "删除工作区（**只删分组本身与归属，不动任何档案本体** —— 与 GUI 一致）",
    "description": "删除工作区（**只删分组本身与归属，不动任何档案本体** —— 与 GUI 一致）。回执里 `untagged_profiles` 列出因此少了一个分组标记的档案 id。**批量**：`workspace_ids` 传数组（一次加锁一次写盘）；`default`/不存在的 id 进 `refused` 并说明。",
    "tags": [
     "workspaces"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "workspace_delete",
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "workspace_id": {
          "type": "string"
         },
         "workspace_ids": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "description": "批量删除的工作区 id（与 workspace_id 二选一）"
         }
        }
       }
      }
     }
    }
   }
  },
  "/v1/profiles/{id}/workspaces": {
   "post": {
    "operationId": "profile_workspaces_post",
    "summary": "查 / 改某个档案的工作区归属（`group_id` 的读写口）",
    "description": "查 / 改某个档案的工作区归属（`group_id` 的读写口）。**多标签**：一个档案可同时属多个工作区。只给 id = 只读当前归属；给 add/remove = 改。工作区名或 id 都可以。",
    "tags": [
     "workspaces"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "profile_workspaces",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "add": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "description": "要加入的工作区（名或 id），已有的**幂等**跳过"
         },
         "remove": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "description": "要退出的工作区（名或 id），不在里面的**幂等**跳过"
         }
        },
        "required": [
         "id"
        ]
       }
      }
     }
    }
   },
   "get": {
    "operationId": "profile_workspaces_get",
    "summary": "查 / 改某个档案的工作区归属（`group_id` 的读写口）",
    "description": "查 / 改某个档案的工作区归属（`group_id` 的读写口）。**多标签**：一个档案可同时属多个工作区。只给 id = 只读当前归属；给 add/remove = 改。工作区名或 id 都可以。",
    "tags": [
     "workspaces"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "profile_workspaces",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/v1/profiles/{id}/duplicate": {
   "post": {
    "operationId": "duplicate_profile_post",
    "summary": "基于已有档案克隆一份全新独立身份的新档案（新 UUID 与独立指纹密钥，不共享 Cookie/会话）",
    "description": "基于已有档案克隆一份全新独立身份的新档案（新 UUID 与独立指纹密钥，不共享 Cookie/会话）。",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "duplicate_profile",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "description": "新档案名称（可选，默认源名 + ' 副本'）"
         }
        },
        "required": [
         "id"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/profiles/batch/launch": {
   "post": {
    "operationId": "batch_launch_post",
    "summary": "有界并发批量启动多个档案（每档均走单点策略与容量门控，返回逐档结果）",
    "description": "有界并发批量启动多个档案（每档均走单点策略与容量门控，返回逐档结果）。",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "batch_launch",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "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"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/profiles/batch/stop": {
   "post": {
    "operationId": "batch_stop_post",
    "summary": "批量停止多个运行中的档案，返回逐档停止回执",
    "description": "批量停止多个运行中的档案，返回逐档停止回执。",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "batch_stop",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "ids": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "description": "要停止的档案 ID 列表（1–32 个）"
         }
        },
        "required": [
         "ids"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/profiles/{id}/downloads": {
   "get": {
    "operationId": "download_list_get",
    "summary": "查询单档案或全部档案的隔离下载记录（只读，读取 AUG/Downloads/<id>.json）",
    "description": "查询单档案或全部档案的隔离下载记录（只读，读取 AUG/Downloads/<id>.json）。",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "download_list",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "description": "返回条数上限（1–200，默认 50）"
      },
      "description": "返回条数上限（1–200，默认 50）"
     }
    ]
   }
  },
  "/v1/proxies/check": {
   "post": {
    "operationId": "proxy_check_post",
    "summary": "检测档案或指定代理的真实出口 IP、国家、时区与延迟（脱敏返回，绝不回显代理密码）",
    "description": "检测档案或指定代理的真实出口 IP、国家、时区与延迟（脱敏返回，绝不回显代理密码）。",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "proxy_check",
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "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）"
         }
        }
       }
      }
     }
    }
   }
  },
  "/v1/runtime/status": {
   "get": {
    "operationId": "runtime_status_get",
    "summary": "返回宿主 macOS 版本、Mac 原生隔离就绪状态以及本机已缓存的 iOS 按需 CAS 运行时清单",
    "description": "返回宿主 macOS 版本、Mac 原生隔离就绪状态以及本机已缓存的 iOS 按需 CAS 运行时清单。",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "runtime_status"
   }
  },
  "/v1/fleet/run": {
   "post": {
    "operationId": "fleet_run_post",
    "summary": "总代理下发一组作业（fan-out/broadcast/pipeline）",
    "description": "总代理下发一组作业（fan-out/broadcast/pipeline）。**必须声明 AUG_AGENT_ID（总代理）**，且目标须同时满足：在 agent 的 fleet 白名单里 + 该档案 identity 有 active binding。只建作业，不驱动浏览器；审批仍由人做（本工具没有批准能力）。",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "fleet_run"
   }
  },
  "/v1/fleet/summary": {
   "get": {
    "operationId": "fleet_summary_get",
    "summary": "看一次总代理运行（run）的汇总：阶段/每档案的作业状态计数",
    "description": "看一次总代理运行（run）的汇总：阶段/每档案的作业状态计数。",
    "tags": [
     "page"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "成功（信封 {ok:true,result:...}）。⚠️ 工具层失败也可能回 200 —— 判成功要看 ok 字段",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "bad_request —— 参数名/类型/取值不合法，或同时给了互斥项",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized —— 缺/错 Authorization；或 key 未通过云端校验",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "local_readonly / tier_required / lease_required —— 只读模式 / 档位不够 / 自动化授权（租约）未生效",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "not_found —— 资源不存在（档案/工作区 id 找不到）或路径/工具不存在",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "bad_request —— 方法不对",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "hid_busy —— HID 串行锁被占用（未投递，可安全重试）",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "rate_limited —— 超过宿主设的 AUG_API_MAX_RPS（背压，不是配额）：按 Retry-After 退避",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "500": {
      "description": "internal —— 服务端内部错误",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-aug-tool": "fleet_summary",
    "parameters": [
     {
      "name": "run_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/v1/health": {
   "get": {
    "operationId": "health",
    "summary": "控制面探活（服务在不在、多少个工具）",
    "description": "不带 key 也可探（回 auth 模式）；带 Bearer 时回该 key 的档位面。",
    "tags": [
     "系统"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "服务信息",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     }
    }
   }
  },
  "/v1/tools": {
   "get": {
    "operationId": "tools",
    "summary": "机器权威清单（全部工具 + 入参 schema）",
    "description": "接口清单由注册表生成，不会出现「文档只列了部分端点」。",
    "tags": [
     "系统"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "工具数组",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     }
    }
   }
  },
  "/v1/call": {
   "post": {
    "operationId": "call",
    "summary": "通用兜底：按工具名调用任何工具",
    "description": "没有专路由的工具走这条；参数名白名单与资源路由同源（拼错键名一律 400）。",
    "tags": [
     "系统"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         },
         "arguments": {
          "type": "object"
         }
        },
        "required": [
         "name"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "工具回执",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "result": {}
         }
        }
       }
      }
     }
    }
   }
  }
 }
}
