dsh-browser-cdp 1.13.2 → 1.14.1
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/CHANGELOG.md +17 -0
- package/CHANGELOG.pt.md +600 -0
- package/README.de.md +1 -1
- package/README.es.md +1 -1
- package/README.fr.md +1 -1
- package/README.it.md +1 -1
- package/README.md +1 -1
- package/README.pt.md +285 -0
- package/README.ru.md +1 -1
- package/bin/cdp-cast-worker.mjs +353 -173
- package/dsh-plugin.json +208 -206
- package/lib/client.js +19 -4
- package/lib/index.js +37 -7
- package/locale/pt.json +6 -0
- package/package.json +154 -152
package/dsh-plugin.json
CHANGED
|
@@ -1,206 +1,208 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://dsh.community/schemas/dsh-plugin-0.15.json",
|
|
3
|
-
"id": "dsh-browser-cdp",
|
|
4
|
-
"name": "dsh-browser-cdp",
|
|
5
|
-
"version": "1.
|
|
6
|
-
"manifestVersion": "0.15",
|
|
7
|
-
"facets": {
|
|
8
|
-
"host": {
|
|
9
|
-
"entry": "lib/index.js",
|
|
10
|
-
"apiVersion": "v1alpha1"
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
"requires": {
|
|
14
|
-
"contracts": [
|
|
15
|
-
{
|
|
16
|
-
"apiVersion": "presentation.dsh/v1alpha1",
|
|
17
|
-
"kind": "OpenExternal",
|
|
18
|
-
"optional": true,
|
|
19
|
-
"fallback": "report the URL as text instead of opening it"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"apiVersion": "presentation.dsh/v1alpha1",
|
|
23
|
-
"kind": "Notification",
|
|
24
|
-
"optional": true,
|
|
25
|
-
"fallback": "log the notice to the browser-status scene"
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
},
|
|
29
|
-
"permissions": [],
|
|
30
|
-
"contributes": {
|
|
31
|
-
"commands": [],
|
|
32
|
-
"x-dsh-tui": [
|
|
33
|
-
{
|
|
34
|
-
"apiVersion": "tui.dsh/v1alpha1",
|
|
35
|
-
"kind": "Scene",
|
|
36
|
-
"id": "dsh-browser-cdp.watch",
|
|
37
|
-
"name": "agent_browser",
|
|
38
|
-
"spec": {
|
|
39
|
-
"title": "Agent 浏览器",
|
|
40
|
-
"titles": {
|
|
41
|
-
"en": "Agent Browser",
|
|
42
|
-
"zh": "Agent 浏览器"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
"
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
"
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
"
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
"
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
"
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
"
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
"
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
"
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
"
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
"
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
"
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://dsh.community/schemas/dsh-plugin-0.15.json",
|
|
3
|
+
"id": "dsh-browser-cdp",
|
|
4
|
+
"name": "dsh-browser-cdp",
|
|
5
|
+
"version": "1.14.1",
|
|
6
|
+
"manifestVersion": "0.15",
|
|
7
|
+
"facets": {
|
|
8
|
+
"host": {
|
|
9
|
+
"entry": "lib/index.js",
|
|
10
|
+
"apiVersion": "v1alpha1"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"requires": {
|
|
14
|
+
"contracts": [
|
|
15
|
+
{
|
|
16
|
+
"apiVersion": "presentation.dsh/v1alpha1",
|
|
17
|
+
"kind": "OpenExternal",
|
|
18
|
+
"optional": true,
|
|
19
|
+
"fallback": "report the URL as text instead of opening it"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"apiVersion": "presentation.dsh/v1alpha1",
|
|
23
|
+
"kind": "Notification",
|
|
24
|
+
"optional": true,
|
|
25
|
+
"fallback": "log the notice to the browser-status scene"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"permissions": [],
|
|
30
|
+
"contributes": {
|
|
31
|
+
"commands": [],
|
|
32
|
+
"x-dsh-tui": [
|
|
33
|
+
{
|
|
34
|
+
"apiVersion": "tui.dsh/v1alpha1",
|
|
35
|
+
"kind": "Scene",
|
|
36
|
+
"id": "dsh-browser-cdp.watch",
|
|
37
|
+
"name": "agent_browser",
|
|
38
|
+
"spec": {
|
|
39
|
+
"title": "Agent 浏览器",
|
|
40
|
+
"titles": {
|
|
41
|
+
"en": "Agent Browser",
|
|
42
|
+
"zh": "Agent 浏览器",
|
|
43
|
+
"pt": "Navegador do agente"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"apiVersion": "tui.dsh/v1alpha1",
|
|
49
|
+
"kind": "SettingsSection",
|
|
50
|
+
"id": "dsh-browser-cdp.settings",
|
|
51
|
+
"name": "dsh_browser_cdp_settings",
|
|
52
|
+
"spec": {
|
|
53
|
+
"namespace": "dsh-browser-cdp",
|
|
54
|
+
"title": "Agent 浏览器",
|
|
55
|
+
"titles": {
|
|
56
|
+
"en": "Agent Browser",
|
|
57
|
+
"zh": "Agent 浏览器",
|
|
58
|
+
"pt": "Navegador do agente"
|
|
59
|
+
},
|
|
60
|
+
"fields": [
|
|
61
|
+
{
|
|
62
|
+
"path": [
|
|
63
|
+
"toolInjection"
|
|
64
|
+
],
|
|
65
|
+
"label": "工具注入模式 (Tool injection mode)",
|
|
66
|
+
"kind": "select",
|
|
67
|
+
"options": [
|
|
68
|
+
{
|
|
69
|
+
"value": "lazy",
|
|
70
|
+
"label": "lazy"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"value": "always",
|
|
74
|
+
"label": "always"
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"hint": "lazy(默认)= 只常驻 1 个(bcdp_help,兼作解锁入口与运行态查询),其余首次 bcdp_* 调用后按下方开关注入,闲置回收时收回;always = 挂载即注册全部 35 个(历史行为)。"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"path": [
|
|
81
|
+
"toolBrowse"
|
|
82
|
+
],
|
|
83
|
+
"label": "基础操作工具(19 个)",
|
|
84
|
+
"kind": "boolean",
|
|
85
|
+
"hint": "开(默认)= 浏览器活动后按 act → observe → wait 三波放行;关 = 19 个工具从模型工具列表移除(空间/导航/点击/填写/键鼠/拖拽/截图/读取/指南/预检/等待…)。"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"path": [
|
|
89
|
+
"toolExtended"
|
|
90
|
+
],
|
|
91
|
+
"label": "扩展能力工具(8 个)",
|
|
92
|
+
"kind": "boolean",
|
|
93
|
+
"hint": "开(默认)= 浏览器活动后注册;关 = 8 个工具移除(裸 CDP/HTTP/上传/下载/对话框/验证码/登录落盘/登录导入)。"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"path": [
|
|
97
|
+
"toolEscape"
|
|
98
|
+
],
|
|
99
|
+
"label": "逃生舱 script(1 个)",
|
|
100
|
+
"kind": "boolean",
|
|
101
|
+
"hint": "与其它非 core 档一样等浏览器活动(1.7.0 起不再有「始终可达」豁免):先调 bcdp_status 即可拿到它,一个 heredoc 能做到其余大多数工具的事。关 = 封印。"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"path": [
|
|
105
|
+
"toolJudge"
|
|
106
|
+
],
|
|
107
|
+
"label": "评审工具 bcdp_jev_*(5 个)",
|
|
108
|
+
"kind": "boolean",
|
|
109
|
+
"hint": "开仍需配了 JEV 或 Laya Key:没 Key 的评审工具只能回答「未配置」,依旧不注入。关 = 任何情况下都不注入。"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"path": [
|
|
113
|
+
"sessionScopedPulse"
|
|
114
|
+
],
|
|
115
|
+
"label": "按会话隔离解锁 (Per-session unlock)",
|
|
116
|
+
"kind": "boolean",
|
|
117
|
+
"hint": "开(默认)= 每个会话各自调 bcdp_status 解锁,不会影响到其他会话;关 = 进程级共享(任一会话解锁对所有会话生效,历史行为)。宿主不支持时自动降级为关。"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"path": [
|
|
121
|
+
"isolateSpaces"
|
|
122
|
+
],
|
|
123
|
+
"label": "任务空间沙盒隔离 (Space isolation)",
|
|
124
|
+
"kind": "boolean",
|
|
125
|
+
"hint": "默认关闭:使用磁盘持久化 Profile,任务中登录的账号跨电脑重启永久保留;开启后使用内存临时沙盒隔离,任务结束不落盘。"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"path": [
|
|
129
|
+
"idleTimeoutMin"
|
|
130
|
+
],
|
|
131
|
+
"label": "空闲自动回收 (Idle auto-stop, minutes)",
|
|
132
|
+
"kind": "number",
|
|
133
|
+
"hint": "N 分钟没有任何 bcdp_* 调用后自动关闭后台浏览器进程(0 = 关闭此功能)。下次调用会自动冷启动(约 2-4 秒)。观察窗正在观看不算活动。"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"path": [
|
|
137
|
+
"chromePath"
|
|
138
|
+
],
|
|
139
|
+
"label": "Browser binary path",
|
|
140
|
+
"kind": "text",
|
|
141
|
+
"hint": "Path to the Chrome/Chromium/Edge binary. Empty = auto-detect."
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"path": [
|
|
145
|
+
"captureBackend"
|
|
146
|
+
],
|
|
147
|
+
"label": "Capture backend",
|
|
148
|
+
"kind": "select",
|
|
149
|
+
"options": [
|
|
150
|
+
{
|
|
151
|
+
"value": "auto",
|
|
152
|
+
"label": "Auto"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"value": "cdp",
|
|
156
|
+
"label": "CDP"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"value": "ffmpeg",
|
|
160
|
+
"label": "FFmpeg"
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"path": [
|
|
166
|
+
"streamProfile"
|
|
167
|
+
],
|
|
168
|
+
"label": "Quality profile",
|
|
169
|
+
"kind": "select",
|
|
170
|
+
"options": [
|
|
171
|
+
{
|
|
172
|
+
"value": "balanced",
|
|
173
|
+
"label": "Balanced"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"value": "quality",
|
|
177
|
+
"label": "Quality"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"value": "speed",
|
|
181
|
+
"label": "Speed"
|
|
182
|
+
}
|
|
183
|
+
]
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"path": [
|
|
187
|
+
"ffmpegPath"
|
|
188
|
+
],
|
|
189
|
+
"label": "FFmpeg binary path",
|
|
190
|
+
"kind": "text",
|
|
191
|
+
"hint": "Path to ffmpeg. Empty = auto-detect / on-demand install."
|
|
192
|
+
}
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
]
|
|
197
|
+
},
|
|
198
|
+
"subscriptions": [],
|
|
199
|
+
"license": "MIT",
|
|
200
|
+
"source": {
|
|
201
|
+
"repository": "https://github.com/drscrewdriver/dsh-browser-cdp"
|
|
202
|
+
},
|
|
203
|
+
"compat": {
|
|
204
|
+
"hosts": [
|
|
205
|
+
"dsh-tui"
|
|
206
|
+
]
|
|
207
|
+
}
|
|
208
|
+
}
|
package/lib/client.js
CHANGED
|
@@ -5298,8 +5298,11 @@ function createPickControl(onState, deliver) {
|
|
|
5298
5298
|
}
|
|
5299
5299
|
};
|
|
5300
5300
|
}
|
|
5301
|
-
function LivePreviewController(ctx) {
|
|
5301
|
+
function LivePreviewController(ctx, sessionId) {
|
|
5302
5302
|
this.ctx = ctx;
|
|
5303
|
+
this.sessionId = typeof sessionId === "string" && sessionId !== "" ? sessionId : null;
|
|
5304
|
+
this.sessionTargetId = null;
|
|
5305
|
+
this.multiSessionWatch = true;
|
|
5303
5306
|
this.store = ensureSnapshotStoreCreator()(this._initialState());
|
|
5304
5307
|
this.frameCache = /* @__PURE__ */ new Map();
|
|
5305
5308
|
this.pageMeta = /* @__PURE__ */ new Map();
|
|
@@ -5432,7 +5435,11 @@ LivePreviewController.prototype._recompute = function() {
|
|
|
5432
5435
|
if (cached) currentSpace = Object.assign({}, currentSpace, { thumbnail: cached });
|
|
5433
5436
|
}
|
|
5434
5437
|
} else {
|
|
5435
|
-
var
|
|
5438
|
+
var sessionTarget = this.multiSessionWatch && this.sessionId ? this.sessionTargetId : null;
|
|
5439
|
+
var activeMarked = sessionTarget ? this.lastList.find(function(s) {
|
|
5440
|
+
return s.targetId === sessionTarget;
|
|
5441
|
+
}) || null : null;
|
|
5442
|
+
if (!activeMarked) activeMarked = this.lastList.find(function(s) {
|
|
5436
5443
|
return s.active === true;
|
|
5437
5444
|
});
|
|
5438
5445
|
if (!activeMarked && this.lastList.length > 0) activeMarked = this.lastList.slice().sort(function(a, b) {
|
|
@@ -5489,6 +5496,8 @@ LivePreviewController.prototype.start = function() {
|
|
|
5489
5496
|
self.trackAll = data.all;
|
|
5490
5497
|
self._recompute();
|
|
5491
5498
|
}
|
|
5499
|
+
self.multiSessionWatch = data ? data.multiSessionWatch !== false : true;
|
|
5500
|
+
self._recompute();
|
|
5492
5501
|
}).catch(function() {});
|
|
5493
5502
|
this._recompute();
|
|
5494
5503
|
if (this.visible) {
|
|
@@ -5587,7 +5596,8 @@ LivePreviewController.prototype._syncWatch = function(targetId) {
|
|
|
5587
5596
|
if (this.watchStarted && this.watchTargetId === targetId) return;
|
|
5588
5597
|
var body = {
|
|
5589
5598
|
clientId: this.clientId,
|
|
5590
|
-
targetId
|
|
5599
|
+
targetId,
|
|
5600
|
+
...this.sessionId ? { sessionId: this.sessionId } : {}
|
|
5591
5601
|
};
|
|
5592
5602
|
var request = this._requestWatch(route, body);
|
|
5593
5603
|
if (!request) {
|
|
@@ -5735,6 +5745,9 @@ LivePreviewController.prototype._processSpaces = function(spaces) {
|
|
|
5735
5745
|
return s$1.active === true;
|
|
5736
5746
|
});
|
|
5737
5747
|
if (activeMarked) this.agentActiveId = activeMarked.targetId;
|
|
5748
|
+
this.sessionTargetId = this.sessionId && this.multiSessionWatch ? (this.lastList.find(function(s$1) {
|
|
5749
|
+
return s$1.activeSource === "focus-session";
|
|
5750
|
+
}) || null)?.targetId ?? null : null;
|
|
5738
5751
|
this.liveCount = this.lastList.length;
|
|
5739
5752
|
var busy = this.lastList.some(function(s$1) {
|
|
5740
5753
|
return Date.now() - (s$1.lastActive || 0) <= ACTIVE_WINDOW_MS;
|
|
@@ -6117,8 +6130,10 @@ LivePreviewController.prototype.handleDoubleClick = function(e) {
|
|
|
6117
6130
|
function EgoBrowserTab(props) {
|
|
6118
6131
|
var visible = props.visible;
|
|
6119
6132
|
var ctx = props.ctx;
|
|
6133
|
+
var scope = props.scope || {};
|
|
6134
|
+
var sessionScopeId = typeof scope.sessionId === "string" && scope.sessionId !== "" ? scope.sessionId : void 0;
|
|
6120
6135
|
var controllerRef = React.useRef(null);
|
|
6121
|
-
if (controllerRef.current === null) controllerRef.current = new LivePreviewController(ctx);
|
|
6136
|
+
if (controllerRef.current === null) controllerRef.current = new LivePreviewController(ctx, sessionScopeId);
|
|
6122
6137
|
var controller = controllerRef.current;
|
|
6123
6138
|
var useSnapshotRef = React.useRef(null);
|
|
6124
6139
|
if (useSnapshotRef.current === null) useSnapshotRef.current = bindSnapshotSelector(controller.store);
|
package/lib/index.js
CHANGED
|
@@ -2204,6 +2204,28 @@ function createFocusStore(now = () => Date.now()) {
|
|
|
2204
2204
|
}
|
|
2205
2205
|
/** Process-wide focus, mirroring `defaultAttachCache`'s lifetime. */
|
|
2206
2206
|
const defaultFocusStore = createFocusStore();
|
|
2207
|
+
function createSessionFocusStores() {
|
|
2208
|
+
const slots = /* @__PURE__ */ new Map();
|
|
2209
|
+
return {
|
|
2210
|
+
for(sessionId) {
|
|
2211
|
+
const key = String(sessionId ?? "").trim();
|
|
2212
|
+
let store = slots.get(key);
|
|
2213
|
+
if (!store) {
|
|
2214
|
+
store = createFocusStore();
|
|
2215
|
+
slots.set(key, store);
|
|
2216
|
+
}
|
|
2217
|
+
return store;
|
|
2218
|
+
},
|
|
2219
|
+
clear() {
|
|
2220
|
+
slots.clear();
|
|
2221
|
+
},
|
|
2222
|
+
sessionIds() {
|
|
2223
|
+
return [...slots.keys()];
|
|
2224
|
+
}
|
|
2225
|
+
};
|
|
2226
|
+
}
|
|
2227
|
+
/** Process-wide session slots. */
|
|
2228
|
+
const sessionFocusStores = createSessionFocusStores();
|
|
2207
2229
|
/**
|
|
2208
2230
|
* Pull a target id out of a tool result, if it carries one.
|
|
2209
2231
|
*
|
|
@@ -3380,7 +3402,8 @@ function initCastServer(ctx, cfg, bridge, ffmpegManager, openAgentWindow$1 = asy
|
|
|
3380
3402
|
return sendJson(res, 200, {
|
|
3381
3403
|
ok: true,
|
|
3382
3404
|
all: getCliTrackAll(cfg.tabTracking === "all"),
|
|
3383
|
-
setting: cfg.tabTracking
|
|
3405
|
+
setting: cfg.tabTracking,
|
|
3406
|
+
multiSessionWatch: cfg.multiSessionWatch !== false
|
|
3384
3407
|
});
|
|
3385
3408
|
}
|
|
3386
3409
|
});
|
|
@@ -4850,6 +4873,7 @@ const Config$1 = z.object({
|
|
|
4850
4873
|
idleTimeoutMin: z.number().min(0).max(1440).step(1).description("Auto-stop the backing browser after N minutes without an bcdp_* call (0 = off). Relaunches on demand at the next call.").volatile(),
|
|
4851
4874
|
chromePath: z.string().description("Path to Chrome/Chromium. Empty = auto-detect.").volatile(),
|
|
4852
4875
|
captureBackend: backend.description("Capture backend: auto, cdp, or ffmpeg.").volatile(),
|
|
4876
|
+
multiSessionWatch: z.boolean().description("Watch panel follows the tab the CURRENT session last drove (recommended; concurrent sessions each see their own page). Turn off to restore the pre-1.14 behavior where every panel follows the browser foreground tab.").volatile(),
|
|
4853
4877
|
streamProfile: profile.description("Capture quality profile.").volatile(),
|
|
4854
4878
|
cdpFps: z.number().min(5).max(30).step(1).description("CDP preview FPS.").volatile(),
|
|
4855
4879
|
cdpQuality: z.number().min(1).max(100).step(1).description("CDP JPEG quality.").volatile(),
|
|
@@ -5185,6 +5209,7 @@ function resolveConfig(config = {}) {
|
|
|
5185
5209
|
"cdp",
|
|
5186
5210
|
"ffmpeg"
|
|
5187
5211
|
], "auto"),
|
|
5212
|
+
multiSessionWatch: typeof config.multiSessionWatch === "boolean" ? config.multiSessionWatch : true,
|
|
5188
5213
|
streamProfile: selectedProfile,
|
|
5189
5214
|
cdpFps: finiteIn(config.cdpFps, 5, 30) ? config.cdpFps : legacyFps,
|
|
5190
5215
|
cdpQuality: finiteIn(config.cdpQuality, 1, 100) ? config.cdpQuality : finiteIn(config.screencastQuality, 1, 100) ? config.screencastQuality : 55,
|
|
@@ -12022,13 +12047,15 @@ const commonOutputSchema = {
|
|
|
12022
12047
|
/**
|
|
12023
12048
|
* Move the operation focus to whatever tab the tool just reported.
|
|
12024
12049
|
*
|
|
12025
|
-
*
|
|
12026
|
-
*
|
|
12027
|
-
*
|
|
12050
|
+
* #15 — a session id scopes the write into that session's focus slot; a call
|
|
12051
|
+
* with no session (operator paths, old clients) keeps the global store. The
|
|
12052
|
+
* global write stays best-effort exactly as before.
|
|
12028
12053
|
*/
|
|
12029
|
-
function noteToolFocus(value) {
|
|
12054
|
+
function noteToolFocus(value, sessionId) {
|
|
12030
12055
|
const targetId = focusIdFrom(value);
|
|
12031
12056
|
if (targetId === null) return;
|
|
12057
|
+
const sid = typeof sessionId === "string" ? sessionId.trim() : "";
|
|
12058
|
+
if (sid !== "") sessionFocusStores.for(sid).set(targetId, "agent");
|
|
12032
12059
|
pushFocus(targetId, "agent").catch(() => null);
|
|
12033
12060
|
}
|
|
12034
12061
|
function callingSessionId(exec) {
|
|
@@ -12763,13 +12790,13 @@ function defineEgoTool(ctx, cfg, opts) {
|
|
|
12763
12790
|
if (!result$1.ok) throw new Error(recoveredFrom ? `${result$1.error}\n${recoveredFrom}` : result$1.error);
|
|
12764
12791
|
if (result$1.value && typeof result$1.value === "object") result$1.value.recoveredFrom = recoveredFrom;
|
|
12765
12792
|
if (typeof opts.afterExecute === "function") opts.afterExecute(args, result$1.value);
|
|
12766
|
-
noteToolFocus(result$1.value);
|
|
12793
|
+
noteToolFocus(result$1.value, callingSessionId(exec));
|
|
12767
12794
|
return toolPayload(result$1);
|
|
12768
12795
|
}
|
|
12769
12796
|
const result = await runWithStaleSpaceRetry(ctx, cfg, exec, () => opts.buildScript(args));
|
|
12770
12797
|
if (!result.ok) throw new Error(result.error);
|
|
12771
12798
|
if (typeof opts.afterExecute === "function") opts.afterExecute(args, result.value);
|
|
12772
|
-
noteToolFocus(result.value);
|
|
12799
|
+
noteToolFocus(result.value, callingSessionId(exec));
|
|
12773
12800
|
return toolPayload(result);
|
|
12774
12801
|
}),
|
|
12775
12802
|
presentCall: () => ({
|
|
@@ -12876,6 +12903,9 @@ function apply(ctx, config = {}) {
|
|
|
12876
12903
|
get tabTracking() {
|
|
12877
12904
|
return resolveConfig(bridge.source()).tabTracking;
|
|
12878
12905
|
},
|
|
12906
|
+
get multiSessionWatch() {
|
|
12907
|
+
return resolveConfig(bridge.source()).multiSessionWatch;
|
|
12908
|
+
},
|
|
12879
12909
|
get viewportWidth() {
|
|
12880
12910
|
return resolveConfig(bridge.source()).viewportWidth;
|
|
12881
12911
|
},
|
package/locale/pt.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "Navegador do agente",
|
|
4
|
+
"description": "Um navegador de agente visível para o DSH: controla o Chromium compatível com ego embarcado no pacote através de CDP, pode se conectar a um Chrome/Edge/Brave em execução e rotear por egolite, Tabbit ou Lightpanda; 34 ferramentas bcdp_* estruturadas, com apenas a bcdp_status residente por padrão; painel de observação em tempo real com entrada direta, e os canais não-CDP sincronizam quadros por sondagem a cada 3 s."
|
|
5
|
+
}
|
|
6
|
+
}
|