yunti-browser-runtime 0.1.1 → 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
 
@@ -79,8 +87,38 @@ npm run doctor
79
87
  npm run doctor:json
80
88
  ```
81
89
 
90
+ ## 复制给 Agent 的安装引导
91
+
92
+ 把下面这段话复制给你正在使用的 Agent,让它一步步引导你安装和验证:
93
+
94
+ ```text
95
+ 请帮我安装并接入 Yunti Browser Runtime。它是一个本地浏览器运行时,让你通过 MCP 操作我本机 Chrome/Edge 页面。
96
+
97
+ 请按步骤引导我完成,不要跳步:
98
+
99
+ 1. 确认我本机有 Node.js 22+。
100
+ 2. 执行:npm install -g yunti-browser-runtime
101
+ 3. 执行:yunti-browser-runtime print-config -- --agent 当前Agent名称 --human
102
+ 4. 根据输出,把 MCP server 配置加入当前 Agent 的 MCP 配置。
103
+ 5. 告诉我:当前 Agent 启动 MCP server 后会自动启动本地 bridge,一般不需要单独运行 bridge。
104
+ 6. 引导我打开 Chrome/Edge 的扩展管理页,开启开发者模式,手动加载扩展目录:
105
+ $(npm root -g)/yunti-browser-runtime/extension
106
+ 7. 告诉我:扩展默认 bridge URL 是 http://127.0.0.1:48887,本地默认不需要 token,不需要打开 popup,也不需要保存设置。
107
+ 8. 打开任意 http/https 页面并刷新。
108
+ 9. 执行:yunti-browser-runtime doctor
109
+ 10. 如果 doctor 正常,再调用 yunti_list_browser_targets 或 yunti_get_tool_usage_hints 验证你能看到浏览器页面。
110
+
111
+ 注意:Chrome 扩展不能由 npm 静默安装,必须由我手动在浏览器扩展页加载。扩展加载完成后默认立即可用,不要要求我填写 token、打开 popup 或保存设置;除非 doctor 明确提示 bridge 未运行,才让我单独执行 yunti-browser-runtime bridge。
112
+ ```
113
+
82
114
  ## 安装浏览器扩展
83
115
 
116
+ npm 全局安装后,扩展目录通常是:
117
+
118
+ ```bash
119
+ $(npm root -g)/yunti-browser-runtime/extension
120
+ ```
121
+
84
122
  开发加载方式:
85
123
 
86
124
  1. 打开 `chrome://extensions` 或 `edge://extensions`。
@@ -88,10 +126,12 @@ npm run doctor:json
88
126
  3. 点击“加载已解压的扩展程序”。
89
127
  4. 选择本项目的 `extension/` 目录。
90
128
  5. 打开任意 `http` 或 `https` 页面。
91
- 6. 点击扩展图标,确认 bridge 地址为 `http://127.0.0.1:48887`,保存设置。
92
- 7. 刷新目标页面,确认页面已连接。
129
+ 6. 刷新目标页面即可连接。
93
130
 
94
- 扩展只负责把页面注册到本地 bridge,并执行 Agent 发来的浏览器动作。
131
+ 扩展默认使用 `http://127.0.0.1:48887`,本地安装不需要 token,不需要打开 popup,
132
+ 也不需要保存设置。扩展 popup 首屏只显示连接状态;自定义 bridge URL、页面匹配或
133
+ 可选 token 都收在高级设置里。扩展只负责把页面注册到本地 bridge,并执行 Agent
134
+ 发来的浏览器动作。
95
135
 
96
136
  也可以生成 zip 包用于分发或归档:
97
137
 
@@ -255,7 +295,8 @@ token。
255
295
 
256
296
  ## 发布状态与后续事项
257
297
 
258
- - `yunti-browser-runtime@0.1.1` 已发布到官方 npm registry。
259
- - `0.1.1` 将本地默认使用路径改为免 bridge token。
298
+ - `yunti-browser-runtime@0.1.3` 已发布到官方 npm registry。
299
+ - `0.1.3` 将扩展 popup 首屏改成零配置状态面板,并补充“Agent 会自动启动 bridge
300
+ 的安装引导。
260
301
  - 发布后验证命令:`npm run release:verify-published`。
261
302
  - 如要上架浏览器扩展商店,需要再次审查 broad host permissions。
@@ -56,6 +56,8 @@
56
56
  | P4.18 | 已完成 | npm 发布后验证命令 |
57
57
  | P4.19 | 已完成 | npm 正式发布执行 |
58
58
  | P5.1 | 已完成 | 本地默认免 bridge token |
59
+ | P5.2 | 已完成 | 扩展 popup 与安装引导简化 |
60
+ | P5.3 | 已完成 | 扩展首屏零配置 |
59
61
 
60
62
  ## P0.1 bridge token + CORS 收紧
61
63
 
@@ -1297,6 +1299,77 @@ metadata 与当前 `package.json` 一致。
1297
1299
  - `npm run release:publish` 成功发布 `yunti-browser-runtime@0.1.1`。
1298
1300
  - `npm run release:verify-published` 返回 0。
1299
1301
 
1302
+ ## P5.2 扩展 popup 与安装引导简化
1303
+
1304
+ 状态:已完成(2026-07-03)
1305
+
1306
+ 实现摘要:
1307
+
1308
+ - 扩展 popup 首屏不再展示 Bridge Token 输入框,避免用户误以为本地默认安装需要填写
1309
+ token。
1310
+ - Bridge Token 移入“高级设置”,并标注为可选;如果用户已有 token 配置,高级设置会
1311
+ 自动展开。
1312
+ - popup 默认状态文案改为“默认无需设置,打开或刷新 http/https 页面即可”。
1313
+ - README 增加“复制给 Agent 的安装引导”,让用户可以把一段话交给 Agent,由 Agent
1314
+ 分步骤带用户完成 npm 安装、MCP 配置、扩展加载和 doctor 验证。
1315
+ - README / INSTALL 明确:加载扩展后默认不需要保存设置,不需要 token。
1316
+ - package 和 extension 版本同步提升到 `0.1.2`。
1317
+
1318
+ ### 目标
1319
+
1320
+ 让用户在安装扩展后尽量立即可用:默认无需填写 token、无需保存 popup 设置;需要
1321
+ 自定义 bridge URL、页面匹配或 token 时再进入高级/设置路径。
1322
+
1323
+ ### 验收标准
1324
+
1325
+ - popup 首屏不出现 Bridge Token 输入框。
1326
+ - popup 仍保留可选 token 配置能力。
1327
+ - README 包含可复制给 Agent 的安装引导词。
1328
+ - README / INSTALL 不再要求默认本地安装时点击 popup 保存 token 或保存设置。
1329
+ - `npm run release:check` 通过。
1330
+ - `npm run release:publish` 发布 `yunti-browser-runtime@0.1.2`,并通过
1331
+ `npm run release:verify-published` 验证。
1332
+
1333
+ ### 验收记录
1334
+
1335
+ - `npm run release:check` 通过。
1336
+ - `npm run release:publish` 成功发布 `yunti-browser-runtime@0.1.2`。
1337
+ - `npm run release:verify-published` 返回 0。
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
+
1300
1373
  ## 每阶段完成后的固定检查
1301
1374
 
1302
1375
  ```bash
@@ -1318,10 +1391,11 @@ rg "/U[s]ers|C[o]deg|x[y]y|y[b]m100" README.md docs skills package.json
1318
1391
 
1319
1392
  ## 当前下一步
1320
1393
 
1321
- P0.1-P5.1 已完成,`yunti-browser-runtime@0.1.1` 已发布到官方 npm registry。
1394
+ P0.1-P5.3 已完成,`yunti-browser-runtime@0.1.3` 待发布验证。
1322
1395
 
1323
- - 发布后验证已通过:`npm run release:verify-published`。
1396
+ - 发布后验证待执行:`npm run release:verify-published`。
1324
1397
  - 本地默认使用不再需要 bridge token;需要加固时可显式设置
1325
1398
  `YUNTI_BROWSER_BRIDGE_TOKEN`。
1399
+ - 扩展 popup 默认不需要用户保存设置;Bridge URL、页面匹配和 token 已移入高级设置。
1326
1400
  - 后续如要上架浏览器扩展商店,发布前还需重新审查 broad host permissions。
1327
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:
@@ -54,12 +63,14 @@ Development loading:
54
63
  2. Enable developer mode.
55
64
  3. Choose "Load unpacked".
56
65
  4. Select the project `extension/` directory.
57
- 5. Click the extension icon and confirm the bridge URL is `http://127.0.0.1:48887`.
58
- 6. Open any `http` or `https` page and click the extension icon to confirm the
59
- page is connected.
60
-
61
- The extension registers browser pages with the local bridge. It does not create
62
- agent conversations or depend on a remote workspace.
66
+ 5. Open or refresh any `http` or `https` page.
67
+ 6. Do not open the extension popup unless you want to confirm status or
68
+ customize settings.
69
+
70
+ The extension defaults to `http://127.0.0.1:48887`. Local installs do not need a
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.
63
74
 
64
75
  To create a distributable zip:
65
76
 
@@ -2,9 +2,10 @@
2
2
 
3
3
  ## Current Phase
4
4
 
5
- Patch release `yunti-browser-runtime@0.1.1` is complete. The local loopback
6
- bridge no longer requires a token by default, and the published package is
7
- verified with `npm run release:verify-published`.
5
+ Patch release `yunti-browser-runtime@0.1.3` is complete. The local loopback
6
+ bridge no longer requires a token by default, the extension popup no longer
7
+ shows settings as a first-run task, and the published package is verified with
8
+ `npm run release:verify-published`.
8
9
 
9
10
  ## Current State
10
11
 
@@ -42,7 +43,9 @@ verified with `npm run release:verify-published`.
42
43
  - `npm run release:dry-run` and `npm run release:publish` pin the official npm
43
44
  registry at `https://registry.npmjs.org/`, avoiding accidental publication to
44
45
  a locally configured mirror registry.
45
- - `yunti-browser-runtime@0.1.1` is published on the official npm registry.
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.
46
49
  - `npm run test:e2e` provides an opt-in real-browser Playwright smoke test for
47
50
  extension loading, page registration, MCP target listing, snapshot, click/fill,
48
51
  and CDP `Runtime.evaluate`.
@@ -248,6 +251,18 @@ verified with `npm run release:verify-published`.
248
251
  real-browser smoke skipped by configuration; `npm run check` and
249
252
  `npm run release:check` passed; `npm run release:publish` published
250
253
  `yunti-browser-runtime@0.1.1`; `npm run release:verify-published` returned 0.
254
+ - P5.2 extension popup and onboarding simplification is complete: Bridge Token
255
+ is now optional under advanced settings, README contains a copyable Agent
256
+ installation prompt, and default extension loading no longer asks users to
257
+ save popup settings.
258
+ - Latest P5.2 validation: `npm run release:check` passed; `npm run
259
+ release:publish` published `yunti-browser-runtime@0.1.2`; `npm run
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`.
251
266
 
252
267
  ## Known Risks
253
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.0` 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.1",
4
+ "version": "0.1.3",
5
5
  "description": "Local browser runtime for AI agents through MCP.",
6
6
  "permissions": [
7
7
  "activeTab",
@@ -34,6 +34,27 @@ label {
34
34
  font-size: 12px;
35
35
  }
36
36
 
37
+ details {
38
+ display: grid;
39
+ gap: 6px;
40
+ color: #334155;
41
+ font-size: 12px;
42
+ }
43
+
44
+ summary {
45
+ cursor: pointer;
46
+ font-weight: 600;
47
+ }
48
+
49
+ details label {
50
+ margin-top: 6px;
51
+ }
52
+
53
+ details button {
54
+ width: 100%;
55
+ margin-top: 6px;
56
+ }
57
+
37
58
  input,
38
59
  textarea {
39
60
  width: 100%;
@@ -59,7 +80,7 @@ button {
59
80
  font: 500 13px/1 system-ui;
60
81
  }
61
82
 
62
- button:first-of-type {
83
+ main > button {
63
84
  border-color: #0f766e;
64
85
  background: #0f766e;
65
86
  color: white;
@@ -10,20 +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
- Bridge Token
19
- <input id="bridgeToken" autocomplete="off" type="password" />
20
- </label>
21
- <label>
22
- 页面匹配
23
- <textarea id="platformMatches" rows="3"></textarea>
24
- </label>
25
- <button id="save">保存设置</button>
26
13
  <button id="refresh">刷新状态</button>
14
+ <details id="advancedSettings">
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>
24
+ <label>
25
+ Bridge Token(可选)
26
+ <input id="bridgeToken" autocomplete="off" type="password" />
27
+ </label>
28
+ <button id="save">保存设置</button>
29
+ </details>
27
30
  </main>
28
31
  <script type="module" src="popup.js"></script>
29
32
  </body>
@@ -2,6 +2,8 @@ const statusEl = document.querySelector("#status")
2
2
  const bridgeUrlEl = document.querySelector("#bridgeUrl")
3
3
  const bridgeTokenEl = document.querySelector("#bridgeToken")
4
4
  const platformMatchesEl = document.querySelector("#platformMatches")
5
+ const advancedSettingsEl = document.querySelector("#advancedSettings")
6
+ const defaultBridgeUrl = "http://127.0.0.1:48887"
5
7
  document.querySelector("#save").addEventListener("click", save)
6
8
  document.querySelector("#refresh").addEventListener("click", refresh)
7
9
 
@@ -14,11 +16,7 @@ async function refresh() {
14
16
  return
15
17
  }
16
18
  renderSettings(state.settings || {})
17
- setStatus(
18
- state.activeSession
19
- ? `页面已连接\n${state.activeSession.title || state.activeSession.url}`
20
- : "请打开任意 http/https 页面,并确认本地 bridge 已启动。"
21
- )
19
+ setStatus(statusText(state))
22
20
  }
23
21
 
24
22
  async function save() {
@@ -35,15 +33,30 @@ async function save() {
35
33
  return
36
34
  }
37
35
  renderSettings(state.settings || {})
38
- setStatus("设置已保存,请刷新目标页面完成重新注册。")
36
+ setStatus("设置已保存。请刷新目标页面完成重新注册。")
39
37
  }
40
38
 
41
39
  function renderSettings(settings) {
42
- bridgeUrlEl.value = settings.bridgeUrl || "http://127.0.0.1:48887"
40
+ bridgeUrlEl.value = settings.bridgeUrl || defaultBridgeUrl
43
41
  bridgeTokenEl.value = settings.bridgeToken || ""
44
- platformMatchesEl.value = Array.isArray(settings.platformMatches)
45
- ? settings.platformMatches.join("\n")
46
- : "*"
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 页面即可连接。"
47
60
  }
48
61
 
49
62
  function setStatus(text) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yunti-browser-runtime",
3
- "version": "0.1.1",
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(", ")}`,