dsh-deepseek-chat 0.1.10 → 0.1.11

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/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  CHAT模式 加载真实的 [DeepSeek Chat 官网](https://chat.deepseek.com/),使用官网的聊天功能和账号历史;HARNESS模式 为原 DSH 工作区。
6
6
 
7
- 当前版本 **0.1.10** · 适配 **DSH 0.2.0-rc.2 桌面版** · 默认语言为简体中文。
7
+ 当前版本 **0.1.11** · 适配 **DSH 0.2.0-rc.2 桌面版** · 默认语言为简体中文。
8
8
 
9
9
  ## 功能预览
10
10
 
@@ -76,7 +76,7 @@ dsh plugin --profile desktop add https://github.com/xingxingbk-git/dsh-deepseek-
76
76
  将构建生成的 `.tgz` 文件交给 DSH 官方插件管理器安装,或使用 CLI:
77
77
 
78
78
  ```bash
79
- dsh plugin --profile desktop add /absolute/path/dsh-deepseek-chat-0.1.10.tgz
79
+ dsh plugin --profile desktop add /absolute/path/dsh-deepseek-chat-0.1.11.tgz
80
80
  ```
81
81
 
82
82
  将路径替换成你的实际安装包;使用其他 profile 时替换 `desktop`。**安装或更新后,完整退出并重新打开 DSH**,让新插件生效。
@@ -88,7 +88,7 @@ dsh plugin --profile desktop add /absolute/path/dsh-deepseek-chat-0.1.10.tgz
88
88
  ## 开始使用
89
89
 
90
90
  1. 选择 **CHAT**。未登录时点击 **登录 DeepSeek**;也可在 **设置 → CHAT设置** 点击同一个登录入口。
91
- 2. 在插件内的真实官网页面正常登录。两个入口使用同一网页,登录后自动同步账号和对话,不需要重新打开设置刷新。
91
+ 2. 登录统一在 CHAT 主页面的真实官网中完成。CHAT 设置只显示账号、登录状态和语言;点击其中的登录按钮会关闭设置并进入 CHAT,登录后自动同步,无需刷新。
92
92
  3. 打开 **设置 → CHAT设置**,确认出现“已记住网页登录”,按需选择语言。退出登录会清除本插件的登录记忆并正常退出官网;模式切换器继续可用。
93
93
 
94
94
  当前登录在插件网页中完成。外部浏览器登录后自动授权回跳需要官网提供面向 Chat 的授权交换接口,目前未确认可用;直接在其他浏览器登录不会自动登录本插件。
@@ -123,7 +123,7 @@ pnpm install --frozen-lockfile
123
123
  pnpm package:plugin
124
124
  ```
125
125
 
126
- 生成 `artifacts/dsh-deepseek-chat-0.1.10.tgz`,包含 Host、Client、类型声明、图标和 bundle patch。插件管理列表的图标位于 `assets/icon.svg`,替换后重新打包安装即可;SVG 须自包含且不超过 256 KiB。
126
+ 生成 `artifacts/dsh-deepseek-chat-0.1.11.tgz`,包含 Host、Client、类型声明、图标和 bundle patch。插件管理列表的图标位于 `assets/icon.svg`,替换后重新打包安装即可;SVG 须自包含且不超过 256 KiB。
127
127
 
128
128
  修改源码后执行 `pnpm release:prepare`,并将源码与整个 `lib/` 一起提交。`pnpm check:distribution` 会检查编译产物与源码、版本及安装入口是否一致;旧产物或缺失文件会使检查失败。安装用户不需要执行这些开发命令。
129
129
 
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "format": 1,
3
3
  "name": "dsh-deepseek-chat",
4
- "version": "0.1.10",
4
+ "version": "0.1.11",
5
5
  "inputs": {
6
6
  "assets/icon.svg": "ad1b0fda90c1c1f2a0b9208bc86f5fe8c21d505a1208576be4e3110b26b4f79c",
7
7
  "cordis.patch.yml": "05edb71cd276de1251ae67644ec68b54efc26258814956fa0e932d36da741bdc",
8
- "package.json": "d3604956f5a0cedab38287d3d665bab0653af9940d9adfb2301ffd1c13715a38",
8
+ "package.json": "a89d7b4f4b2dd1a2068e1e716644af0ae96df7a1d6a63e6676fa0a8b63d2e279",
9
9
  "pnpm-lock.yaml": "c4f600b0d599b85f6181d295cd5f9f06f1eb0435eeeb2e7cf1a376b3c6a4ca15",
10
10
  "scripts/build.mjs": "a9a2961e09fb16b99e206c4d191c9e970a4a3999979df9a626fa310c0fdee5b1",
11
11
  "scripts/check-artifact.mjs": "6fec38fb74e41dfeacef7147280c69854087d0665747d7d65137cc98f9dc673b",
@@ -13,17 +13,17 @@
13
13
  "scripts/client-contract.mjs": "1e212575218fc985f4405e2eac98b33a969494ff6b2144b1204a6d66963ba894",
14
14
  "scripts/distribution-manifest.mjs": "e746c447b03b0e9a86efce7827bbd5d9184c6ccd1f1f0f1c9eb12abfe1b2f3b7",
15
15
  "src/authorization.ts": "5f0c1b69e43541ce606349047788df72e442e9cbb3267c8c0caf2c0f556a5589",
16
- "src/client.ts": "3b60eb6a9f3625c9b1c344713907631f9213ba54f797a2d4c67e4ffe7d4e6da6",
16
+ "src/client.ts": "6800337488d5f811dd29c226f3122719469ae9412418e54cc9e2b7cd5e16a2d2",
17
17
  "src/core/mode.ts": "2fe56c319706d86746010bd5551f4ee47e31e12a0ee28effffb719b0696ad70c",
18
18
  "src/index.ts": "59edf0d6af2feec3e08da322cabc07a2dc83868312c4daa1074b2a5b12892f57",
19
19
  "src/protocol.ts": "5194007a0c06f7b293cc34579ccdc150c23c35b825091667f37a7293594bd29f",
20
20
  "src/server.ts": "295c52235fa399967a594b76b1f4c869adccc978ee3c0f3f8f3a12894b81ef9b",
21
21
  "src/sidebar-adapter.ts": "edcc051bbcaabb2d09055b231f57253a50a6d9e75acf18adafbf262001b18a48",
22
- "src/styles.ts": "24a03f8c96b8966aae0a1b7df2a6bbb13390ee22ec17a7ff9126f7da2259c8cf",
23
- "src/ui.tsx": "fd08c974ea997794d06a2270f4d0da789ce879327dc7149fcd4f63d3ffca35e3",
24
- "src/web-surface.tsx": "ad423c66b639ea853a59e7ef1b656226e3b0e8df5d21aefb95df967022e6fef3",
22
+ "src/styles.ts": "f3088f1142cf2b9521f14dc73ee9e33f079bfe48230c58787dbf0a3c81014700",
23
+ "src/ui.tsx": "cc35c70c0aa003012aee067470fd380928e87baaa8bb72e4255b96c17998f64a",
24
+ "src/web-surface.tsx": "3e2487fa6d99762d59e7f94ac738384c811c1a3b0cfeb4e35a8230aba81a5468",
25
25
  "src/website-header.ts": "ac4972a28a5f0968de4d5f98d54fbac853f901c7eda00c0849984a2e66f291f3",
26
- "src/website-navigation.ts": "0c70ef6a518d2ba051be0f9094d92cad33ead42815c52742a93835247331dd1c",
26
+ "src/website-navigation.ts": "743a6599af09c200b9bbe16dcdc10adf5007374b9982036f5b9e602f36b620c7",
27
27
  "src/website-notice.ts": "65c781bec41e6c2e541d9512cc0051864d64fc3204b3ba5f2e005bdc955f39c9",
28
28
  "src/website-session-store.ts": "8ef6d49465e0034f12b763a666b4a90c8c9819fb8baea06dcaba340fd97d72f1",
29
29
  "src/website-session.ts": "f2434fafc40adb15b5f16fc8b6152bd8df7e85f5210330a1337502c9a08136d8",
@@ -31,7 +31,7 @@
31
31
  "tsconfig.json": "1ad0b3b39537564a180dc7f4084ceb3098b567f509320c77d71bc37aaf4f1879"
32
32
  },
33
33
  "artifacts": {
34
- "lib/client.js": "c380faa909eb794101949a7621dab657508cd393e67b246f33912fc50bf08a96",
34
+ "lib/client.js": "00c9df0385a2b53eb7aa16f2d2ebd167710f533346ceb8beab096ebe63cf88d4",
35
35
  "lib/index.js": "e9c50cc544f24c60d086538ab1283ae0ed2811f23c9bb469916a2e89c3ffb38d",
36
36
  "lib/types/authorization.d.ts": "130649eed3635e75c3f50c13de93c52440a27f1b88136ab2297552570c013d49",
37
37
  "lib/types/client.d.ts": "a79702d5d86c75e81f1e954b3e9f4a562a6b3082d68d798d6a1b37bd41b908a7",
@@ -41,7 +41,7 @@
41
41
  "lib/types/server.d.ts": "62b23f8f9fe9bb16a20274929876c1a34b3ab1e94179567e2e3a56cd67638288",
42
42
  "lib/types/sidebar-adapter.d.ts": "9296987e7ecbd76e42d75bbf65d06f3e368dc036501baf931d7eaa9fb923252d",
43
43
  "lib/types/styles.d.ts": "305836b3ce5cb256ffb033038b7df2919759976f3ca29395a7cd41bbd5811536",
44
- "lib/types/ui.d.ts": "ecd307b91dec65724fe331081c00c6aea5e286051a9f79cda0f9ab476398d8f4",
44
+ "lib/types/ui.d.ts": "5e42f24c522d2bef8758279167a289e0205b30e40e7504ed9bc4e4f527c08c42",
45
45
  "lib/types/web-surface.d.ts": "71686d72b4a5d6c619ee4ec916bbf7b853a87a7cc4d506fbfd0359191434984f",
46
46
  "lib/types/website-header.d.ts": "6379a35e7d35af3fb969802ee2cae969a104dbad937f7b9e371463a0bd7dea9d",
47
47
  "lib/types/website-navigation.d.ts": "6ffd226ded2fc9971bf982e41ee8d8b15d89d113943bbd7cea18f9d4c1ccc973",
package/lib/client.js CHANGED
@@ -14747,9 +14747,9 @@ window.__ModuleLoader__.load({
14747
14747
  var chatStyles = String.raw`
14748
14748
  .dsh-chat-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
14749
14749
  .dsh-chat-navigation,.dsh-chat-brand-control,.dsh-chat-brand-name,.dsh-chat-main-anchor,.dsh-chat-web-surface{font-family:var(--dsw-font-family,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif);color:var(--dsw-alias-label-primary,#22242a);box-sizing:border-box;font-size:14px}
14750
- .dsh-chat-navigation *,.dsh-chat-brand-control *,.dsh-chat-brand-name *,.dsh-chat-main-anchor *,.dsh-chat-web-surface *{box-sizing:border-box}
14751
- .dsh-chat-navigation button,.dsh-chat-brand-control button,.dsh-chat-main-anchor button,.dsh-chat-web-surface button{font:inherit;-webkit-app-region:no-drag}
14752
- .dsh-chat-navigation button:focus-visible,.dsh-chat-brand-control button:focus-visible,.dsh-chat-main-anchor button:focus-visible,.dsh-chat-web-surface button:focus-visible{outline:2px solid #4d6bfe;outline-offset:3px}
14750
+ .dsh-chat-navigation *,.dsh-chat-brand-control *,.dsh-chat-brand-name *,.dsh-chat-main-anchor *,.dsh-chat-web-surface *,.dsh-chat-settings *{box-sizing:border-box}
14751
+ .dsh-chat-navigation button,.dsh-chat-brand-control button,.dsh-chat-main-anchor button,.dsh-chat-web-surface button,.dsh-chat-settings button{font:inherit;-webkit-app-region:no-drag}
14752
+ .dsh-chat-navigation button:focus-visible,.dsh-chat-brand-control button:focus-visible,.dsh-chat-main-anchor button:focus-visible,.dsh-chat-web-surface button:focus-visible,.dsh-chat-settings button:focus-visible{outline:2px solid #4d6bfe;outline-offset:3px}
14753
14753
  .dsh-chat-modes{display:flex;align-items:center;gap:2px;border:0;padding:3px;margin:0;border-radius:9px;background:var(--dsw-alias-interactive-bg-hover,#e7e9ed);min-width:0;width:max-content}
14754
14754
  .dsh-chat-modes button{padding:6px 9px;border:0;background:transparent;border-radius:6px;color:inherit;font-size:10px;font-weight:650;letter-spacing:.35px;white-space:nowrap;cursor:pointer;min-height:27px}
14755
14755
  .dsh-chat-modes button[aria-pressed="true"]{background:#fff;color:#242832;box-shadow:0 1px 3px #151e2f15}
@@ -14784,6 +14784,7 @@ window.__ModuleLoader__.load({
14784
14784
  .dsh-chat-navigation-status{font-size:12px;line-height:1.7;color:var(--dsw-alias-label-secondary,#8b8d91);padding:6px 4px}
14785
14785
  .dsh-chat-navigation-rail{align-items:center;padding-top:6px}
14786
14786
  .dsh-chat-text-button{padding:7px 4px;border:0;background:transparent;color:var(--dsw-alias-label-secondary,#8b8d91);font-size:11px!important;cursor:pointer}
14787
+ .dsh-chat-primary-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:144px;min-height:40px;padding:10px 20px;border:1px solid #4d6bfe;border-radius:8px;background:#4d6bfe;color:#fff;font-size:14px!important;font-weight:600!important;line-height:20px;white-space:nowrap;cursor:pointer;pointer-events:auto;-webkit-app-region:no-drag}.dsh-chat-primary-button:hover{background:#617dff;border-color:#617dff}.dsh-chat-primary-button:active{background:#3b58e8;border-color:#3b58e8}.dsh-chat-primary-button:disabled{opacity:.5;cursor:default}
14787
14788
  .dsh-chat-main-anchor{height:100%;min-width:0;width:100%;position:relative;background:var(--dsw-alias-bg-base,#fff)}
14788
14789
  .dsh-chat-web-surface{position:fixed;z-index:20;pointer-events:auto;display:flex;flex-direction:column;background:var(--dsw-alias-bg-base,#fff);overflow:hidden}
14789
14790
  .dsh-chat-web-content{position:relative;flex:1;min-height:0;display:flex}.dsh-chat-webview{display:flex;width:100%;height:100%;flex:1;border:0}
@@ -14795,8 +14796,7 @@ window.__ModuleLoader__.load({
14795
14796
  .dsh-chat-leading button{flex:none;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:0;border-radius:var(--dsw-radius-sm,6px);background:transparent;color:var(--dsw-alias-label-secondary);cursor:pointer;-webkit-app-region:no-drag}
14796
14797
  .dsh-chat-leading button:hover{background:var(--dsw-alias-interactive-bg-hover)}.dsh-chat-leading button:disabled{opacity:.4;cursor:default}
14797
14798
  .dsh-chat-settings{font-family:var(--dsw-font-family,system-ui);color:var(--dsw-alias-label-primary);font-size:14px;min-width:0}.dsh-chat-settings h2{margin:0 0 20px;font-size:20px}
14798
- .dsh-chat-settings-pane-hidden{height:1px!important;min-height:1px!important;background:transparent!important;overflow:hidden!important}.dsh-chat-settings-card{border:1px solid var(--dsw-alias-border-primary,#ffffff15);border-radius:12px;padding:24px;background:var(--dsw-alias-bg-base,#202124)}.dsh-chat-settings-language{display:flex;align-items:center;justify-content:space-between;gap:24px;border-top:1px solid #ffffff15;padding-top:20px}.dsh-chat-settings-select{position:relative;display:inline-flex;flex:none;min-width:140px}.dsh-chat-settings-language select{box-sizing:border-box;width:100%;appearance:none;-webkit-appearance:none;font:inherit;color:inherit;background:var(--dsw-alias-bg-base,#202124);border:1px solid #ffffff25;border-radius:8px;padding:8px 38px 8px 12px;min-width:140px}.dsh-chat-settings-select-arrow{position:absolute;right:12px;top:50%;transform:translateY(-50%);width:12px;height:12px;pointer-events:none}.dsh-chat-settings-language select:disabled+.dsh-chat-settings-select-arrow{opacity:.4}.dsh-chat-settings-account p,.dsh-chat-settings-progress{font-size:12px;color:var(--dsw-alias-label-secondary,#aaa)}
14799
- .dsh-chat-settings-pane{position:relative;height:min(500px,calc(100vh - 340px));min-height:220px;border-radius:12px;overflow:hidden;background:#292a2d}
14799
+ .dsh-chat-settings-card{border:1px solid var(--dsw-alias-border-primary,#ffffff15);border-radius:12px;padding:24px;background:var(--dsw-alias-bg-base,#202124)}.dsh-chat-settings-status strong{display:block;font-size:16px;font-weight:600}.dsh-chat-settings-status p{margin:10px 0 20px;color:var(--dsw-alias-label-secondary,#aaa);line-height:1.7}.dsh-chat-settings-status .dsh-chat-settings-error{color:#ff8585}.dsh-chat-settings-language{display:flex;align-items:center;justify-content:space-between;gap:24px;border-top:1px solid #ffffff15;padding-top:20px}.dsh-chat-settings-select{position:relative;display:inline-flex;flex:none;min-width:140px}.dsh-chat-settings-language select{box-sizing:border-box;width:100%;appearance:none;-webkit-appearance:none;font:inherit;color:inherit;background:var(--dsw-alias-bg-base,#202124);border:1px solid #ffffff25;border-radius:8px;padding:8px 38px 8px 12px;min-width:140px}.dsh-chat-settings-select-arrow{position:absolute;right:12px;top:50%;transform:translateY(-50%);width:12px;height:12px;pointer-events:none}.dsh-chat-settings-language select:disabled+.dsh-chat-settings-select-arrow{opacity:.4}.dsh-chat-settings-account p,.dsh-chat-settings-progress{font-size:12px;color:var(--dsw-alias-label-secondary,#aaa)}
14800
14800
  .dsh-chat-settings-account{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px;min-width:0}.dsh-chat-settings-account>div{flex:1 1 0%;min-width:0;max-width:100%}.dsh-chat-settings-account strong{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dsh-chat-settings-account button{flex-shrink:0;white-space:nowrap;padding:8px 14px;border:1px solid #ff5f64;border-radius:8px;background:transparent;color:#ff5f64;cursor:pointer;font:inherit}.dsh-chat-settings-account button:disabled{opacity:.4;cursor:default}
14801
14801
  .dsh-chat-settings-error{color:#ff8585;line-height:1.5;font-size:12px}
14802
14802
  `;
@@ -14968,44 +14968,32 @@ window.__ModuleLoader__.load({
14968
14968
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Tooltip, { label: "\u65B0\u5EFA\u5BF9\u8BDD", delayMs: 500, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", "aria-label": "\u65B0\u5EFA\u5B98\u7F51\u5BF9\u8BDD", disabled: !state.modeEnabled || !state.websiteNavigation.canCreate, onClick: () => bridge.commandWebsite({ type: "new" }), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconNewChatOutlineRegular, { size: 16 }) }) })
14969
14969
  ] });
14970
14970
  }
14971
- function DshChatChatSettings({ bridge }) {
14971
+ function DshChatChatSettings({ bridge, close }) {
14972
14972
  const state = useDshChat(bridge);
14973
- const pane = (0, import_react.useRef)(null);
14974
14973
  const enabled = state.desktopAvailable;
14975
14974
  (0, import_react.useLayoutEffect)(() => {
14976
- const element = pane.current;
14977
- if (!element || !enabled) {
14978
- bridge.updateSettingsViewport(null);
14975
+ if (!enabled) {
14976
+ bridge.setSettingsOpen(false);
14979
14977
  return;
14980
14978
  }
14981
- const measure = () => {
14982
- const rect = element.getBoundingClientRect();
14983
- bridge.updateSettingsViewport({ left: rect.left, top: rect.top, width: rect.width, height: rect.height });
14984
- };
14985
- const resize = new ResizeObserver(measure);
14986
- resize.observe(element);
14987
- globalThis.addEventListener("resize", measure);
14988
- globalThis.addEventListener("scroll", measure, true);
14989
- measure();
14979
+ bridge.setSettingsOpen(true);
14990
14980
  return () => {
14991
- resize.disconnect();
14992
- globalThis.removeEventListener("resize", measure);
14993
- globalThis.removeEventListener("scroll", measure, true);
14994
- bridge.updateSettingsViewport(null);
14981
+ bridge.setSettingsOpen(false);
14995
14982
  };
14996
14983
  }, [bridge, enabled]);
14997
- (0, import_react.useLayoutEffect)(() => {
14998
- if (!enabled || !pane.current) return;
14999
- const rect = pane.current.getBoundingClientRect();
15000
- bridge.updateSettingsViewport({ left: rect.left, top: rect.top, width: rect.width, height: rect.height });
15001
- }, [bridge, enabled, state.preferenceError, state.websiteNavigation.accountName, state.websiteNavigation.settings?.error, state.websiteAuthenticationStatus]);
14984
+ const signIn = () => {
14985
+ bridge.setSettingsOpen(false);
14986
+ close();
14987
+ bridge.beginWebsiteSignIn();
14988
+ };
15002
14989
  const navigation = state.websiteNavigation;
15003
14990
  const settings = navigation.settings;
14991
+ const showAccount = enabled && navigation.authenticated === true && !["signed-out", "signing-in", "signing-out"].includes(state.websiteAuthenticationStatus);
15004
14992
  const language = /中文|Chinese/i.test(settings?.language ?? "") ? "zh-CN" : /English|英语/i.test(settings?.language ?? "") ? "en" : /^(System|跟随系统|系统|Follow system)$/i.test(settings?.language ?? "") ? "system" : "";
15005
14993
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "dsh-chat-settings", children: [
15006
14994
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DshChatStyles, {}),
15007
14995
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { children: "CHAT\u8BBE\u7F6E" }),
15008
- enabled && navigation.authenticated === true && state.websiteAuthenticationStatus !== "signing-out" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-chat-settings-card", children: [
14996
+ showAccount && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-chat-settings-card", children: [
15009
14997
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-chat-settings-account", role: "group", "aria-label": "DeepSeek \u5B98\u7F51\u8D26\u53F7", children: [
15010
14998
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
15011
14999
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { title: navigation.accountName || "DeepSeek Chat", children: navigation.accountName || "DeepSeek Chat" }),
@@ -15045,23 +15033,30 @@ window.__ModuleLoader__.load({
15045
15033
  ] })
15046
15034
  ] }),
15047
15035
  !enabled && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { role: "status", children: "\u9700\u8981 DSH \u684C\u9762\u7248\u7684\u5B98\u65B9\u7F51\u9875\u5BB9\u5668\u3002" }),
15048
- enabled && state.websiteAuthenticationStatus === "signed-out" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-chat-settings-card", children: [
15049
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "CHAT \u5C1A\u672A\u767B\u5F55\u3002\u8FD9\u91CC\u4E0E\u5BF9\u8BDD\u9875\u9762\u4F7F\u7528\u540C\u4E00\u4E2A\u5B98\u7F51\u8D26\u53F7\uFF0C\u767B\u5F55\u540E\u81EA\u52A8\u540C\u6B65\u3002" }),
15050
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", onClick: () => bridge.beginWebsiteSignIn(), children: "\u767B\u5F55 DeepSeek" })
15036
+ enabled && state.websiteAuthenticationStatus === "signed-out" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-chat-settings-card dsh-chat-settings-status", children: [
15037
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: "CHAT \u5C1A\u672A\u767B\u5F55" }),
15038
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "\u767B\u5F55\u4F1A\u6253\u5F00 CHAT \u5BF9\u8BDD\u9875\u9762\u3002\u5B8C\u6210\u5B98\u7F51\u767B\u5F55\u540E\uFF0C\u8FD9\u91CC\u7684\u8D26\u53F7\u4E0E\u5B98\u7F51\u5BF9\u8BDD\u4F1A\u81EA\u52A8\u540C\u6B65\u3002" }),
15039
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "dsh-chat-primary-button", onClick: signIn, children: "\u767B\u5F55 DeepSeek" })
15051
15040
  ] }),
15052
- enabled && state.websiteAuthenticationStatus === "signing-in" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { role: "status", children: "\u8BF7\u5728\u4E0B\u65B9\u5B98\u7F51\u5B8C\u6210\u767B\u5F55\u3002\u767B\u5F55\u6210\u529F\u540E\u8D26\u53F7\u3001\u5BF9\u8BDD\u5217\u8868\u548C\u767B\u5F55\u8BB0\u5FC6\u4F1A\u81EA\u52A8\u540C\u6B65\u3002" }),
15053
- enabled && state.websiteAuthenticationStatus === "signing-out" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { role: "status", children: "\u6B63\u5728\u6E05\u9664\u767B\u5F55\u8BB0\u5FC6\u5E76\u9000\u51FA\u5B98\u7F51\u2026" }),
15054
- enabled && state.websiteAuthenticationStatus === "error" && state.websiteSessionError && navigation.authenticated !== true && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "dsh-chat-settings-error", role: "alert", children: [
15055
- state.websiteSessionError,
15056
- " ",
15057
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", onClick: () => bridge.logoutWebsite(), children: "\u91CD\u8BD5\u9000\u51FA\u767B\u5F55" })
15041
+ enabled && state.websiteAuthenticationStatus === "signing-in" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-chat-settings-card dsh-chat-settings-status", children: [
15042
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { role: "status", children: "\u6B63\u5728\u767B\u5F55 DeepSeek" }),
15043
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "\u8BF7\u5728 CHAT \u5BF9\u8BDD\u9875\u9762\u5B8C\u6210\u5B98\u7F51\u767B\u5F55\u3002\u767B\u5F55\u6210\u529F\u540E\uFF0C\u8D26\u53F7\u548C\u767B\u5F55\u8BB0\u5FC6\u4F1A\u81EA\u52A8\u540C\u6B65\u3002" }),
15044
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "dsh-chat-primary-button", onClick: signIn, children: "\u7EE7\u7EED\u767B\u5F55" })
15058
15045
  ] }),
15059
- enabled && state.websiteAuthenticationStatus !== "signing-out" && navigation.authenticated !== true && navigation.status !== "sign-in" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { role: "status", children: [
15060
- state.webError || (navigation.status === "unsupported" ? "\u5B98\u7F51\u9875\u9762\u5DF2\u6253\u5F00\uFF0C\u6682\u672A\u8BC6\u522B\u5230\u8D26\u53F7\u548C\u5BF9\u8BDD\u533A\u57DF\uFF0C\u6B63\u5728\u81EA\u52A8\u91CD\u8BD5\u3002" : "\u6B63\u5728\u8BC6\u522B DeepSeek \u5B98\u7F51\u767B\u5F55\u72B6\u6001\u2026"),
15061
- " ",
15062
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", onClick: () => bridge.reloadWebsite(), children: "\u91CD\u65B0\u52A0\u8F7D" })
15046
+ enabled && state.websiteAuthenticationStatus === "signing-out" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-chat-settings-card dsh-chat-settings-status", children: [
15047
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { role: "status", children: "\u6B63\u5728\u9000\u51FA\u767B\u5F55" }),
15048
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "\u6B63\u5728\u6E05\u9664\u767B\u5F55\u8BB0\u5FC6\u5E76\u9000\u51FA\u5B98\u7F51\u2026" })
15063
15049
  ] }),
15064
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref: pane, className: `dsh-chat-settings-pane${enabled && state.websiteAuthenticationStatus === "signing-in" ? "" : " dsh-chat-settings-pane-hidden"}`, "aria-label": "CHAT\u5B98\u7F51\u767B\u5F55\u533A\u57DF" })
15050
+ enabled && state.websiteAuthenticationStatus === "error" && !showAccount && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-chat-settings-card dsh-chat-settings-status", children: [
15051
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: "\u767B\u5F55\u72B6\u6001\u6682\u65F6\u65E0\u6CD5\u540C\u6B65" }),
15052
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "dsh-chat-settings-error", role: "alert", children: state.websiteSessionError || state.webError || "\u6682\u65F6\u65E0\u6CD5\u786E\u8BA4\u5B98\u7F51\u767B\u5F55\u72B6\u6001\uFF0C\u8BF7\u91CD\u8BD5\u3002" }),
15053
+ /退出/.test(state.websiteSessionError ?? "") ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "dsh-chat-text-button", onClick: () => bridge.logoutWebsite(), children: "\u91CD\u8BD5\u9000\u51FA\u767B\u5F55" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "dsh-chat-text-button", onClick: () => bridge.reloadWebsite(), children: "\u91CD\u65B0\u52A0\u8F7D" })
15054
+ ] }),
15055
+ enabled && !showAccount && state.websiteAuthenticationStatus === "loading" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-chat-settings-card dsh-chat-settings-status", children: [
15056
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { role: "status", children: "\u6B63\u5728\u540C\u6B65\u5B98\u7F51\u8D26\u53F7" }),
15057
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: state.webError || (navigation.status === "unsupported" ? "\u5B98\u7F51\u9875\u9762\u5DF2\u6253\u5F00\uFF0C\u6B63\u5728\u540C\u6B65\u8D26\u53F7\u548C\u5BF9\u8BDD\u5217\u8868\u2026" : "\u6B63\u5728\u8BC6\u522B DeepSeek \u5B98\u7F51\u767B\u5F55\u72B6\u6001\u2026") }),
15058
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "dsh-chat-text-button", onClick: () => bridge.reloadWebsite(), children: "\u91CD\u65B0\u52A0\u8F7D" })
15059
+ ] })
15065
15060
  ] });
15066
15061
  }
15067
15062
 
@@ -15415,16 +15410,18 @@ window.__ModuleLoader__.load({
15415
15410
  const profileProofMarker = "data-dsh-chat-profile-confirmed";
15416
15411
  const profileAvatarMarker = "data-dsh-chat-profile-avatar";
15417
15412
  const navigationWidthMarker = "data-dsh-chat-navigation-width";
15413
+ const expandingMarker = "data-dsh-chat-expanding";
15414
+ const compactToggleMarker = "data-dsh-chat-compact-toggle";
15418
15415
  const conversationError = "\u8BE5\u5BF9\u8BDD\u4E0D\u5728\u5F53\u524D\u5B98\u7F51\u5217\u8868\uFF0C\u8BF7\u5237\u65B0\u5217\u8868\u3002";
15419
15416
  const styleId = "dsh-chat-website-navigation-style";
15420
15417
  const preparingStyleId = "dsh-chat-website-preparing-style";
15421
- const owned = [marker, presentedMarker, missingSidebarMarker, fallbackMarker, fallbackErrorMarker, profileMarker, profileProofMarker, profileAvatarMarker, navigationWidthMarker, "data-dsh-chat-layout", "data-dsh-chat-content", "data-dsh-chat-web-chrome", "data-dsh-chat-settings-dialog", "data-dsh-chat-settings-host", "data-dsh-chat-settings-tabs", "data-dsh-chat-settings-pane", "data-dsh-chat-settings-layout", "data-dsh-chat-settings-chrome", "data-dsh-chat-settings-appearance", "data-dsh-chat-expanding", "data-dsh-chat-header-row", "data-dsh-chat-header-title", "data-dsh-chat-header-share", "data-dsh-chat-header-title-host", "data-dsh-chat-header-editor", "data-dsh-chat-header-native-depth"];
15418
+ const owned = [marker, presentedMarker, missingSidebarMarker, fallbackMarker, fallbackErrorMarker, profileMarker, profileProofMarker, profileAvatarMarker, navigationWidthMarker, expandingMarker, compactToggleMarker, "data-dsh-chat-layout", "data-dsh-chat-content", "data-dsh-chat-web-chrome", "data-dsh-chat-settings-dialog", "data-dsh-chat-settings-host", "data-dsh-chat-settings-tabs", "data-dsh-chat-settings-pane", "data-dsh-chat-settings-layout", "data-dsh-chat-settings-chrome", "data-dsh-chat-settings-appearance", "data-dsh-chat-header-row", "data-dsh-chat-header-title", "data-dsh-chat-header-share", "data-dsh-chat-header-title-host", "data-dsh-chat-header-editor", "data-dsh-chat-header-native-depth"];
15422
15419
  const empty = (status) => ({ status, ...status === "sign-in" ? { authenticated: false } : {}, conversations: [], selectedHref: null, canCreate: false, error: null });
15423
15420
  const clearSettings = (preserveConfirmedPreferences = false) => {
15424
15421
  const confirmed = ["data-dsh-chat-language", "data-dsh-chat-theme", "data-dsh-chat-dark-complete", "data-dsh-chat-settings-restored"];
15425
15422
  for (const attr of [...doc.documentElement.attributes]) if (/^data-dsh-chat-(settings-|language$|theme$|dark-complete$)/.test(attr.name) && !(preserveConfirmedPreferences && confirmed.includes(attr.name))) doc.documentElement.removeAttribute(attr.name);
15426
15423
  };
15427
- const restore = (preserveConfirmedPreferences = false) => {
15424
+ const restore = (preserveConfirmedPreferences = false, preserveCompactAttempt = false) => {
15428
15425
  clearSettings(preserveConfirmedPreferences);
15429
15426
  doc.getElementById(styleId)?.remove();
15430
15427
  doc.getElementById("dsh-chat-header-style")?.remove();
@@ -15433,10 +15430,14 @@ window.__ModuleLoader__.load({
15433
15430
  doc.getElementById("dsh-chat-settings-view-style")?.remove();
15434
15431
  doc.documentElement.removeAttribute("data-dsh-chat-voice");
15435
15432
  doc.documentElement.removeAttribute("data-dsh-chat-preparing");
15436
- owned.forEach((attr) => doc.querySelectorAll(`[${attr}]`).forEach((node2) => node2.removeAttribute(attr)));
15433
+ owned.forEach((attr) => {
15434
+ if (preserveCompactAttempt && (attr === expandingMarker || attr === compactToggleMarker)) return;
15435
+ doc.querySelectorAll(`[${attr}]`).forEach((node2) => node2.removeAttribute(attr));
15436
+ });
15437
15437
  };
15438
15438
  const fallback = (error51 = null) => {
15439
- restore(page.origin === origin && !/^\/sign_in\/?$/.test(page.pathname) && command.type !== "restore");
15439
+ const preserveRecovery = page.origin === origin && !/^\/sign_in\/?$/.test(page.pathname) && command.type !== "restore";
15440
+ restore(preserveRecovery, preserveRecovery);
15440
15441
  if (page.origin === origin && /^\/sign_in\/?$/.test(page.pathname)) return empty("sign-in");
15441
15442
  if (!(command.type === "snapshot" && command.showOriginal)) {
15442
15443
  doc.documentElement.setAttribute(fallbackMarker, "");
@@ -15539,25 +15540,56 @@ window.__ModuleLoader__.load({
15539
15540
  if (started !== previous) doc.documentElement.setAttribute(missingSidebarMarker, String(started));
15540
15541
  return now - started >= 5e3;
15541
15542
  };
15543
+ const iconButtonSelector = 'button,[role="button"],.ds-icon-button';
15544
+ const compactNavigation = () => {
15545
+ const toggleLabels = /^(展开侧边栏|打开侧边栏|侧边栏|切换侧边栏|Open sidebar|Expand sidebar|Toggle sidebar|Sidebar)$/i;
15546
+ const openingLabels = /^(展开侧边栏|打开侧边栏|Open sidebar|Expand sidebar)$/i;
15547
+ const searchLabels = /^(搜索|搜索对话|Search|Search chats|Search conversations)$/i;
15548
+ const newLabels = /^(开启新对话|新对话|新建对话|New chat|New Chat)$/i;
15549
+ const namedAs = (button, expected) => {
15550
+ const names = ["aria-label", "title"].map((attr) => (button.getAttribute(attr) ?? "").trim()).filter(Boolean);
15551
+ return names.length === 0 || names.every((name2) => expected.test(name2));
15552
+ };
15553
+ for (const row of doc.querySelectorAll("div,header,nav")) {
15554
+ const bounds = row.getBoundingClientRect();
15555
+ if (bounds.top < -1 || bounds.top > 72 || bounds.left < -1 || bounds.left > 160 || bounds.width < 72 || bounds.width > 360 || bounds.height < 24 || bounds.height > 80 || row.textContent?.trim() || row.closest('[role="dialog"],[role="menu"],[data-dsh-chat-settings-dialog],.ds-modal-content,.ds-dropdown-menu') || row.querySelector('a[href],input,textarea,[contenteditable="true"]')) continue;
15556
+ const rowButtons = [...row.querySelectorAll(iconButtonSelector)].filter((button) => {
15557
+ const parentButton = button.parentElement?.closest(iconButtonSelector);
15558
+ return !parentButton || !row.contains(parentButton);
15559
+ });
15560
+ if (rowButtons.length !== 3) continue;
15561
+ const buttons = rowButtons.filter((button) => {
15562
+ const rect = button.getBoundingClientRect();
15563
+ return rect.width >= 20 && rect.width <= 64 && rect.height >= 20 && rect.height <= 64 && rect.left >= bounds.left - 1 && rect.right <= bounds.right + 1 && rect.top >= bounds.top - 1 && rect.bottom <= bounds.bottom + 1 && !button.textContent?.trim() && !!button.querySelector("svg") && !button.closest('[hidden],[aria-hidden="true"]') && getComputedStyle(button).visibility !== "hidden" && button.getAttribute("aria-disabled") !== "true" && !button.matches(":disabled");
15564
+ }).sort((left, right) => left.getBoundingClientRect().left - right.getBoundingClientRect().left);
15565
+ if (buttons.length !== 3 || buttons[0].getAttribute("aria-expanded") === "true" || !namedAs(buttons[0], toggleLabels) || !namedAs(buttons[1], searchLabels) || !namedAs(buttons[2], newLabels)) continue;
15566
+ const rects = buttons.map((button) => button.getBoundingClientRect());
15567
+ if (rects.some((rect) => Math.abs(rect.top - rects[0].top) > 8) || rects[1].left < rects[0].right - 1 || rects[2].left < rects[1].right - 1) continue;
15568
+ return { row, toggle: buttons[0] };
15569
+ }
15570
+ for (const toggle of doc.querySelectorAll(iconButtonSelector)) {
15571
+ const bounds = toggle.getBoundingClientRect();
15572
+ const name2 = (toggle.getAttribute("aria-label") || toggle.getAttribute("title") || "").trim();
15573
+ const expanded = toggle.getAttribute("aria-expanded");
15574
+ if (!toggleLabels.test(name2) || expanded === "true" || !openingLabels.test(name2) && expanded !== "false" || bounds.left < 0 || bounds.left > 160 || bounds.top < 0 || bounds.top > 72 || bounds.width < 20 || bounds.width > 64 || bounds.height < 20 || bounds.height > 64 || toggle.textContent?.trim() || !toggle.querySelector("svg") || toggle.getAttribute("aria-disabled") === "true" || toggle.matches(":disabled") || getComputedStyle(toggle).visibility === "hidden" || toggle.closest('[hidden],[aria-hidden="true"],a[href],[role="dialog"],[role="menu"],[data-dsh-chat-settings-dialog],.ds-modal-content,.ds-dropdown-menu')) continue;
15575
+ return { row: toggle.parentElement, toggle };
15576
+ }
15577
+ return null;
15578
+ };
15542
15579
  if (!sidebar || !newChat) {
15580
+ const compact = !isOriginalSnapshot && command.type === "snapshot" ? compactNavigation() : null;
15581
+ if (compact && !doc.documentElement.hasAttribute(expandingMarker)) {
15582
+ const started = String(Date.now());
15583
+ compact.toggle.setAttribute(compactToggleMarker, started);
15584
+ doc.documentElement.setAttribute(expandingMarker, started);
15585
+ doc.documentElement.setAttribute(missingSidebarMarker, started);
15586
+ compact.toggle.click();
15587
+ return empty("loading");
15588
+ }
15589
+ const expandedAt = Number(doc.documentElement.getAttribute(expandingMarker));
15590
+ if (!isOriginalSnapshot && Number.isFinite(expandedAt) && expandedAt > 0 && Date.now() - expandedAt < 5e3) return empty("loading");
15543
15591
  if (recovering) return fallbackNavigation();
15544
15592
  if (isOriginalSnapshot || structureExpired()) return fallback();
15545
- if (!doc.documentElement.hasAttribute(presentedMarker) && !doc.documentElement.hasAttribute("data-dsh-chat-expanding")) {
15546
- const compact = [...doc.querySelectorAll("div,header")].find((el) => {
15547
- const r = el.getBoundingClientRect();
15548
- const buttons = el.querySelectorAll('button,[role="button"]');
15549
- return r.top >= -1 && r.top < 80 && r.left >= -1 && r.left < 180 && r.width > 30 && r.width < 400 && r.height > 16 && r.height < 80 && buttons.length >= 2 && buttons.length <= 3 && el.querySelector("svg,img") && !el.textContent?.trim();
15550
- });
15551
- const mobileToggle = [...doc.querySelectorAll('button,[role="button"]')].find((el) => {
15552
- const r = el.getBoundingClientRect();
15553
- return r.left >= 0 && r.left < 80 && r.top >= 0 && r.top < 80 && r.width >= 20 && r.width <= 72 && r.height >= 20 && r.height <= 72 && !el.textContent?.trim() && !!el.querySelector("svg") && !el.closest("[data-dsh-chat-settings-dialog]");
15554
- });
15555
- const expandable = compact ?? mobileToggle;
15556
- if (expandable) {
15557
- doc.documentElement.setAttribute("data-dsh-chat-expanding", String(Date.now()));
15558
- (compact?.querySelector('button,[role="button"]') ?? mobileToggle)?.click();
15559
- }
15560
- }
15561
15593
  return empty("loading");
15562
15594
  }
15563
15595
  let track = sidebar;
@@ -15581,6 +15613,8 @@ window.__ModuleLoader__.load({
15581
15613
  return empty("loading");
15582
15614
  }
15583
15615
  doc.documentElement.removeAttribute(missingSidebarMarker);
15616
+ doc.documentElement.removeAttribute(expandingMarker);
15617
+ doc.querySelectorAll(`[${compactToggleMarker}]`).forEach((button) => button.removeAttribute(compactToggleMarker));
15584
15618
  if (recovering) {
15585
15619
  doc.documentElement.removeAttribute(fallbackMarker);
15586
15620
  doc.documentElement.removeAttribute(fallbackErrorMarker);
@@ -15705,7 +15739,7 @@ window.__ModuleLoader__.load({
15705
15739
  content.setAttribute("data-dsh-chat-content", "");
15706
15740
  for (const candidate of content.querySelectorAll("div,header")) {
15707
15741
  const r = candidate.getBoundingClientRect();
15708
- if (r.top >= -1 && r.top <= 72 && r.height > 0 && r.height <= 80 && r.width <= 400 && candidate.querySelectorAll('button,[role="button"]').length >= 2 && candidate.querySelectorAll('button,[role="button"]').length <= 3 && candidate.querySelector("svg,img") && !candidate.querySelector('textarea,[contenteditable="true"]') && !candidate.textContent?.trim()) candidate.setAttribute("data-dsh-chat-web-chrome", "");
15742
+ if (r.top >= -1 && r.top <= 72 && r.height > 0 && r.height <= 80 && r.width <= 400 && candidate.querySelectorAll(iconButtonSelector).length >= 2 && candidate.querySelectorAll(iconButtonSelector).length <= 3 && candidate.querySelector("svg,img") && !candidate.querySelector('textarea,[contenteditable="true"]') && !candidate.textContent?.trim()) candidate.setAttribute("data-dsh-chat-web-chrome", "");
15709
15743
  }
15710
15744
  }
15711
15745
  const styleText = `html:not([data-dsh-chat-settings-request]) [${marker}],[data-dsh-chat-web-chrome]{display:none!important}
@@ -15870,12 +15904,12 @@ window.__ModuleLoader__.load({
15870
15904
  const retryGuestSession = (0, import_react2.useRef)(null);
15871
15905
  const lastReload = (0, import_react2.useRef)(state.websiteReloadRevision);
15872
15906
  (0, import_react2.useEffect)(() => {
15873
- if ((state.mode === "chat" && state.modeEnabled || state.settingsViewport) && state.authorizationStatus === "authorized") {
15907
+ if ((state.mode === "chat" && state.modeEnabled || state.settingsOpen) && state.authorizationStatus === "authorized") {
15874
15908
  setRequestedGeneration(state.authorizationGeneration);
15875
15909
  if (previousMode.current === "harness" && needsRecovery.current) setRecoveryRevision((value) => value + 1);
15876
15910
  }
15877
15911
  previousMode.current = state.mode;
15878
- }, [state.mode, state.modeEnabled, state.authorizationStatus, state.authorizationGeneration, state.settingsViewport]);
15912
+ }, [state.mode, state.modeEnabled, state.authorizationStatus, state.authorizationGeneration, state.settingsOpen]);
15879
15913
  (0, import_react2.useEffect)(() => {
15880
15914
  let stopped = false;
15881
15915
  let held;
@@ -16067,7 +16101,7 @@ window.__ModuleLoader__.load({
16067
16101
  if (currentProjection()) {
16068
16102
  documentPresented = true;
16069
16103
  bridge.reportWebsiteNavigation(generation, { status: "unsupported", conversations: [], selectedHref: null, canCreate: false, error: null });
16070
- setPresentationReady(!snapshot.settingsViewport);
16104
+ setPresentationReady(!snapshot.settingsOpen);
16071
16105
  if (currentProjection()) {
16072
16106
  try {
16073
16107
  await execute({ type: "restore" });
@@ -16189,14 +16223,14 @@ window.__ModuleLoader__.load({
16189
16223
  (0, import_react2.useEffect)(() => () => {
16190
16224
  guestEvents.current?.abort();
16191
16225
  }, []);
16192
- const inSettings = state.settingsViewport !== null;
16193
- const rect = inSettings && state.websiteNavigation.status !== "sign-in" ? { left: 0, top: 0, width: globalThis.innerWidth, height: globalThis.innerHeight } : state.settingsViewport ?? state.viewport;
16194
- const visible = (inSettings && state.websiteNavigation.status === "sign-in" && presentationReady || !inSettings && state.mode === "chat" && state.modeEnabled) && rect !== null;
16226
+ const inSettings = state.settingsOpen;
16227
+ const rect = inSettings ? state.viewport ?? { left: 0, top: 0, width: globalThis.innerWidth, height: globalThis.innerHeight } : state.viewport;
16228
+ const visible = !inSettings && state.mode === "chat" && state.modeEnabled && rect !== null && rect.width > 0 && rect.height > 0;
16195
16229
  const activeReservation = reservation !== null && reservation.generation === state.authorizationGeneration && reservation.storageKey === state.accountStorageKey ? reservation : null;
16196
16230
  const clearance = 0;
16197
16231
  const logoutError = state.websiteAuthenticationStatus === "error" && /退出/.test(state.websiteSessionError ?? "");
16198
16232
  return (0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("section", { id: "dsh-chat-website-surface", className: "dsh-chat-web-surface", "aria-label": "DeepSeek \u5B98\u7F51\u7F51\u9875", "aria-hidden": !visible, style: {
16199
- zIndex: inSettings ? visible ? 1001 : 0 : 14,
16233
+ zIndex: inSettings ? 0 : 14,
16200
16234
  visibility: visible ? "visible" : "hidden",
16201
16235
  display: (inSettings || state.mode === "chat") && rect ? "flex" : "none",
16202
16236
  opacity: visible ? 1 : 0,
@@ -16205,7 +16239,7 @@ window.__ModuleLoader__.load({
16205
16239
  top: (rect?.top ?? 0) + clearance,
16206
16240
  width: rect?.width ?? 0,
16207
16241
  height: Math.max(0, (rect?.height ?? 0) - clearance),
16208
- borderRadius: inSettings ? 12 : 0,
16242
+ borderRadius: 0,
16209
16243
  overflow: "hidden"
16210
16244
  }, children: [
16211
16245
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DshChatStyles, {}),
@@ -16228,7 +16262,7 @@ window.__ModuleLoader__.load({
16228
16262
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: nativeBrowser === void 0 ? "\u5F53\u524D\u73AF\u5883\u65E0\u6CD5\u5185\u5D4C\u7F51\u9875" : state.webError !== null ? "\u7F51\u9875\u6682\u65F6\u65E0\u6CD5\u4F7F\u7528" : logoutError ? "\u9000\u51FA\u767B\u5F55\u672A\u5B8C\u6210" : state.websiteAuthenticationStatus === "signed-out" ? "\u767B\u5F55 DeepSeek Chat" : state.websiteAuthenticationStatus === "signing-out" ? "\u6B63\u5728\u9000\u51FA\u767B\u5F55" : "\u6B63\u5728\u6253\u5F00 DeepSeek \u5B98\u7F51" }),
16229
16263
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: state.webError || (logoutError ? state.websiteSessionError : nativeBrowser === void 0 ? "\u9700\u8981\u63D0\u4F9B\u5B98\u65B9\u6D4F\u89C8\u5668\u80FD\u529B\u7684 DSH \u684C\u9762\u7248\u3002" : state.websiteAuthenticationStatus === "signing-out" ? "\u6B63\u5728\u6E05\u9664\u767B\u5F55\u8BB0\u5FC6\u5E76\u9000\u51FA\u5B98\u7F51\u3002" : "CHAT \u4F7F\u7528\u72EC\u7ACB\u7684\u5B98\u7F51\u767B\u5F55\uFF0C\u767B\u5F55\u540E\u81EA\u52A8\u540C\u6B65\u8D26\u53F7\u548C\u5B98\u7F51\u5BF9\u8BDD\u3002") }),
16230
16264
  logoutError && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: "dsh-chat-text-button", onClick: () => bridge.logoutWebsite(), children: "\u91CD\u8BD5\u9000\u51FA\u767B\u5F55" }),
16231
- state.websiteAuthenticationStatus === "signed-out" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: "dsh-chat-text-button", onClick: () => bridge.beginWebsiteSignIn(), children: "\u767B\u5F55 DeepSeek" }),
16265
+ state.websiteAuthenticationStatus === "signed-out" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: "dsh-chat-primary-button", onClick: () => bridge.beginWebsiteSignIn(), children: "\u767B\u5F55 DeepSeek" }),
16232
16266
  state.authorizationStatus !== "authorized" && nativeBrowser !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: "dsh-chat-text-button", onClick: () => bridge.refreshAuthorization(), children: "\u91CD\u8BD5\u8FDE\u63A5" }),
16233
16267
  state.webError !== null && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: "dsh-chat-text-button", onClick: () => bridge.reloadWebsite(), disabled: nativeBrowser === void 0 || !state.modeEnabled, children: "\u91CD\u8BD5\u7F51\u9875" })
16234
16268
  ] })
@@ -16346,7 +16380,7 @@ window.__ModuleLoader__.load({
16346
16380
  let webLoading = false;
16347
16381
  let webError = null;
16348
16382
  let connectionError = null;
16349
- let settingsViewport = null;
16383
+ let settingsOpen = false;
16350
16384
  let settingsReadRequested = false;
16351
16385
  let preferenceError = null;
16352
16386
  let preferences = null;
@@ -16421,7 +16455,7 @@ window.__ModuleLoader__.load({
16421
16455
  desktopAvailable: Boolean(nativeBrowser),
16422
16456
  webLoading,
16423
16457
  webError,
16424
- settingsViewport,
16458
+ settingsOpen,
16425
16459
  preferenceError,
16426
16460
  viewport,
16427
16461
  brandAnchor,
@@ -16675,7 +16709,7 @@ window.__ModuleLoader__.load({
16675
16709
  },
16676
16710
  beginWebsiteSignIn: () => {
16677
16711
  if (disposed || !nativeBrowser || logoutRequested) return;
16678
- if (mode.getSnapshot().mode !== "chat" && !settingsViewport) mode.select("chat");
16712
+ if (mode.getSnapshot().mode !== "chat") mode.select("chat");
16679
16713
  restorationBlocked = true;
16680
16714
  if (!websiteSignInRequested) websiteAuthenticationRevision++;
16681
16715
  websiteSignInRequested = true;
@@ -16818,11 +16852,11 @@ window.__ModuleLoader__.load({
16818
16852
  showWebsiteNavigation = !showWebsiteNavigation;
16819
16853
  publish();
16820
16854
  },
16821
- updateSettingsViewport: (next) => {
16822
- if (settingsViewport?.left === next?.left && settingsViewport?.top === next?.top && settingsViewport?.width === next?.width && settingsViewport?.height === next?.height) return;
16823
- const opening = !settingsViewport && !!next;
16855
+ setSettingsOpen: (next) => {
16856
+ if (settingsOpen === next) return;
16857
+ const opening = !settingsOpen && next;
16824
16858
  if (opening) settingsReadRequested = false;
16825
- settingsViewport = next;
16859
+ settingsOpen = next;
16826
16860
  publish();
16827
16861
  if (!next && navigationHandler) void navigationHandler({ type: "settings-close" });
16828
16862
  else readSettingsWhenReady();
@@ -16959,7 +16993,7 @@ window.__ModuleLoader__.load({
16959
16993
  publish();
16960
16994
  }
16961
16995
  function readSettingsWhenReady() {
16962
- if (!settingsViewport || !navigationHandler || websiteNavigation.status !== "ready" || websiteNavigation.authenticated !== true || settingsReadRequested || restoringPreferences || logoutRequested || logoutFailed || websiteNavigation.settings?.pending) return;
16996
+ if (!settingsOpen || !navigationHandler || websiteNavigation.status !== "ready" || websiteNavigation.authenticated !== true || settingsReadRequested || restoringPreferences || logoutRequested || logoutFailed || websiteNavigation.settings?.pending) return;
16963
16997
  settingsReadRequested = true;
16964
16998
  if (websiteNavigation.settings?.language && !websiteNavigation.settings.error) return;
16965
16999
  void navigationHandler({ type: "settings-read" });
package/lib/types/ui.d.ts CHANGED
@@ -22,7 +22,7 @@ export interface DshChatViewState {
22
22
  readonly accountStorageKey: string | null;
23
23
  readonly authorizationGeneration: number;
24
24
  readonly websiteReloadRevision: number;
25
- readonly settingsViewport: DshChatViewportRect | null;
25
+ readonly settingsOpen: boolean;
26
26
  readonly preferenceError: string | null;
27
27
  readonly websiteAuthenticationStatus: 'loading' | 'signed-out' | 'signing-in' | 'signed-in' | 'signing-out' | 'error';
28
28
  readonly websiteAuthenticationRevision: number;
@@ -55,7 +55,7 @@ export interface DshChatUIBridge {
55
55
  bindWebsiteNavigation(generation: number, handler: (command: WebsiteCommand) => Promise<void>): () => void;
56
56
  commandWebsite(command: WebsiteCommand): void;
57
57
  toggleWebsiteNavigation(): void;
58
- updateSettingsViewport(rect: DshChatViewportRect | null): void;
58
+ setSettingsOpen(open: boolean): void;
59
59
  logoutWebsite(): void;
60
60
  loadWebsiteSession(generation: number): Promise<WebsiteSession | null>;
61
61
  saveWebsiteSession(generation: number, session: WebsiteSession): Promise<boolean>;
@@ -81,4 +81,4 @@ export declare function DshChatChatNavigation({ bridge, wide, expandSidebar }: P
81
81
  export declare function DshChatChatPanel({ bridge }: PropsRuntime<'main'> & DshChatBridgeProps): import("react/jsx-runtime").JSX.Element;
82
82
  /** Same public primitive icons, geometry and tooltip behavior as native rc.2 chrome. */
83
83
  export declare function DshChatLeadingControls({ bridge }: PropsRuntime<'shell.leading'> & DshChatBridgeProps): import("react/jsx-runtime").JSX.Element;
84
- export declare function DshChatChatSettings({ bridge }: PropsRuntime<'settings.section'> & DshChatBridgeProps): import("react/jsx-runtime").JSX.Element;
84
+ export declare function DshChatChatSettings({ bridge, close }: PropsRuntime<'settings.section'> & DshChatBridgeProps): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-deepseek-chat",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "CHAT / HARNESS mode switcher for DeepSeek Harness",
5
5
  "repository": {
6
6
  "type": "git",