dsh-browser-cdp 1.11.0 → 1.12.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 1.12.0 (2026-11-15)
2
+
3
+ **设置分节排版:连接目标置顶,评审(JEV / Laya)组可抽屉折叠。**
4
+
5
+ - **连接目标置顶**:`FamilySettingsCard` 把 `FamLinks` 移到 `FAM_FIELD_GROUPS` 之前并传 `first: true`——顺序即优先级,它决定每一次 `bcdp_*` 打谁,是分节的第一性配置;置顶后块顶分隔线按 `first` 条件去掉,分节最上方不再出现无意义横线。
6
+ - **评审组抽屉折叠**:`gJudge` 组加 `foldable: true`,组标题改为 `<button aria-expanded>` + `▸/▾`,收起时标题右侧显示实际字段数「14 项」;收起态字段行**整段不渲染**(不是 CSS 隐藏,避免隐藏输入框仍可 Tab 聚焦)。
7
+ - **折叠态只存 localStorage**(`bcdp.settings.fold.<gk>`,读写全程 try/catch):折叠是纯 UI 偏好,**绝不写宿主配置**——每次配置写都是一次 patch 落盘。契约测试强制断言 `FamGroup` 内无 `commitField` / `scope.set`。
8
+ - 新增 3 条契约用例(`tests/fam-links.contract.test.ts`):连接目标必须先于所有分组、首个块不带顶部分隔线、只有评审组可折叠且折叠不落配置。
9
+
1
10
  ## 1.11.0
2
11
 
3
12
  **设置入口改为独立顶层分节 + 齿轮挂载崩溃修复。**
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.11.0",
5
+ "version": "1.12.0",
6
6
  "manifestVersion": "0.15",
7
7
  "facets": {
8
8
  "host": {
package/lib/client.js CHANGED
@@ -326,7 +326,7 @@ function shouldShowGen1SettingsGear(hasConfigForms, hasOpenSettingsDocument) {
326
326
  *
327
327
  * Keep in sync with package.json — `node scripts/bump.mjs <version>` writes both.
328
328
  */
329
- const CLIENT_BUILD = "1.9.51";
329
+ const CLIENT_BUILD = "1.12.0";
330
330
 
331
331
  //#endregion
332
332
  //#region src/client/index.ts
@@ -1569,9 +1569,25 @@ function SettingsGearOverlay(props) {
1569
1569
  }
1570
1570
  }, "×")), h(FamilySettingsCard, { scope }))) : null);
1571
1571
  }
1572
+ function foldKey(gk) {
1573
+ return "bcdp.settings.fold." + gk;
1574
+ }
1575
+ function readFold(gk) {
1576
+ try {
1577
+ return window.localStorage.getItem(foldKey(gk)) === "1";
1578
+ } catch (e) {
1579
+ return false;
1580
+ }
1581
+ }
1582
+ function writeFold(gk, open) {
1583
+ try {
1584
+ window.localStorage.setItem(foldKey(gk), open ? "1" : "0");
1585
+ } catch (e) {}
1586
+ }
1572
1587
  var FAM_FIELD_GROUPS = [
1573
1588
  {
1574
1589
  gk: "gTools",
1590
+ foldable: true,
1575
1591
  en: "Tool sealing",
1576
1592
  zh: "工具封印",
1577
1593
  fields: [
@@ -1616,6 +1632,7 @@ var FAM_FIELD_GROUPS = [
1616
1632
  },
1617
1633
  {
1618
1634
  gk: "gBasic",
1635
+ foldable: true,
1619
1636
  en: "Basics",
1620
1637
  zh: "基础",
1621
1638
  fields: [
@@ -1691,6 +1708,7 @@ var FAM_FIELD_GROUPS = [
1691
1708
  },
1692
1709
  {
1693
1710
  gk: "gCapture",
1711
+ foldable: true,
1694
1712
  en: "Capture & streaming",
1695
1713
  zh: "截图与推流",
1696
1714
  fields: [
@@ -1848,6 +1866,7 @@ var FAM_FIELD_GROUPS = [
1848
1866
  },
1849
1867
  {
1850
1868
  gk: "gJudge",
1869
+ foldable: true,
1851
1870
  en: "Judgement (JEV / Laya)",
1852
1871
  zh: "评审(JEV / Laya)",
1853
1872
  fields: [
@@ -1970,7 +1989,13 @@ function FamilySettingsCard(props) {
1970
1989
  return h("div", { style: {
1971
1990
  display: "grid",
1972
1991
  gap: "8px"
1973
- } }, FAM_FIELD_GROUPS.map(function(group) {
1992
+ } }, h(FamLinks, {
1993
+ key: "links",
1994
+ first: true,
1995
+ value,
1996
+ writable,
1997
+ scope
1998
+ }), FAM_FIELD_GROUPS.map(function(group) {
1974
1999
  return h(FamGroup, {
1975
2000
  key: group.gk,
1976
2001
  group,
@@ -1978,25 +2003,65 @@ function FamilySettingsCard(props) {
1978
2003
  writable,
1979
2004
  scope
1980
2005
  });
1981
- }), h(FamLinks, {
1982
- key: "links",
1983
- value,
1984
- writable,
1985
- scope
1986
2006
  }));
1987
2007
  }
1988
2008
  function FamGroup(props) {
1989
2009
  var group = props.group;
1990
2010
  var h = React.createElement;
1991
- return h("div", { style: {
1992
- borderTop: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.25))",
1993
- paddingTop: "6px"
1994
- } }, h("div", { style: {
2011
+ var title = _egoLocale === "zh" ? group.zh : group.en;
2012
+ var foldable = group.foldable === true;
2013
+ var foldState = React.useState(function() {
2014
+ return foldable ? readFold(group.gk) : true;
2015
+ });
2016
+ var open = foldState[0], setOpen = foldState[1];
2017
+ var headStyle = {
1995
2018
  fontSize: "12px",
1996
2019
  fontWeight: 600,
1997
2020
  color: "var(--dsw-alias-label-secondary, rgba(127,127,127,.9))",
1998
2021
  padding: "2px 0 4px"
1999
- } }, _egoLocale === "zh" ? group.zh : group.en), group.fields.map(function(f) {
2022
+ };
2023
+ var chevronStyle = {
2024
+ fontSize: "10px",
2025
+ lineHeight: "16px",
2026
+ flex: "0 0 auto",
2027
+ color: "var(--dsw-alias-label-tertiary, rgba(127,127,127,.8))"
2028
+ };
2029
+ function toggle() {
2030
+ var next = !open;
2031
+ setOpen(next);
2032
+ writeFold(group.gk, next);
2033
+ }
2034
+ return h("div", { style: {
2035
+ borderTop: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.25))",
2036
+ paddingTop: "6px"
2037
+ } }, foldable ? h("button", {
2038
+ type: "button",
2039
+ onClick: toggle,
2040
+ "aria-expanded": open,
2041
+ "aria-label": title,
2042
+ style: {
2043
+ display: "flex",
2044
+ alignItems: "center",
2045
+ gap: "6px",
2046
+ width: "100%",
2047
+ background: "none",
2048
+ border: "none",
2049
+ padding: 0,
2050
+ margin: 0,
2051
+ cursor: "pointer",
2052
+ font: "inherit",
2053
+ textAlign: "left",
2054
+ color: "inherit"
2055
+ }
2056
+ }, h("span", { style: chevronStyle }, open ? "▾" : "▸"), h("span", { style: {
2057
+ ...headStyle,
2058
+ flex: "1 1 auto",
2059
+ minWidth: 0
2060
+ } }, title), h("span", { style: {
2061
+ fontSize: "10px",
2062
+ flex: "0 0 auto",
2063
+ color: "var(--dsw-alias-label-tertiary, rgba(127,127,127,.7))"
2064
+ } }, open ? "" : String(group.fields.length) + (_egoLocale === "zh" ? " 项" : " items"))) : h("div", { style: headStyle }, title), foldable && !open ? null : group.fields.map(function(f) {
2000
2065
  return h(FamField, {
2001
2066
  key: f.k,
2002
2067
  f,
@@ -2475,7 +2540,11 @@ function FamLinks(props) {
2475
2540
  commitField(scope, "cdpMode", "local");
2476
2541
  }
2477
2542
  }, wt("linksActivate"))));
2478
- return h("div", { style: {
2543
+ return h("div", { style: props.first === true ? {
2544
+ paddingTop: "0",
2545
+ display: "grid",
2546
+ gap: "4px"
2547
+ } : {
2479
2548
  borderTop: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.25))",
2480
2549
  paddingTop: "6px",
2481
2550
  display: "grid",
package/lib/index.js CHANGED
@@ -2169,7 +2169,7 @@ function focusIdFrom(value) {
2169
2169
  *
2170
2170
  * Keep in sync with package.json — `node scripts/bump.mjs <version>` writes both.
2171
2171
  */
2172
- const CLIENT_BUILD = "1.9.51";
2172
+ const CLIENT_BUILD = "1.12.0";
2173
2173
 
2174
2174
  //#endregion
2175
2175
  //#region src/cast-server.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-browser-cdp",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "dsh-browser-cdp: visible agent browser for DSH — drives the vendored ego-compatible Chromium over CDP, and can also attach to a running Chrome/Edge/Brave or route through egolite, Tabbit and Lightpanda backends. 35 structured bcdp_* tools; only bcdp_status stays resident by default (lazy injection, −91.9% schema per turn for non-browser sessions). Realtime watch panel with direct click/scroll/IME input, element picks quoted into the composer, human-verification notices; non-CDP channels sync frames by 3s polling. Web shell: floating watch ball without dsh-better-sidebar, sidebar tab with it. Headless/TUI hosts: tools-only. [DSH 0.1.0-rc.2 ~ 0.2.2-rc.1: declarative settings via Config .volatile() fields on 0.1.7+; imperative installSection / module-level registration + describe/mutate bridge on 0.1.0 ~ 0.1.5 (experimental, pending farm). Client peers stay optional so gen-1 hosts without dsh-client-store still load; for a production install on the current line use the 0.17.x line]",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -124,7 +124,7 @@
124
124
  "@deepseek-ai/dsh-session": "^0.2.1-rc.3",
125
125
  "@deepseek-ai/dsh-skill": "^0.2.1-rc.3",
126
126
  "@deepseek-ai/dsh-system-prompt": "^0.2.1-rc.3",
127
- "@deepseek-ai/dsh-tools": ">=0.1.0-rc.2 <0.3.0-0",
127
+ "@deepseek-ai/dsh-tools": ">=0.2.1-rc.1 <0.2.2-0",
128
128
  "@deepseek-ai/dsh-user-approval": "^0.2.1-rc.3",
129
129
  "@deepseek-ai/dsh-working-directory": "^0.2.1-rc.3",
130
130
  "@types/node": "^22.20.1",