dsh-browser-cdp 1.6.1 → 1.6.2
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 +1 -0
- package/dsh-plugin.json +1 -1
- package/lib/client.js +6 -0
- package/lib/index.js +20 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -173,6 +173,7 @@ dshx list # 应显示:[on] dsh-
|
|
|
173
173
|
- `cdpMode`:`auto` 按激活项(两种类型都行);`remote` **只接受 CDP 端点**,激活项是本机 CLI 时会显式报 `mode-kind-mismatch`;`local` 走受管本地启动器。
|
|
174
174
|
- `remoteEnabled`(远端总开关)**只管远端 CDP**,不影响本机 CLI 连接。
|
|
175
175
|
- `allowLocalFallback` / `localHeadless` / `localUserDataDir` 只作用于 CDP 端点的回落与受管启动。
|
|
176
|
+
- `allowProbeColdStart`(**默认关**):就绪探测**绝不拉起 ego 浏览器**——`--status` 证明浏览器已在跑才做 heredoc 验证,否则跳过,浏览器推迟到首个真实 `bcdp_*` 调用才启动(插件挂载/改设置不再弹浏览器窗口)。打开 = 挂载探测预先验证 SDK harness(可能当场弹出浏览器窗口)。
|
|
176
177
|
|
|
177
178
|
`bcdp_doctor` 会报告当前序列类型计数、CLI 实际解析到的路径与形态,以及(若同机装了旧版 `dsh-ego-browser`)一条共存提示。
|
|
178
179
|
|
package/dsh-plugin.json
CHANGED
package/lib/client.js
CHANGED
|
@@ -1432,6 +1432,12 @@ var FAM_FIELD_GROUPS = [
|
|
|
1432
1432
|
en: ["Allow local fallback in auto mode", "auto may launch a local browser when the activated target is unreachable"],
|
|
1433
1433
|
zh: ["auto 模式允许本地回退", "已激活目标不可达时允许自动拉起本地浏览器"]
|
|
1434
1434
|
},
|
|
1435
|
+
{
|
|
1436
|
+
k: "allowProbeColdStart",
|
|
1437
|
+
kind: "bool",
|
|
1438
|
+
en: ["Allow the probe to launch the browser", "Off (default) = the ego-cli readiness probe never launches the browser: when --status cannot prove it is already up, the heredoc check is skipped and the browser starts on the first real bcdp_* call (no browser window at plugin startup). On = the probe verifies the SDK harness at startup, which may open the browser window"],
|
|
1439
|
+
zh: ["探测允许拉起浏览器", "关(默认)= ego-cli 就绪探测绝不拉起 ego 浏览器:--status 证明浏览器已在跑才做 heredoc 验证,否则跳过,浏览器推迟到首个真实 bcdp_* 调用才启动(插件启动不再弹浏览器窗口);开 = 挂载时预先验证 SDK harness,可能当场弹出浏览器窗口"]
|
|
1440
|
+
},
|
|
1435
1441
|
{
|
|
1436
1442
|
k: "chromePath",
|
|
1437
1443
|
kind: "str",
|
package/lib/index.js
CHANGED
|
@@ -1071,6 +1071,17 @@ async function probeCliLink(input, io) {
|
|
|
1071
1071
|
const parsed = parseCliStatus(mergeCliOutput(statusRun));
|
|
1072
1072
|
if (parsed.ok) running = parsed.running;
|
|
1073
1073
|
}
|
|
1074
|
+
if (input.coldStart === false && running !== true) return {
|
|
1075
|
+
ok: true,
|
|
1076
|
+
code: "",
|
|
1077
|
+
message: "",
|
|
1078
|
+
cliPath,
|
|
1079
|
+
origin: resolve$1.origin,
|
|
1080
|
+
shape,
|
|
1081
|
+
heredocSkipped: true,
|
|
1082
|
+
...running === void 0 ? {} : { running },
|
|
1083
|
+
latencyMs: Math.max(0, io.now() - started)
|
|
1084
|
+
};
|
|
1074
1085
|
const sdkArgs = input.useSdkPath === true && (input.sdkPath ?? "") !== "" ? ["--sdk-path", input.sdkPath] : [];
|
|
1075
1086
|
const script = `console.log(${JSON.stringify(CLI_READY_SENTINEL)}, typeof taskSpaces, typeof browser)\n`;
|
|
1076
1087
|
const runHeredoc = (extra) => io.run({
|
|
@@ -1512,7 +1523,8 @@ async function refreshCliAttach(input, cache, suggested, link, now) {
|
|
|
1512
1523
|
bundled: input.bundledCli ?? "",
|
|
1513
1524
|
useSdkPath: link.useSdkPath === true,
|
|
1514
1525
|
sdkPath: input.sdkPath ?? "",
|
|
1515
|
-
timeoutMs: input.timeoutMs
|
|
1526
|
+
timeoutMs: input.timeoutMs,
|
|
1527
|
+
coldStart: input.cliProbeColdStart
|
|
1516
1528
|
}, io);
|
|
1517
1529
|
if (!probe.ok) return cache.patch({
|
|
1518
1530
|
...base,
|
|
@@ -1530,7 +1542,7 @@ async function refreshCliAttach(input, cache, suggested, link, now) {
|
|
|
1530
1542
|
status: "ready",
|
|
1531
1543
|
endpointSource: coldStart ? "cli-launch" : "cli",
|
|
1532
1544
|
code: "",
|
|
1533
|
-
message: probe.warning ?? (coldStart ? "local ego CLI reachable; the backing browser is not running yet and will start on the first call" : "local ego CLI ready"),
|
|
1545
|
+
message: probe.warning ?? (coldStart ? "local ego CLI reachable; the backing browser is not running yet and will start on the first call" : probe.heredocSkipped === true ? "local ego CLI ready; heredoc probe skipped (allowProbeColdStart off) — the SDK harness check runs with the first call" : "local ego CLI ready"),
|
|
1534
1546
|
cliPath: probe.cliPath,
|
|
1535
1547
|
cliShape: probe.shape,
|
|
1536
1548
|
sdkPath: link.useSdkPath === true && probe.warning === void 0 ? input.sdkPath ?? "" : "",
|
|
@@ -2720,6 +2732,7 @@ const Config$1 = z.object({
|
|
|
2720
2732
|
toolJudge: z.boolean().default(true).description("Judgement tier (5 bcdp_jev_* tools). On still requires a JEV or Laya key: without one they can only answer \"not configured\", so they stay sealed anyway.").volatile(),
|
|
2721
2733
|
localHeadless: z.boolean().description("Run the locally launched browser headless."),
|
|
2722
2734
|
remoteEnabled: z.boolean().description("Master switch for REMOTE attach. Off = the configured target sequence is preserved but inert (nothing probes or connects remotely); flip back on any time. Does not affect cdpMode=local.").volatile(),
|
|
2735
|
+
allowProbeColdStart: z.boolean().description("Allow the ego-cli readiness probe to cold-start the backing browser. Off (default): the probe never launches the browser — when --status cannot prove the browser is already up, the heredoc round-trip is skipped and the browser starts on the first real bcdp_* call instead (no browser window at plugin startup). On: the probe verifies the SDK harness up front, which may launch the browser.").volatile(),
|
|
2723
2736
|
localUserDataDir: z.string().description("Profile dir for the locally launched browser. Empty = managed dir; never point at your daily Chrome profile."),
|
|
2724
2737
|
lightpandaArgs: z.string().description("Extra args appended to a managed `lightpanda serve` argv. --host/--port are managed and cannot be overridden.").volatile(),
|
|
2725
2738
|
castFpsCap: z.number().min(0).max(60).step(1),
|
|
@@ -2990,6 +3003,7 @@ function resolveConfig(config = {}) {
|
|
|
2990
3003
|
localUserDataDir: typeof config.localUserDataDir === "string" ? config.localUserDataDir : "",
|
|
2991
3004
|
lightpandaArgs: trimmed(config.lightpandaArgs),
|
|
2992
3005
|
remoteEnabled: config.remoteEnabled === void 0 ? true : Boolean(config.remoteEnabled),
|
|
3006
|
+
allowProbeColdStart: config.allowProbeColdStart === true || config.allowProbeColdStart === "true",
|
|
2993
3007
|
jevUrl: trimmed(config.jevUrl),
|
|
2994
3008
|
jevKey: trimmed(config.jevKey),
|
|
2995
3009
|
jevModel: trimmed(config.jevModel) === "" ? "jev" : trimmed(config.jevModel),
|
|
@@ -8018,6 +8032,9 @@ function apply(ctx, config = {}) {
|
|
|
8018
8032
|
get lightpandaArgs() {
|
|
8019
8033
|
return resolveConfig(bridge.source()).lightpandaArgs;
|
|
8020
8034
|
},
|
|
8035
|
+
get allowProbeColdStart() {
|
|
8036
|
+
return resolveConfig(bridge.source()).allowProbeColdStart;
|
|
8037
|
+
},
|
|
8021
8038
|
get jevUrl() {
|
|
8022
8039
|
return judgeSettingsOf(resolveConfig(bridge.source())).jevUrl;
|
|
8023
8040
|
},
|
|
@@ -8168,6 +8185,7 @@ function apply(ctx, config = {}) {
|
|
|
8168
8185
|
},
|
|
8169
8186
|
remoteEnabled: resolved.remoteEnabled,
|
|
8170
8187
|
useLauncher: true,
|
|
8188
|
+
cliProbeColdStart: resolved.allowProbeColdStart === true,
|
|
8171
8189
|
lightpandaArgs: resolved.lightpandaArgs,
|
|
8172
8190
|
cliIo: createSubprocessCliIo(ctx.subprocess),
|
|
8173
8191
|
sdkPath: fileURLToPath(new URL("../runtime/ego-browser/dist/out/index.js", import.meta.url)),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-browser-cdp",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "dsh-browser-cdp: DSH browser plugin — attach to a running Chrome/Edge over CDP (no bundled browser needed); structured browser-automation tools (30+ bcdp_*) that drive the vendored ego runtime through ctx.subprocess, plus a realtime watch panel (live SSE screencast + direct mouse interaction + download capture + human-verification notice). Web shell: floating watch panel without dsh-better-sidebar, sidebar tab with it. Headless/TUI hosts: tools-only. [DSH 0.1.7-rc.1 ~ 0.2.1-rc.1 line (exact rc enumeration): declarative settings via Config .volatile() fields; for DSH 0.1.2-rc.1 ~ 0.1.5-rc.3 use the 0.17.x line]",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@deepseek-ai/cosmokit": "^1.8.5",
|
|
85
|
-
"@deepseek-ai/dsh-tools": "
|
|
85
|
+
"@deepseek-ai/dsh-tools": "0.2.1-rc.3",
|
|
86
86
|
"@types/node": "^22.20.1",
|
|
87
87
|
"@types/react": "~18.3.31",
|
|
88
88
|
"@types/ws": "^8.5.10",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"typescript": "^5.9.0",
|
|
92
92
|
"vitest": "^3.2.0",
|
|
93
93
|
"ws": "^8.18.0",
|
|
94
|
-
"@deepseek-ai/dsh-sandbox": "
|
|
94
|
+
"@deepseek-ai/dsh-sandbox": "0.2.1-rc.3"
|
|
95
95
|
},
|
|
96
96
|
"engines": {
|
|
97
97
|
"node": ">=22",
|