@qzsy/dsh-bridge 3.5.0 → 3.5.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/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # 更新日志
2
2
 
3
+ ## [v3.5.2] - 2026-11-02
4
+
5
+ ### 🐛 修复
6
+
7
+ - **复用宿主已打开的父菜单**:选完不同模型后,宿主通常会把父级「模型 / 推理等级」popover 留在 DOM 里;现在直接点其中的「推理等级」,不再多点一次触发按钮把父菜单关掉。
8
+ - **当前模型的关闭/重开**:只有模型子菜单还开着(选的是当前模型)时,才先点一次触发按钮收起,再点一次打开父菜单,然后进入推理等级。
9
+ - 保持旧 sheet 快照和透明隐藏,推理 sheet 出现后再清理。
10
+
11
+ ### 🧪 验证
12
+
13
+ - 独立宿主模拟 4/4;待安装后分别验证「选不同模型」和「选当前模型」两条真实链路。
14
+
15
+
16
+ ## [v3.5.1] - 2026-11-02
17
+
18
+ ### 🐛 修复
19
+
20
+ - **选当前模型也能继续**:选中项与当前模型相同时,宿主不一定会关闭模型菜单;现在会先按 Esc / 外部点击收起旧菜单,再打开父级并进入「推理等级」,不会卡在半路。
21
+ - **父菜单点击时序**:等父 popover 进入动画和事件绑定完成后再点「推理等级」,避免点得太早导致推理 sheet 不出现。
22
+ - **过渡期宿主菜单改为透明隐藏**:不再用 `visibility:hidden`,避免宿主按钮虽然可见性隐藏却无法被程序化点击;推理 sheet 出现后立即恢复。
23
+
24
+ ### 🧪 验证
25
+
26
+ - 独立宿主模拟:模型 sheet → 选模型 → 推理 sheet → 选等级关闭,4/4;待安装后跑真实 DSH。
27
+
28
+
3
29
  ## [v3.5.0] - 2026-11-02
4
30
 
5
31
  ### ✨ 新增
package/client/client.js CHANGED
@@ -469,7 +469,7 @@ var MOBILE_DRAWER_CSS = `
469
469
  pointer-events: none !important;
470
470
  }
471
471
  body.qzsy-model-advancing div[id$="-menu"]:not([data-qzsy-model-sheet]):not([data-qzsy-model-sheet-clone]) {
472
- visibility: hidden !important;
472
+ opacity: 0 !important;
473
473
  pointer-events: none !important;
474
474
  }
475
475
  body.qzsy-model-sheet-dragging [data-qzsy-model-sheet] {
@@ -930,41 +930,63 @@ function setupMobileDrawer() {
930
930
  document.body.appendChild(modelClone);
931
931
  window.setTimeout(() => {
932
932
  if (disposed || token !== modelAdvanceToken || !modelAdvancing) return;
933
- const trigger = document.querySelector(
934
- 'button[aria-haspopup="menu"][aria-label*="\u9009\u62E9\u6A21\u578B"], button[aria-haspopup="menu"][aria-label*="Select model"], button[aria-haspopup="menu"][aria-label*="\u6A21\u578B"]'
935
- );
936
- try {
937
- trigger?.click();
938
- } catch {
939
- }
933
+ const findReasonCell = () => [...document.querySelectorAll('button[role="menuitem"]')].find((b) => /推理等级|Reasoning effort|Reasoning level|推理强度/i.test(b.innerText || ""));
934
+ const clickReasonCell = (cell) => {
935
+ if (!cell) return;
936
+ reasoningStep = true;
937
+ try {
938
+ cell.click();
939
+ } catch {
940
+ }
941
+ window.setTimeout(() => {
942
+ if (disposed || token !== modelAdvanceToken) return;
943
+ if (!modelPortal) {
944
+ cancelAdvanceOverlay();
945
+ clearModelSheet();
946
+ }
947
+ }, 1200);
948
+ };
940
949
  let attempts = 0;
941
- const openReasonCell = () => {
950
+ const pollReasonCell = () => {
942
951
  if (disposed || token !== modelAdvanceToken || !modelAdvancing) return;
943
- const cell = [...document.querySelectorAll('button[role="menuitem"]')].find((b) => /推理等级|Reasoning effort|Reasoning level|推理强度/i.test(b.innerText || ""));
952
+ const cell = findReasonCell();
944
953
  if (cell) {
945
- reasoningStep = true;
946
- try {
947
- cell.click();
948
- } catch {
949
- }
950
- window.setTimeout(() => {
951
- if (disposed || token !== modelAdvanceToken) return;
952
- if (!modelPortal) {
953
- cancelAdvanceOverlay();
954
- clearModelSheet();
955
- }
956
- }, 900);
954
+ clickReasonCell(cell);
957
955
  return;
958
956
  }
959
957
  attempts += 1;
960
- if (attempts > 16) {
958
+ if (attempts > 20) {
961
959
  cancelAdvanceOverlay();
962
960
  clearModelSheet();
963
961
  return;
964
962
  }
965
- window.setTimeout(openReasonCell, 60);
963
+ window.setTimeout(pollReasonCell, 60);
966
964
  };
967
- window.setTimeout(openReasonCell, 120);
965
+ const initialCell = findReasonCell();
966
+ if (initialCell) {
967
+ clickReasonCell(initialCell);
968
+ return;
969
+ }
970
+ const trigger = document.querySelector(
971
+ 'button[aria-haspopup="menu"][aria-label*="\u9009\u62E9\u6A21\u578B"], button[aria-haspopup="menu"][aria-label*="Select model"], button[aria-haspopup="menu"][aria-label*="\u6A21\u578B"]'
972
+ );
973
+ const reopenParent = () => {
974
+ if (disposed || token !== modelAdvanceToken || !modelAdvancing) return;
975
+ try {
976
+ trigger?.click();
977
+ } catch {
978
+ }
979
+ window.setTimeout(pollReasonCell, 300);
980
+ };
981
+ if (modelPortal && visiblePortal(modelPortal)) {
982
+ try {
983
+ trigger?.click();
984
+ } catch {
985
+ }
986
+ window.setTimeout(reopenParent, 180);
987
+ return;
988
+ }
989
+ reopenParent();
968
990
  }, 140);
969
991
  };
970
992
  const syncModelSheet = () => {
package/client/mobile.js CHANGED
@@ -266,7 +266,7 @@ export const MOBILE_DRAWER_CSS = `
266
266
  pointer-events: none !important;
267
267
  }
268
268
  body.qzsy-model-advancing div[id$="-menu"]:not([data-qzsy-model-sheet]):not([data-qzsy-model-sheet-clone]) {
269
- visibility: hidden !important;
269
+ opacity: 0 !important;
270
270
  pointer-events: none !important;
271
271
  }
272
272
  body.qzsy-model-sheet-dragging [data-qzsy-model-sheet] {
@@ -756,36 +756,60 @@ export function setupMobileDrawer() {
756
756
 
757
757
  window.setTimeout(() => {
758
758
  if (disposed || token !== modelAdvanceToken || !modelAdvancing) return;
759
- const trigger = document.querySelector(
760
- 'button[aria-haspopup="menu"][aria-label*="选择模型"], button[aria-haspopup="menu"][aria-label*="Select model"], button[aria-haspopup="menu"][aria-label*="模型"]',
761
- );
762
- try { trigger?.click(); } catch { /* 忽略 */ }
759
+ const findReasonCell = () => [...document.querySelectorAll('button[role="menuitem"]')].find((b) => /推理等级|Reasoning effort|Reasoning level|推理强度/i.test(b.innerText || ''));
760
+ const clickReasonCell = (cell) => {
761
+ if (!cell) return;
762
+ reasoningStep = true;
763
+ try { cell.click(); } catch { /* 忽略 */ }
764
+ window.setTimeout(() => {
765
+ if (disposed || token !== modelAdvanceToken) return;
766
+ if (!modelPortal) {
767
+ // 推理菜单没出现:撤掉 overlay,避免卡在半路
768
+ cancelAdvanceOverlay();
769
+ clearModelSheet();
770
+ }
771
+ }, 1200);
772
+ };
763
773
  let attempts = 0;
764
- const openReasonCell = () => {
774
+ const pollReasonCell = () => {
765
775
  if (disposed || token !== modelAdvanceToken || !modelAdvancing) return;
766
- const cell = [...document.querySelectorAll('button[role="menuitem"]')].find((b) => /推理等级|Reasoning effort|Reasoning level|推理强度/i.test(b.innerText || ''));
776
+ const cell = findReasonCell();
767
777
  if (cell) {
768
- reasoningStep = true;
769
- try { cell.click(); } catch { /* 忽略 */ }
770
- window.setTimeout(() => {
771
- if (disposed || token !== modelAdvanceToken) return;
772
- if (!modelPortal) {
773
- // 推理菜单没出现:撤掉 overlay,避免卡在半路
774
- cancelAdvanceOverlay();
775
- clearModelSheet();
776
- }
777
- }, 900);
778
+ clickReasonCell(cell);
778
779
  return;
779
780
  }
780
781
  attempts += 1;
781
- if (attempts > 16) {
782
+ if (attempts > 20) {
782
783
  cancelAdvanceOverlay();
783
784
  clearModelSheet();
784
785
  return;
785
786
  }
786
- window.setTimeout(openReasonCell, 60);
787
+ window.setTimeout(pollReasonCell, 60);
788
+ };
789
+
790
+ // 不同模型:宿主通常已经把父级「模型 / 推理等级」popover 留在 DOM 里(视觉上被隐藏)
791
+ const initialCell = findReasonCell();
792
+ if (initialCell) {
793
+ clickReasonCell(initialCell);
794
+ return;
795
+ }
796
+
797
+ const trigger = document.querySelector(
798
+ 'button[aria-haspopup="menu"][aria-label*="选择模型"], button[aria-haspopup="menu"][aria-label*="Select model"], button[aria-haspopup="menu"][aria-label*="模型"]',
799
+ );
800
+ const reopenParent = () => {
801
+ if (disposed || token !== modelAdvanceToken || !modelAdvancing) return;
802
+ try { trigger?.click(); } catch { /* 忽略 */ }
803
+ window.setTimeout(pollReasonCell, 300);
787
804
  };
788
- window.setTimeout(openReasonCell, 120);
805
+
806
+ // 当前模型:宿主可能不关模型子菜单,先关一次再打开父级
807
+ if (modelPortal && visiblePortal(modelPortal)) {
808
+ try { trigger?.click(); } catch { /* 忽略 */ }
809
+ window.setTimeout(reopenParent, 180);
810
+ return;
811
+ }
812
+ reopenParent();
789
813
  }, 140);
790
814
  };
791
815
 
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@qzsy/dsh-bridge",
3
- "version": "3.5.0",
3
+ "version": "3.5.2",
4
4
  "description": "DSH 远程隧道云官方客户端插件:一条命令把本机 DeepSeek Harness 接入云端隧道(设备码绑定、短期令牌、本地门禁代理、HTTP/SSE/WebSocket 反向隧道)。",
5
- "releaseNotes": "【v3.5.0】模型 → 思考级别连招\\n• 选完模型自动进入推理等级 sheet(Off / Low / High / Max),选完才关闭\\n• 旧 sheet 快照过渡,宿主菜单在背后切换,不闪桌面 popover\\n• 模型和推理等级仍由宿主选择;桌面端不变",
5
+ "releaseNotes": "【v3.5.2】模型 → 思考级别连招稳定版\\n• 不同模型:直接复用宿主保留的父菜单,点「推理等级」进入 sheet\\n• 当前模型:先收起模型子菜单,再打开父菜单进入推理等级\\n• 保持旧 sheet 快照过渡,推理 sheet 出现后清理,不再卡在半路",
6
6
  "type": "module",
7
7
  "main": "lib/index.js",
8
8
  "exports": {