dsh-browser-cdp 1.7.9 → 1.7.10
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/bin/cdp-cast-worker.mjs
CHANGED
|
@@ -6300,7 +6300,9 @@ const FULL = {
|
|
|
6300
6300
|
/**
|
|
6301
6301
|
* The capability projection per engine. `chrome` / `unknown` → full
|
|
6302
6302
|
* capabilities (bit-for-bit today's behavior); `lightpanda` → the analysis
|
|
6303
|
-
* (docs/plans/2026-10-04-lightpanda-backend-analysis.md §7) projection
|
|
6303
|
+
* (docs/plans/2026-10-04-lightpanda-backend-analysis.md §7) projection;
|
|
6304
|
+
* `tabbit` → CLI-protocol limitations (no download events, no overlay pick,
|
|
6305
|
+
* no raw CDP screencast through the plugin's usual path).
|
|
6304
6306
|
*/
|
|
6305
6307
|
function capabilitiesFor(engine) {
|
|
6306
6308
|
if (engine === "lightpanda") return {
|
|
@@ -6313,6 +6315,16 @@ function capabilitiesFor(engine) {
|
|
|
6313
6315
|
downloadEvents: false,
|
|
6314
6316
|
browserClose: false
|
|
6315
6317
|
};
|
|
6318
|
+
if (engine === "tabbit") return {
|
|
6319
|
+
engine: "tabbit",
|
|
6320
|
+
screencast: true,
|
|
6321
|
+
overlay: false,
|
|
6322
|
+
bindingCalled: false,
|
|
6323
|
+
imageFormat: "jpeg",
|
|
6324
|
+
loadEvent: true,
|
|
6325
|
+
downloadEvents: false,
|
|
6326
|
+
browserClose: false
|
|
6327
|
+
};
|
|
6316
6328
|
return {
|
|
6317
6329
|
...FULL,
|
|
6318
6330
|
engine
|
|
@@ -6331,7 +6343,10 @@ const BCDP_CDP_ENGINE = "BCDP_CDP_ENGINE";
|
|
|
6331
6343
|
* conservatively break a Chrome endpoint.
|
|
6332
6344
|
*/
|
|
6333
6345
|
function capabilitiesFromEnvValue(value) {
|
|
6334
|
-
|
|
6346
|
+
const v = (value ?? "").trim();
|
|
6347
|
+
if (v === "lightpanda") return capabilitiesFor("lightpanda");
|
|
6348
|
+
if (v === "tabbit") return capabilitiesFor("tabbit");
|
|
6349
|
+
return capabilitiesFor("unknown");
|
|
6335
6350
|
}
|
|
6336
6351
|
|
|
6337
6352
|
//#endregion
|
package/dsh-plugin.json
CHANGED
package/lib/client.js
CHANGED
|
@@ -58,6 +58,8 @@ const MAX_LINKS = 32;
|
|
|
58
58
|
const EGO_CLI_LABEL = "本机 ego CLI";
|
|
59
59
|
/** Lightpanda managed-serve singleton default label — mirrors host `LP_LABEL`. */
|
|
60
60
|
const LP_LABEL = "Lightpanda(受管)";
|
|
61
|
+
/** Tabbit CLI singleton default label — mirrors host `TABBIT_CLI_LABEL`. */
|
|
62
|
+
const TABBIT_CLI_LABEL = "Tabbit 浏览器";
|
|
61
63
|
/** Fresh id, same shape as the host `newTargetId()` (uuid, `t-` fallback). */
|
|
62
64
|
function newLinkId() {
|
|
63
65
|
const cryptoObj = globalThis.crypto;
|
|
@@ -142,6 +144,29 @@ function hasLpLink(links) {
|
|
|
142
144
|
return row.kind === "lightpanda";
|
|
143
145
|
});
|
|
144
146
|
}
|
|
147
|
+
/** Second tabbit-cli anywhere in the array would be silently dropped on read. */
|
|
148
|
+
function hasTabbitLink(links) {
|
|
149
|
+
return links.some(function(row) {
|
|
150
|
+
return row.kind === "tabbit-cli";
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
/** Full-field tabbit-cli row (`cliPath` '' = host auto-resolve chain). */
|
|
154
|
+
function buildTabbitRow(input) {
|
|
155
|
+
const cliPath = trimmed(input.cliPath);
|
|
156
|
+
return {
|
|
157
|
+
kind: "tabbit-cli",
|
|
158
|
+
id: newLinkId(),
|
|
159
|
+
label: trimmed(input.label) || cliPath || TABBIT_CLI_LABEL,
|
|
160
|
+
cliPath,
|
|
161
|
+
enabled: true,
|
|
162
|
+
note: "",
|
|
163
|
+
probeStatus: "unknown",
|
|
164
|
+
probeLatencyMs: 0,
|
|
165
|
+
probeError: "",
|
|
166
|
+
probeCode: "",
|
|
167
|
+
probeAt: 0
|
|
168
|
+
};
|
|
169
|
+
}
|
|
145
170
|
function isFull(links) {
|
|
146
171
|
return links.length >= MAX_LINKS;
|
|
147
172
|
}
|
|
@@ -159,6 +184,10 @@ function addRow(links, row) {
|
|
|
159
184
|
links,
|
|
160
185
|
code: "lightpanda-already-exists"
|
|
161
186
|
};
|
|
187
|
+
if (row.kind === "tabbit-cli" && hasTabbitLink(links)) return {
|
|
188
|
+
links,
|
|
189
|
+
code: "tabbit-cli-already-exists"
|
|
190
|
+
};
|
|
162
191
|
if (links.length >= MAX_LINKS) return {
|
|
163
192
|
links,
|
|
164
193
|
code: "link-limit-reached"
|
|
@@ -584,6 +613,9 @@ var watchEn = {
|
|
|
584
613
|
linksAddCli: "Add local ego CLI",
|
|
585
614
|
linksAddLp: "Add Lightpanda (managed)",
|
|
586
615
|
linksAddLpExists: "The Lightpanda link already exists — local-only, one per machine",
|
|
616
|
+
linksAddTabbit: "Add Tabbit CLI",
|
|
617
|
+
linksAddTabbitExists: "The Tabbit link already exists — local-only, one per machine",
|
|
618
|
+
linksTabbitPathHint: "Empty = auto-detect (%LOCALAPPDATA%\\Tabbit\\LocalAgent\\bin)",
|
|
587
619
|
linksLpPathHint: "Empty = auto (PATH → ~/.local/bin; Windows runs it inside WSL2)",
|
|
588
620
|
linksLpHeadlessHint: "Headless quick-trial engine — no manual fallback (login/captcha). Early in the order = quick trials use it; after the headed kinds (CDP / local Chrome / ego CLI) = backstop first.",
|
|
589
621
|
linksLpRemoteWarn: "Activating a Lightpanda link under cdpMode=remote fails with mode-kind-mismatch",
|
|
@@ -680,6 +712,9 @@ var watchDict = {
|
|
|
680
712
|
linksAddCli: "添加本机 ego CLI",
|
|
681
713
|
linksAddLp: "添加 Lightpanda(受管)",
|
|
682
714
|
linksAddLpExists: "Lightpanda 连接已存在——仅限本机,一台机器只允许一条",
|
|
715
|
+
linksAddTabbit: "添加 Tabbit CLI",
|
|
716
|
+
linksAddTabbitExists: "Tabbit 连接已存在——仅限本机,一台机器只允许一条",
|
|
717
|
+
linksTabbitPathHint: "留空 = 自动检测 (%LOCALAPPDATA%\\Tabbit\\LocalAgent\\bin)",
|
|
683
718
|
linksLpPathHint: "留空 = 自动检测(PATH → ~/.local/bin;Windows 经 WSL2)",
|
|
684
719
|
linksLpHeadlessHint: "无头快速试验引擎:无法人工兜底(登录/验证码)。排前面 = 快速场景优先用它;排在有头类型(CDP/本机 Chrome/ego CLI)后 = 兜底优先。",
|
|
685
720
|
linksLpRemoteWarn: "cdpMode=remote 时激活 Lightpanda 行会报 mode-kind-mismatch",
|
|
@@ -2149,6 +2184,8 @@ function FamLinks(props) {
|
|
|
2149
2184
|
var addCliPath = addCliPathState[0], setAddCliPath = addCliPathState[1];
|
|
2150
2185
|
var addLpPathState = React.useState("");
|
|
2151
2186
|
var addLpPath = addLpPathState[0], setAddLpPath = addLpPathState[1];
|
|
2187
|
+
var addTabbitPathState = React.useState("");
|
|
2188
|
+
var addTabbitPath = addTabbitPathState[0], setAddTabbitPath = addTabbitPathState[1];
|
|
2152
2189
|
var btnStyle = {
|
|
2153
2190
|
font: "inherit",
|
|
2154
2191
|
fontSize: "12px",
|
|
@@ -2237,6 +2274,20 @@ function FamLinks(props) {
|
|
|
2237
2274
|
setAddLpPath("");
|
|
2238
2275
|
setErrText("");
|
|
2239
2276
|
}
|
|
2277
|
+
function addTabbit() {
|
|
2278
|
+
var res = addRow(links, buildTabbitRow({
|
|
2279
|
+
label: "",
|
|
2280
|
+
cliPath: addTabbitPath
|
|
2281
|
+
}));
|
|
2282
|
+
if (res.code) {
|
|
2283
|
+
setErrText(res.code === "link-limit-reached" ? limitText() : wt("linksAddTabbitExists"));
|
|
2284
|
+
return;
|
|
2285
|
+
}
|
|
2286
|
+
writeLinks(res.links);
|
|
2287
|
+
if (activeId === "") commitField(scope, "activeTargetId", res.links[res.links.length - 1].id);
|
|
2288
|
+
setAddTabbitPath("");
|
|
2289
|
+
setErrText("");
|
|
2290
|
+
}
|
|
2240
2291
|
function removeOne(row) {
|
|
2241
2292
|
var res = removeRow(links, row.id);
|
|
2242
2293
|
writeLinks(res.links);
|
|
@@ -2321,6 +2372,7 @@ function FamLinks(props) {
|
|
|
2321
2372
|
} }, wt("linksEmpty")) : links.map(function(row, idx) {
|
|
2322
2373
|
var isCli = row.kind === "ego-cli";
|
|
2323
2374
|
var isLp = row.kind === "lightpanda";
|
|
2375
|
+
var isTabbit = row.kind === "tabbit-cli";
|
|
2324
2376
|
var isActive = row.id !== void 0 && row.id === activeId;
|
|
2325
2377
|
var probeBadge = null;
|
|
2326
2378
|
if (row.probeStatus === "ok" || row.probeStatus === "error") probeBadge = h("span", {
|
|
@@ -2351,7 +2403,7 @@ function FamLinks(props) {
|
|
|
2351
2403
|
onToggle: function(next) {
|
|
2352
2404
|
writeLinks(updateRow(links, row.id, { enabled: next }));
|
|
2353
2405
|
}
|
|
2354
|
-
}), h("span", { style: badgeStyle }, isCli ? "CLI" : isLp ? "LP·无头" : "CDP"), h(FamRowInput, {
|
|
2406
|
+
}), h("span", { style: badgeStyle }, isCli ? "CLI" : isLp ? "LP·无头" : isTabbit ? "TABBIT" : "CDP"), h(FamRowInput, {
|
|
2355
2407
|
v: row.label || "",
|
|
2356
2408
|
writable,
|
|
2357
2409
|
placeholder: wt("linksLabel"),
|
|
@@ -2377,11 +2429,11 @@ function FamLinks(props) {
|
|
|
2377
2429
|
gap: "8px",
|
|
2378
2430
|
flexWrap: "wrap"
|
|
2379
2431
|
} }, h(FamRowInput, {
|
|
2380
|
-
v: (isCli ? row.cliPath : isLp ? row.servePath : row.endpoint) || "",
|
|
2432
|
+
v: (isCli || isTabbit ? row.cliPath : isLp ? row.servePath : row.endpoint) || "",
|
|
2381
2433
|
writable,
|
|
2382
|
-
placeholder: isCli ? wt("linksCliPathHint") : isLp ? wt("linksLpPathHint") : wt("linksEndpointHint"),
|
|
2434
|
+
placeholder: isCli ? wt("linksCliPathHint") : isTabbit ? wt("linksTabbitPathHint") : isLp ? wt("linksLpPathHint") : wt("linksEndpointHint"),
|
|
2383
2435
|
onCommit: function(v) {
|
|
2384
|
-
if (isCli) {
|
|
2436
|
+
if (isCli || isTabbit) {
|
|
2385
2437
|
writeLinks(updateRow(links, row.id, { cliPath: v }));
|
|
2386
2438
|
return;
|
|
2387
2439
|
}
|
|
@@ -2395,7 +2447,7 @@ function FamLinks(props) {
|
|
|
2395
2447
|
}
|
|
2396
2448
|
writeLinks(updateRow(links, row.id, { endpoint: v }));
|
|
2397
2449
|
}
|
|
2398
|
-
}), !isCli && !isLp ? h("button", {
|
|
2450
|
+
}), !isCli && !isLp && !isTabbit ? h("button", {
|
|
2399
2451
|
type: "button",
|
|
2400
2452
|
disabled: !writable || probingId === row.id,
|
|
2401
2453
|
style: btnStyle,
|
|
@@ -2426,11 +2478,11 @@ function FamLinks(props) {
|
|
|
2426
2478
|
onClick: function() {
|
|
2427
2479
|
removeOne(row);
|
|
2428
2480
|
}
|
|
2429
|
-
}, "✕"), (isCli || isLp) && cdpMode === "remote" ? h("span", { style: {
|
|
2481
|
+
}, "✕"), (isCli || isLp || isTabbit) && cdpMode === "remote" ? h("span", { style: {
|
|
2430
2482
|
fontSize: "11px",
|
|
2431
2483
|
color: "#ff9f0a",
|
|
2432
2484
|
flex: "1 1 100%"
|
|
2433
|
-
} }, wt(isCli ? "linksCliRemoteWarn" : "linksLpRemoteWarn")) : null, isLp ? h("span", { style: {
|
|
2485
|
+
} }, wt(isCli || isTabbit ? "linksCliRemoteWarn" : "linksLpRemoteWarn")) : null, isLp ? h("span", { style: {
|
|
2434
2486
|
fontSize: "11px",
|
|
2435
2487
|
color: "var(--dsw-alias-label-tertiary, rgba(127,127,127,.7))",
|
|
2436
2488
|
flex: "1 1 100%"
|
|
@@ -2526,7 +2578,33 @@ function FamLinks(props) {
|
|
|
2526
2578
|
title: hasLpLink(links) ? wt("linksAddLpExists") : isFull(links) ? limitText() : void 0,
|
|
2527
2579
|
style: btnStyle,
|
|
2528
2580
|
onClick: addLp
|
|
2529
|
-
}, wt("linksAddLp"))),
|
|
2581
|
+
}, wt("linksAddLp"))), h("div", { style: {
|
|
2582
|
+
display: "flex",
|
|
2583
|
+
gap: "8px",
|
|
2584
|
+
alignItems: "center",
|
|
2585
|
+
flexWrap: "wrap"
|
|
2586
|
+
} }, h("input", {
|
|
2587
|
+
type: "text",
|
|
2588
|
+
value: addTabbitPath,
|
|
2589
|
+
disabled: !writable || isFull(links) || hasTabbitLink(links),
|
|
2590
|
+
placeholder: wt("linksTabbitPathHint"),
|
|
2591
|
+
style: Object.assign({
|
|
2592
|
+
flex: "1 1 160px",
|
|
2593
|
+
minWidth: 0
|
|
2594
|
+
}, inputStyle),
|
|
2595
|
+
onChange: function(e) {
|
|
2596
|
+
setAddTabbitPath(e.target.value);
|
|
2597
|
+
},
|
|
2598
|
+
onKeyDown: function(e) {
|
|
2599
|
+
if (e.key === "Enter") addTabbit();
|
|
2600
|
+
}
|
|
2601
|
+
}), h("button", {
|
|
2602
|
+
type: "button",
|
|
2603
|
+
disabled: !writable || isFull(links) || hasTabbitLink(links),
|
|
2604
|
+
title: hasTabbitLink(links) ? wt("linksAddTabbitExists") : isFull(links) ? limitText() : void 0,
|
|
2605
|
+
style: btnStyle,
|
|
2606
|
+
onClick: addTabbit
|
|
2607
|
+
}, wt("linksAddTabbit"))), errText ? h("div", { style: {
|
|
2530
2608
|
fontSize: "11px",
|
|
2531
2609
|
color: "#ff453a"
|
|
2532
2610
|
} }, errText) : null));
|