@jaychang1989/dsh-webchat 0.3.0
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/LICENSE +201 -0
- package/NOTICE +18 -0
- package/README.md +78 -0
- package/README.zh.md +83 -0
- package/cordis.patch.yml +22 -0
- package/lib/client.js +1725 -0
- package/lib/client.js.map +1 -0
- package/lib/index.js +3887 -0
- package/lib/types/client/api.d.ts +74 -0
- package/lib/types/client/controller.d.ts +19 -0
- package/lib/types/client/index.d.ts +30 -0
- package/lib/types/client/locales.d.ts +169 -0
- package/lib/types/client/mount.d.ts +23 -0
- package/lib/types/client/panel/Markdown.d.ts +15 -0
- package/lib/types/client/panel/WebChatPanel.d.ts +28 -0
- package/lib/types/client/sidebar-entry-core.d.ts +60 -0
- package/lib/types/client/sidebar-entry.d.ts +22 -0
- package/lib/types/engine/engine.d.ts +247 -0
- package/lib/types/engine/html-md.d.ts +23 -0
- package/lib/types/index.d.ts +63 -0
- package/lib/types/protocol.d.ts +107 -0
- package/lib/types/routes.d.ts +22 -0
- package/lib/types/store.d.ts +69 -0
- package/lib/types/tools.d.ts +27 -0
- package/lib/types/transfer.d.ts +138 -0
- package/package.json +96 -0
- package/src/client/api.ts +90 -0
- package/src/client/controller.ts +43 -0
- package/src/client/css-modules.d.ts +5 -0
- package/src/client/index.ts +75 -0
- package/src/client/locales.ts +172 -0
- package/src/client/mount.tsx +125 -0
- package/src/client/panel/Markdown.tsx +251 -0
- package/src/client/panel/WebChatPanel.tsx +760 -0
- package/src/client/panel/panel.module.css +936 -0
- package/src/client/sidebar-entry-core.ts +207 -0
- package/src/client/sidebar-entry.ts +49 -0
- package/src/engine/engine.ts +1385 -0
- package/src/engine/html-md.ts +126 -0
- package/src/index.ts +212 -0
- package/src/protocol.ts +116 -0
- package/src/routes.ts +307 -0
- package/src/store.ts +217 -0
- package/src/tools.ts +257 -0
- package/src/transfer.ts +602 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
dsh-webchat
|
|
2
|
+
Copyright 2026 jaychang1989
|
|
3
|
+
|
|
4
|
+
This product is a maintained fork of dsh-web-chat
|
|
5
|
+
(https://github.com/xmuwenxiang/dsh-web-chat), Copyright the dsh-web-chat
|
|
6
|
+
authors, licensed under the Apache License, Version 2.0.
|
|
7
|
+
|
|
8
|
+
The fork retargets the plugin at the DeepSeek Harness 0.2.x plugin APIs:
|
|
9
|
+
|
|
10
|
+
* the settings section is no longer registered by the plugin
|
|
11
|
+
(`installSettingsSection` / `settingsNamespace` were removed from
|
|
12
|
+
`@deepseek-ai/dsh-settings` in 0.1.7; forms are now derived from the
|
|
13
|
+
profile entry and its exported `Config`);
|
|
14
|
+
* session persistence is addressed through per-session handles
|
|
15
|
+
(`sessionPersistence.open` / `create` + handle `read` / `append` / `flush`)
|
|
16
|
+
instead of the retired service-level `load` / `append` pair.
|
|
17
|
+
|
|
18
|
+
See MAINTAINING.md for the exact files and the shipped-build policy.
|
package/README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# dsh-webchat
|
|
2
|
+
|
|
3
|
+
Codex-ChatGPT-mode style web chat for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness): a real browser drives [chat.deepseek.com](https://chat.deepseek.com), so you chat with the DeepSeek web model through your own web login — **no API billing**. A conversation can be transferred into Harness: it is distilled into an executable task brief and opened as a new harness session, imported as markdown context, or continued by the harness agent through the same web session.
|
|
4
|
+
|
|
5
|
+
> **This is a maintained fork of [xmuwenxiang/dsh-web-chat](https://github.com/xmuwenxiang/dsh-web-chat).** The unmaintained upstream release **cannot start** on dsh 0.2.x. This fork retargets the plugin at the dsh 0.2.x plugin APIs. License stays Apache-2.0.
|
|
6
|
+
> See [MAINTAINING.md](./MAINTAINING.md) and [NOTICE](./NOTICE) for the exact difference.
|
|
7
|
+
|
|
8
|
+
## Difference from upstream
|
|
9
|
+
|
|
10
|
+
| Area | Upstream on dsh 0.2.x | This fork |
|
|
11
|
+
| --- | --- | --- |
|
|
12
|
+
| Startup | `installSettingsSection` and `settingsNamespace` were removed from `@deepseek-ai/dsh-settings` in dsh 0.1.7, so the host half fails at ESM link time and the whole `webchat` entry reports `failed to import` — the plugin never loads | Uses the Loader-owned settings form (namespace = profile entry id, schema = this package's exported `Config`); the plugin no longer registers a settings section |
|
|
13
|
+
| Transfer to Harness | `sessionPersistence.load(id)` and `persistence.append(id, events)` became a **handle-based** API in dsh 0.2.x, so the call throws | Migrated to the `SessionHandle` returned by `open(id, 'write')` / `create(header)`, using `handle.read` / `append` / `flush` / `close` |
|
|
14
|
+
| Dependency declarations | `devDependencies` pinned at `@deepseek-ai/*: ^0.1.0-rc.7` | Updated to 0.2.x, plus runtime `peerDependencies` and `engines.dsh` |
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
From npm (prebuilt — no build step, no `allowBuilds` approval):
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
dsh plugin --profile desktop add @jaychang1989/dsh-webchat
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Or straight from this repository (also prebuilt, `lib/` is committed):
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
dsh plugin --profile desktop add github:jaychang1989/dsh-webchat
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
> The npm package is scoped because the unscoped `dsh-webchat` name belongs to the unmaintained upstream project. The plugin's own identity is unchanged by the scope: the entry id stays `webchat`, and so do the `/api/dsh-webchat` routes, the data directory and the locale namespace.
|
|
31
|
+
|
|
32
|
+
**Switching from upstream:** both packages insert the same `id: webchat` row, and one profile cannot hold the same entry id twice — boot fails on the duplicate. Remove the upstream package first (the Plugin Manager UI, or `dsh plugin --profile desktop remove dsh-webchat`), then add this one.
|
|
33
|
+
|
|
34
|
+
**Restart the DSH desktop app afterwards** — an entry that failed during startup is not hot-reloaded.
|
|
35
|
+
|
|
36
|
+
## First use
|
|
37
|
+
|
|
38
|
+
1. Open the "网页聊天 / Web chat" entry in the Web GUI sidebar.
|
|
39
|
+
2. Click "打开登录窗口" and complete the DeepSeek web login in the window that opens.
|
|
40
|
+
3. The window closes itself once you are logged in; chatting then runs headless.
|
|
41
|
+
|
|
42
|
+
## Features
|
|
43
|
+
|
|
44
|
+
- **Web chat** — reuses your DeepSeek web login, streams replies, with "deep think (R1)" and "smart search" toggles.
|
|
45
|
+
- **Transfer to Harness** — distill the current web conversation into a task brief and open it as a new harness session (first message is the brief), or continue an existing session by appending the brief to it; the transfer can target a registered workspace.
|
|
46
|
+
- **Recover from the web** — pull web-side conversations that are not in the local store yet (panel button / `webchat_recover`).
|
|
47
|
+
- **Import as context** — export a stored web conversation as markdown context.
|
|
48
|
+
- **Agent tools** — `webchat_status`, `webchat_send`, `webchat_recover`, `webchat_import`, `webchat_transfer`, callable by the harness agent directly.
|
|
49
|
+
- **Effortless login** — the login window is visible once, then closes itself; chatting afterwards is headless.
|
|
50
|
+
|
|
51
|
+
## Configuration
|
|
52
|
+
|
|
53
|
+
The settings form follows the profile entry (`webchat`) and is generated from this package's `Config`: `browserChannel` (default `auto`), `browserExecutablePath`, `browserProxy`, `browserHeadless` (default `true` — the login window is always visible and closes itself), `replyTimeoutMs`, `transferDistill` / `transferProvider` / `transferModel` (distillation model for transfers), `transferMaxTokens` (final brief cap, default 4096), `transferChunkTokens` (per-chunk cap for long conversations, default 1024).
|
|
54
|
+
|
|
55
|
+
## Requirements
|
|
56
|
+
|
|
57
|
+
- DeepSeek Harness **0.2.0-rc.1 or a newer 0.2.x**
|
|
58
|
+
- Node.js >= 22
|
|
59
|
+
- Google Chrome or Microsoft Edge installed
|
|
60
|
+
- An interactive desktop for the one-time login window
|
|
61
|
+
|
|
62
|
+
## Limitations
|
|
63
|
+
|
|
64
|
+
- The DeepSeek web front end is rate-limited and can change; failures return errors instead of crashing.
|
|
65
|
+
- Credentials and session data live in a local private directory (the profile) — do not share it.
|
|
66
|
+
- "Continue an existing session" on dsh 0.2.x needs that session to be free of another writer (for example it must not be open in the GUI holding the write lease). A taken session returns an explicit error rather than failing silently.
|
|
67
|
+
|
|
68
|
+
## Development
|
|
69
|
+
|
|
70
|
+
`lib/` is committed as the shipped build and is what a git install runs. Host-half changes must be mirrored in `src/` and `lib/` until the build pipeline is restored — see [MAINTAINING.md](./MAINTAINING.md).
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
node --test # unit tests (Node's built-in test runner)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## License
|
|
77
|
+
|
|
78
|
+
[Apache-2.0](./LICENSE). Original copyright belongs to the authors of [xmuwenxiang/dsh-web-chat](https://github.com/xmuwenxiang/dsh-web-chat); see [NOTICE](./NOTICE).
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# dsh-webchat
|
|
2
|
+
|
|
3
|
+
为 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 提供的「Codex ChatGPT 模式」插件:通过真实浏览器驱动 [chat.deepseek.com](https://chat.deepseek.com),用你的 DeepSeek 网页登录会话与网页模型对话,**无需 API 额度**。对话可「转移到 Harness」——蒸馏成可执行任务简报并新建 harness 会话作为开发上下文,也可把网页对话导入为 markdown 上下文,或让 harness agent 直接通过同一个网页会话提问。
|
|
4
|
+
|
|
5
|
+
> **这是 [xmuwenxiang/dsh-web-chat](https://github.com/xmuwenxiang/dsh-web-chat) 的维护分支(fork)**,已停止维护的上游版本在 dsh 0.2.x 上**无法启动**。本分支把插件重新对准 dsh 0.2.x 的插件 API,许可证沿用 Apache-2.0。
|
|
6
|
+
> 差异与原因见 [MAINTAINING.md](./MAINTAINING.md) 与 [NOTICE](./NOTICE)。
|
|
7
|
+
|
|
8
|
+
## 与上游的差异
|
|
9
|
+
|
|
10
|
+
| 问题 | 上游(dsh 0.2.x 上) | 本分支 |
|
|
11
|
+
| --- | --- | --- |
|
|
12
|
+
| 启动 | `installSettingsSection` / `settingsNamespace` 在 dsh 0.1.7 起已从 `@deepseek-ai/dsh-settings` 移除,宿主半区在 ESM 链接期报错,整条 `webchat` entry `failed to import`,插件**完全不加载** | 改为使用 Loader 自带的设置表单(命名空间 = profile entry id,schema = 本包导出的 `Config`),插件不再自行注册设置段 |
|
|
13
|
+
| 转移到 harness | `sessionPersistence.load(id)` / `persistence.append(id, events)` 在 dsh 0.2.x 已改为**句柄式** API,调用即抛错 | 迁到 `open(id, 'write')` / `create(header)` 返回的 `SessionHandle`,用 `handle.read` / `append` / `flush` / `close` |
|
|
14
|
+
| 依赖声明 | `devDependencies` 停留在 `@deepseek-ai/*: ^0.1.0-rc.7` | 更新到 0.2.x,并补上运行时 `peerDependencies` 与 `engines.dsh` |
|
|
15
|
+
|
|
16
|
+
## 安装
|
|
17
|
+
|
|
18
|
+
从 npm 安装(预构建产物,免构建、免 `allowBuilds` 授权):
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
dsh plugin --profile desktop add @jaychang1989/dsh-webchat
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
或直接从本仓库安装(同样是预构建,`lib/` 已提交):
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
dsh plugin --profile desktop add github:jaychang1989/dsh-webchat
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
> npm 包名带 scope,是因为不带 scope 的 `dsh-webchat` 属于已停止维护的上游项目。scope 不影响插件自身身份:entry id 仍是 `webchat`,`/api/dsh-webchat` 路由、数据目录与 locale 命名空间也都不变。
|
|
31
|
+
|
|
32
|
+
**从上游切换过来时**:上游包与本包都插入 `id: webchat` 这一行,同一个 profile 里同时存在会因 entry id 重复而在启动时报错。请先移除上游包:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
dsh plugin --profile desktop remove dsh-webchat
|
|
36
|
+
dsh plugin --profile desktop add github:jaychang1989/dsh-webchat
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
改完请**重启 DSH 桌面端**(启动期已判定失败的 entry 不会热重载)。
|
|
40
|
+
|
|
41
|
+
## 首次使用
|
|
42
|
+
|
|
43
|
+
1. 打开 Web GUI 侧边栏「网页聊天」入口。
|
|
44
|
+
2. 点击「打开登录窗口」,在弹出的浏览器中完成 DeepSeek 网页登录。
|
|
45
|
+
3. 登录成功后窗口会自动关闭,之后即可正常聊天 / 转移。
|
|
46
|
+
|
|
47
|
+
## 特性
|
|
48
|
+
|
|
49
|
+
- **网页聊天**:复用 DeepSeek 网页端登录,流式获取回复,支持「深度思考(R1)」与「智能搜索」开关。
|
|
50
|
+
- **转移到 Harness**:一键把当前网页对话蒸馏成任务简报(首条消息即简报)并创建新 harness 会话继续开发,或「延续到已有会话」——把简报作为新消息追加进指定会话;转移时可选择目标工作区(未选则归入「未分组」)。
|
|
51
|
+
- **从网页恢复会话**:把网页端已存在但本地未收录的会话拉回本地存储(面板「从网页恢复」按钮 / `webchat_recover`)。
|
|
52
|
+
- **导入为上下文**:把存储的网页对话导出为 markdown 上下文。
|
|
53
|
+
- **Agent 工具**:`webchat_status` / `webchat_send` / `webchat_recover` / `webchat_import` / `webchat_transfer`,harness agent 可直接调用。
|
|
54
|
+
- **无感登录**:首次使用弹出可见浏览器窗口完成登录,登录后窗口自动关闭,后续聊天在无头浏览器中进行。
|
|
55
|
+
|
|
56
|
+
## 配置
|
|
57
|
+
|
|
58
|
+
插件设置跟随 profile entry(`webchat`)自动生成,可调整:`browserChannel`(浏览器渠道,默认 auto)、`browserExecutablePath`(显式浏览器路径)、`browserProxy`(代理)、`browserHeadless`(聊天是否无头,默认 true——登录窗口始终可见且登录后自动关闭)、`replyTimeoutMs`(回复等待上限)、`transferDistill` / `transferProvider` / `transferModel`(转移时的蒸馏模型)、`transferMaxTokens`(最终简报输出上限,默认 4096)、`transferChunkTokens`(长对话分块摘要每段上限,默认 1024)。
|
|
59
|
+
|
|
60
|
+
## 环境要求
|
|
61
|
+
|
|
62
|
+
- DeepSeek Harness **0.2.0-rc.1 或更新的 0.2.x**
|
|
63
|
+
- Node.js >= 22
|
|
64
|
+
- 已安装 Google Chrome 或 Microsoft Edge
|
|
65
|
+
- 首次登录需要可交互的图形环境(弹出登录窗口)
|
|
66
|
+
|
|
67
|
+
## 限制
|
|
68
|
+
|
|
69
|
+
- 网页端受 DeepSeek 官方风控;页面改版或操作失败时返回错误而非崩溃。
|
|
70
|
+
- 密码/会话凭据保存在本地私有目录(profile),请勿外泄。
|
|
71
|
+
- 「延续到已有会话」在 dsh 0.2.x 上需要该会话未被其它写入方占用(例如未在界面上打开并持有写租约);被占用时会返回明确错误而不是静默失败。
|
|
72
|
+
|
|
73
|
+
## 开发
|
|
74
|
+
|
|
75
|
+
`lib/` 是随仓库提交的编译产物,从 git 安装直接使用它。宿主半区改动需要同步 `src/` 与 `lib/`(构建流水线尚未恢复,见 [MAINTAINING.md](./MAINTAINING.md))。
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
node --test # 运行单元测试(Node 内置测试运行器)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## License
|
|
82
|
+
|
|
83
|
+
[Apache-2.0](./LICENSE) — 原始版权归 [xmuwenxiang/dsh-web-chat](https://github.com/xmuwenxiang/dsh-web-chat) 作者所有,详见 [NOTICE](./NOTICE)。
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# dsh-webchat bundle patch: inserts the dual-face plugin row into a profile
|
|
2
|
+
# roster. Applied as a profile bundle layer (the `dsh.bundle.patch` manifest
|
|
3
|
+
# field) over dsh-base; activate by adding this package to the profile's
|
|
4
|
+
# `dsh.profile.bundles`, or with
|
|
5
|
+
# dsh plugin --profile <name> add @jaychang1989/dsh-webchat
|
|
6
|
+
# dsh plugin --profile <name> add github:jaychang1989/dsh-webchat
|
|
7
|
+
#
|
|
8
|
+
# The row is a bare plugin by package name: the node half (exports ".") runs in
|
|
9
|
+
# the host process (DeepSeek web browser engine, /api/dsh-webchat routes, agent
|
|
10
|
+
# tools), and the `dsh.client` declaration in package.json makes the browser
|
|
11
|
+
# half (exports "./client", served at /plugins/<id>/client.js) load in the web
|
|
12
|
+
# GUI. `name` must be this package's manifest name verbatim (scoped names
|
|
13
|
+
# included) — dsh-client-modules keys every browser row by it, and lib/client.js
|
|
14
|
+
# registers its factory under the same id. `id` is the profile entry id; dsh >=
|
|
15
|
+
# 0.1.7 also uses it as the settings form namespace, so keep it stable.
|
|
16
|
+
#
|
|
17
|
+
# Note: the upstream package xmuwenxiang/dsh-web-chat inserts the same
|
|
18
|
+
# `id: webchat`. Do not keep both installed in one profile — a duplicate entry
|
|
19
|
+
# id is rejected at boot.
|
|
20
|
+
- insert:
|
|
21
|
+
- id: webchat
|
|
22
|
+
name: '@jaychang1989/dsh-webchat'
|