feat: approved external browser startup / 受审批启动外部浏览器 (#217)

外部 Chrome 调试端口关闭时,原技能要求用户手动输入命令,无法完成一句话启动并操作的流程。

本更新声明受工具审批的 BrowserExternalLaunch:使用客户端检测到的原生可执行文件与独立 Profile,验真 CDP
后打开网页;成功后高级交互使用预置解释器。Probe
保持只读,拒绝审批不启动,端口冲突和启动失败如实报告。浏览器本身仍需单独安装。旧客户端未提供启动工具时保留只展示的手动备用方式。

主仓实现见 desirecore/desirecore#4811。中英正文、参考材料、版本元数据和翻译摘要同步。校验 0
错误;已有治理警告未改。新公开内容与路径采用通用产品术语,私有测试目录与用户身份不进入提交。

The skill uses an approved native browser-launch tool when advertised by
the client, followed by verified CDP and the bundled interpreter for
advanced interaction. Older builds retain a display-only manual
fallback. Browser installation and site sign-in remain operator
prerequisites. Metadata validation and translation freshness checks
pass.
This commit is contained in:
2026-10-14 21:36:50 +08:00
committed by GitHub
parent e567c2d767
commit bffe21103e
5 changed files with 46 additions and 58 deletions

View File

@@ -2,7 +2,7 @@
Detailed recipes for accessing sites through the user-approved external Chromium browser, via Chrome DevTools Protocol (CDP) + Python Playwright.
**Scope**: this manual is only for advanced external-browser interaction such as clicking, reading dynamic content, extraction, or form work. A simple open/navigation must use `BrowserExternalProbe` → `BrowserExternalOpen` and must not invoke shell, Python, pip, or Playwright.
**Scope**: this manual is only for advanced external-browser interaction such as clicking, reading dynamic content, extraction, or form work. For simple open/navigation, probe first: a ready endpoint uses `BrowserExternalOpen`; a closed endpoint on a capable client uses approved `BrowserExternalLaunch`, which already opens the URL. Do not call Open again for that same URL after a successful launch. Neither route invokes shell, Python, pip, or Playwright.
**Precondition for advanced interaction**: `BrowserExternalProbe` has returned `ready` for the exact browser the user requested, that browser is running with its DesireCore-isolated profile, and the user has manually logged in to the target sites. Never infer readiness from a failed/successful `curl`; see the main SKILL.md status table.
@@ -308,7 +308,7 @@ print(clean_md)
Do not guess that the browser is merely closed. Call `BrowserExternalProbe` again:
- `debug_port_closed` → show its current `launchCommand`, end the turn, and wait for the user;
- `debug_port_closed` → on a client advertising BrowserExternalLaunch, request that approved native launch with the exact browser, port and URL, then re-probe; on older clients only, show the manual fallback and wait;
`commandPolicy: display_only_never_execute` forbids passing it to Bash, PowerShell, a terminal,
a script, or any other execution tool even when the user previously said “continue”
- `browser_mismatch` → report the actual/requested products and ask the user to correct or approve the change
@@ -328,7 +328,7 @@ The approved external Chromium browser is running but no windows are open. Ask t
DesireCore prepares `<DESIRECORE_HOME>/runtime/external-browser-playwright` from the installation
package using its bundled Python and complete local wheel profile. No user package installation,
network index, or browser download is needed. Chrome/Edge/Chromium remains separately installed,
subject to its own terms, and manually started with CDP. Run the import-only check with the prepared
subject to its own terms, and started with CDP through approved BrowserExternalLaunch when available (manual fallback on older builds). Run the import-only check with the prepared
interpreter. Missing files or import errors are client preparation failures: report the original
error and do not install packages, create another venv, or attach until the runtime is available.
@@ -421,3 +421,5 @@ ask before changing the execution route.
CDP is specifically the "right tool" for: **small number of pages + login required + human-like behavior needed**.
Before advanced interaction, probe with `prepareAutomationRuntime: true`; require `automationRuntime.status: ready` and use its returned `pythonExecutable`. Ordinary external URL opening does not require this runtime.
For a closed debugging port on a client advertising BrowserExternalLaunch, use that governed tool with the exact browser, port and requested URL through approval. Do not execute the display-only launchCommand through PowerShell/Bash. After launch, obtain browser and automation runtime readiness from Probe before attaching. The browser product remains separately installed; the tool does not download it.