dsh-browser-cdp 0.18.19 → 1.1.5
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 +29 -0
- package/THIRD_PARTY_NOTICES.md +13 -0
- package/bin/cdp-cast-worker.mjs +93 -11
- package/dsh-plugin.json +148 -148
- package/lib/client.js +296 -25
- package/lib/index.js +542 -61
- package/lib/{launcher-DBaxfIsF.js → launcher-BadIUjAx.js} +160 -28
- package/lib/launcher-h0Ca5NV1.js +3 -0
- package/package.json +27 -15
- package/lib/launcher-CQyI8-By.js +0 -3
package/README.md
CHANGED
|
@@ -172,6 +172,35 @@ dshx list # 应显示:[on] dsh-
|
|
|
172
172
|
|
|
173
173
|
`bcdp_doctor` 会报告当前序列类型计数、CLI 实际解析到的路径与形态,以及(若同机装了上游 `dsh-ego-browser`)一条共存提示。
|
|
174
174
|
|
|
175
|
+
## Lightpanda 后端(可选引擎,beta)
|
|
176
|
+
|
|
177
|
+
[Lightpanda](https://lightpanda.io) 是面向 AI 的无头文本渲染浏览器(AGPL-3.0,本插件仅作 CDP 客户端使用)。它对插件来说就是一个**普通 CDP 端点**:设置面板添加并激活后,probe 会从 `/json/version` 的 `Browser: Lightpanda/…` **自动识别引擎**,badge 与 `bcdp_doctor` 显示 engine,能力降级自动生效(无需任何配置)。
|
|
178
|
+
|
|
179
|
+
### 分系统安装
|
|
180
|
+
|
|
181
|
+
| 系统 | 方式 |
|
|
182
|
+
|---|---|
|
|
183
|
+
| **Linux**(建议本机直装测试) | `curl -fsSL https://pkg.lightpanda.io/install.sh \| bash`(装入 `~/.local/bin`,确保 PATH 含它)→ `lightpanda serve --host 127.0.0.1 --port 9222` |
|
|
184
|
+
| **macOS**(建议本机直装测试) | 同上一键脚本(aarch64)→ 同 serve 命令 |
|
|
185
|
+
| **Windows**(内置方案 = WSL2,无原生版) | 管理员 PowerShell `wsl --install` → 重启 → `wsl --install -d Ubuntu` → WSL 内同 Linux 一键脚本 → WSL 内 `lightpanda serve …`;WSL2 自动把端口映射到 Windows localhost(**二进制只存在于 WSL 内,宿主侧没有文件,属预期**) |
|
|
186
|
+
| **Docker(备选)** | `docker run -d --name lightpanda -p 127.0.0.1:9222:9222 lightpanda/browser:nightly` |
|
|
187
|
+
|
|
188
|
+
装好后在本插件设置面板添加 CDP 端点 `http://127.0.0.1:9222` 并激活即可。可选:`export LIGHTPANDA_DISABLE_TELEMETRY=true` 关遥测。
|
|
189
|
+
|
|
190
|
+
### 能力降级矩阵(识别后自动生效)
|
|
191
|
+
|
|
192
|
+
| 能力 | Lightpanda 上的行为 |
|
|
193
|
+
|---|---|
|
|
194
|
+
| 导航 / JS / 点击 / 填表 / 键鼠 / 快照(AX 树)/ HTTP / 登录导入 / 等待族 | **无损可用** |
|
|
195
|
+
| `bcdp_screenshot` | PNG **文本级渲染**(无像素引擎,视觉保真低于 Chrome;runtime 本就发 png,零改动兼容) |
|
|
196
|
+
| jev 视觉链(`bcdp_jev_frame` 等) | 投影自动改发 PNG;输出带 `engine` / `rendering: text` 元数据 |
|
|
197
|
+
| 观察窗实时画面 | **关闭**——无 screencast 且无窗口,worker 不启动采集循环,面板显示降级提示 |
|
|
198
|
+
| 面板点选(inspect 路径) | **关闭**——无 Overlay 域 / bindingCalled 事件,返回 `engine-unsupported`(i18n);坐标回退路径保留 |
|
|
199
|
+
| `bcdp_download` | **关闭**——无 Page 下载事件,调用即返回结构化错误(不会挂起超时) |
|
|
200
|
+
| `bcdp_auth_flush` | 返回 `degraded: true`——引擎无 `Storage.flushCookies`,cookie 仅随引擎进程存活 |
|
|
201
|
+
|
|
202
|
+
识别失败的端点(`engine: unknown`)保持**全能力**——误判只应"少给",不应"错给"。
|
|
203
|
+
|
|
175
204
|
## 工具清单(38 个,前缀 `bcdp_`,完整索引见 `bcdp_help`)
|
|
176
205
|
|
|
177
206
|
| 类别 | 工具 |
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -37,6 +37,19 @@ Additional local modifications on top of upstream (see `runtime/ego-linux/src/ch
|
|
|
37
37
|
launched Chrome, so the agent browser can reach the network through a local proxy
|
|
38
38
|
without hijacking the CLI's own loopback CDP traffic.
|
|
39
39
|
|
|
40
|
+
## Lightpanda notice (optional backend)
|
|
41
|
+
|
|
42
|
+
[Lightpanda](https://lightpanda.io) (https://github.com/lightpanda-io/browser) is an
|
|
43
|
+
**optional** third-party browser engine the user may run themselves (native Linux/macOS
|
|
44
|
+
binary, WSL2, or Docker). This plugin uses it strictly over its CDP network protocol as
|
|
45
|
+
a CLIENT — no Lightpanda code is vendored, linked, aggregated, or distributed with this
|
|
46
|
+
plugin, and the user installs the binary independently. Under AGPL-3.0 this client-over-
|
|
47
|
+
network use does not create a combined work; this plugin remains MIT. Users and
|
|
48
|
+
distributors of Lightpanda itself must comply with its AGPL-3.0 license
|
|
49
|
+
(https://www.gnu.org/licenses/agpl-3.0.html). Telemetry of the Lightpanda binary is
|
|
50
|
+
opt-out via `LIGHTPANDA_DISABLE_TELEMETRY=true` (set automatically for plugin-managed
|
|
51
|
+
launches).
|
|
52
|
+
|
|
40
53
|
MIT License (as provided by the upstream project):
|
|
41
54
|
|
|
42
55
|
MIT License
|
package/bin/cdp-cast-worker.mjs
CHANGED
|
@@ -3832,6 +3832,7 @@ var CdpCaptureBackend = class {
|
|
|
3832
3832
|
getConfig;
|
|
3833
3833
|
onStatus;
|
|
3834
3834
|
onJpegFrame;
|
|
3835
|
+
imageFormat;
|
|
3835
3836
|
now;
|
|
3836
3837
|
setTimer;
|
|
3837
3838
|
clearTimer;
|
|
@@ -3843,12 +3844,13 @@ var CdpCaptureBackend = class {
|
|
|
3843
3844
|
metrics;
|
|
3844
3845
|
offFrame;
|
|
3845
3846
|
offDestroyed;
|
|
3846
|
-
constructor({ cdp, sessions, getConfig, onStatus, onJpegFrame, now = Date.now, setTimer = setTimeout, clearTimer = clearTimeout }) {
|
|
3847
|
+
constructor({ cdp, sessions, getConfig, onStatus, onJpegFrame, imageFormat = "jpeg", now = Date.now, setTimer = setTimeout, clearTimer = clearTimeout }) {
|
|
3847
3848
|
this.cdp = cdp;
|
|
3848
3849
|
this.sessions = sessions;
|
|
3849
3850
|
this.getConfig = getConfig;
|
|
3850
3851
|
this.onStatus = onStatus;
|
|
3851
3852
|
this.onJpegFrame = onJpegFrame;
|
|
3853
|
+
this.imageFormat = imageFormat;
|
|
3852
3854
|
this.now = now;
|
|
3853
3855
|
this.setTimer = setTimer;
|
|
3854
3856
|
this.clearTimer = clearTimer;
|
|
@@ -3892,8 +3894,8 @@ var CdpCaptureBackend = class {
|
|
|
3892
3894
|
});
|
|
3893
3895
|
try {
|
|
3894
3896
|
await this.cdp.call("Page.startScreencast", {
|
|
3895
|
-
format:
|
|
3896
|
-
quality: config.cdpQuality,
|
|
3897
|
+
format: this.imageFormat,
|
|
3898
|
+
...this.imageFormat === "jpeg" ? { quality: config.cdpQuality } : {},
|
|
3897
3899
|
maxWidth: config.cdpMaxWidth,
|
|
3898
3900
|
everyNthFrame: 1
|
|
3899
3901
|
}, session.sessionId);
|
|
@@ -4016,8 +4018,8 @@ var CdpCaptureBackend = class {
|
|
|
4016
4018
|
const session = await this.sessions.updateViewport(current.targetId);
|
|
4017
4019
|
const scale = session.viewportW > this.getConfig().cdpMaxWidth ? this.getConfig().cdpMaxWidth / session.viewportW : 1;
|
|
4018
4020
|
const result = await this.cdp.call("Page.captureScreenshot", {
|
|
4019
|
-
format:
|
|
4020
|
-
quality: this.getConfig().cdpQuality,
|
|
4021
|
+
format: this.imageFormat,
|
|
4022
|
+
...this.imageFormat === "jpeg" ? { quality: this.getConfig().cdpQuality } : {},
|
|
4021
4023
|
captureBeyondViewport: false,
|
|
4022
4024
|
...session.viewportW && session.viewportH ? { clip: {
|
|
4023
4025
|
x: 0,
|
|
@@ -4047,6 +4049,7 @@ var CaptureManager = class {
|
|
|
4047
4049
|
backendFactories;
|
|
4048
4050
|
getConfig;
|
|
4049
4051
|
onStatus;
|
|
4052
|
+
screencastSupported;
|
|
4050
4053
|
now;
|
|
4051
4054
|
setTimer;
|
|
4052
4055
|
clearTimer;
|
|
@@ -4061,10 +4064,11 @@ var CaptureManager = class {
|
|
|
4061
4064
|
transition;
|
|
4062
4065
|
stopTimer;
|
|
4063
4066
|
sweepTimer;
|
|
4064
|
-
constructor({ backendFactories, getConfig, onStatus, now = Date.now, setTimer = setTimeout, clearTimer = clearTimeout, leaseTtlMs = 12e4, idleGraceMs = 1500 }) {
|
|
4067
|
+
constructor({ backendFactories, getConfig, onStatus, screencastSupported = true, now = Date.now, setTimer = setTimeout, clearTimer = clearTimeout, leaseTtlMs = 12e4, idleGraceMs = 1500 }) {
|
|
4065
4068
|
this.backendFactories = backendFactories;
|
|
4066
4069
|
this.getConfig = getConfig;
|
|
4067
4070
|
this.onStatus = onStatus;
|
|
4071
|
+
this.screencastSupported = screencastSupported;
|
|
4068
4072
|
this.now = now;
|
|
4069
4073
|
this.setTimer = setTimer;
|
|
4070
4074
|
this.clearTimer = clearTimer;
|
|
@@ -4084,7 +4088,8 @@ var CaptureManager = class {
|
|
|
4084
4088
|
...fallbackReason ? {
|
|
4085
4089
|
code: "ffmpeg-fallback-cdp",
|
|
4086
4090
|
message: fallbackReason
|
|
4087
|
-
} : {}
|
|
4091
|
+
} : {},
|
|
4092
|
+
...screencastSupported ? {} : { engineUnsupported: true }
|
|
4088
4093
|
};
|
|
4089
4094
|
this.transition = Promise.resolve();
|
|
4090
4095
|
this.stopTimer = null;
|
|
@@ -4169,6 +4174,18 @@ var CaptureManager = class {
|
|
|
4169
4174
|
}
|
|
4170
4175
|
async #activate(backendName, targetId, force = false) {
|
|
4171
4176
|
if (!force && this.backend && this.backendName === backendName && this.targetId === targetId) return;
|
|
4177
|
+
if (!this.screencastSupported) {
|
|
4178
|
+
await this.#stopBackend("engine-unsupported");
|
|
4179
|
+
this.#setStatus({
|
|
4180
|
+
backend: backendName,
|
|
4181
|
+
state: "unsupported",
|
|
4182
|
+
targetId,
|
|
4183
|
+
code: "engine-unsupported",
|
|
4184
|
+
message: "the attached engine cannot capture frames (no screencast, no window)",
|
|
4185
|
+
engineUnsupported: true
|
|
4186
|
+
});
|
|
4187
|
+
return;
|
|
4188
|
+
}
|
|
4172
4189
|
await this.#stopBackend("backend-change");
|
|
4173
4190
|
const factory = this.backendFactories[backendName];
|
|
4174
4191
|
if (!factory) {
|
|
@@ -6257,9 +6274,64 @@ async function captureMarked(call, sessionId, options = {}) {
|
|
|
6257
6274
|
};
|
|
6258
6275
|
}
|
|
6259
6276
|
|
|
6277
|
+
//#endregion
|
|
6278
|
+
//#region src/cdp/capabilities.ts
|
|
6279
|
+
const FULL = {
|
|
6280
|
+
engine: "chrome",
|
|
6281
|
+
screencast: true,
|
|
6282
|
+
overlay: true,
|
|
6283
|
+
bindingCalled: true,
|
|
6284
|
+
imageFormat: "jpeg",
|
|
6285
|
+
loadEvent: true,
|
|
6286
|
+
downloadEvents: true,
|
|
6287
|
+
browserClose: true
|
|
6288
|
+
};
|
|
6289
|
+
/**
|
|
6290
|
+
* The capability projection per engine. `chrome` / `unknown` → full
|
|
6291
|
+
* capabilities (bit-for-bit today's behavior); `lightpanda` → the analysis
|
|
6292
|
+
* (docs/plans/2026-10-04-lightpanda-backend-analysis.md §7) projection.
|
|
6293
|
+
*/
|
|
6294
|
+
function capabilitiesFor(engine) {
|
|
6295
|
+
if (engine === "lightpanda") return {
|
|
6296
|
+
engine: "lightpanda",
|
|
6297
|
+
screencast: false,
|
|
6298
|
+
overlay: false,
|
|
6299
|
+
bindingCalled: false,
|
|
6300
|
+
imageFormat: "png",
|
|
6301
|
+
loadEvent: false,
|
|
6302
|
+
downloadEvents: false,
|
|
6303
|
+
browserClose: false
|
|
6304
|
+
};
|
|
6305
|
+
return {
|
|
6306
|
+
...FULL,
|
|
6307
|
+
engine
|
|
6308
|
+
};
|
|
6309
|
+
}
|
|
6310
|
+
/**
|
|
6311
|
+
* Env key the host half sets when spawning the cast / render workers
|
|
6312
|
+
* (mirrors `EGO_LINUX_CDP_URL`'s injection pattern in cast-server). The child
|
|
6313
|
+
* processes cannot see the host's attach cache, so the projected engine id
|
|
6314
|
+
* travels as data — the host decides once, children only read.
|
|
6315
|
+
*/
|
|
6316
|
+
const BCDP_CDP_ENGINE = "BCDP_CDP_ENGINE";
|
|
6317
|
+
/**
|
|
6318
|
+
* Project capabilities from the spawn-env value. Anything absent or
|
|
6319
|
+
* unrecognized means FULL capabilities — an unknown engine must never
|
|
6320
|
+
* conservatively break a Chrome endpoint.
|
|
6321
|
+
*/
|
|
6322
|
+
function capabilitiesFromEnvValue(value) {
|
|
6323
|
+
return capabilitiesFor(value !== void 0 && value.trim() === "lightpanda" ? "lightpanda" : "unknown");
|
|
6324
|
+
}
|
|
6325
|
+
|
|
6260
6326
|
//#endregion
|
|
6261
6327
|
//#region src/worker/cdp-cast-worker.ts
|
|
6262
6328
|
const SENTINEL = "@@DSH_RESULT@@";
|
|
6329
|
+
/**
|
|
6330
|
+
* Lightpanda backend — capability projection for THIS connection. The host
|
|
6331
|
+
* decides once (probe → attach cache → spawn env); the worker only reads.
|
|
6332
|
+
* Absent env = full capabilities = pre-Lightpanda behavior.
|
|
6333
|
+
*/
|
|
6334
|
+
const CAPS = capabilitiesFromEnvValue(process.env[BCDP_CDP_ENGINE]);
|
|
6263
6335
|
const HOME = homedir() || process.env.HOME || process.env.USERPROFILE || "/root";
|
|
6264
6336
|
const IS_WIN = platform() === "win32";
|
|
6265
6337
|
const STATE_HOME = IS_WIN ? process.env.LOCALAPPDATA || join(HOME, "AppData", "Local") : process.env.XDG_STATE_HOME || join(HOME, ".local", "state");
|
|
@@ -6442,7 +6514,10 @@ function publishJpeg(frame) {
|
|
|
6442
6514
|
viewportH: frame.vh
|
|
6443
6515
|
});
|
|
6444
6516
|
while (frameCache.size > 30) frameCache.delete(frameCache.keys().next().value);
|
|
6445
|
-
broadcast("frame", frame
|
|
6517
|
+
broadcast("frame", frame.data !== void 0 && CAPS.imageFormat === "png" ? {
|
|
6518
|
+
...frame,
|
|
6519
|
+
fmt: "png"
|
|
6520
|
+
} : frame);
|
|
6446
6521
|
}
|
|
6447
6522
|
function publishVideoInit(event) {
|
|
6448
6523
|
videoInit = {
|
|
@@ -6490,6 +6565,7 @@ function endVideo({ generation } = {}) {
|
|
|
6490
6565
|
const manager = new CaptureManager({
|
|
6491
6566
|
getConfig: () => castConfig,
|
|
6492
6567
|
onStatus: publishStatus,
|
|
6568
|
+
screencastSupported: CAPS.screencast,
|
|
6493
6569
|
backendFactories: {
|
|
6494
6570
|
cdp: ({ onStatus }) => {
|
|
6495
6571
|
if (!active) throw new Error("no live browser");
|
|
@@ -6498,7 +6574,8 @@ const manager = new CaptureManager({
|
|
|
6498
6574
|
sessions: active.sessions,
|
|
6499
6575
|
getConfig: () => castConfig,
|
|
6500
6576
|
onStatus,
|
|
6501
|
-
onJpegFrame: publishJpeg
|
|
6577
|
+
onJpegFrame: publishJpeg,
|
|
6578
|
+
imageFormat: CAPS.imageFormat
|
|
6502
6579
|
});
|
|
6503
6580
|
},
|
|
6504
6581
|
ffmpeg: ({ generation, onStatus }) => {
|
|
@@ -6777,6 +6854,11 @@ async function main() {
|
|
|
6777
6854
|
code: "browser-disconnected",
|
|
6778
6855
|
error: "no live browser"
|
|
6779
6856
|
});
|
|
6857
|
+
if (body.enabled === true && (!CAPS.overlay || !CAPS.bindingCalled)) return sendJson(res, 503, {
|
|
6858
|
+
ok: false,
|
|
6859
|
+
code: "engine-unsupported",
|
|
6860
|
+
error: "this engine does not support Overlay-based picking"
|
|
6861
|
+
});
|
|
6780
6862
|
const channel = ensurePickChannel();
|
|
6781
6863
|
if (channel === null) return sendJson(res, 409, {
|
|
6782
6864
|
ok: false,
|
|
@@ -6875,8 +6957,8 @@ async function main() {
|
|
|
6875
6957
|
limit: typeof body.limit === "number" ? body.limit : 20,
|
|
6876
6958
|
highlightIndex: typeof body.highlightIndex === "number" ? body.highlightIndex : void 0,
|
|
6877
6959
|
measureRects: body.measureRects !== false,
|
|
6878
|
-
format: body.format === "jpeg" ? "jpeg" : "png",
|
|
6879
|
-
quality: typeof body.quality === "number" ? body.quality : void 0,
|
|
6960
|
+
format: CAPS.imageFormat === "png" ? "png" : body.format === "jpeg" ? "jpeg" : "png",
|
|
6961
|
+
quality: CAPS.imageFormat === "png" ? void 0 : typeof body.quality === "number" ? body.quality : void 0,
|
|
6880
6962
|
timeoutMs: 15e3
|
|
6881
6963
|
});
|
|
6882
6964
|
return sendJson(res, result.ok ? 200 : 502, result);
|
package/dsh-plugin.json
CHANGED
|
@@ -1,148 +1,148 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://dsh.community/schemas/dsh-plugin-0.15.json",
|
|
3
|
-
"id": "dsh-browser-cdp",
|
|
4
|
-
"name": "dsh-browser-cdp",
|
|
5
|
-
"version": "
|
|
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
|
-
"apiVersion": "tui.dsh/v1alpha1",
|
|
48
|
-
"kind": "SettingsSection",
|
|
49
|
-
"id": "dsh-browser-cdp.settings",
|
|
50
|
-
"name": "dsh_browser_cdp_settings",
|
|
51
|
-
"spec": {
|
|
52
|
-
"namespace": "dsh-browser-cdp",
|
|
53
|
-
"title": "Agent 浏览器",
|
|
54
|
-
"titles": {
|
|
55
|
-
"en": "Agent Browser",
|
|
56
|
-
"zh": "Agent 浏览器"
|
|
57
|
-
},
|
|
58
|
-
"fields": [
|
|
59
|
-
{
|
|
60
|
-
"path": [
|
|
61
|
-
"isolateSpaces"
|
|
62
|
-
],
|
|
63
|
-
"label": "任务空间沙盒隔离 (Space isolation)",
|
|
64
|
-
"kind": "boolean",
|
|
65
|
-
"hint": "默认关闭:使用磁盘持久化 Profile,任务中登录的账号跨电脑重启永久保留;开启后使用内存临时沙盒隔离,任务结束不落盘。"
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
"path": [
|
|
69
|
-
"idleTimeoutMin"
|
|
70
|
-
],
|
|
71
|
-
"label": "空闲自动回收 (Idle auto-stop, minutes)",
|
|
72
|
-
"kind": "number",
|
|
73
|
-
"hint": "N 分钟没有任何 bcdp_* 调用后自动关闭后台浏览器进程(0 = 关闭此功能)。下次调用会自动冷启动(约 2-4 秒)。观察窗正在观看不算活动。"
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
"path": [
|
|
77
|
-
"chromePath"
|
|
78
|
-
],
|
|
79
|
-
"label": "Browser binary path",
|
|
80
|
-
"kind": "text",
|
|
81
|
-
"hint": "Path to the Chrome/Chromium/Edge binary. Empty = auto-detect."
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
"path": [
|
|
85
|
-
"captureBackend"
|
|
86
|
-
],
|
|
87
|
-
"label": "Capture backend",
|
|
88
|
-
"kind": "select",
|
|
89
|
-
"options": [
|
|
90
|
-
{
|
|
91
|
-
"value": "auto",
|
|
92
|
-
"label": "Auto"
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"value": "cdp",
|
|
96
|
-
"label": "CDP"
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
"value": "ffmpeg",
|
|
100
|
-
"label": "FFmpeg"
|
|
101
|
-
}
|
|
102
|
-
]
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
"path": [
|
|
106
|
-
"streamProfile"
|
|
107
|
-
],
|
|
108
|
-
"label": "Quality profile",
|
|
109
|
-
"kind": "select",
|
|
110
|
-
"options": [
|
|
111
|
-
{
|
|
112
|
-
"value": "balanced",
|
|
113
|
-
"label": "Balanced"
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
"value": "quality",
|
|
117
|
-
"label": "Quality"
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
"value": "speed",
|
|
121
|
-
"label": "Speed"
|
|
122
|
-
}
|
|
123
|
-
]
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
"path": [
|
|
127
|
-
"ffmpegPath"
|
|
128
|
-
],
|
|
129
|
-
"label": "FFmpeg binary path",
|
|
130
|
-
"kind": "text",
|
|
131
|
-
"hint": "Path to ffmpeg. Empty = auto-detect / on-demand install."
|
|
132
|
-
}
|
|
133
|
-
]
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
]
|
|
137
|
-
},
|
|
138
|
-
"subscriptions": [],
|
|
139
|
-
"license": "MIT",
|
|
140
|
-
"source": {
|
|
141
|
-
"repository": "https://github.com/drscrewdriver/dsh-browser-cdp"
|
|
142
|
-
},
|
|
143
|
-
"compat": {
|
|
144
|
-
"hosts": [
|
|
145
|
-
"dsh-tui"
|
|
146
|
-
]
|
|
147
|
-
}
|
|
148
|
-
}
|
|
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.1.3",
|
|
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
|
+
"apiVersion": "tui.dsh/v1alpha1",
|
|
48
|
+
"kind": "SettingsSection",
|
|
49
|
+
"id": "dsh-browser-cdp.settings",
|
|
50
|
+
"name": "dsh_browser_cdp_settings",
|
|
51
|
+
"spec": {
|
|
52
|
+
"namespace": "dsh-browser-cdp",
|
|
53
|
+
"title": "Agent 浏览器",
|
|
54
|
+
"titles": {
|
|
55
|
+
"en": "Agent Browser",
|
|
56
|
+
"zh": "Agent 浏览器"
|
|
57
|
+
},
|
|
58
|
+
"fields": [
|
|
59
|
+
{
|
|
60
|
+
"path": [
|
|
61
|
+
"isolateSpaces"
|
|
62
|
+
],
|
|
63
|
+
"label": "任务空间沙盒隔离 (Space isolation)",
|
|
64
|
+
"kind": "boolean",
|
|
65
|
+
"hint": "默认关闭:使用磁盘持久化 Profile,任务中登录的账号跨电脑重启永久保留;开启后使用内存临时沙盒隔离,任务结束不落盘。"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"path": [
|
|
69
|
+
"idleTimeoutMin"
|
|
70
|
+
],
|
|
71
|
+
"label": "空闲自动回收 (Idle auto-stop, minutes)",
|
|
72
|
+
"kind": "number",
|
|
73
|
+
"hint": "N 分钟没有任何 bcdp_* 调用后自动关闭后台浏览器进程(0 = 关闭此功能)。下次调用会自动冷启动(约 2-4 秒)。观察窗正在观看不算活动。"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"path": [
|
|
77
|
+
"chromePath"
|
|
78
|
+
],
|
|
79
|
+
"label": "Browser binary path",
|
|
80
|
+
"kind": "text",
|
|
81
|
+
"hint": "Path to the Chrome/Chromium/Edge binary. Empty = auto-detect."
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"path": [
|
|
85
|
+
"captureBackend"
|
|
86
|
+
],
|
|
87
|
+
"label": "Capture backend",
|
|
88
|
+
"kind": "select",
|
|
89
|
+
"options": [
|
|
90
|
+
{
|
|
91
|
+
"value": "auto",
|
|
92
|
+
"label": "Auto"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"value": "cdp",
|
|
96
|
+
"label": "CDP"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"value": "ffmpeg",
|
|
100
|
+
"label": "FFmpeg"
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"path": [
|
|
106
|
+
"streamProfile"
|
|
107
|
+
],
|
|
108
|
+
"label": "Quality profile",
|
|
109
|
+
"kind": "select",
|
|
110
|
+
"options": [
|
|
111
|
+
{
|
|
112
|
+
"value": "balanced",
|
|
113
|
+
"label": "Balanced"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"value": "quality",
|
|
117
|
+
"label": "Quality"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"value": "speed",
|
|
121
|
+
"label": "Speed"
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"path": [
|
|
127
|
+
"ffmpegPath"
|
|
128
|
+
],
|
|
129
|
+
"label": "FFmpeg binary path",
|
|
130
|
+
"kind": "text",
|
|
131
|
+
"hint": "Path to ffmpeg. Empty = auto-detect / on-demand install."
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
"subscriptions": [],
|
|
139
|
+
"license": "MIT",
|
|
140
|
+
"source": {
|
|
141
|
+
"repository": "https://github.com/drscrewdriver/dsh-browser-cdp"
|
|
142
|
+
},
|
|
143
|
+
"compat": {
|
|
144
|
+
"hosts": [
|
|
145
|
+
"dsh-tui"
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
}
|