dsh-browser-cdp 1.7.5 → 1.7.6

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 CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://dsh.community/schemas/dsh-plugin-0.15.json",
3
3
  "id": "dsh-browser-cdp",
4
4
  "name": "dsh-browser-cdp",
5
- "version": "1.7.5",
5
+ "version": "1.7.6",
6
6
  "manifestVersion": "0.15",
7
7
  "facets": {
8
8
  "host": {
package/lib/client.js CHANGED
@@ -259,10 +259,16 @@ function FamilyHostSection(props) {
259
259
  if (props.useTabs !== void 0 || raw === void 0) return;
260
260
  return raw.subscribe(() => setPolled(raw.getSnapshot()));
261
261
  });
262
+ const tabs = props.useTabs !== void 0 ? props.useTabs((value) => value, eqRows) : polled;
263
+ const ownId = props.ownId ?? "__own__";
262
264
  return (0, react.createElement)("div", { style: {
263
265
  display: "grid",
264
266
  gap: "12px"
265
- } }, (props.useTabs !== void 0 ? props.useTabs((value) => value, eqRows) : polled).map((row) => (0, react.createElement)("div", { key: row.id }, props.renderSlot ? props.renderSlot(FAMILY_CHILD_KEY, {}, {
267
+ } }, (props.renderOwn ? [{
268
+ id: ownId,
269
+ order: Number.NEGATIVE_INFINITY,
270
+ label: ownId
271
+ }, ...tabs.filter((tab) => tab.id !== ownId)] : tabs).map((row) => (0, react.createElement)("div", { key: row.id }, props.renderOwn && row.id === ownId ? props.renderOwn() : props.renderSlot ? props.renderSlot(FAMILY_CHILD_KEY, {}, {
266
272
  only: row.id,
267
273
  fallback: null
268
274
  }) : props.renderContributor?.(row.id) ?? null)));
@@ -305,7 +311,7 @@ function projectLedger(slots) {
305
311
  * @param log - console 前缀(带插件名)。
306
312
  * @returns 取消定时器与撤销接管注册的 disposer。
307
313
  */
308
- function claimFamilyHostIfOrphaned(slots, isHeld, label, log) {
314
+ function claimFamilyHostIfOrphaned(slots, isHeld, label, log, ownTab) {
309
315
  let disposeClaim;
310
316
  let claimed = false;
311
317
  const timer = setTimeout(() => {
@@ -344,7 +350,9 @@ function claimFamilyHostIfOrphaned(slots, isHeld, label, log) {
344
350
  label,
345
351
  inject: () => ({
346
352
  hooks: { tabs: ledger },
347
- renderContributor
353
+ renderContributor,
354
+ ownId: ownTab?.id,
355
+ renderOwn: ownTab === void 0 ? void 0 : () => (0, react.createElement)(ownTab.component, ownTab.inject ? ownTab.inject() : {})
348
356
  }),
349
357
  children: { [FAMILY_CHILD_KEY]: {
350
358
  kind: "list",
@@ -1363,9 +1371,7 @@ function mountFamilySettingsCard(ctx) {
1363
1371
  var forms = typeof ctx.get === "function" ? ctx.get("configForms") : void 0;
1364
1372
  var scope = forms && typeof forms.get === "function" ? forms.get("dsh-browser-cdp") : void 0;
1365
1373
  if (!scope) scope = makeBridgeScope();
1366
- var familyTabHeld = false;
1367
1374
  ctx.slots.inject("dsh-family.tab", function() {
1368
- familyTabHeld = true;
1369
1375
  return ctx.slots.register({
1370
1376
  name: "dsh-family.tab",
1371
1377
  id: "dsh-browser-cdp",
@@ -1379,10 +1385,22 @@ function mountFamilySettingsCard(ctx) {
1379
1385
  }, FamilySettingsCard);
1380
1386
  }, "dsh-browser-cdp: family settings tab");
1381
1387
  var claim = claimFamilyHostIfOrphaned(ctx.slots, function() {
1382
- return familyTabHeld;
1388
+ try {
1389
+ return ctx.slots.entries("settings.section").some(function(e) {
1390
+ return String(e && e.options && e.options.id || "") === "dsh-family";
1391
+ });
1392
+ } catch {
1393
+ return false;
1394
+ }
1383
1395
  }, function() {
1384
1396
  return "起子插件设置";
1385
- }, "[dsh-browser-cdp]");
1397
+ }, "[dsh-browser-cdp]", {
1398
+ id: "dsh-browser-cdp",
1399
+ component: FamilySettingsCard,
1400
+ inject: function() {
1401
+ return { scope };
1402
+ }
1403
+ });
1386
1404
  if (typeof ctx.effect === "function") ctx.effect(function() {
1387
1405
  return claim;
1388
1406
  }, "dsh-browser-cdp: family host backstop");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-browser-cdp",
3
- "version": "1.7.5",
3
+ "version": "1.7.6",
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",
@@ -38,7 +38,12 @@
38
38
  "0.1.7-rc.2": "compatible",
39
39
  "0.2.0-rc.1": "compatible",
40
40
  "0.2.0-rc.2": "compatible",
41
- "0.2.1-rc.1": "compatible", "0.2.1-rc.2": "compatible", "0.2.1-rc.3": "compatible", "0.2.1-rc.4": "compatible", "0.2.1-rc.5": "compatible"}
41
+ "0.2.1-rc.1": "compatible",
42
+ "0.2.1-rc.2": "compatible",
43
+ "0.2.1-rc.3": "compatible",
44
+ "0.2.1-rc.4": "compatible",
45
+ "0.2.1-rc.5": "compatible"
46
+ }
42
47
  }
43
48
  },
44
49
  "scripts": {