dsh-browser-cdp 0.18.13 → 0.18.14
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/dsh-plugin.json +1 -1
- package/lib/client.js +15 -69
- package/package.json +1 -1
package/dsh-plugin.json
CHANGED
package/lib/client.js
CHANGED
|
@@ -3103,6 +3103,13 @@ var TAB_CSS = `
|
|
|
3103
3103
|
* {"cdpEndpoint":..., "targetId":..., "pageUrl":..., "elements":[{n,backendNodeId,tag,id,name,focusable,describe}]}
|
|
3104
3104
|
* [/CDP-PICKS]
|
|
3105
3105
|
*/
|
|
3106
|
+
function injectPickCardStyles() {
|
|
3107
|
+
if (document.getElementById("dsh-cdp-picks-styles") !== null) return;
|
|
3108
|
+
var style = document.createElement("style");
|
|
3109
|
+
style.id = "dsh-cdp-picks-styles";
|
|
3110
|
+
style.textContent = "[data-dsh-cdp-picks-card] {\n box-sizing: border-box; flex: none;\n display: grid; gap: 4px; padding: 8px 10px;\n font: inherit; font-size: 12px;\n color: #1d1d1f; background: #f7f7f9;\n border: 1px solid rgba(0, 0, 0, 0.16); border-radius: 12px;\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);\n /* input-traffic 同款限宽:卡宽被限制在内容列(拖动范围)内,两侧留出\n clearance,永不顶满整窗 */\n width: min(\n calc(100% - var(--dsh-composer-side-clearance, 16px) - var(--dsh-composer-side-clearance, 16px) - var(--dsh-composer-dock-inset, 8px) - var(--dsh-composer-dock-inset, 8px)),\n calc(var(--dsh-chat-content-width, 100%) - var(--dsh-composer-dock-inset, 8px) - var(--dsh-composer-dock-inset, 8px))\n );\n overflow-y: auto; max-height: 40vh;\n}\n@media (prefers-color-scheme: dark) {\n [data-dsh-cdp-picks-card] { color: #f2f2f7; background: #1c1c1e; border-color: rgba(255, 255, 255, 0.18); }\n}\n[data-dsh-cdp-picks-card] .dsh-cdp-picks-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }\n[data-dsh-cdp-picks-card] .dsh-cdp-picks-sub { font-size: 11px; color: rgba(60, 60, 67, 0.62); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }\n[data-dsh-cdp-picks-card] .dsh-cdp-picks-chip { display: flex; align-items: baseline; gap: 6px; padding: 3px 8px; background: rgba(120, 120, 128, 0.12); border: 1px solid rgba(0, 0, 0, 0.1); border-radius: 8px; min-width: 0; }\n[data-dsh-cdp-picks-card] .dsh-cdp-picks-num { font-weight: 700; flex: none; color: rgba(60, 60, 67, 0.62); }\n[data-dsh-cdp-picks-card] .dsh-cdp-picks-tag { font-weight: 600; flex: none; }\n[data-dsh-cdp-picks-card] .dsh-cdp-picks-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }\n[data-dsh-cdp-picks-card] .dsh-cdp-picks-close { margin-left: auto; flex: none; font: inherit; font-size: 12px; cursor: pointer; border: none; background: none; color: rgba(60, 60, 67, 0.62); padding: 0 2px; border-radius: 6px; }\n[data-dsh-cdp-picks-card] .dsh-cdp-picks-close:hover { background: rgba(120, 120, 128, 0.18); }\n@media (prefers-color-scheme: dark) {\n [data-dsh-cdp-picks-card] .dsh-cdp-picks-sub { color: rgba(235, 235, 245, 0.62); }\n [data-dsh-cdp-picks-card] .dsh-cdp-picks-chip { background: rgba(120, 120, 128, 0.24); border-color: rgba(255, 255, 255, 0.12); }\n [data-dsh-cdp-picks-card] .dsh-cdp-picks-num { color: rgba(235, 235, 245, 0.62); }\n [data-dsh-cdp-picks-card] .dsh-cdp-picks-close { color: rgba(235, 235, 245, 0.62); }\n [data-dsh-cdp-picks-card] .dsh-cdp-picks-close:hover { background: rgba(120, 120, 128, 0.3); }\n}";
|
|
3111
|
+
document.head.appendChild(style);
|
|
3112
|
+
}
|
|
3106
3113
|
function CdpPicksDockCard(props) {
|
|
3107
3114
|
var input = props.input;
|
|
3108
3115
|
var h = React.createElement;
|
|
@@ -3166,68 +3173,6 @@ function CdpPicksDockCard(props) {
|
|
|
3166
3173
|
next = next.replace(/^\s*\n+/, "").replace(/\n+\s*$/, "");
|
|
3167
3174
|
input.setDraft(next);
|
|
3168
3175
|
}
|
|
3169
|
-
var cardStyle = {
|
|
3170
|
-
display: "grid",
|
|
3171
|
-
gap: "4px",
|
|
3172
|
-
padding: "8px 10px",
|
|
3173
|
-
font: "inherit",
|
|
3174
|
-
fontSize: "12px",
|
|
3175
|
-
color: "var(--dsw-alias-label-primary, inherit)",
|
|
3176
|
-
background: "var(--dsw-alias-bg-surface, rgba(127,127,127,.14))",
|
|
3177
|
-
border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.35))",
|
|
3178
|
-
borderRadius: "12px",
|
|
3179
|
-
boxSizing: "border-box"
|
|
3180
|
-
};
|
|
3181
|
-
var headStyle = {
|
|
3182
|
-
display: "flex",
|
|
3183
|
-
alignItems: "center",
|
|
3184
|
-
gap: "6px",
|
|
3185
|
-
flexWrap: "wrap"
|
|
3186
|
-
};
|
|
3187
|
-
var subStyle = {
|
|
3188
|
-
fontSize: "11px",
|
|
3189
|
-
color: "var(--dsw-alias-label-tertiary, rgba(127,127,127,.75))",
|
|
3190
|
-
overflow: "hidden",
|
|
3191
|
-
textOverflow: "ellipsis",
|
|
3192
|
-
whiteSpace: "nowrap",
|
|
3193
|
-
minWidth: 0
|
|
3194
|
-
};
|
|
3195
|
-
var chipStyle = {
|
|
3196
|
-
display: "flex",
|
|
3197
|
-
alignItems: "baseline",
|
|
3198
|
-
gap: "6px",
|
|
3199
|
-
padding: "3px 8px",
|
|
3200
|
-
background: "var(--dsw-alias-bg-module-platform, rgba(127,127,127,.1))",
|
|
3201
|
-
border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.22))",
|
|
3202
|
-
borderRadius: "8px",
|
|
3203
|
-
minWidth: 0
|
|
3204
|
-
};
|
|
3205
|
-
var numStyle = {
|
|
3206
|
-
fontWeight: 700,
|
|
3207
|
-
flex: "0 0 auto",
|
|
3208
|
-
color: "var(--dsw-alias-label-tertiary, rgba(127,127,127,.75))"
|
|
3209
|
-
};
|
|
3210
|
-
var tagStyle = {
|
|
3211
|
-
fontWeight: 600,
|
|
3212
|
-
flex: "0 0 auto"
|
|
3213
|
-
};
|
|
3214
|
-
var descStyle = {
|
|
3215
|
-
overflow: "hidden",
|
|
3216
|
-
textOverflow: "ellipsis",
|
|
3217
|
-
whiteSpace: "nowrap",
|
|
3218
|
-
minWidth: 0
|
|
3219
|
-
};
|
|
3220
|
-
var closeStyle = {
|
|
3221
|
-
marginLeft: "auto",
|
|
3222
|
-
flex: "0 0 auto",
|
|
3223
|
-
font: "inherit",
|
|
3224
|
-
fontSize: "12px",
|
|
3225
|
-
cursor: "pointer",
|
|
3226
|
-
border: "none",
|
|
3227
|
-
background: "none",
|
|
3228
|
-
color: "var(--dsw-alias-label-tertiary, rgba(127,127,127,.75))",
|
|
3229
|
-
padding: "0 2px"
|
|
3230
|
-
};
|
|
3231
3176
|
return h("div", { style: {
|
|
3232
3177
|
display: "grid",
|
|
3233
3178
|
gap: "6px"
|
|
@@ -3238,10 +3183,10 @@ function CdpPicksDockCard(props) {
|
|
|
3238
3183
|
var obj = JSON.parse(content);
|
|
3239
3184
|
elements = obj && obj.elements || [];
|
|
3240
3185
|
} catch (e) {}
|
|
3241
|
-
var head = h("div", {
|
|
3186
|
+
var head = h("div", { className: "dsh-cdp-picks-head" }, h("span", { style: { fontWeight: 700 } }, "🌐 " + wt("pickCardTitle")), h("span", { className: "dsh-cdp-picks-sub" }, (r.endpoint || "") + " · " + (r.title || "")), h("span", { className: "dsh-cdp-picks-sub" }, wt("pickCardElements", { n: r.count })), h("button", {
|
|
3242
3187
|
type: "button",
|
|
3243
3188
|
title: wt("pickCardRemove"),
|
|
3244
|
-
|
|
3189
|
+
className: "dsh-cdp-picks-close",
|
|
3245
3190
|
onClick: function() {
|
|
3246
3191
|
removeRef(r.line);
|
|
3247
3192
|
}
|
|
@@ -3249,26 +3194,27 @@ function CdpPicksDockCard(props) {
|
|
|
3249
3194
|
var chips = [];
|
|
3250
3195
|
if (typeof content !== "string") chips.push(h("div", {
|
|
3251
3196
|
key: "loading",
|
|
3252
|
-
|
|
3197
|
+
className: "dsh-cdp-picks-sub"
|
|
3253
3198
|
}, "…"));
|
|
3254
3199
|
for (var i = 0; i < elements.length && i < 6; i++) {
|
|
3255
3200
|
var el = elements[i] || {};
|
|
3256
3201
|
chips.push(h("div", {
|
|
3257
3202
|
key: el.n || i,
|
|
3258
|
-
|
|
3259
|
-
}, h("span", {
|
|
3203
|
+
className: "dsh-cdp-picks-chip"
|
|
3204
|
+
}, h("span", { className: "dsh-cdp-picks-num" }, "#" + (el.n || i + 1)), h("span", { className: "dsh-cdp-picks-tag" }, el.tag || "?"), h("span", { className: "dsh-cdp-picks-desc" }, el.describe || el.name || "")));
|
|
3260
3205
|
}
|
|
3261
3206
|
if (elements.length > 6) chips.push(h("div", {
|
|
3262
3207
|
key: "more",
|
|
3263
|
-
|
|
3208
|
+
className: "dsh-cdp-picks-sub"
|
|
3264
3209
|
}, "… +" + (elements.length - 6)));
|
|
3265
3210
|
return h("div", {
|
|
3266
3211
|
key: r.file,
|
|
3267
|
-
|
|
3212
|
+
"data-dsh-cdp-picks-card": ""
|
|
3268
3213
|
}, head, chips);
|
|
3269
3214
|
}));
|
|
3270
3215
|
}
|
|
3271
3216
|
function mountPicksDockCard(ctx) {
|
|
3217
|
+
injectPickCardStyles();
|
|
3272
3218
|
try {
|
|
3273
3219
|
window.__dshBrowserCdpDeco = Object.assign({}, window.__dshBrowserCdpDeco, { stage: "registered" });
|
|
3274
3220
|
} catch (e) {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-browser-cdp",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.14",
|
|
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.2.0-rc.1+ line: declarative settings via Config .volatile() fields; for DSH 0.1.2-rc.1 ~ 0.1.7 use the 0.17.x line]",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|