yunti-browser-runtime 0.1.2 → 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 +52 -15
- package/bin/yunti-browser-runtime.js +6 -0
- package/docs/ACTION_RESULT_COVERAGE.md +41 -0
- package/docs/AGENT_WORKFLOW_CONTRACT.md +97 -0
- package/docs/EXECUTION_PLAN.md +1433 -4
- package/docs/EXTENSION_DISTRIBUTION.md +145 -0
- package/docs/EXTENSION_PERMISSION_STRATEGY.md +164 -0
- package/docs/EXTENSION_STORE_COPY.md +210 -0
- package/docs/INSTALL.md +18 -8
- package/docs/NEXT_MAJOR_PLAN.md +808 -0
- package/docs/PROJECT_STATUS.md +1019 -8
- package/docs/PUBLISHING_BLOCKERS.md +2 -2
- package/docs/RELEASE.md +6 -2
- package/docs/RELEASE_0_2_0_CHECKLIST.md +820 -0
- package/docs/ROADMAP.md +44 -0
- package/docs/SECURITY.md +34 -0
- package/docs/TOOL_GUIDE.md +282 -5
- package/extension/content.js +76 -7
- package/extension/dom-observer.js +588 -0
- package/extension/manifest.json +2 -2
- package/extension/popup.css +6 -1
- package/extension/popup.html +10 -10
- package/extension/popup.js +21 -10
- package/extension/session-manager.js +2 -0
- package/extension/tool-handlers.js +1120 -94
- package/mcp/bridge-hub.js +257 -3
- package/mcp/http-server.js +213 -0
- package/mcp/memory.js +5 -5
- package/mcp/redaction.js +52 -3
- package/mcp/server.js +2 -0
- package/mcp/tools.js +417 -38
- package/package.json +4 -2
- package/scripts/check-action-result-coverage.js +145 -0
- package/scripts/doctor.js +4 -0
- package/scripts/package-extension.js +1 -0
- package/scripts/print-config.js +1 -1
- package/scripts/release-check.js +3 -0
- package/skills/yunti-browser-runtime/SKILL.md +125 -2
package/extension/popup.js
CHANGED
|
@@ -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 ||
|
|
40
|
+
bridgeUrlEl.value = settings.bridgeUrl || defaultBridgeUrl
|
|
44
41
|
bridgeTokenEl.value = settings.bridgeToken || ""
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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) {
|
|
@@ -300,6 +300,7 @@ function normalizeClientInfo(client) {
|
|
|
300
300
|
const value = client && typeof client === "object" ? client : {}
|
|
301
301
|
return {
|
|
302
302
|
family: normalizeBrowserFamily(value.family || value.userAgent),
|
|
303
|
+
extensionVersion: String(value.extensionVersion || "").slice(0, 80),
|
|
303
304
|
userAgent: String(value.userAgent || "").slice(0, 500),
|
|
304
305
|
platform: String(value.platform || "").slice(0, 120),
|
|
305
306
|
language: String(value.language || "").slice(0, 80),
|
|
@@ -308,6 +309,7 @@ function normalizeClientInfo(client) {
|
|
|
308
309
|
|
|
309
310
|
function getBackgroundClientInfo() {
|
|
310
311
|
return {
|
|
312
|
+
extensionVersion: chrome.runtime?.getManifest?.().version || "",
|
|
311
313
|
userAgent: String(globalThis.navigator?.userAgent || ""),
|
|
312
314
|
platform: String(globalThis.navigator?.platform || ""),
|
|
313
315
|
language: String(globalThis.navigator?.language || ""),
|