yunti-browser-runtime 0.1.3 → 0.2.0

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
@@ -54,6 +54,22 @@ yunti-browser-runtime print-config -- --agent codex --human
54
54
  yunti-browser-runtime bridge
55
55
  ```
56
56
 
57
+ 需要查看本地运行时状态时,可以打开可选控制台:
58
+
59
+ ```bash
60
+ yunti-browser-runtime console
61
+ ```
62
+
63
+ 然后访问:
64
+
65
+ ```text
66
+ http://127.0.0.1:48887/console
67
+ ```
68
+
69
+ 控制台只展示连接页面、pending/queued 任务、最近工具 activity 和诊断数量等脱敏摘要;
70
+ 它不是必选 hub,也不会改变 Agent 的 MCP 使用路径。
71
+ `yunti-browser-runtime doctor` 的人类可读摘要也会打印这个控制台 URL。
72
+
57
73
  其他常用 CLI:
58
74
 
59
75
  ```bash
@@ -140,6 +156,8 @@ npm run package:extension
140
156
  ```
141
157
 
142
158
  输出文件位于 `dist/yunti-browser-runtime-extension-<version>.zip`,zip 内只包含扩展运行所需文件。
159
+ 浏览器商店分发前的权限、隐私和素材准备清单见
160
+ [扩展分发准备度](docs/EXTENSION_DISTRIBUTION.md)。
143
161
 
144
162
  ## 给 Agent 注册 MCP
145
163
 
@@ -221,6 +239,7 @@ cp -R skills/yunti-browser-runtime ~/.codex/skills/
221
239
  - [工具指南](docs/TOOL_GUIDE.md)
222
240
  - [权限和隐私说明](docs/SECURITY.md)
223
241
  - [发布运行手册](docs/RELEASE.md)
242
+ - [0.2.0 发布清单](docs/RELEASE_0_2_0_CHECKLIST.md)
224
243
  - [发布阻塞处理](docs/PUBLISHING_BLOCKERS.md)
225
244
  - [项目初衷](docs/PROJECT_INTENT.md)
226
245
  - [项目状态](docs/PROJECT_STATUS.md)
@@ -295,8 +314,10 @@ token。
295
314
 
296
315
  ## 发布状态与后续事项
297
316
 
298
- - `yunti-browser-runtime@0.1.3` 已发布到官方 npm registry。
299
- - `0.1.3` 将扩展 popup 首屏改成零配置状态面板,并补充“Agent 会自动启动 bridge”
300
- 的安装引导。
317
+ - 当前稳定发布版本:`yunti-browser-runtime@0.1.3`。
318
+ - 当前分支正在收口 `0.2.0` npm/unpacked extension 发布候选版本;`0.2.0`
319
+ 增强了 `yunti_observe_page`、fresh uid 操作闭环、结构化恢复诊断、DOM/diagnostic
320
+ 脱敏和可选本地控制台。
301
321
  - 发布后验证命令:`npm run release:verify-published`。
302
- - 如要上架浏览器扩展商店,需要再次审查 broad host permissions。
322
+ - 浏览器扩展商店版本不阻塞 `0.2.0` npm 发布;如要上架商店,需要沿
323
+ `docs/EXTENSION_PERMISSION_STRATEGY.md` 另行设计 store-candidate 权限 UX。
@@ -16,6 +16,10 @@ const commands = {
16
16
  script: join(rootDir, "mcp", "server.js"),
17
17
  env: { YUNTI_BROWSER_BRIDGE_ONLY: "1" },
18
18
  },
19
+ console: {
20
+ script: join(rootDir, "mcp", "server.js"),
21
+ env: { YUNTI_BROWSER_BRIDGE_ONLY: "1" },
22
+ },
19
23
  doctor: {
20
24
  script: join(rootDir, "scripts", "doctor.js"),
21
25
  env: {},
@@ -73,6 +77,7 @@ Usage:
73
77
  Commands:
74
78
  mcp Start the stdio MCP server (default)
75
79
  bridge Start only the local HTTP bridge
80
+ console Start the bridge and print the optional local console URL
76
81
  doctor Run install and bridge diagnostics
77
82
  print-config Print MCP configuration for an agent
78
83
  package-extension Build the browser extension zip
@@ -80,6 +85,7 @@ Commands:
80
85
  Examples:
81
86
  yunti-browser-runtime
82
87
  yunti-browser-runtime bridge
88
+ yunti-browser-runtime console
83
89
  yunti-browser-runtime doctor
84
90
  yunti-browser-runtime print-config -- --agent codex --human
85
91
  yunti-browser-runtime package-extension`)
@@ -0,0 +1,41 @@
1
+ # Action Result Coverage
2
+
3
+ This document is the durable P6.2 action result coverage matrix. It exists so
4
+ future context compaction or thread handoff cannot blur which browser action
5
+ surfaces already expose structured result fields.
6
+
7
+ Compatibility rule: every action path must keep its historical fields while
8
+ adding structured fields such as `action`, `target`, `ok`, `code`,
9
+ `recoverable`, `recoveryHint`, and `nextStepHint` where useful.
10
+
11
+ ## Coverage Matrix
12
+
13
+ | Tool | Covered success paths | Covered failure diagnostics | Compatibility fields preserved | Remaining validation |
14
+ | --- | --- | --- | --- | --- |
15
+ | `yunti_click` | uid, coordinate, selector | stale uid, missing uid, selector failure via content result | `clicked`, `uid`, `selector`, `x`, `y`, `method`, `element`, `browserSessionId` | Real-browser observe-click-observe closure pending |
16
+ | `yunti_hover` | uid, coordinate, selector | stale uid, missing uid, selector failure via content result | `hovered`, `uid`, `selector`, `x`, `y`, `method`, `element`, `browserSessionId` | Real-browser hover menu closure pending |
17
+ | `yunti_fill` | uid keyboard, uid select, uid contenteditable, selector | stale uid, missing uid, selector failure, non-editable, hidden, disabled, readonly, option miss, value not applied | `filled`, `uid`, `selector`, `method`, `value`, `valueLength`, `element`, `before`, `after`, `browserSessionId` | Real-browser controlled input closure pending |
18
+ | `yunti_select` | selector value, uid value, uid text | selector failure, uid failure, option miss, disabled option, non-select target | `selected`, `uid`, `selector`, `value`, `text`, `selectedIndex`, `element`, `browserSessionId` | Real-browser async option closure pending |
19
+ | `yunti_fill_form` | aggregate success, partial failure | per-field fill/select failure aggregation | `filled`, `failed`, `results`, `browserSessionId` | Real-browser multi-field form closure pending |
20
+ | `yunti_wait_for` | text, selector, urlContains | timeout | `found`, `text`, `selector`, `condition`, `value`, `waitedMs`, `browserSessionId` | Real-browser async wait closure pending |
21
+ | `yunti_scroll` | document, uid container, coordinate container, coordinate document fallback | uid missing, uid stale, coordinate unavailable, no movement, partial movement, document fallback hint | `scrolled`, `deltaX`, `deltaY`, `target`, `before`, `after`, `moved`, `browserSessionId` | Real-browser nested panel closure pending |
22
+ | `yunti_type_text` | uid, selector | stale uid, missing uid, selector failure via content result | `typed`, `uid`, `selector`, `text`, `textLength`, `method`, `mode`, `element`, `browserSessionId` | Real-browser text editor closure pending |
23
+ | `yunti_press_key` | uid, selector | stale uid, missing uid, selector failure via content result | `pressed`, `uid`, `selector`, `key`, `element`, `valueChanged`, `browserSessionId` | Real-browser shortcut closure pending |
24
+ | `yunti_upload_file` | uid, selector | stale uid, missing uid, selector failure via CDP/content path | `uploaded`, `uid`, `selector`, `fileCount`, `filePaths`, `browserSessionId` | Real-browser file input closure pending |
25
+ | `yunti_drag` | coordinate | coordinate argument validation, CDP dispatch failure via tool error | `dragged`, `from`, `to`, `steps`, `browserSessionId` | Real-browser drag target closure pending |
26
+
27
+ ## Coverage Gate
28
+
29
+ - Last audited phase: P6.2.7.
30
+ - Required automated check: `npm run check:action-results`.
31
+ - Required release gate: `npm run release:check` runs the coverage check.
32
+ - Real browser closure: Pending until Playwright/Chromium is installed in the
33
+ validation environment.
34
+ - Real browser command: `YUNTI_E2E=1 npm run test:e2e`.
35
+
36
+ ## Next Coverage Work
37
+
38
+ P6.2.7 closes the structured action result coverage audit. The next engineering
39
+ slice should not add another manual coverage checklist unless a new action tool
40
+ or result contract is introduced. Prefer moving to real-browser closure
41
+ validation or P6.3 agent workflow contracts.
@@ -0,0 +1,97 @@
1
+ # Agent Workflow Contract
2
+
3
+ This document is the P6.3.1 default operating contract for agents using Yunti
4
+ Browser Runtime. It is intentionally tool-level and LLM-agnostic: Yunti stays
5
+ the browser operation layer, while the agent remains responsible for task
6
+ planning and user judgment.
7
+
8
+ ## Default Loop
9
+
10
+ Use this loop for normal page work:
11
+
12
+ 1. Call `yunti_get_tool_usage_hints` when the tool contract is uncertain.
13
+ 2. Call `yunti_list_browser_targets` and choose the intended
14
+ `browserSessionId`.
15
+ 3. Call `yunti_observe_page` for the current page state.
16
+ 4. Act with a fresh uid when possible.
17
+ 5. If the page is loading or changing, call `yunti_wait_for`.
18
+ 6. After every wait or action, call `yunti_observe_page` again.
19
+ 7. Verify the result using observe, snapshot, evaluate, screenshot, network, or
20
+ console tools before assuming the task is done.
21
+ 8. If a uid/session/action result is stale or recoverable, follow
22
+ `code`, `recoveryHint`, and `nextStepHint` before retrying.
23
+
24
+ ## Recovery Rules
25
+
26
+ - Stale route: call `yunti_list_browser_targets` and use the latest
27
+ `browserSessionId`.
28
+ - Stale uid: call `yunti_observe_page` again and use a fresh uid.
29
+ - Async UI: call `yunti_wait_for`, then `yunti_observe_page`, then continue
30
+ with a fresh uid.
31
+ - Scroll uncertainty: prefer fresh `scrollableContainers[]` uids, inspect
32
+ `moved`, `edgeHint`, `partialMovement`, and `recoveryHint`.
33
+ - Fill/select uncertainty: inspect `fillable`, `readOnly`, `disabled`,
34
+ `fillBlockReason`, `selectedValue`, `selectedText`, and `options[]` before
35
+ retrying.
36
+ - Timeout: treat `WAIT_TIMEOUT` as a signal to observe and adjust the condition,
37
+ not proof that the user task failed.
38
+ - Coordinates/selectors: use them as recovery or debugging paths when fresh
39
+ uids are unavailable.
40
+
41
+ ## Confirmation Boundary
42
+
43
+ Ask the user for explicit confirmation before:
44
+
45
+ - submitting forms that change production data;
46
+ - deleting, approving, purchasing, publishing, or sending messages;
47
+ - uploading sensitive files;
48
+ - exposing or copying secrets, credentials, cookies, auth headers, tokens, or
49
+ private keys;
50
+ - taking an action whose effect cannot be verified from page state.
51
+
52
+ ## Copyable Prompt
53
+
54
+ ```text
55
+ Please operate my browser through Yunti Browser Runtime.
56
+
57
+ Follow this workflow:
58
+ 1. Call yunti_get_tool_usage_hints if tool usage is uncertain.
59
+ 2. Call yunti_list_browser_targets and choose the intended browserSessionId.
60
+ 3. Use yunti_observe_page before page actions.
61
+ 4. Prefer fresh uids from yunti_observe_page for click, hover, fill, select,
62
+ scroll, type, press, upload, and drag operations.
63
+ 5. After each action, verify by observing again or using snapshot, evaluate,
64
+ screenshot, network, or console tools.
65
+ 6. For async rendering, validation, navigation, option loading, or infinite
66
+ scroll, call yunti_wait_for, then yunti_observe_page, then continue with a
67
+ fresh uid.
68
+ 7. If a result has ok=false, code, recoveryHint, or nextStepHint, follow that
69
+ guidance before retrying. Do not blindly repeat the same action.
70
+ 8. Use selector or coordinate fallback only when fresh uids are unavailable or
71
+ as an explicit recovery/debugging path.
72
+ 9. Before submitting, deleting, approving, purchasing, publishing, uploading
73
+ sensitive files, or changing production data, ask me for confirmation.
74
+ 10. Do not expose raw cookies, passwords, auth headers, tokens, private keys, or
75
+ other secrets. Remember that DOM observation redaction does not redact
76
+ screenshots.
77
+ ```
78
+
79
+ ## Minimal Use Case Index
80
+
81
+ The concrete P6.3.2 minimal use cases are maintained in
82
+ [Tool Guide](TOOL_GUIDE.md#minimal-use-cases) and mirrored in the packaged
83
+ skill:
84
+
85
+ - Click
86
+ - Fill Form
87
+ - Scroll To Find
88
+ - Switch Tab
89
+ - Wait For Async Result
90
+
91
+ ## Non-Goals
92
+
93
+ - Do not move a built-in LLM loop into Yunti Runtime.
94
+ - Do not replace fine-grained `yunti_*` tools with a single opaque task runner.
95
+ - Do not require a mandatory hub tab or side panel for the default local path.
96
+ - Do not remove CDP, screenshots, network, console, tab control, upload, or
97
+ diagnostic capabilities while improving page-level workflows.