dsh-deepseek-chat 0.1.17 → 0.1.19
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 +37 -25
- package/lib/build-manifest.json +11 -9
- package/lib/client.js +184 -59
- package/lib/types/ui.d.ts +6 -4
- package/lib/types/website-sidebar-collapse.d.ts +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
CHAT模式 加载真实的 [DeepSeek Chat 官网](https://chat.deepseek.com/),使用官网的聊天功能和账号历史;HARNESS模式 为原 DSH 工作区。
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
当前版本 **0.1.19** · 适配 **DSH 0.2.0-rc.2 桌面版** · 默认语言为简体中文。
|
|
8
8
|
|
|
9
9
|
## 功能预览
|
|
10
10
|
|
|
@@ -39,64 +39,72 @@ CHAT模式 加载真实的 [DeepSeek Chat 官网](https://chat.deepseek.com/),
|
|
|
39
39
|
|
|
40
40
|
## 安装
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
**希望尽快获取仓库中最新版本时,建议复制下方仓库地址,在 DSH 插件安装输入框中安装。**
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
按 npm 名称 `dsh-deepseek-chat` 安装,可能受到已锁定版本、包元数据缓存或 pnpm 的最低发布时间策略影响,刚发布的新版本不一定立即被选中。例如,`minimumReleaseAge: 1440` 表示版本发布满 **24 小时**后才符合该策略;这不是固定的“24 小时缓存”,具体取决于 DSH 使用的 pnpm 版本和配置。参见 [pnpm 官方说明](https://github.com/pnpm/pnpm.io/blob/main/versioned_docs/version-10.x/settings.md#minimumreleaseage)。
|
|
45
|
+
|
|
46
|
+
仓库地址安装获取的是**已推送到 GitHub 的源码及编译产物**;作者尚未推送的本地修改不会包含在内。已有安装也需要手动更新,并完整退出后重新打开 DSH。
|
|
47
|
+
|
|
48
|
+
### 使用仓库地址安装(希望尽快获取更新时推荐)
|
|
49
|
+
|
|
50
|
+
在 DSH 的插件安装输入框中粘贴:
|
|
45
51
|
|
|
46
52
|
```text
|
|
47
|
-
dsh-deepseek-chat
|
|
53
|
+
https://github.com/xingxingbk-git/dsh-deepseek-chat
|
|
48
54
|
```
|
|
49
55
|
|
|
50
|
-
|
|
56
|
+
仓库同时提供源码和编译好的 `lib`,安装直接加载编译产物,无需运行构建脚本或修改 `allowBuilds`。
|
|
57
|
+
|
|
58
|
+
使用命令行也可以安装:
|
|
51
59
|
|
|
52
60
|
```bash
|
|
53
|
-
dsh plugin --profile desktop add dsh-deepseek-chat
|
|
61
|
+
dsh plugin --profile desktop add https://github.com/xingxingbk-git/dsh-deepseek-chat
|
|
54
62
|
```
|
|
55
63
|
|
|
56
|
-
|
|
64
|
+
旧名称 `dsh-chat` 在 npm 上属于其他项目,请使用新的插件名称或完整仓库地址。
|
|
57
65
|
|
|
58
|
-
### 升级已有安装
|
|
59
66
|
|
|
60
|
-
|
|
67
|
+
### 按名称安装
|
|
68
|
+
|
|
69
|
+
在 DSH 的插件安装输入框中输入:
|
|
61
70
|
|
|
62
71
|
```text
|
|
63
|
-
dsh-deepseek-chat
|
|
72
|
+
dsh-deepseek-chat
|
|
64
73
|
```
|
|
65
74
|
|
|
66
|
-
|
|
75
|
+
也可以使用命令行:
|
|
67
76
|
|
|
68
77
|
```bash
|
|
69
|
-
dsh plugin --profile desktop add dsh-deepseek-chat
|
|
78
|
+
dsh plugin --profile desktop add dsh-deepseek-chat
|
|
70
79
|
```
|
|
71
80
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
使用其他 profile 时替换 `desktop`。通过 DSH 官方插件管理器或 CLI 更新,让依赖记录和锁文件一起更新;直接覆盖安装目录中的文件不能保证下次启动仍使用新版。
|
|
81
|
+
这是 npm 上的插件包,由 DSH 安装;无需运行独立的 npx 命令。
|
|
75
82
|
|
|
76
|
-
###
|
|
83
|
+
### 升级已有安装
|
|
77
84
|
|
|
78
|
-
|
|
85
|
+
已有安装可能继续使用之前锁定的版本。升级到当前版本时,在 DSH 的插件安装输入框中明确输入:
|
|
79
86
|
|
|
80
87
|
```text
|
|
81
|
-
|
|
88
|
+
dsh-deepseek-chat@0.1.19
|
|
82
89
|
```
|
|
83
90
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
使用命令行也可以安装:
|
|
91
|
+
指定版本可以明确安装目标,但仍可能受到发布时间策略限制。使用命令行指定要升级的版本:
|
|
87
92
|
|
|
88
93
|
```bash
|
|
89
|
-
dsh plugin --profile desktop add
|
|
94
|
+
dsh plugin --profile desktop add dsh-deepseek-chat@0.1.19
|
|
90
95
|
```
|
|
91
96
|
|
|
92
|
-
|
|
97
|
+
**完整退出并重新打开 DSH**,在插件管理页检查已安装版本为 **0.1.19**。进入 CHAT 后,“对话”标题右侧应显示刷新图标,未登录时登录按钮应有蓝色背景。
|
|
98
|
+
|
|
99
|
+
使用其他 profile 时替换 `desktop`。通过 DSH 官方插件管理器或 CLI 更新,让依赖记录和锁文件一起更新;直接覆盖安装目录中的文件不能保证下次启动仍使用新版。
|
|
100
|
+
|
|
93
101
|
|
|
94
102
|
### 本地安装包
|
|
95
103
|
|
|
96
104
|
将构建生成的 `.tgz` 文件交给 DSH 官方插件管理器安装,或使用 CLI:
|
|
97
105
|
|
|
98
106
|
```bash
|
|
99
|
-
dsh plugin --profile desktop add /absolute/path/dsh-deepseek-chat-0.1.
|
|
107
|
+
dsh plugin --profile desktop add /absolute/path/dsh-deepseek-chat-0.1.19.tgz
|
|
100
108
|
```
|
|
101
109
|
|
|
102
110
|
将路径替换成你的实际安装包;使用其他 profile 时替换 `desktop`。**安装或更新后,完整退出并重新打开 DSH**,让新插件生效。
|
|
@@ -145,7 +153,7 @@ pnpm install --frozen-lockfile
|
|
|
145
153
|
pnpm package:plugin
|
|
146
154
|
```
|
|
147
155
|
|
|
148
|
-
生成 `artifacts/dsh-deepseek-chat-0.1.
|
|
156
|
+
生成 `artifacts/dsh-deepseek-chat-0.1.19.tgz`,包含 Host、Client、类型声明、图标和 bundle patch。插件管理列表的图标位于 `assets/icon.svg`,替换后重新打包安装即可;SVG 须自包含且不超过 256 KiB。
|
|
149
157
|
|
|
150
158
|
修改源码后执行 `pnpm release:prepare`,并将源码与整个 `lib/` 一起提交。`pnpm check:distribution` 会检查编译产物与源码、版本及安装入口是否一致;旧产物或缺失文件会使检查失败。安装用户不需要执行这些开发命令。
|
|
151
159
|
|
|
@@ -154,3 +162,7 @@ pnpm package:plugin
|
|
|
154
162
|
```bash
|
|
155
163
|
dsh plugin --profile desktop remove dsh-deepseek-chat
|
|
156
164
|
```
|
|
165
|
+
|
|
166
|
+
## 已知问题:分享链接复制
|
|
167
|
+
|
|
168
|
+
CHAT 模式可以正常创建分享链接,但点击“创建并复制”或“复制”可能提示复制失败。DSH 桌面版内嵌浏览器会拒绝网页的剪贴板权限请求,目前没有提供开启此权限的配置项。遇到此问题,请选中完整链接,在 macOS 按 `⌘C`、Windows 按 `Ctrl+C` 手动复制。
|
package/lib/build-manifest.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": 1,
|
|
3
3
|
"name": "dsh-deepseek-chat",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.19",
|
|
5
5
|
"inputs": {
|
|
6
6
|
"assets/icon.svg": "8ea4f1d75f655c24e7f42fd5ed76763872d2c2c9d0661e14d64bcbc4dc5f84c8",
|
|
7
7
|
"cordis.patch.yml": "05edb71cd276de1251ae67644ec68b54efc26258814956fa0e932d36da741bdc",
|
|
8
|
-
"package.json": "
|
|
8
|
+
"package.json": "9a523a699158a0bd3144857b94dec8f68b2a358293484b9ee84c44dbdf1e66e3",
|
|
9
9
|
"pnpm-lock.yaml": "c4f600b0d599b85f6181d295cd5f9f06f1eb0435eeeb2e7cf1a376b3c6a4ca15",
|
|
10
10
|
"scripts/build.mjs": "715879e3c25382c35b06db2065b3b13815d1185aa4b9267b68a6257cacee30ec",
|
|
11
11
|
"scripts/check-artifact.mjs": "6fec38fb74e41dfeacef7147280c69854087d0665747d7d65137cc98f9dc673b",
|
|
@@ -13,26 +13,27 @@
|
|
|
13
13
|
"scripts/client-contract.mjs": "1e212575218fc985f4405e2eac98b33a969494ff6b2144b1204a6d66963ba894",
|
|
14
14
|
"scripts/distribution-manifest.mjs": "e746c447b03b0e9a86efce7827bbd5d9184c6ccd1f1f0f1c9eb12abfe1b2f3b7",
|
|
15
15
|
"src/authorization.ts": "5f0c1b69e43541ce606349047788df72e442e9cbb3267c8c0caf2c0f556a5589",
|
|
16
|
-
"src/client.ts": "
|
|
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": "
|
|
23
|
-
"src/ui.tsx": "
|
|
22
|
+
"src/styles.ts": "2ce32a9f1e9e263210875ee38c13f65ff3318a425c6ef6787d163b50d8670cbf",
|
|
23
|
+
"src/ui.tsx": "d4e9271b018ee68bd184237b9fc1c3ce10726cbc2afb15188fe8d52fec418d84",
|
|
24
24
|
"src/web-surface.tsx": "a13ec7ad7d151877d27e7cb79c80e6bf549cbd08f84a53eeadd56d4667419918",
|
|
25
25
|
"src/website-conversation-actions.ts": "558196cb6ad5c34b8cbffe1ebef4a77a8a0312cfc4bf275fa13c4d9aeaf02f0e",
|
|
26
26
|
"src/website-header.ts": "ac4972a28a5f0968de4d5f98d54fbac853f901c7eda00c0849984a2e66f291f3",
|
|
27
|
-
"src/website-navigation.ts": "
|
|
27
|
+
"src/website-navigation.ts": "7766736f8f9313b635ce06796509ad5ac7b96a312d43f36ad56c549032e17cb7",
|
|
28
28
|
"src/website-notice.ts": "65c781bec41e6c2e541d9512cc0051864d64fc3204b3ba5f2e005bdc955f39c9",
|
|
29
29
|
"src/website-session-store.ts": "8ef6d49465e0034f12b763a666b4a90c8c9819fb8baea06dcaba340fd97d72f1",
|
|
30
30
|
"src/website-session.ts": "f2434fafc40adb15b5f16fc8b6152bd8df7e85f5210330a1337502c9a08136d8",
|
|
31
31
|
"src/website-settings.ts": "adc9511be1d76e62d59a5e834dc561b8a2b8fdf6a877ecc865f5f0e840600fb2",
|
|
32
|
+
"src/website-sidebar-collapse.ts": "55483a2c5eb7ca46030147d968f83411c7936c537e46b75057ced223fe763c0b",
|
|
32
33
|
"tsconfig.json": "1ad0b3b39537564a180dc7f4084ceb3098b567f509320c77d71bc37aaf4f1879"
|
|
33
34
|
},
|
|
34
35
|
"artifacts": {
|
|
35
|
-
"lib/client.js": "
|
|
36
|
+
"lib/client.js": "678cc96e0ef7baffff0297fc06cc1a5679c5bfd741e02a89d456bcee201522bb",
|
|
36
37
|
"lib/index.js": "e9c50cc544f24c60d086538ab1283ae0ed2811f23c9bb469916a2e89c3ffb38d",
|
|
37
38
|
"lib/types/authorization.d.ts": "130649eed3635e75c3f50c13de93c52440a27f1b88136ab2297552570c013d49",
|
|
38
39
|
"lib/types/client.d.ts": "a79702d5d86c75e81f1e954b3e9f4a562a6b3082d68d798d6a1b37bd41b908a7",
|
|
@@ -42,7 +43,7 @@
|
|
|
42
43
|
"lib/types/server.d.ts": "62b23f8f9fe9bb16a20274929876c1a34b3ab1e94179567e2e3a56cd67638288",
|
|
43
44
|
"lib/types/sidebar-adapter.d.ts": "5730bbeb661d8731620dc22397c8a8928209124b8d92d8b8549b6a84824e0518",
|
|
44
45
|
"lib/types/styles.d.ts": "c7434168512577eb1255158835dd6ea044413edd586844b21daf711ea2eeffec",
|
|
45
|
-
"lib/types/ui.d.ts": "
|
|
46
|
+
"lib/types/ui.d.ts": "79be011d99dc65f60118b0a026271a7a0f1087aad80ddcd40b4fe48d86cae30c",
|
|
46
47
|
"lib/types/web-surface.d.ts": "71686d72b4a5d6c619ee4ec916bbf7b853a87a7cc4d506fbfd0359191434984f",
|
|
47
48
|
"lib/types/website-conversation-actions.d.ts": "3bfea5b960e2e78ba6a03c060ff606a3b07293028843c481f8d8f3a41d733c19",
|
|
48
49
|
"lib/types/website-header.d.ts": "6379a35e7d35af3fb969802ee2cae969a104dbad937f7b9e371463a0bd7dea9d",
|
|
@@ -50,6 +51,7 @@
|
|
|
50
51
|
"lib/types/website-notice.d.ts": "2912746645e3e9facfe167c7b2b2eff584e3b812cab5e106afc7cb2b0259fc15",
|
|
51
52
|
"lib/types/website-session-store.d.ts": "bd641ab5e62ea4dd5f5cbfa823548a5c266c9701bca986fb348482ee69b2e0c0",
|
|
52
53
|
"lib/types/website-session.d.ts": "5ded232b24dd72e7b3c5f0ff505ba0aa818cbde14be7e2099bbbf262ec395a2b",
|
|
53
|
-
"lib/types/website-settings.d.ts": "d6d3dbf3e3bfce364a7778c2104224b0f8fbc64e9661d33ddc074bbafe77c733"
|
|
54
|
+
"lib/types/website-settings.d.ts": "d6d3dbf3e3bfce364a7778c2104224b0f8fbc64e9661d33ddc074bbafe77c733",
|
|
55
|
+
"lib/types/website-sidebar-collapse.d.ts": "3ec7a64053cc040050bdd606b390c4597266ce7e25652933c9756c9fb985f0d3"
|
|
54
56
|
}
|
|
55
57
|
}
|
package/lib/client.js
CHANGED
|
@@ -14761,8 +14761,8 @@ window.__ModuleLoader__.load({
|
|
|
14761
14761
|
.dsh-chat-brand-name{display:inline-flex;align-items:center;gap:6px;min-width:0;max-width:100%;flex:1;width:100%}
|
|
14762
14762
|
.dsh-chat-brand-wordmark{display:block;flex:0 1 102px;min-width:0;width:102px;height:24px;overflow:hidden}
|
|
14763
14763
|
.dsh-chat-brand-wordmark svg{display:block;width:156px;max-width:none;height:24px}
|
|
14764
|
-
.dsh-chat-brand-
|
|
14765
|
-
.dsh-chat-brand-control{position:
|
|
14764
|
+
.dsh-chat-brand-control-host{display:flex;align-items:center;width:112px;height:24px;flex:none;margin-left:auto;-webkit-app-region:no-drag}
|
|
14765
|
+
.dsh-chat-brand-control{position:relative;width:100%;height:24px;pointer-events:auto;display:flex;align-items:center;-webkit-app-region:no-drag}
|
|
14766
14766
|
.dsh-chat-brand-control .dsh-chat-modes{height:23px;min-height:23px;max-height:23px;padding:1px;border-radius:5px;gap:0;overflow:hidden}
|
|
14767
14767
|
.dsh-chat-brand-control .dsh-chat-mode-wrap,.dsh-chat-brand-control .dsh-chat-modes{width:100%}
|
|
14768
14768
|
.dsh-chat-brand-control .dsh-chat-modes button{flex:1}
|
|
@@ -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{
|
|
14776
|
-
.dsh-chat-navigation-header
|
|
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}
|
|
@@ -14890,48 +14907,46 @@ window.__ModuleLoader__.load({
|
|
|
14890
14907
|
}
|
|
14891
14908
|
function DshChatBrandName({ bridge }) {
|
|
14892
14909
|
const name2 = (0, import_react.useRef)(null);
|
|
14893
|
-
const
|
|
14894
|
-
const [localAnchor, setLocalAnchor] = (0, import_react.useState)(null);
|
|
14910
|
+
const [controlHost, setControlHost] = (0, import_react.useState)(null);
|
|
14895
14911
|
(0, import_react.useLayoutEffect)(() => {
|
|
14896
|
-
const element = anchor.current;
|
|
14897
14912
|
const group = name2.current;
|
|
14898
|
-
if (!
|
|
14899
|
-
const
|
|
14900
|
-
|
|
14901
|
-
|
|
14913
|
+
if (!group) return;
|
|
14914
|
+
const host = document.createElement("span");
|
|
14915
|
+
host.className = "dsh-chat-brand-control-host";
|
|
14916
|
+
const reconcile = () => {
|
|
14917
|
+
if (!group.isConnected) {
|
|
14918
|
+
host.remove();
|
|
14919
|
+
return;
|
|
14920
|
+
}
|
|
14902
14921
|
bridge.attachSidebar(group);
|
|
14903
|
-
const
|
|
14904
|
-
const
|
|
14905
|
-
const
|
|
14906
|
-
|
|
14907
|
-
|
|
14922
|
+
const outlet = group.parentElement;
|
|
14923
|
+
const seat = outlet?.getAttribute("data-slot") === "sidebar.brand.name" ? outlet.parentElement : outlet;
|
|
14924
|
+
const identity = seat?.parentElement;
|
|
14925
|
+
const brand = identity?.parentElement;
|
|
14926
|
+
const row = brand?.parentElement;
|
|
14927
|
+
if (!identity || identity.getAttribute("aria-hidden") !== "true" || !brand || !row?.hasAttribute("data-window-drag")) {
|
|
14928
|
+
host.remove();
|
|
14929
|
+
return;
|
|
14930
|
+
}
|
|
14931
|
+
if (host.parentElement !== row || brand.nextElementSibling !== host) brand.after(host);
|
|
14908
14932
|
};
|
|
14909
|
-
|
|
14910
|
-
|
|
14911
|
-
|
|
14912
|
-
|
|
14913
|
-
|
|
14914
|
-
window.addEventListener("focus", measure);
|
|
14915
|
-
document.addEventListener("visibilitychange", measure);
|
|
14916
|
-
window.addEventListener("resize", measure);
|
|
14917
|
-
window.addEventListener("scroll", measure, true);
|
|
14933
|
+
reconcile();
|
|
14934
|
+
setControlHost(host);
|
|
14935
|
+
const observer = new MutationObserver(reconcile);
|
|
14936
|
+
observer.observe(host.parentElement?.parentElement ?? group, { childList: true, subtree: true });
|
|
14937
|
+
const styleRecovery = window.setInterval(() => ensureChatStyles(document), 250);
|
|
14918
14938
|
return () => {
|
|
14919
|
-
|
|
14920
|
-
window.clearInterval(
|
|
14921
|
-
|
|
14922
|
-
document.removeEventListener("visibilitychange", measure);
|
|
14923
|
-
window.removeEventListener("resize", measure);
|
|
14924
|
-
window.removeEventListener("scroll", measure, true);
|
|
14925
|
-
bridge.updateBrandAnchor(null, group);
|
|
14939
|
+
observer.disconnect();
|
|
14940
|
+
window.clearInterval(styleRecovery);
|
|
14941
|
+
host.remove();
|
|
14926
14942
|
};
|
|
14927
14943
|
}, [bridge]);
|
|
14928
14944
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
14929
14945
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { ref: name2, className: "dsh-chat-brand-name", children: [
|
|
14930
14946
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DshChatStyles, {}),
|
|
14931
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DshChatWordmark, {})
|
|
14932
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { ref: anchor, className: "dsh-chat-brand-anchor" })
|
|
14947
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DshChatWordmark, {})
|
|
14933
14948
|
] }),
|
|
14934
|
-
(0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DshChatBrandControl, { bridge
|
|
14949
|
+
controlHost && (0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DshChatBrandControl, { bridge }), controlHost)
|
|
14935
14950
|
] });
|
|
14936
14951
|
}
|
|
14937
14952
|
function DshChatAuthorizationNotice({ bridge, state }) {
|
|
@@ -14941,16 +14956,9 @@ window.__ModuleLoader__.load({
|
|
|
14941
14956
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "dsh-chat-text-button", onClick: () => bridge.refreshAuthorization(), children: "\u91CD\u8BD5\u8FDE\u63A5" })
|
|
14942
14957
|
] });
|
|
14943
14958
|
}
|
|
14944
|
-
function DshChatBrandControl({ bridge
|
|
14959
|
+
function DshChatBrandControl({ bridge }) {
|
|
14945
14960
|
const state = useDshChat(bridge);
|
|
14946
|
-
|
|
14947
|
-
if (rect === null) return null;
|
|
14948
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-chat-brand-control", "aria-label": "dsh-deepseek-chat \u6A21\u5F0F\u9009\u62E9", style: {
|
|
14949
|
-
left: rect.left,
|
|
14950
|
-
top: rect.top,
|
|
14951
|
-
width: rect.width,
|
|
14952
|
-
height: rect.height
|
|
14953
|
-
}, children: [
|
|
14961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-chat-brand-control", "aria-label": "dsh-deepseek-chat \u6A21\u5F0F\u9009\u62E9", children: [
|
|
14954
14962
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DshChatStyles, {}),
|
|
14955
14963
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DshChatModeSelector, { bridge, state }),
|
|
14956
14964
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DshChatAuthorizationNotice, { bridge, state }),
|
|
@@ -15035,11 +15043,49 @@ window.__ModuleLoader__.load({
|
|
|
15035
15043
|
error51 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-chat-rename-error", role: "alert", children: error51 })
|
|
15036
15044
|
] });
|
|
15037
15045
|
}
|
|
15046
|
+
function guardHarnessSearchReplay(entry) {
|
|
15047
|
+
if (entry.locale !== "workspace" || typeof entry.component !== "function" || !entry.children?.["sidebar.workspaces.session.menu.item"] || !entry.inject) return null;
|
|
15048
|
+
const original = entry.component;
|
|
15049
|
+
function SearchRequestGuard(props) {
|
|
15050
|
+
const originalHook = props.useWorkspaceShortcuts;
|
|
15051
|
+
const request = originalHook((state) => state.searchRequest);
|
|
15052
|
+
const mountedRequest = (0, import_react.useRef)(request);
|
|
15053
|
+
const guardedHook = (0, import_react.useCallback)((selector) => originalHook((state) => selector(state.searchRequest === mountedRequest.current ? { ...state, searchRequest: 0 } : state)), [originalHook]);
|
|
15054
|
+
return (0, import_react.createElement)(original, { ...props, useWorkspaceShortcuts: guardedHook });
|
|
15055
|
+
}
|
|
15056
|
+
function GuardedWorkspace(props) {
|
|
15057
|
+
return typeof props.useWorkspaceShortcuts === "function" ? (0, import_react.createElement)(SearchRequestGuard, props) : (0, import_react.createElement)(original, props);
|
|
15058
|
+
}
|
|
15059
|
+
entry.component = GuardedWorkspace;
|
|
15060
|
+
return () => {
|
|
15061
|
+
if (entry.component === GuardedWorkspace) entry.component = original;
|
|
15062
|
+
};
|
|
15063
|
+
}
|
|
15038
15064
|
function DshChatChatNavigation({ bridge, wide, expandSidebar }) {
|
|
15039
15065
|
const state = useDshChat(bridge);
|
|
15040
15066
|
const [renameTarget, setRenameTarget] = (0, import_react.useState)(null);
|
|
15041
15067
|
const [query, setQuery] = (0, import_react.useState)("");
|
|
15042
15068
|
const [searching, setSearching] = (0, import_react.useState)(false);
|
|
15069
|
+
const searchRoot = (0, import_react.useRef)(null);
|
|
15070
|
+
const searchInput = (0, import_react.useRef)(null);
|
|
15071
|
+
const searchButton = (0, import_react.useRef)(null);
|
|
15072
|
+
const closeSearch = () => {
|
|
15073
|
+
setQuery("");
|
|
15074
|
+
setSearching(false);
|
|
15075
|
+
};
|
|
15076
|
+
(0, import_react.useLayoutEffect)(() => {
|
|
15077
|
+
if (wide && searching) searchInput.current?.focus({ preventScroll: true });
|
|
15078
|
+
}, [wide, searching]);
|
|
15079
|
+
(0, import_react.useEffect)(() => {
|
|
15080
|
+
if (!wide || !searching) return;
|
|
15081
|
+
const outside = (event) => {
|
|
15082
|
+
if (!(event.target instanceof Node) || searchRoot.current?.contains(event.target)) return;
|
|
15083
|
+
searchInput.current?.blur();
|
|
15084
|
+
if (!query.trim()) setSearching(false);
|
|
15085
|
+
};
|
|
15086
|
+
document.addEventListener("click", outside);
|
|
15087
|
+
return () => document.removeEventListener("click", outside);
|
|
15088
|
+
}, [wide, searching, query]);
|
|
15043
15089
|
const navigation = state.websiteNavigation;
|
|
15044
15090
|
const refreshing = state.websiteNavigationRefreshing;
|
|
15045
15091
|
const refreshDisabled = !state.modeEnabled || !state.desktopAvailable || refreshing || state.webLoading || navigation.authenticated !== true || ["signing-in", "signing-out"].includes(state.websiteAuthenticationStatus) || navigation.settings?.pending;
|
|
@@ -15054,17 +15100,25 @@ window.__ModuleLoader__.load({
|
|
|
15054
15100
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DshChatStyles, {}),
|
|
15055
15101
|
renameTarget && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DshChatRenameConversation, { bridge, item: renameTarget, onClose: () => setRenameTarget(null) }, renameTarget.href),
|
|
15056
15102
|
!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-
|
|
15061
|
-
|
|
15062
|
-
|
|
15063
|
-
|
|
15064
|
-
|
|
15065
|
-
|
|
15103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { className: "dsh-chat-navigation-header", "data-searching": searching || void 0, children: [
|
|
15104
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsh-chat-search-label", children: "\u5BF9\u8BDD" }),
|
|
15105
|
+
/* @__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: [
|
|
15106
|
+
/* @__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 }) }) }),
|
|
15107
|
+
/* @__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) => {
|
|
15108
|
+
if (event.key === "Escape" && !event.nativeEvent.isComposing) {
|
|
15109
|
+
event.preventDefault();
|
|
15110
|
+
event.stopPropagation();
|
|
15111
|
+
closeSearch();
|
|
15112
|
+
searchButton.current?.focus({ preventScroll: true });
|
|
15113
|
+
}
|
|
15114
|
+
} }),
|
|
15115
|
+
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) => {
|
|
15116
|
+
event.stopPropagation();
|
|
15117
|
+
closeSearch();
|
|
15118
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconCloseFillRegular, {}) })
|
|
15119
|
+
] }) }),
|
|
15120
|
+
/* @__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
15121
|
] }),
|
|
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
15122
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-chat-navigation-list", children: [
|
|
15069
15123
|
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
15124
|
navigation.authenticated === true && navigation.status === "ready" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
@@ -15217,6 +15271,58 @@ window.__ModuleLoader__.load({
|
|
|
15217
15271
|
var import_react_dom2 = require("react-dom");
|
|
15218
15272
|
var import_react2 = require("react");
|
|
15219
15273
|
|
|
15274
|
+
// src/website-sidebar-collapse.ts
|
|
15275
|
+
function collapseWebsiteSidebar(doc, track) {
|
|
15276
|
+
const attempt = "data-dsh-chat-native-collapse-attempt";
|
|
15277
|
+
if (doc.defaultView?.location.origin !== "https://chat.deepseek.com" || doc.documentElement.hasAttribute(attempt) || !track.hasAttribute("data-dsh-chat-navigation") || !track.querySelector('[data-dsh-chat-profile-confirmed="footer-v1"]')) return false;
|
|
15278
|
+
const sheet = doc.getElementById("dsh-chat-website-navigation-style")?.sheet;
|
|
15279
|
+
const originalStyle = track.getAttribute("style");
|
|
15280
|
+
const disabled = sheet?.disabled;
|
|
15281
|
+
try {
|
|
15282
|
+
track.style.setProperty("visibility", "hidden", "important");
|
|
15283
|
+
track.style.setProperty("pointer-events", "none", "important");
|
|
15284
|
+
if (sheet) sheet.disabled = true;
|
|
15285
|
+
const bounds = track.getBoundingClientRect();
|
|
15286
|
+
if (bounds.width < 160 || bounds.width > 480 || bounds.left < -1 || bounds.left > 16) return false;
|
|
15287
|
+
let controls = [...track.querySelectorAll('button,[role="button"],.ds-icon-button,.ds-button')].filter((el) => {
|
|
15288
|
+
const r = el.getBoundingClientRect();
|
|
15289
|
+
return r.top >= 0 && r.top <= 72 && r.width >= 12 && r.width <= 56 && r.height >= 12 && r.height <= 56 && (!el.textContent?.trim() || /^(收起侧边栏|关闭侧边栏|搜索|搜索对话|Collapse sidebar|Close sidebar|Hide sidebar|Search)$/i.test(el.textContent.trim())) && !!el.querySelector("svg") && !el.matches(':disabled,[aria-disabled="true"]');
|
|
15290
|
+
}).filter((el) => ![...track.querySelectorAll('button,[role="button"],.ds-icon-button,.ds-button')].some((other) => other !== el && el.contains(other)));
|
|
15291
|
+
if (controls.length === 0) {
|
|
15292
|
+
const candidates = [];
|
|
15293
|
+
for (const svg of track.querySelectorAll("svg")) {
|
|
15294
|
+
let el = svg.parentElement;
|
|
15295
|
+
for (let depth = 0; el && el !== track && depth < 4; depth++, el = el.parentElement) {
|
|
15296
|
+
const r = el.getBoundingClientRect();
|
|
15297
|
+
if (r.top >= 0 && r.top <= 72 && r.left >= bounds.right - 100 && r.right <= bounds.right + 1 && r.width >= 12 && r.width <= 56 && r.height >= 12 && r.height <= 56 && !el.textContent?.trim() && !el.querySelector("input,a[href]")) candidates.push(el);
|
|
15298
|
+
}
|
|
15299
|
+
}
|
|
15300
|
+
controls = [...new Set(candidates)].filter((el) => !candidates.some((other) => other !== el && other.contains(el)));
|
|
15301
|
+
}
|
|
15302
|
+
const named = controls.filter((el) => /^(收起侧边栏|关闭侧边栏|Collapse sidebar|Close sidebar|Hide sidebar)$/i.test(el.getAttribute("aria-label") || el.getAttribute("title") || el.textContent?.trim() || ""));
|
|
15303
|
+
let button = named.length === 1 ? named[0] : void 0;
|
|
15304
|
+
if (!button && controls.length === 2) {
|
|
15305
|
+
const ordered = controls.sort((a, b) => a.getBoundingClientRect().left - b.getBoundingClientRect().left);
|
|
15306
|
+
let header = ordered[1].parentElement;
|
|
15307
|
+
for (let depth = 0; header && header !== track && depth < 4; depth++, header = header.parentElement) {
|
|
15308
|
+
const r = header.getBoundingClientRect();
|
|
15309
|
+
if (header.contains(ordered[0]) && r.top >= 0 && r.top <= 32 && r.height <= 80 && header.querySelector("svg,img")) {
|
|
15310
|
+
button = ordered[1];
|
|
15311
|
+
break;
|
|
15312
|
+
}
|
|
15313
|
+
}
|
|
15314
|
+
}
|
|
15315
|
+
if (!button) return false;
|
|
15316
|
+
doc.documentElement.setAttribute(attempt, "true");
|
|
15317
|
+
button.click();
|
|
15318
|
+
return true;
|
|
15319
|
+
} finally {
|
|
15320
|
+
if (sheet && disabled !== void 0) sheet.disabled = disabled;
|
|
15321
|
+
if (originalStyle === null) track.removeAttribute("style");
|
|
15322
|
+
else track.setAttribute("style", originalStyle);
|
|
15323
|
+
}
|
|
15324
|
+
}
|
|
15325
|
+
|
|
15220
15326
|
// src/website-conversation-actions.ts
|
|
15221
15327
|
async function performWebsiteConversationAction(doc, command) {
|
|
15222
15328
|
const error51 = "\u6682\u65F6\u65E0\u6CD5\u6267\u884C\u8BE5\u5BF9\u8BDD\u64CD\u4F5C\uFF0C\u8BF7\u5237\u65B0\u5217\u8868\u540E\u91CD\u8BD5\u3002";
|
|
@@ -15671,7 +15777,7 @@ window.__ModuleLoader__.load({
|
|
|
15671
15777
|
const conversationError = "\u8BE5\u5BF9\u8BDD\u4E0D\u5728\u5F53\u524D\u5B98\u7F51\u5217\u8868\uFF0C\u8BF7\u5237\u65B0\u5217\u8868\u3002";
|
|
15672
15778
|
const styleId = "dsh-chat-website-navigation-style";
|
|
15673
15779
|
const preparingStyleId = "dsh-chat-website-preparing-style";
|
|
15674
|
-
const owned = [marker, presentedMarker, missingSidebarMarker, fallbackMarker, fallbackErrorMarker, profileMarker, profileProofMarker, profileAvatarMarker, navigationWidthMarker, expandingMarker, compactToggleMarker, "data-dsh-chat-action-menu", "data-dsh-chat-conversation-error", "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"];
|
|
15780
|
+
const owned = [marker, presentedMarker, missingSidebarMarker, fallbackMarker, fallbackErrorMarker, profileMarker, profileProofMarker, profileAvatarMarker, navigationWidthMarker, expandingMarker, compactToggleMarker, "data-dsh-chat-native-collapse-attempt", "data-dsh-chat-action-menu", "data-dsh-chat-conversation-error", "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"];
|
|
15675
15781
|
const empty = (status) => ({ status, ...status === "sign-in" ? { authenticated: false } : {}, conversations: [], selectedHref: null, canCreate: false, error: null });
|
|
15676
15782
|
const clearSettings = (preserveConfirmedPreferences = false) => {
|
|
15677
15783
|
const confirmed = ["data-dsh-chat-language", "data-dsh-chat-theme", "data-dsh-chat-dark-complete", "data-dsh-chat-settings-restored"];
|
|
@@ -16003,6 +16109,7 @@ window.__ModuleLoader__.load({
|
|
|
16003
16109
|
doc.head.append(style);
|
|
16004
16110
|
}
|
|
16005
16111
|
if (style.textContent !== styleText) style.textContent = styleText;
|
|
16112
|
+
if (authenticated === true && command.type === "snapshot" && !command.showOriginal) collapseWebsiteSidebar(doc, track);
|
|
16006
16113
|
}
|
|
16007
16114
|
const selected = conversations.find((item) => item.href === safeHref(page.pathname));
|
|
16008
16115
|
if (!(command.type === "snapshot" && command.showOriginal)) adaptWebsiteHeader(doc, content, selected?.title ?? null, command.type === "snapshot" ? command.headerInset ?? (Number.parseInt(settingsRoot.style.getPropertyValue("--dsh-chat-title-inset")) || 24) : Number.parseInt(settingsRoot.style.getPropertyValue("--dsh-chat-title-inset")) || 24);
|
|
@@ -16015,8 +16122,8 @@ window.__ModuleLoader__.load({
|
|
|
16015
16122
|
}
|
|
16016
16123
|
function websiteCommandScript(command) {
|
|
16017
16124
|
if (command.type === "refresh") throw new Error("Website refresh must be handled by the guest owner");
|
|
16018
|
-
if (command.type === "conversation-action") return `(async () => { const adaptWebsiteSettings = ${adaptWebsiteSettings.toString()}; const adaptWebsiteHeader = ${adaptWebsiteHeader.toString()}; const dismissWebsiteEnvironmentNotice = ${dismissWebsiteEnvironmentNotice.toString()}; const adapt = ${adaptWebsiteNavigation.toString()}; const command = ${JSON.stringify(command)}; const before = adapt(document,location,{type:'snapshot',showOriginal:false}); if (before.authenticated !== true || !before.conversations.some(item=>item.href===command.href)) return before; const error = await (${performWebsiteConversationAction.toString()})(document,command); if(error) document.documentElement.setAttribute('data-dsh-chat-
|
|
16019
|
-
return `(() => { const adaptWebsiteSettings = ${adaptWebsiteSettings.toString()}; const adaptWebsiteHeader = ${adaptWebsiteHeader.toString()}; const dismissWebsiteEnvironmentNotice = ${dismissWebsiteEnvironmentNotice.toString()}; return (${adaptWebsiteNavigation.toString()})(document,location,${JSON.stringify(command)}); })()`;
|
|
16125
|
+
if (command.type === "conversation-action") return `(async () => { const collapseWebsiteSidebar = ${collapseWebsiteSidebar.toString()}; const adaptWebsiteSettings = ${adaptWebsiteSettings.toString()}; const adaptWebsiteHeader = ${adaptWebsiteHeader.toString()}; const dismissWebsiteEnvironmentNotice = ${dismissWebsiteEnvironmentNotice.toString()}; const adapt = ${adaptWebsiteNavigation.toString()}; const command = ${JSON.stringify(command)}; const before = adapt(document,location,{type:'snapshot',showOriginal:false}); if (before.authenticated !== true || !before.conversations.some(item=>item.href===command.href)) return before; const error = await (${performWebsiteConversationAction.toString()})(document,command); if(error) document.documentElement.setAttribute('data-dsh-chat-conversation-error',error); else document.documentElement.removeAttribute('data-dsh-chat-conversation-error'); return adapt(document,location,{type:'snapshot',showOriginal:false}); })()`;
|
|
16126
|
+
return `(() => { const collapseWebsiteSidebar = ${collapseWebsiteSidebar.toString()}; const adaptWebsiteSettings = ${adaptWebsiteSettings.toString()}; const adaptWebsiteHeader = ${adaptWebsiteHeader.toString()}; const dismissWebsiteEnvironmentNotice = ${dismissWebsiteEnvironmentNotice.toString()}; return (${adaptWebsiteNavigation.toString()})(document,location,${JSON.stringify(command)}); })()`;
|
|
16020
16127
|
}
|
|
16021
16128
|
function parseWebsiteNavigation(value) {
|
|
16022
16129
|
if (!value || typeof value !== "object") throw new Error("Invalid navigation response");
|
|
@@ -17462,6 +17569,21 @@ window.__ModuleLoader__.load({
|
|
|
17462
17569
|
});
|
|
17463
17570
|
publish();
|
|
17464
17571
|
ctx.effect(() => {
|
|
17572
|
+
const guardedEntries = /* @__PURE__ */ new Map();
|
|
17573
|
+
const guardSearch = () => {
|
|
17574
|
+
const current = ctx.slots.entries("sidebar.workspaces");
|
|
17575
|
+
for (const [entry, cleanup] of guardedEntries) if (!current.includes(entry)) {
|
|
17576
|
+
cleanup();
|
|
17577
|
+
guardedEntries.delete(entry);
|
|
17578
|
+
}
|
|
17579
|
+
for (const entry of ctx.slots.entries("sidebar.workspaces")) {
|
|
17580
|
+
if (guardedEntries.has(entry)) continue;
|
|
17581
|
+
const cleanup = guardHarnessSearchReplay(entry);
|
|
17582
|
+
if (cleanup) guardedEntries.set(entry, cleanup);
|
|
17583
|
+
}
|
|
17584
|
+
};
|
|
17585
|
+
guardSearch();
|
|
17586
|
+
const stopSearchGuard = ctx.slots.subscribe("sidebar.workspaces", guardSearch);
|
|
17465
17587
|
const releaseStyles = typeof document === "undefined" ? () => {
|
|
17466
17588
|
} : acquireChatStyles(document);
|
|
17467
17589
|
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 +17603,9 @@ window.__ModuleLoader__.load({
|
|
|
17481
17603
|
void refreshAuthorization();
|
|
17482
17604
|
return () => {
|
|
17483
17605
|
clearTimeout(logoutTimer);
|
|
17606
|
+
stopSearchGuard();
|
|
17607
|
+
for (const cleanup of guardedEntries.values()) cleanup();
|
|
17608
|
+
guardedEntries.clear();
|
|
17484
17609
|
mode.dispose();
|
|
17485
17610
|
sidebar?.dispose();
|
|
17486
17611
|
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';
|
|
@@ -80,12 +81,13 @@ export declare function DshChatModeSelector({ bridge, state, compact }: DshChatB
|
|
|
80
81
|
readonly state: DshChatViewState;
|
|
81
82
|
readonly compact?: boolean;
|
|
82
83
|
}): import("react/jsx-runtime").JSX.Element;
|
|
83
|
-
/**
|
|
84
|
+
/** Keep interactive controls in the sidebar row, outside its decorative/new-chat brand. */
|
|
84
85
|
export declare function DshChatBrandName({ bridge }: PropsRuntime<'sidebar.brand.name'> & DshChatBridgeProps): import("react/jsx-runtime").JSX.Element;
|
|
85
86
|
/** The interactive surface is outside the brand slot's hidden/button ancestry. */
|
|
86
|
-
export declare function DshChatBrandControl({ bridge
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
export declare function DshChatBrandControl({ bridge }: DshChatBridgeProps): import("react/jsx-runtime").JSX.Element;
|
|
88
|
+
/** rc.2 replays its retained request counter on WorkspaceBrowser remount.
|
|
89
|
+
* Adapt only the view hook; never mutate the host request store or actions. */
|
|
90
|
+
export declare function guardHarnessSearchReplay(entry: StoredEntry): (() => void) | null;
|
|
89
91
|
/** Only the middle browsing region changes; the shipped shell and Settings stay mounted. */
|
|
90
92
|
export declare function DshChatChatNavigation({ bridge, wide, expandSidebar }: PropsRuntime<'sidebar.workspaces'> & DshChatBridgeProps): import("react/jsx-runtime").JSX.Element;
|
|
91
93
|
/** Measures only this plugin's own element; website content lives in the retained overlay. */
|