dsh-deepseek-chat 0.1.17 → 0.1.18

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.17**(npm 公开版本仍为 0.1.16) · 适配 **DSH 0.2.0-rc.2 桌面版** · 默认语言为简体中文。
7
+ 当前本地候选版本 **0.1.18**(npm 公开版本为 0.1.17) · 适配 **DSH 0.2.0-rc.2 桌面版** · 默认语言为简体中文。
8
8
 
9
9
  ## 功能预览
10
10
 
@@ -60,16 +60,16 @@ dsh plugin --profile desktop add dsh-deepseek-chat
60
60
  已有安装可能继续使用之前锁定的版本。升级到当前版本时,在 DSH 的插件安装输入框中明确输入:
61
61
 
62
62
  ```text
63
- dsh-deepseek-chat@0.1.16
63
+ dsh-deepseek-chat@0.1.17
64
64
  ```
65
65
 
66
66
  使用命令行指定要升级的版本:
67
67
 
68
68
  ```bash
69
- dsh plugin --profile desktop add dsh-deepseek-chat@0.1.16
69
+ dsh plugin --profile desktop add dsh-deepseek-chat@0.1.17
70
70
  ```
71
71
 
72
- **完整退出并重新打开 DSH**,在插件管理页检查已安装版本为 **0.1.16**。进入 CHAT 后,“对话”标题右侧应显示刷新图标,未登录时登录按钮应有蓝色背景。
72
+ **完整退出并重新打开 DSH**,在插件管理页检查已安装版本为 **0.1.17**。进入 CHAT 后,“对话”标题右侧应显示刷新图标,未登录时登录按钮应有蓝色背景。
73
73
 
74
74
  使用其他 profile 时替换 `desktop`。通过 DSH 官方插件管理器或 CLI 更新,让依赖记录和锁文件一起更新;直接覆盖安装目录中的文件不能保证下次启动仍使用新版。
75
75
 
@@ -96,7 +96,7 @@ dsh plugin --profile desktop add https://github.com/xingxingbk-git/dsh-deepseek-
96
96
  将构建生成的 `.tgz` 文件交给 DSH 官方插件管理器安装,或使用 CLI:
97
97
 
98
98
  ```bash
99
- dsh plugin --profile desktop add /absolute/path/dsh-deepseek-chat-0.1.17.tgz
99
+ dsh plugin --profile desktop add /absolute/path/dsh-deepseek-chat-0.1.18.tgz
100
100
  ```
101
101
 
102
102
  将路径替换成你的实际安装包;使用其他 profile 时替换 `desktop`。**安装或更新后,完整退出并重新打开 DSH**,让新插件生效。
@@ -145,7 +145,7 @@ pnpm install --frozen-lockfile
145
145
  pnpm package:plugin
146
146
  ```
147
147
 
148
- 生成 `artifacts/dsh-deepseek-chat-0.1.17.tgz`,包含 Host、Client、类型声明、图标和 bundle patch。插件管理列表的图标位于 `assets/icon.svg`,替换后重新打包安装即可;SVG 须自包含且不超过 256 KiB。
148
+ 生成 `artifacts/dsh-deepseek-chat-0.1.18.tgz`,包含 Host、Client、类型声明、图标和 bundle patch。插件管理列表的图标位于 `assets/icon.svg`,替换后重新打包安装即可;SVG 须自包含且不超过 256 KiB。
149
149
 
150
150
  修改源码后执行 `pnpm release:prepare`,并将源码与整个 `lib/` 一起提交。`pnpm check:distribution` 会检查编译产物与源码、版本及安装入口是否一致;旧产物或缺失文件会使检查失败。安装用户不需要执行这些开发命令。
151
151
 
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "format": 1,
3
3
  "name": "dsh-deepseek-chat",
4
- "version": "0.1.17",
4
+ "version": "0.1.18",
5
5
  "inputs": {
6
6
  "assets/icon.svg": "8ea4f1d75f655c24e7f42fd5ed76763872d2c2c9d0661e14d64bcbc4dc5f84c8",
7
7
  "cordis.patch.yml": "05edb71cd276de1251ae67644ec68b54efc26258814956fa0e932d36da741bdc",
8
- "package.json": "e2b34523efa241f10feb9287abffc2c91ad8365072c3932b4faffebac111d6b7",
8
+ "package.json": "a9adcb61ef0398a2f716b8fbb427da044808d7361684db3eb857c911110b4a73",
9
9
  "pnpm-lock.yaml": "c4f600b0d599b85f6181d295cd5f9f06f1eb0435eeeb2e7cf1a376b3c6a4ca15",
10
10
  "scripts/build.mjs": "715879e3c25382c35b06db2065b3b13815d1185aa4b9267b68a6257cacee30ec",
11
11
  "scripts/check-artifact.mjs": "6fec38fb74e41dfeacef7147280c69854087d0665747d7d65137cc98f9dc673b",
@@ -13,14 +13,14 @@
13
13
  "scripts/client-contract.mjs": "1e212575218fc985f4405e2eac98b33a969494ff6b2144b1204a6d66963ba894",
14
14
  "scripts/distribution-manifest.mjs": "e746c447b03b0e9a86efce7827bbd5d9184c6ccd1f1f0f1c9eb12abfe1b2f3b7",
15
15
  "src/authorization.ts": "5f0c1b69e43541ce606349047788df72e442e9cbb3267c8c0caf2c0f556a5589",
16
- "src/client.ts": "4c4ce2b680d295a36d103c6f2aeb23d5347e9c30f5e5b45a53ff48dee3a88f67",
16
+ "src/client.ts": "cf41fb5dd826fb404e645a8baf1dfc7e570e085782c1d18bf9a9c4be010e1c92",
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": "83c2ce69a160cfeb8e4af6498d2233c150e8c1decdf4805288d56a9829835ad4",
22
- "src/styles.ts": "51a2e65e7244a47b540d25e0d8dbbc2fccdc51b4caf980419b054e7c60060889",
23
- "src/ui.tsx": "5666fea9b9e75c110f7398b99d2ce9a9f75a72b0b9a228cc1efe02b8e52c5c21",
22
+ "src/styles.ts": "af329e4cdd0a63df88d4bf2f102ab44bef477881733605b9fda89d3740981490",
23
+ "src/ui.tsx": "1b74bbb58c64eac78e824ecf389490e5bfb9e1c11ecf4d5e7a92cc2f6f48a221",
24
24
  "src/web-surface.tsx": "a13ec7ad7d151877d27e7cb79c80e6bf549cbd08f84a53eeadd56d4667419918",
25
25
  "src/website-conversation-actions.ts": "558196cb6ad5c34b8cbffe1ebef4a77a8a0312cfc4bf275fa13c4d9aeaf02f0e",
26
26
  "src/website-header.ts": "ac4972a28a5f0968de4d5f98d54fbac853f901c7eda00c0849984a2e66f291f3",
@@ -32,7 +32,7 @@
32
32
  "tsconfig.json": "1ad0b3b39537564a180dc7f4084ceb3098b567f509320c77d71bc37aaf4f1879"
33
33
  },
34
34
  "artifacts": {
35
- "lib/client.js": "33a434e4e6f8ac8639ce8d90679257b80d1e13c0ebd5f7befcbfaee6c9891d57",
35
+ "lib/client.js": "f3c71862a00a5bc7aa6a10521afb49c7df33fa2947493f87197ff4946ae3bcb7",
36
36
  "lib/index.js": "e9c50cc544f24c60d086538ab1283ae0ed2811f23c9bb469916a2e89c3ffb38d",
37
37
  "lib/types/authorization.d.ts": "130649eed3635e75c3f50c13de93c52440a27f1b88136ab2297552570c013d49",
38
38
  "lib/types/client.d.ts": "a79702d5d86c75e81f1e954b3e9f4a562a6b3082d68d798d6a1b37bd41b908a7",
@@ -42,7 +42,7 @@
42
42
  "lib/types/server.d.ts": "62b23f8f9fe9bb16a20274929876c1a34b3ab1e94179567e2e3a56cd67638288",
43
43
  "lib/types/sidebar-adapter.d.ts": "5730bbeb661d8731620dc22397c8a8928209124b8d92d8b8549b6a84824e0518",
44
44
  "lib/types/styles.d.ts": "c7434168512577eb1255158835dd6ea044413edd586844b21daf711ea2eeffec",
45
- "lib/types/ui.d.ts": "26ed9db1073e303ff8d7e8bdf548a90181267ca38d26cce6e2e6a95823d1d972",
45
+ "lib/types/ui.d.ts": "7e6df316358f9ed0d9cdcd60789be2ed79f2f93bb70d9ff579d6a06221abdc19",
46
46
  "lib/types/web-surface.d.ts": "71686d72b4a5d6c619ee4ec916bbf7b853a87a7cc4d506fbfd0359191434984f",
47
47
  "lib/types/website-conversation-actions.d.ts": "3bfea5b960e2e78ba6a03c060ff606a3b07293028843c481f8d8f3a41d733c19",
48
48
  "lib/types/website-header.d.ts": "6379a35e7d35af3fb969802ee2cae969a104dbad937f7b9e371463a0bd7dea9d",
package/lib/client.js CHANGED
@@ -14772,11 +14772,28 @@ window.__ModuleLoader__.load({
14772
14772
  .dsh-chat-authorization-notice{position:absolute;top:calc(100% + 6px);right:0;width:230px;max-width:calc(100vw - 24px);padding:10px 12px;z-index:40;border:1px solid var(--dsw-alias-border-l2,#dee1e8);border-radius:8px;background:var(--dsw-specific-sidebar-fill,#f4f5f8);box-shadow:0 4px 16px #0d1a3520;font-size:11px;line-height:1.6;color:var(--dsw-alias-label-primary,#22242a)}
14773
14773
  .dsh-chat-authorization-notice p{margin:0 0 5px}
14774
14774
  .dsh-chat-navigation{display:flex;flex-direction:column;height:100%;min-height:0;background:transparent;color:inherit}
14775
- .dsh-chat-navigation-header{display:flex;align-items:center;justify-content:space-between;padding:0 14px 8px 16px;min-height:36px;color:var(--dsw-alias-label-secondary,#8b8d91);font-size:14px}
14776
- .dsh-chat-navigation-header>div{display:flex;gap:2px}
14775
+ .dsh-chat-navigation-header{margin:2px 12px 4px;padding:0 4px}
14776
+ .dsh-chat-navigation-header{box-sizing:border-box;border-radius:var(--dsw-radius-md);height:36px;color:var(--dsw-alias-label-tertiary);flex:none;justify-content:flex-end;align-items:center;gap:4px;margin-bottom:4px;padding-left:4px;display:flex;overflow:hidden}
14777
+ .dsh-chat-search-label{white-space:nowrap;opacity:1;visibility:visible;min-width:0;max-width:45%;transition:max-width .18s var(--ds-ease-in-out), margin-right .18s var(--ds-ease-in-out), opacity .12s var(--ds-ease-in-out), transform .18s var(--ds-ease-in-out), visibility 0s linear;flex:none;line-height:20px;overflow:hidden}
14778
+ [data-searching] .dsh-chat-search-label{opacity:0;visibility:hidden;max-width:0;margin-right:-4px;transition-delay:0s,0s,0s,0s,.18s;transform:translate(-4px)}
14779
+ .dsh-chat-search-slot{box-sizing:border-box;min-width:0;max-width:28px;transition:max-width .18s var(--ds-ease-in-out), padding-left .18s var(--ds-ease-in-out);flex:1;align-items:center;margin-left:auto;padding-left:0;display:flex}
14780
+ [data-searching] .dsh-chat-search-slot{max-width:100%;padding-left:0}
14781
+ .dsh-chat-search-actions{opacity:1;visibility:visible;max-width:60px;transition:max-width .18s var(--ds-ease-in-out), opacity .12s var(--ds-ease-in-out), transform .18s var(--ds-ease-in-out), visibility 0s linear;flex:none;align-items:center;gap:4px;display:flex;overflow:hidden}
14782
+ [data-searching] .dsh-chat-search-actions{opacity:0;visibility:hidden;pointer-events:none;max-width:0;transition-delay:0s,0s,0s,.18s;transform:translate(4px)}
14783
+ .dsh-chat-search{box-sizing:border-box;border-radius:var(--dsw-radius-sm);cursor:text;width:100%;height:28px;color:var(--dsw-alias-label-secondary);transition:width .18s var(--ds-ease-in-out), padding .18s var(--ds-ease-in-out), border-color .18s var(--ds-ease-in-out), background-color .18s var(--ds-ease-in-out);background:0 0;border:none;flex:none;align-items:center;gap:0;margin:0;padding:0;display:flex;overflow:hidden}
14784
+ [data-searching] .dsh-chat-search{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);width:calc(100% + 4px);height:30px;color:var(--dsw-alias-label-caption);background:0 0;margin-inline:-2px;padding:0 4px 0 0}
14785
+ .dsh-chat-search-button{border-radius:var(--dsw-radius-sm);cursor:pointer;width:28px;height:28px;color:inherit;background:0 0;border:none;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}
14786
+ [data-searching] .dsh-chat-search .dsh-chat-search-button{width:28px;height:30px}
14787
+ .dsh-chat-search-button:hover{background:var(--dsw-alias-interactive-bg-hover)}
14788
+ [data-searching] .dsh-chat-search .dsh-chat-search-button:hover{background:0 0}
14789
+ .dsh-chat-search-input{opacity:0;pointer-events:none;width:0;min-width:0;color:var(--dsw-alias-label-primary);transition:opacity .12s var(--ds-ease-in-out);background:0 0;border:none;outline:none;flex:1;font-size:13px;line-height:18px}
14790
+ [data-searching] .dsh-chat-search .dsh-chat-search-input{opacity:1;pointer-events:auto;margin-left:-2px}
14791
+ .dsh-chat-search-input::placeholder{color:var(--dsw-alias-label-tertiary)}
14792
+ .dsh-chat-search-clear{border-radius:var(--dsw-radius-sm);cursor:pointer;width:24px;height:24px;color:var(--dsw-alias-label-secondary);background:0 0;border:none;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}
14793
+ .dsh-chat-search-button:focus-visible,.dsh-chat-search-clear:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:-2px}
14794
+ .dsh-chat-search-clear:hover{background:var(--dsw-alias-interactive-bg-hover)}
14777
14795
  .dsh-chat-icon-button{display:inline-flex;align-items:center;justify-content:center;flex:none;width:28px;height:28px;border:0;border-radius:6px;background:transparent;color:var(--dsw-alias-label-secondary,#8b8d91);cursor:pointer;font-size:21px!important}.dsh-chat-icon-button:hover{background:var(--dsw-alias-interactive-bg-hover,#ffffff0d)}.dsh-chat-icon-button:disabled{opacity:.4;cursor:default}
14778
- .dsh-chat-refreshing{animation:dsh-chat-refresh-spin .8s linear infinite}@keyframes dsh-chat-refresh-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.dsh-chat-refreshing{animation:none}}
14779
- .dsh-chat-navigation-search{margin:0 14px 8px;padding:7px 9px;min-width:0;border:1px solid var(--dsw-alias-border-l2,#85858b40);border-radius:6px;background:transparent;color:inherit;font:inherit;font-size:12px}
14796
+ .dsh-chat-refreshing{animation:dsh-chat-refresh-spin .8s linear infinite}@keyframes dsh-chat-refresh-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.dsh-chat-refreshing{animation:none}.dsh-chat-search,.dsh-chat-search-label,.dsh-chat-search-slot,.dsh-chat-search-input,.dsh-chat-search-actions{transition:none}}
14780
14797
  .dsh-chat-navigation-list{flex:1;min-height:0;overflow:auto;padding:0 12px 12px;scrollbar-width:thin}
14781
14798
  .dsh-chat-conversation-group h3{font-size:12px;font-weight:400;color:var(--dsw-alias-label-secondary,#8b8d91);margin:15px 4px 6px}
14782
14799
  .dsh-chat-conversation-row{display:block;flex:1;min-width:0;width:100%;min-height:32px;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:7px 10px;border:0;border-radius:8px;background:transparent;color:inherit;font-size:13px;cursor:pointer}.dsh-chat-conversation-item{display:flex;align-items:center;border-radius:8px;padding-right:4px;min-width:0}
@@ -15035,11 +15052,49 @@ window.__ModuleLoader__.load({
15035
15052
  error51 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-chat-rename-error", role: "alert", children: error51 })
15036
15053
  ] });
15037
15054
  }
15055
+ function guardHarnessSearchReplay(entry) {
15056
+ if (entry.locale !== "workspace" || typeof entry.component !== "function" || !entry.children?.["sidebar.workspaces.session.menu.item"] || !entry.inject) return null;
15057
+ const original = entry.component;
15058
+ function SearchRequestGuard(props) {
15059
+ const originalHook = props.useWorkspaceShortcuts;
15060
+ const request = originalHook((state) => state.searchRequest);
15061
+ const mountedRequest = (0, import_react.useRef)(request);
15062
+ const guardedHook = (0, import_react.useCallback)((selector) => originalHook((state) => selector(state.searchRequest === mountedRequest.current ? { ...state, searchRequest: 0 } : state)), [originalHook]);
15063
+ return (0, import_react.createElement)(original, { ...props, useWorkspaceShortcuts: guardedHook });
15064
+ }
15065
+ function GuardedWorkspace(props) {
15066
+ return typeof props.useWorkspaceShortcuts === "function" ? (0, import_react.createElement)(SearchRequestGuard, props) : (0, import_react.createElement)(original, props);
15067
+ }
15068
+ entry.component = GuardedWorkspace;
15069
+ return () => {
15070
+ if (entry.component === GuardedWorkspace) entry.component = original;
15071
+ };
15072
+ }
15038
15073
  function DshChatChatNavigation({ bridge, wide, expandSidebar }) {
15039
15074
  const state = useDshChat(bridge);
15040
15075
  const [renameTarget, setRenameTarget] = (0, import_react.useState)(null);
15041
15076
  const [query, setQuery] = (0, import_react.useState)("");
15042
15077
  const [searching, setSearching] = (0, import_react.useState)(false);
15078
+ const searchRoot = (0, import_react.useRef)(null);
15079
+ const searchInput = (0, import_react.useRef)(null);
15080
+ const searchButton = (0, import_react.useRef)(null);
15081
+ const closeSearch = () => {
15082
+ setQuery("");
15083
+ setSearching(false);
15084
+ };
15085
+ (0, import_react.useLayoutEffect)(() => {
15086
+ if (wide && searching) searchInput.current?.focus({ preventScroll: true });
15087
+ }, [wide, searching]);
15088
+ (0, import_react.useEffect)(() => {
15089
+ if (!wide || !searching) return;
15090
+ const outside = (event) => {
15091
+ if (!(event.target instanceof Node) || searchRoot.current?.contains(event.target)) return;
15092
+ searchInput.current?.blur();
15093
+ if (!query.trim()) setSearching(false);
15094
+ };
15095
+ document.addEventListener("click", outside);
15096
+ return () => document.removeEventListener("click", outside);
15097
+ }, [wide, searching, query]);
15043
15098
  const navigation = state.websiteNavigation;
15044
15099
  const refreshing = state.websiteNavigationRefreshing;
15045
15100
  const refreshDisabled = !state.modeEnabled || !state.desktopAvailable || refreshing || state.webLoading || navigation.authenticated !== true || ["signing-in", "signing-out"].includes(state.websiteAuthenticationStatus) || navigation.settings?.pending;
@@ -15054,17 +15109,25 @@ window.__ModuleLoader__.load({
15054
15109
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DshChatStyles, {}),
15055
15110
  renameTarget && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DshChatRenameConversation, { bridge, item: renameTarget, onClose: () => setRenameTarget(null) }, renameTarget.href),
15056
15111
  !wide ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "dsh-chat-icon-button", onClick: expandSidebar, "aria-label": "\u5C55\u5F00\u5B98\u7F51\u5BF9\u8BDD\u5217\u8868", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PanelIcon, {}) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
15057
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { className: "dsh-chat-navigation-header", children: [
15058
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "\u5BF9\u8BDD" }),
15059
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
15060
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "dsh-chat-icon-button", "aria-label": "\u641C\u7D22\u5B98\u7F51\u5BF9\u8BDD", onClick: () => setSearching((value) => !value), children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { width: "17", height: "17", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
15061
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "8.5", cy: "8.5", r: "6", stroke: "currentColor", strokeWidth: "1.4" }),
15062
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m13 13 4 4", stroke: "currentColor", strokeWidth: "1.4" })
15063
- ] }) }),
15064
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Tooltip, { label: refreshing ? "\u6B63\u5728\u5237\u65B0\u5B98\u7F51\u5BF9\u8BDD\u5217\u8868\u2026" : "\u5237\u65B0\u5B98\u7F51\u5BF9\u8BDD\u5217\u8868", delayMs: 500, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "dsh-chat-icon-button", "aria-label": "\u5237\u65B0\u5B98\u7F51\u5BF9\u8BDD\u5217\u8868", "aria-busy": refreshing, disabled: refreshDisabled, onClick: () => bridge.refreshWebsiteNavigation(), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconRefreshOutlineRegular, { size: 14, className: refreshing ? "dsh-chat-refreshing" : void 0 }) }) })
15065
- ] })
15112
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { className: "dsh-chat-navigation-header", "data-searching": searching || void 0, children: [
15113
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsh-chat-search-label", children: "\u5BF9\u8BDD" }),
15114
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-chat-search-slot", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ref: searchRoot, className: "dsh-chat-search", onClick: () => setSearching(true), children: [
15115
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Tooltip, { label: "\u641C\u7D22\u5B98\u7F51\u5BF9\u8BDD", delayMs: 500, disabled: searching, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { ref: searchButton, type: "button", className: "dsh-chat-search-button", "aria-label": "\u641C\u7D22\u5B98\u7F51\u5BF9\u8BDD", "aria-expanded": searching, onClick: () => setSearching(true), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconSearchOutlineRegular, { size: searching ? 11 : 14 }) }) }),
15116
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { ref: searchInput, className: "dsh-chat-search-input", type: "text", "aria-label": "\u641C\u7D22\u5DF2\u52A0\u8F7D\u7684\u5B98\u7F51\u5BF9\u8BDD\u6807\u9898", placeholder: "\u641C\u7D22\u4F1A\u8BDD\u540D\u79F0", maxLength: 300, value: query, tabIndex: searching ? 0 : -1, onChange: (event) => setQuery(event.target.value), onKeyDown: (event) => {
15117
+ if (event.key === "Escape" && !event.nativeEvent.isComposing) {
15118
+ event.preventDefault();
15119
+ event.stopPropagation();
15120
+ closeSearch();
15121
+ searchButton.current?.focus({ preventScroll: true });
15122
+ }
15123
+ } }),
15124
+ searching && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "dsh-chat-search-clear", "aria-label": "\u5173\u95ED\u5B98\u7F51\u5BF9\u8BDD\u641C\u7D22", onClick: (event) => {
15125
+ event.stopPropagation();
15126
+ closeSearch();
15127
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconCloseFillRegular, {}) })
15128
+ ] }) }),
15129
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-chat-search-actions", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Tooltip, { label: refreshing ? "\u6B63\u5728\u5237\u65B0\u5B98\u7F51\u5BF9\u8BDD\u5217\u8868\u2026" : "\u5237\u65B0\u5B98\u7F51\u5BF9\u8BDD\u5217\u8868", delayMs: 500, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "dsh-chat-icon-button", "aria-label": "\u5237\u65B0\u5B98\u7F51\u5BF9\u8BDD\u5217\u8868", "aria-busy": refreshing, disabled: refreshDisabled, onClick: () => bridge.refreshWebsiteNavigation(), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconRefreshOutlineRegular, { size: 14, className: refreshing ? "dsh-chat-refreshing" : void 0 }) }) }) })
15066
15130
  ] }),
15067
- searching && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { className: "dsh-chat-navigation-search", "aria-label": "\u641C\u7D22\u5DF2\u52A0\u8F7D\u7684\u5B98\u7F51\u5BF9\u8BDD\u6807\u9898", placeholder: "\u641C\u7D22\u5BF9\u8BDD", value: query, onChange: (event) => setQuery(event.target.value), autoFocus: true }),
15068
15131
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-chat-navigation-list", children: [
15069
15132
  refreshing && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "dsh-chat-navigation-status", role: "status", children: "\u6B63\u5728\u5237\u65B0\u5B98\u7F51\u5BF9\u8BDD\u5217\u8868\u2026" }),
15070
15133
  navigation.authenticated === true && navigation.status === "ready" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
@@ -17462,6 +17525,21 @@ window.__ModuleLoader__.load({
17462
17525
  });
17463
17526
  publish();
17464
17527
  ctx.effect(() => {
17528
+ const guardedEntries = /* @__PURE__ */ new Map();
17529
+ const guardSearch = () => {
17530
+ const current = ctx.slots.entries("sidebar.workspaces");
17531
+ for (const [entry, cleanup] of guardedEntries) if (!current.includes(entry)) {
17532
+ cleanup();
17533
+ guardedEntries.delete(entry);
17534
+ }
17535
+ for (const entry of ctx.slots.entries("sidebar.workspaces")) {
17536
+ if (guardedEntries.has(entry)) continue;
17537
+ const cleanup = guardHarnessSearchReplay(entry);
17538
+ if (cleanup) guardedEntries.set(entry, cleanup);
17539
+ }
17540
+ };
17541
+ guardSearch();
17542
+ const stopSearchGuard = ctx.slots.subscribe("sidebar.workspaces", guardSearch);
17465
17543
  const releaseStyles = typeof document === "undefined" ? () => {
17466
17544
  } : acquireChatStyles(document);
17467
17545
  ctx.slots.inject("settings.section", () => ctx.slots.register({ name: "settings.section", id: "dsh-deepseek-chat.chat-settings", order: 80, label: "CHAT\u8BBE\u7F6E", inject: () => ({ bridge }) }, DshChatChatSettings));
@@ -17481,6 +17559,9 @@ window.__ModuleLoader__.load({
17481
17559
  void refreshAuthorization();
17482
17560
  return () => {
17483
17561
  clearTimeout(logoutTimer);
17562
+ stopSearchGuard();
17563
+ for (const cleanup of guardedEntries.values()) cleanup();
17564
+ guardedEntries.clear();
17484
17565
  mode.dispose();
17485
17566
  sidebar?.dispose();
17486
17567
  releaseStyles();
package/lib/types/ui.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { StoredEntry } from '@deepseek-ai/dsh-client-ui-slots';
1
2
  import type { PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
2
3
  import type { WebsiteCommand, WebsiteNavigation } from './website-navigation.js';
3
4
  import type { WebsiteSession } from './protocol.js';
@@ -86,6 +87,9 @@ export declare function DshChatBrandName({ bridge }: PropsRuntime<'sidebar.brand
86
87
  export declare function DshChatBrandControl({ bridge, rect: ownedRect }: DshChatBridgeProps & {
87
88
  readonly rect?: DshChatViewportRect | null;
88
89
  }): import("react/jsx-runtime").JSX.Element | null;
90
+ /** rc.2 replays its retained request counter on WorkspaceBrowser remount.
91
+ * Adapt only the view hook; never mutate the host request store or actions. */
92
+ export declare function guardHarnessSearchReplay(entry: StoredEntry): (() => void) | null;
89
93
  /** Only the middle browsing region changes; the shipped shell and Settings stay mounted. */
90
94
  export declare function DshChatChatNavigation({ bridge, wide, expandSidebar }: PropsRuntime<'sidebar.workspaces'> & DshChatBridgeProps): import("react/jsx-runtime").JSX.Element;
91
95
  /** Measures only this plugin's own element; website content lives in the retained overlay. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-deepseek-chat",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "CHAT / HARNESS mode switcher for DeepSeek Harness",
5
5
  "repository": {
6
6
  "type": "git",