yunti-browser-runtime 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -38,18 +38,26 @@ yunti-browser-runtime/
38
38
 
39
39
  ## 快速启动
40
40
 
41
+ 推荐作为 MCP 工具接入 Agent,由 Agent 自动启动本地 bridge:
42
+
41
43
  ```bash
42
- cd yunti-browser-runtime
43
- npm install
44
- npm run bridge
44
+ npm install -g yunti-browser-runtime
45
+ yunti-browser-runtime print-config -- --agent codex --human
45
46
  ```
46
47
 
47
- 安装为 npm 包后,也可以使用 CLI:
48
+ 把输出的 MCP 配置加入 Agent 后,加载浏览器扩展并刷新任意 `http` / `https` 页面即可。
49
+ 默认不需要填写 token,不需要打开扩展 popup,也不需要保存设置。
50
+
51
+ 需要独立调试 bridge 时,可以手动运行:
48
52
 
49
53
  ```bash
50
54
  yunti-browser-runtime bridge
55
+ ```
56
+
57
+ 其他常用 CLI:
58
+
59
+ ```bash
51
60
  yunti-browser-runtime doctor
52
- yunti-browser-runtime print-config -- --agent codex --human
53
61
  yunti-browser-runtime package-extension
54
62
  ```
55
63
 
@@ -92,19 +100,25 @@ npm run doctor:json
92
100
  2. 执行:npm install -g yunti-browser-runtime
93
101
  3. 执行:yunti-browser-runtime print-config -- --agent 当前Agent名称 --human
94
102
  4. 根据输出,把 MCP server 配置加入当前 Agent 的 MCP 配置。
95
- 5. 执行:yunti-browser-runtime bridge
103
+ 5. 告诉我:当前 Agent 启动 MCP server 后会自动启动本地 bridge,一般不需要单独运行 bridge。
96
104
  6. 引导我打开 Chrome/Edge 的扩展管理页,开启开发者模式,手动加载扩展目录:
97
105
  $(npm root -g)/yunti-browser-runtime/extension
98
- 7. 告诉我扩展里默认 bridge URL 是 http://127.0.0.1:48887,本地默认不需要 token,也不需要保存设置。
106
+ 7. 告诉我:扩展默认 bridge URL 是 http://127.0.0.1:48887,本地默认不需要 token,不需要打开 popup,也不需要保存设置。
99
107
  8. 打开任意 http/https 页面并刷新。
100
108
  9. 执行:yunti-browser-runtime doctor
101
109
  10. 如果 doctor 正常,再调用 yunti_list_browser_targets 或 yunti_get_tool_usage_hints 验证你能看到浏览器页面。
102
110
 
103
- 注意:Chrome 扩展不能由 npm 静默安装,必须由我手动在浏览器扩展页加载。你要一步步告诉我点哪里、复制什么、检查什么。
111
+ 注意:Chrome 扩展不能由 npm 静默安装,必须由我手动在浏览器扩展页加载。扩展加载完成后默认立即可用,不要要求我填写 token、打开 popup 或保存设置;除非 doctor 明确提示 bridge 未运行,才让我单独执行 yunti-browser-runtime bridge。
104
112
  ```
105
113
 
106
114
  ## 安装浏览器扩展
107
115
 
116
+ npm 全局安装后,扩展目录通常是:
117
+
118
+ ```bash
119
+ $(npm root -g)/yunti-browser-runtime/extension
120
+ ```
121
+
108
122
  开发加载方式:
109
123
 
110
124
  1. 打开 `chrome://extensions` 或 `edge://extensions`。
@@ -112,11 +126,12 @@ npm run doctor:json
112
126
  3. 点击“加载已解压的扩展程序”。
113
127
  4. 选择本项目的 `extension/` 目录。
114
128
  5. 打开任意 `http` 或 `https` 页面。
115
- 6. 刷新目标页面,确认页面已连接。
129
+ 6. 刷新目标页面即可连接。
116
130
 
117
- 扩展默认使用 `http://127.0.0.1:48887`,本地安装不需要 token,也不需要保存设置。
118
- 扩展 popup 只用于自定义 bridge URL、页面匹配或可选 token。扩展只负责把页面注册到
119
- 本地 bridge,并执行 Agent 发来的浏览器动作。
131
+ 扩展默认使用 `http://127.0.0.1:48887`,本地安装不需要 token,不需要打开 popup,
132
+ 也不需要保存设置。扩展 popup 首屏只显示连接状态;自定义 bridge URL、页面匹配或
133
+ 可选 token 都收在高级设置里。扩展只负责把页面注册到本地 bridge,并执行 Agent
134
+ 发来的浏览器动作。
120
135
 
121
136
  也可以生成 zip 包用于分发或归档:
122
137
 
@@ -280,7 +295,8 @@ token。
280
295
 
281
296
  ## 发布状态与后续事项
282
297
 
283
- - `yunti-browser-runtime@0.1.2` 已发布到官方 npm registry。
284
- - `0.1.2` 将扩展 popup token 移入高级设置,并补充可复制给 Agent 的安装引导。
298
+ - `yunti-browser-runtime@0.1.3` 已发布到官方 npm registry。
299
+ - `0.1.3` 将扩展 popup 首屏改成零配置状态面板,并补充“Agent 会自动启动 bridge”
300
+ 的安装引导。
285
301
  - 发布后验证命令:`npm run release:verify-published`。
286
302
  - 如要上架浏览器扩展商店,需要再次审查 broad host permissions。
@@ -57,6 +57,7 @@
57
57
  | P4.19 | 已完成 | npm 正式发布执行 |
58
58
  | P5.1 | 已完成 | 本地默认免 bridge token |
59
59
  | P5.2 | 已完成 | 扩展 popup 与安装引导简化 |
60
+ | P5.3 | 已完成 | 扩展首屏零配置 |
60
61
 
61
62
  ## P0.1 bridge token + CORS 收紧
62
63
 
@@ -1335,6 +1336,40 @@ metadata 与当前 `package.json` 一致。
1335
1336
  - `npm run release:publish` 成功发布 `yunti-browser-runtime@0.1.2`。
1336
1337
  - `npm run release:verify-published` 返回 0。
1337
1338
 
1339
+ ## P5.3 扩展首屏零配置
1340
+
1341
+ 状态:已完成(2026-07-03)
1342
+
1343
+ 实现摘要:
1344
+
1345
+ - 扩展 popup 首屏只保留连接状态和“刷新状态”,不再展示 Bridge URL、页面匹配、
1346
+ Bridge Token 或保存按钮。
1347
+ - Bridge URL、页面匹配和可选 Bridge Token 统一收进“高级设置”;只有检测到用户已
1348
+ 配置自定义值时才自动展开。
1349
+ - popup 根据 bridge 健康状态区分“Agent MCP/bridge 未启动”和“刷新页面即可连接”,
1350
+ 避免把用户引向不必要的设置项。
1351
+ - README / INSTALL 明确:作为 MCP 接入时,Agent 启动 MCP server 后会自动启动本地
1352
+ bridge;`yunti-browser-runtime bridge` 是独立调试路径。
1353
+ - package 和 extension 版本同步提升到 `0.1.3`。
1354
+
1355
+ ### 目标
1356
+
1357
+ 让用户在完成扩展加载后立即进入可用路径:不打开 popup、不填写 token、不保存设置;
1358
+ 除非 doctor 明确提示 bridge 未运行,否则不要求用户单独启动 bridge。
1359
+
1360
+ ### 验收标准
1361
+
1362
+ - popup 首屏没有任何输入框或保存按钮。
1363
+ - 默认本地安装仍可在刷新 http/https 页面后自动注册 session。
1364
+ - README 的复制给 Agent 引导不再把独立 `bridge` 当作必选步骤。
1365
+ - `npm run release:check` 通过。
1366
+ - `npm run release:publish` 发布 `yunti-browser-runtime@0.1.3`,并通过
1367
+ `npm run release:verify-published` 验证。
1368
+
1369
+ ### 验收记录
1370
+
1371
+ - 待执行。
1372
+
1338
1373
  ## 每阶段完成后的固定检查
1339
1374
 
1340
1375
  ```bash
@@ -1356,11 +1391,11 @@ rg "/U[s]ers|C[o]deg|x[y]y|y[b]m100" README.md docs skills package.json
1356
1391
 
1357
1392
  ## 当前下一步
1358
1393
 
1359
- P0.1-P5.2 已完成,`yunti-browser-runtime@0.1.2` 已发布到官方 npm registry。
1394
+ P0.1-P5.3 已完成,`yunti-browser-runtime@0.1.3` 待发布验证。
1360
1395
 
1361
- - 发布后验证已通过:`npm run release:verify-published`。
1396
+ - 发布后验证待执行:`npm run release:verify-published`。
1362
1397
  - 本地默认使用不再需要 bridge token;需要加固时可显式设置
1363
1398
  `YUNTI_BROWSER_BRIDGE_TOKEN`。
1364
- - 扩展 popup 默认不需要用户保存设置;token 已移入高级可选项。
1399
+ - 扩展 popup 默认不需要用户保存设置;Bridge URL、页面匹配和 token 已移入高级设置。
1365
1400
  - 后续如要上架浏览器扩展商店,发布前还需重新审查 broad host permissions。
1366
1401
  - 后续版本开发前,先在本文档新增下一阶段目标、范围和验收标准。
package/docs/INSTALL.md CHANGED
@@ -6,9 +6,13 @@
6
6
  - Chrome, Edge, or another Chromium browser with extension developer mode.
7
7
  - An MCP-capable agent.
8
8
 
9
- ## Start The Local Bridge
9
+ ## Bridge Startup
10
10
 
11
- From the project root:
11
+ Normal MCP usage does not require manually starting the bridge. After the agent
12
+ loads the `yunti-browser-runtime` MCP server, that stdio process starts the
13
+ local bridge automatically.
14
+
15
+ For standalone debugging from the project root:
12
16
 
13
17
  ```bash
14
18
  npm install
@@ -46,6 +50,11 @@ When installed as an npm package, the equivalent CLI command is:
46
50
  yunti-browser-runtime bridge
47
51
  ```
48
52
 
53
+ When Yunti Browser Runtime is registered as an MCP server, the agent starts the
54
+ stdio MCP process and that process starts the local bridge automatically. The
55
+ standalone `bridge` command is useful for debugging, doctor checks, or manual
56
+ extension testing.
57
+
49
58
  ## Load The Extension
50
59
 
51
60
  Development loading:
@@ -55,13 +64,13 @@ Development loading:
55
64
  3. Choose "Load unpacked".
56
65
  4. Select the project `extension/` directory.
57
66
  5. Open or refresh any `http` or `https` page.
58
- 6. Click the extension icon only if you want to confirm status or customize
59
- settings.
67
+ 6. Do not open the extension popup unless you want to confirm status or
68
+ customize settings.
60
69
 
61
70
  The extension defaults to `http://127.0.0.1:48887`. Local installs do not need a
62
- token and do not require saving popup settings. The extension registers browser
63
- pages with the local bridge. It does not create agent conversations or depend on
64
- a remote workspace.
71
+ token, opening the popup, or saving popup settings. The extension registers
72
+ browser pages with the local bridge. It does not create agent conversations or
73
+ depend on a remote workspace.
65
74
 
66
75
  To create a distributable zip:
67
76
 
@@ -2,9 +2,9 @@
2
2
 
3
3
  ## Current Phase
4
4
 
5
- Patch release `yunti-browser-runtime@0.1.2` is complete. The local loopback
5
+ Patch release `yunti-browser-runtime@0.1.3` is complete. The local loopback
6
6
  bridge no longer requires a token by default, the extension popup no longer
7
- shows token as a first-run field, and the published package is verified with
7
+ shows settings as a first-run task, and the published package is verified with
8
8
  `npm run release:verify-published`.
9
9
 
10
10
  ## Current State
@@ -43,9 +43,9 @@ shows token as a first-run field, and the published package is verified with
43
43
  - `npm run release:dry-run` and `npm run release:publish` pin the official npm
44
44
  registry at `https://registry.npmjs.org/`, avoiding accidental publication to
45
45
  a locally configured mirror registry.
46
- - `yunti-browser-runtime@0.1.2` is published on the official npm registry.
47
- - Extension popup keeps Bridge Token under optional advanced settings; default
48
- local installs do not require saving popup settings.
46
+ - `yunti-browser-runtime@0.1.3` is published on the official npm registry.
47
+ - Extension popup is a zero-config status panel by default; Bridge URL, page
48
+ matching, and optional Bridge Token stay under advanced settings.
49
49
  - `npm run test:e2e` provides an opt-in real-browser Playwright smoke test for
50
50
  extension loading, page registration, MCP target listing, snapshot, click/fill,
51
51
  and CDP `Runtime.evaluate`.
@@ -258,6 +258,11 @@ shows token as a first-run field, and the published package is verified with
258
258
  - Latest P5.2 validation: `npm run release:check` passed; `npm run
259
259
  release:publish` published `yunti-browser-runtime@0.1.2`; `npm run
260
260
  release:verify-published` returned 0.
261
+ - P5.3 extension zero-config first-run is complete: popup first screen now only
262
+ shows connection status plus refresh, optional Bridge URL/page match/token
263
+ controls are hidden under advanced settings, and docs explain that the MCP
264
+ server starts the local bridge automatically.
265
+ - Latest P5.3 validation: pending for `yunti-browser-runtime@0.1.3`.
261
266
 
262
267
  ## Known Risks
263
268
 
@@ -7,7 +7,7 @@ publishing `yunti-browser-runtime`.
7
7
 
8
8
  No active npm publish blockers as of 2026-07-03.
9
9
 
10
- `yunti-browser-runtime@0.1.2` is published on the official npm registry and
10
+ `yunti-browser-runtime@0.1.3` is published on the official npm registry and
11
11
  verified with `npm run release:verify-published`.
12
12
 
13
13
  ## Resolved Blocker: npm 2FA Publish Token
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Yunti Browser Runtime",
4
- "version": "0.1.2",
4
+ "version": "0.1.3",
5
5
  "description": "Local browser runtime for AI agents through MCP.",
6
6
  "permissions": [
7
7
  "activeTab",
@@ -50,6 +50,11 @@ details label {
50
50
  margin-top: 6px;
51
51
  }
52
52
 
53
+ details button {
54
+ width: 100%;
55
+ margin-top: 6px;
56
+ }
57
+
53
58
  input,
54
59
  textarea {
55
60
  width: 100%;
@@ -75,7 +80,7 @@ button {
75
80
  font: 500 13px/1 system-ui;
76
81
  }
77
82
 
78
- button:first-of-type {
83
+ main > button {
79
84
  border-color: #0f766e;
80
85
  background: #0f766e;
81
86
  color: white;
@@ -10,23 +10,23 @@
10
10
  <main>
11
11
  <h1>Yunti Browser Runtime</h1>
12
12
  <p id="status">正在读取状态...</p>
13
- <label>
14
- Bridge URL
15
- <input id="bridgeUrl" autocomplete="off" />
16
- </label>
17
- <label>
18
- 页面匹配
19
- <textarea id="platformMatches" rows="3"></textarea>
20
- </label>
13
+ <button id="refresh">刷新状态</button>
21
14
  <details id="advancedSettings">
22
15
  <summary>高级设置</summary>
16
+ <label>
17
+ Bridge URL
18
+ <input id="bridgeUrl" autocomplete="off" />
19
+ </label>
20
+ <label>
21
+ 页面匹配
22
+ <textarea id="platformMatches" rows="3"></textarea>
23
+ </label>
23
24
  <label>
24
25
  Bridge Token(可选)
25
26
  <input id="bridgeToken" autocomplete="off" type="password" />
26
27
  </label>
28
+ <button id="save">保存设置</button>
27
29
  </details>
28
- <button id="save">保存设置</button>
29
- <button id="refresh">刷新状态</button>
30
30
  </main>
31
31
  <script type="module" src="popup.js"></script>
32
32
  </body>
@@ -3,6 +3,7 @@ const bridgeUrlEl = document.querySelector("#bridgeUrl")
3
3
  const bridgeTokenEl = document.querySelector("#bridgeToken")
4
4
  const platformMatchesEl = document.querySelector("#platformMatches")
5
5
  const advancedSettingsEl = document.querySelector("#advancedSettings")
6
+ const defaultBridgeUrl = "http://127.0.0.1:48887"
6
7
  document.querySelector("#save").addEventListener("click", save)
7
8
  document.querySelector("#refresh").addEventListener("click", refresh)
8
9
 
@@ -15,11 +16,7 @@ async function refresh() {
15
16
  return
16
17
  }
17
18
  renderSettings(state.settings || {})
18
- setStatus(
19
- state.activeSession
20
- ? `页面已连接\n${state.activeSession.title || state.activeSession.url}`
21
- : "默认无需设置。请打开或刷新任意 http/https 页面。"
22
- )
19
+ setStatus(statusText(state))
23
20
  }
24
21
 
25
22
  async function save() {
@@ -40,12 +37,26 @@ async function save() {
40
37
  }
41
38
 
42
39
  function renderSettings(settings) {
43
- bridgeUrlEl.value = settings.bridgeUrl || "http://127.0.0.1:48887"
40
+ bridgeUrlEl.value = settings.bridgeUrl || defaultBridgeUrl
44
41
  bridgeTokenEl.value = settings.bridgeToken || ""
45
- advancedSettingsEl.open = Boolean(settings.bridgeToken)
46
- platformMatchesEl.value = Array.isArray(settings.platformMatches)
47
- ? settings.platformMatches.join("\n")
48
- : "*"
42
+ const platformMatches = Array.isArray(settings.platformMatches)
43
+ ? settings.platformMatches
44
+ : ["*"]
45
+ advancedSettingsEl.open =
46
+ Boolean(settings.bridgeToken) ||
47
+ (settings.bridgeUrl && settings.bridgeUrl !== defaultBridgeUrl) ||
48
+ platformMatches.some((pattern) => pattern !== "*")
49
+ platformMatchesEl.value = platformMatches.join("\n")
50
+ }
51
+
52
+ function statusText(state) {
53
+ if (state.activeSession) {
54
+ return `页面已连接\n${state.activeSession.title || state.activeSession.url}`
55
+ }
56
+ if (!state.bridge?.ok) {
57
+ return "Bridge 未连接。请确认 Agent MCP 已启动,或运行 yunti-browser-runtime bridge。"
58
+ }
59
+ return "默认无需设置。打开或刷新任意 http/https 页面即可连接。"
49
60
  }
50
61
 
51
62
  function setStatus(text) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yunti-browser-runtime",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "description": "Local browser runtime and MCP tools for AI agents.",
6
6
  "license": "MIT",
@@ -95,7 +95,7 @@ function humanOutput(payload) {
95
95
  "",
96
96
  `Project root: ${payload.projectRoot}`,
97
97
  `MCP server: ${payload.mcpServerPath}`,
98
- `Bridge port: ${payload.bridge.port}`,
98
+ `Bridge port: ${payload.bridge.port} (started automatically by the MCP server)`,
99
99
  `Token: ${payload.bridge.tokenInstruction}`,
100
100
  `Skill: ${payload.skill.sourcePath}`,
101
101
  payload.ok ? "" : `Unsupported agent "${payload.agent}". Supported: ${payload.supportedAgents.join(", ")}`,