@qzsy/dsh-bridge 3.5.1 → 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,18 @@
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
+
3
16
  ## [v3.5.1] - 2026-11-02
4
17
 
5
18
  ### 🐛 修复
package/client/client.js CHANGED
@@ -930,53 +930,63 @@ function setupMobileDrawer() {
930
930
  document.body.appendChild(modelClone);
931
931
  window.setTimeout(() => {
932
932
  if (disposed || token !== modelAdvanceToken || !modelAdvancing) return;
933
- if (modelPortal && visiblePortal(modelPortal)) {
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;
934
937
  try {
935
- dismissHostMenus();
938
+ cell.click();
936
939
  } catch {
937
940
  }
938
- window.setTimeout(() => openParentAndReason(), 100);
941
+ window.setTimeout(() => {
942
+ if (disposed || token !== modelAdvanceToken) return;
943
+ if (!modelPortal) {
944
+ cancelAdvanceOverlay();
945
+ clearModelSheet();
946
+ }
947
+ }, 1200);
948
+ };
949
+ let attempts = 0;
950
+ const pollReasonCell = () => {
951
+ if (disposed || token !== modelAdvanceToken || !modelAdvancing) return;
952
+ const cell = findReasonCell();
953
+ if (cell) {
954
+ clickReasonCell(cell);
955
+ return;
956
+ }
957
+ attempts += 1;
958
+ if (attempts > 20) {
959
+ cancelAdvanceOverlay();
960
+ clearModelSheet();
961
+ return;
962
+ }
963
+ window.setTimeout(pollReasonCell, 60);
964
+ };
965
+ const initialCell = findReasonCell();
966
+ if (initialCell) {
967
+ clickReasonCell(initialCell);
939
968
  return;
940
969
  }
941
- openParentAndReason();
942
- function openParentAndReason() {
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 = () => {
943
974
  if (disposed || token !== modelAdvanceToken || !modelAdvancing) return;
944
- const trigger = document.querySelector(
945
- '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"]'
946
- );
947
975
  try {
948
976
  trigger?.click();
949
977
  } catch {
950
978
  }
951
- let attempts = 0;
952
- const openReasonCell = () => {
953
- if (disposed || token !== modelAdvanceToken || !modelAdvancing) return;
954
- const cell = [...document.querySelectorAll('button[role="menuitem"]')].find((b) => /推理等级|Reasoning effort|Reasoning level|推理强度/i.test(b.innerText || ""));
955
- if (cell) {
956
- reasoningStep = true;
957
- try {
958
- cell.click();
959
- } catch {
960
- }
961
- window.setTimeout(() => {
962
- if (disposed || token !== modelAdvanceToken) return;
963
- if (!modelPortal) {
964
- cancelAdvanceOverlay();
965
- clearModelSheet();
966
- }
967
- }, 1200);
968
- return;
969
- }
970
- attempts += 1;
971
- if (attempts > 20) {
972
- cancelAdvanceOverlay();
973
- clearModelSheet();
974
- return;
975
- }
976
- window.setTimeout(openReasonCell, 60);
977
- };
978
- window.setTimeout(openReasonCell, 300);
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;
979
988
  }
989
+ reopenParent();
980
990
  }, 140);
981
991
  };
982
992
  const syncModelSheet = () => {
package/client/mobile.js CHANGED
@@ -756,48 +756,60 @@ export function setupMobileDrawer() {
756
756
 
757
757
  window.setTimeout(() => {
758
758
  if (disposed || token !== modelAdvanceToken || !modelAdvancing) return;
759
- // 选中的是当前模型时宿主可能不关菜单,先按 Esc/外部点击收掉
760
- if (modelPortal && visiblePortal(modelPortal)) {
761
- try { dismissHostMenus(); } catch { /* 忽略 */ }
762
- window.setTimeout(() => openParentAndReason(), 100);
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
+ };
773
+ let attempts = 0;
774
+ const pollReasonCell = () => {
775
+ if (disposed || token !== modelAdvanceToken || !modelAdvancing) return;
776
+ const cell = findReasonCell();
777
+ if (cell) {
778
+ clickReasonCell(cell);
779
+ return;
780
+ }
781
+ attempts += 1;
782
+ if (attempts > 20) {
783
+ cancelAdvanceOverlay();
784
+ clearModelSheet();
785
+ return;
786
+ }
787
+ window.setTimeout(pollReasonCell, 60);
788
+ };
789
+
790
+ // 不同模型:宿主通常已经把父级「模型 / 推理等级」popover 留在 DOM 里(视觉上被隐藏)
791
+ const initialCell = findReasonCell();
792
+ if (initialCell) {
793
+ clickReasonCell(initialCell);
763
794
  return;
764
795
  }
765
- openParentAndReason();
766
796
 
767
- function openParentAndReason() {
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 = () => {
768
801
  if (disposed || token !== modelAdvanceToken || !modelAdvancing) return;
769
- const trigger = document.querySelector(
770
- 'button[aria-haspopup="menu"][aria-label*="选择模型"], button[aria-haspopup="menu"][aria-label*="Select model"], button[aria-haspopup="menu"][aria-label*="模型"]',
771
- );
772
802
  try { trigger?.click(); } catch { /* 忽略 */ }
773
- let attempts = 0;
774
- const openReasonCell = () => {
775
- if (disposed || token !== modelAdvanceToken || !modelAdvancing) return;
776
- const cell = [...document.querySelectorAll('button[role="menuitem"]')].find((b) => /推理等级|Reasoning effort|Reasoning level|推理强度/i.test(b.innerText || ''));
777
- if (cell) {
778
- reasoningStep = true;
779
- try { cell.click(); } catch { /* 忽略 */ }
780
- window.setTimeout(() => {
781
- if (disposed || token !== modelAdvanceToken) return;
782
- if (!modelPortal) {
783
- // 推理菜单没出现:撤掉 overlay,避免卡在半路
784
- cancelAdvanceOverlay();
785
- clearModelSheet();
786
- }
787
- }, 1200);
788
- return;
789
- }
790
- attempts += 1;
791
- if (attempts > 20) {
792
- cancelAdvanceOverlay();
793
- clearModelSheet();
794
- return;
795
- }
796
- window.setTimeout(openReasonCell, 60);
797
- };
798
- // 等父菜单的进入动画/事件绑定完成再点「推理等级」
799
- window.setTimeout(openReasonCell, 300);
803
+ window.setTimeout(pollReasonCell, 300);
804
+ };
805
+
806
+ // 当前模型:宿主可能不关模型子菜单,先关一次再打开父级
807
+ if (modelPortal && visiblePortal(modelPortal)) {
808
+ try { trigger?.click(); } catch { /* 忽略 */ }
809
+ window.setTimeout(reopenParent, 180);
810
+ return;
800
811
  }
812
+ reopenParent();
801
813
  }, 140);
802
814
  };
803
815
 
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@qzsy/dsh-bridge",
3
- "version": "3.5.1",
3
+ "version": "3.5.2",
4
4
  "description": "DSH 远程隧道云官方客户端插件:一条命令把本机 DeepSeek Harness 接入云端隧道(设备码绑定、短期令牌、本地门禁代理、HTTP/SSE/WebSocket 反向隧道)。",
5
- "releaseNotes": "【v3.5.1】模型 → 思考级别连招修复\\n• 选中当前模型时先收起旧菜单,再进入推理等级,不再卡住\\n• 等父菜单动画/事件就绪后再点推理等级,避免 sheet 不出现\\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": {