Skip to content

Commit 9dab0e3

Browse files
committed
fix(ci): register browser_webview_close and refresh capability projections
The new browser_webview_close Tauri command needs a Product Operation Registry row; capability generation rejects commands without one. It is also the documented counterpart of the embedded browser scene/panel, so that item gains the command and the frontend closeWebview call as evidence. Rebase onto current main to pick up the ssh_proxy_command_v1 desktop advertisement the branch base was missing, and let the Tauri transport boundary rule accept the projected emit_to("main", ...) form used to isolate agentic events to the main window.
1 parent 0a81346 commit 9dab0e3

13 files changed

Lines changed: 63 additions & 31 deletions

File tree

‎docs/interactive-capabilities/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ OpenBitFun Playbook currently contains **22 features**, **22 settings pages**, a
2727
- Generated per-item interaction audit: `docs/interactive-capabilities/technical/product-control-open-audit.json`
2828
- Generated low-level audit map: `docs/interactive-capabilities/technical/tauri-command-map.json`
2929

30-
说明书、网站、搜索和智能体只看“功能 + 设置 + 子能力”。每项子能力都必须引用已注册 Tauri Command 或可解析的源码标记;这些证据不会进入公开目录。当前 **709** 个 Tauri 命令只用于实现覆盖审计。产品 UI 交互源码会在生成和检查时扫描并校验,但不会保存成随普通 UI 改动频繁变化的版本化快照。
30+
说明书、网站、搜索和智能体只看“功能 + 设置 + 子能力”。每项子能力都必须引用已注册 Tauri Command 或可解析的源码标记;这些证据不会进入公开目录。当前 **710** 个 Tauri 命令只用于实现覆盖审计。产品 UI 交互源码会在生成和检查时扫描并校验,但不会保存成随普通 UI 改动频繁变化的版本化快照。
3131

32-
Docs, website, search, and agents see only features, settings, and documented sub-capabilities. Every sub-capability must reference a registered Tauri command or a resolvable source marker; evidence is stripped from public projections. The **709** Tauri commands remain implementation-audit evidence only. Product UI interaction sources are scanned and validated during generation and checks, but are not stored as a versioned snapshot that churns with ordinary UI changes.
32+
Docs, website, search, and agents see only features, settings, and documented sub-capabilities. Every sub-capability must reference a registered Tauri command or a resolvable source marker; evidence is stripped from public projections. The **710** Tauri commands remain implementation-audit evidence only. Product UI interaction sources are scanned and validated during generation and checks, but are not stored as a versioned snapshot that churns with ordinary UI changes.
3333

3434
## 控制边界 / Control boundary
3535

‎docs/interactive-capabilities/capabilities.json‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"title": "OpenBitFun Playbook",
55
"origin": "https://playbook.openbitfun.com",
66
"source": "src/shared/interactive-capabilities/catalog.json",
7-
"digest": "6ae2eeaa19e6342f9dcf7ff33b7c0fa94547ee1c02fc1835f6f4471caab6fbb3",
7+
"digest": "b08b4b912cb2ed217bc2fd592e59a2e41b9c8cb342e6c0a01c1ea46bbd72b258",
88
"ownerDigest": "3cc6d7d869b2c90c2161494a854b5ff7eb72ea69a1a28e40ccd42065fb3382e2",
99
"searchAcceptance": [
1010
{
@@ -23060,8 +23060,8 @@
2306023060
},
2306123061
{
2306223062
"id": "scene-and-panel",
23063-
"titleZh": "既可作为独立浏览器场景,也可在会话旁的辅助面板中打开",
23064-
"titleEn": "Use the browser as a standalone scene or an auxiliary panel beside a session",
23063+
"titleZh": "既可作为独立浏览器场景,也可在会话旁的辅助面板中打开;关闭面板时释放对应的原生 WebView",
23064+
"titleEn": "Use the browser as a standalone scene or an auxiliary panel beside a session, and release the native webview when the panel closes",
2306523065
"control": {
2306623066
"kind": "delegate",
2306723067
"tools": [
@@ -23306,8 +23306,8 @@
2330623306
"Navigate page history with Back, Forward, and the address bar",
2330723307
"刷新页面,并同步当前 URL、加载状态与错误提示",
2330823308
"Reload pages and synchronize the current URL, loading state, and errors",
23309-
"既可作为独立浏览器场景,也可在会话旁的辅助面板中打开",
23310-
"Use the browser as a standalone scene or an auxiliary panel beside a session",
23309+
"既可作为独立浏览器场景,也可在会话旁的辅助面板中打开;关闭面板时释放对应的原生 WebView",
23310+
"Use the browser as a standalone scene or an auxiliary panel beside a session, and release the native webview when the panel closes",
2331123311
"启动元素选择器,悬停时高亮页面元素并显示标签、ID 和 Class",
2331223312
"Start the element picker to highlight hovered elements and show tag, ID, and class details",
2331323313
"点击元素后捕获 CSS 路径、属性、文本和 HTML,并加入当前会话上下文",

‎docs/interactive-capabilities/capabilities/feature.browser.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ Open webpages and local services inside OpenBitFun, where an agent can inspect t
2525
- Navigate page history with Back, Forward, and the address bar
2626
- **由专用智能体工具控制 / Delegated Agent tool** · `ControlHub` · 刷新页面,并同步当前 URL、加载状态与错误提示
2727
- Reload pages and synchronize the current URL, loading state, and errors
28-
- **由专用智能体工具控制 / Delegated Agent tool** · `ControlHub` · 既可作为独立浏览器场景,也可在会话旁的辅助面板中打开
29-
- Use the browser as a standalone scene or an auxiliary panel beside a session
28+
- **由专用智能体工具控制 / Delegated Agent tool** · `ControlHub` · 既可作为独立浏览器场景,也可在会话旁的辅助面板中打开;关闭面板时释放对应的原生 WebView
29+
- Use the browser as a standalone scene or an auxiliary panel beside a session, and release the native webview when the panel closes
3030
- **由专用智能体工具控制 / Delegated Agent tool** · `ControlHub` · 启动元素选择器,悬停时高亮页面元素并显示标签、ID 和 Class
3131
- Start the element picker to highlight hovered elements and show tag, ID, and class details
3232
- **由专用智能体工具控制 / Delegated Agent tool** · `ControlHub` · 点击元素后捕获 CSS 路径、属性、文本和 HTML,并加入当前会话上下文

‎docs/interactive-capabilities/technical/product-control-open-audit.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"schemaVersion": 1,
33
"generatedFrom": "src/shared/interactive-capabilities/catalog.json",
4-
"catalogDigest": "6ae2eeaa19e6342f9dcf7ff33b7c0fa94547ee1c02fc1835f6f4471caab6fbb3",
4+
"catalogDigest": "b08b4b912cb2ed217bc2fd592e59a2e41b9c8cb342e6c0a01c1ea46bbd72b258",
55
"count": 205,
66
"reasonCounts": {
77
"externalAuth": 4,

‎docs/interactive-capabilities/technical/tauri-command-map.json‎

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"schemaVersion": 2,
33
"generatedFrom": "src/shared/interactive-capabilities/catalog.json",
4-
"catalogDigest": "6ae2eeaa19e6342f9dcf7ff33b7c0fa94547ee1c02fc1835f6f4471caab6fbb3",
5-
"commandCount": 709,
4+
"catalogDigest": "b08b4b912cb2ed217bc2fd592e59a2e41b9c8cb342e6c0a01c1ea46bbd72b258",
5+
"commandCount": 710,
66
"coverage": {
7-
"commandCount": 709,
8-
"documentedCommandCount": 649,
7+
"commandCount": 710,
8+
"documentedCommandCount": 650,
99
"implementationCommandCount": 60,
1010
"implementationDigest": "5047b674e890f899e65baf9235e9df4bd912fa28f44eb10a656e079a1b89974d"
1111
},
@@ -804,6 +804,22 @@
804804
"signature": "fn browser_webview_capture_preview( app: tauri::AppHandle, request: WebviewLabelRequest, ) -> Result<WebviewPreviewResponse, String>",
805805
"remoteWorkspacePolicy": "LocalOnly"
806806
},
807+
{
808+
"id": "browser_webview_close",
809+
"moduleId": "browser",
810+
"capabilityId": "feature.browser",
811+
"capabilityIds": [
812+
"feature.browser"
813+
],
814+
"documentedItemIds": [
815+
"feature.browser:scene-and-panel"
816+
],
817+
"visibility": "documented",
818+
"rustPath": "api::browser_api::browser_webview_close",
819+
"sourceFile": "src/apps/desktop/src/api/browser_api.rs",
820+
"signature": "fn browser_webview_close( app: tauri::AppHandle, request: WebviewLabelRequest, ) -> Result<(), String>",
821+
"remoteWorkspacePolicy": "LocalOnly"
822+
},
807823
{
808824
"id": "browser_webview_create",
809825
"moduleId": "browser",

‎scripts/core-boundaries/rules/source/required-rules.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ export const requiredContentRules = [
363363
message: 'missing shared frontend projection usage in Tauri transport',
364364
},
365365
{
366-
regex: /\.emit\(projected\.event_name\.as_str\(\), projected\.payload\)/,
366+
regex: /\.emit(?:_to\("main", |\()projected\.event_name\.as_str\(\), projected\.payload\)/,
367367
message: 'Tauri transport must emit projected event name and payload',
368368
},
369369
],

‎src/crates/contracts/product-domains/src/generated/product-control-catalog.json‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"title": "OpenBitFun Playbook",
55
"origin": "https://playbook.openbitfun.com",
66
"source": "src/shared/interactive-capabilities/catalog.json",
7-
"digest": "6ae2eeaa19e6342f9dcf7ff33b7c0fa94547ee1c02fc1835f6f4471caab6fbb3",
7+
"digest": "b08b4b912cb2ed217bc2fd592e59a2e41b9c8cb342e6c0a01c1ea46bbd72b258",
88
"ownerDigest": "3cc6d7d869b2c90c2161494a854b5ff7eb72ea69a1a28e40ccd42065fb3382e2",
99
"searchAcceptance": [
1010
{
@@ -23076,8 +23076,8 @@
2307623076
},
2307723077
{
2307823078
"id": "scene-and-panel",
23079-
"titleZh": "既可作为独立浏览器场景,也可在会话旁的辅助面板中打开",
23080-
"titleEn": "Use the browser as a standalone scene or an auxiliary panel beside a session",
23079+
"titleZh": "既可作为独立浏览器场景,也可在会话旁的辅助面板中打开;关闭面板时释放对应的原生 WebView",
23080+
"titleEn": "Use the browser as a standalone scene or an auxiliary panel beside a session, and release the native webview when the panel closes",
2308123081
"control": {
2308223082
"kind": "delegate",
2308323083
"tools": [
@@ -23322,8 +23322,8 @@
2332223322
"Navigate page history with Back, Forward, and the address bar",
2332323323
"刷新页面,并同步当前 URL、加载状态与错误提示",
2332423324
"Reload pages and synchronize the current URL, loading state, and errors",
23325-
"既可作为独立浏览器场景,也可在会话旁的辅助面板中打开",
23326-
"Use the browser as a standalone scene or an auxiliary panel beside a session",
23325+
"既可作为独立浏览器场景,也可在会话旁的辅助面板中打开;关闭面板时释放对应的原生 WebView",
23326+
"Use the browser as a standalone scene or an auxiliary panel beside a session, and release the native webview when the panel closes",
2332723327
"启动元素选择器,悬停时高亮页面元素并显示标签、ID 和 Class",
2332823328
"Start the element picker to highlight hovered elements and show tag, ID, and class details",
2332923329
"点击元素后捕获 CSS 路径、属性、文本和 HTML,并加入当前会话上下文",

‎src/crates/contracts/product-domains/src/generated/remote-surface-registry.json‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"schemaVersion": 1,
3-
"digest": "fnv1a64:7dadb93da46481aa",
3+
"digest": "fnv1a64:b6f21440c8242b1f",
44
"retiredCommandPrefixes": [
55
{
66
"prefix": "lsp_",
@@ -714,6 +714,18 @@
714714
"reason": "the controller keeps this command; peer hosts refuse it before dispatch"
715715
}
716716
},
717+
{
718+
"id": "browser_webview_close",
719+
"surface": "tauri_command",
720+
"remoteWorkspace": "LocalOnly",
721+
"peer": {
722+
"kind": "controller_local"
723+
},
724+
"cliPeer": {
725+
"kind": "unsupported",
726+
"reason": "the controller keeps this command; peer hosts refuse it before dispatch"
727+
}
728+
},
717729
{
718730
"id": "browser_webview_create",
719731
"surface": "tauri_command",

‎src/crates/contracts/product-domains/src/remote_surface/table.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ pub(super) const OPERATIONS: &[OperationDefinition] = &[
139139
op("browser_control_restart_with_cdp", LocalOnly, Proxied, CLI_NO_BROWSER_OR_OS_AUTOMATION),
140140
op("browser_get_url", LocalOnly, ControllerLocal, REFUSED),
141141
op("browser_webview_capture_preview", LocalOnly, ControllerLocal, REFUSED),
142+
op("browser_webview_close", LocalOnly, ControllerLocal, REFUSED),
142143
op("browser_webview_create", LocalOnly, ControllerLocal, REFUSED),
143144
op("browser_webview_eval", LocalOnly, ControllerLocal, REFUSED),
144145
op("browser_webview_navigate", LocalOnly, ControllerLocal, REFUSED),

‎src/shared/interactive-capabilities/catalog.json‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2484,14 +2484,16 @@
24842484
},
24852485
{
24862486
"id": "scene-and-panel",
2487-
"titleZh": "既可作为独立浏览器场景,也可在会话旁的辅助面板中打开",
2488-
"titleEn": "Use the browser as a standalone scene or an auxiliary panel beside a session",
2487+
"titleZh": "既可作为独立浏览器场景,也可在会话旁的辅助面板中打开;关闭面板时释放对应的原生 WebView",
2488+
"titleEn": "Use the browser as a standalone scene or an auxiliary panel beside a session, and release the native webview when the panel closes",
24892489
"control": {
24902490
"kind": "delegate"
24912491
},
24922492
"evidence": [
24932493
"source:src/web-ui/src/app/scenes/browser/BrowserScene.tsx#BrowserScene",
2494-
"source:src/web-ui/src/app/scenes/browser/BrowserPanel.tsx#BrowserPanel"
2494+
"source:src/web-ui/src/app/scenes/browser/BrowserPanel.tsx#BrowserPanel",
2495+
"source:src/web-ui/src/app/scenes/browser/useEmbeddedBrowserWebview.ts#closeWebview",
2496+
"command:browser_webview_close"
24952497
]
24962498
},
24972499
{

0 commit comments

Comments
 (0)