@samuelchung2010/dshift 0.0.0-stage → 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.
Files changed (46) hide show
  1. package/CHANGELOG.md +97 -0
  2. package/LICENSE +21 -0
  3. package/README.en.md +116 -0
  4. package/README.md +116 -3
  5. package/assets/dshift-readme.gif +0 -0
  6. package/client.js +18831 -0
  7. package/cordis.patch.yml +58 -0
  8. package/docs/architecture.md +203 -0
  9. package/docs/configuration.md +103 -0
  10. package/docs/development.md +125 -0
  11. package/docs/limitations.md +74 -0
  12. package/docs/math-boxed-qquad.png +0 -0
  13. package/docs/math-boxed-single.png +0 -0
  14. package/docs/memory-integration.md +111 -0
  15. package/docs/perf/baseline-before.json +4872 -0
  16. package/docs/perf/baseline-before.summary.json +659 -0
  17. package/docs/perf/fixed-after.json +2927 -0
  18. package/docs/perf/fixed-after.summary.json +583 -0
  19. package/docs/perf/long-chat-performance.md +340 -0
  20. package/docs/perf/merged-after.json +1953 -0
  21. package/docs/perf/merged-after.summary.json +382 -0
  22. package/docs/perf/mount-after.json +82 -0
  23. package/docs/perf/mount-baseline.json +82 -0
  24. package/docs/user-guide.md +202 -0
  25. package/icon.svg +13 -0
  26. package/index.js +16 -0
  27. package/lib/api.js +336 -0
  28. package/lib/artifact/approval-bus.js +94 -0
  29. package/lib/artifact/prompt.js +99 -0
  30. package/lib/artifact/service.js +602 -0
  31. package/lib/artifact/workspace.js +260 -0
  32. package/lib/import/convert.js +343 -0
  33. package/lib/import/format.js +262 -0
  34. package/lib/import/index.js +585 -0
  35. package/lib/import/media.js +101 -0
  36. package/lib/import/zip.js +296 -0
  37. package/lib/memory-store.js +629 -0
  38. package/lib/memory-text.js +162 -0
  39. package/lib/memory.js +871 -0
  40. package/lib/model-config.js +280 -0
  41. package/lib/protocol.js +593 -0
  42. package/lib/service.js +2102 -0
  43. package/lib/store.js +1011 -0
  44. package/locale/en.json +6 -0
  45. package/locale/zh.json +6 -0
  46. package/package.json +49 -6
package/CHANGELOG.md ADDED
@@ -0,0 +1,97 @@
1
+ # Changelog
2
+
3
+ DSHift 的版本变更记录。每个版本都对应一个 GitHub Release,安装包、校验和与验证记录见链接。
4
+
5
+ ## v0.3.0 — 2026-12-03
6
+
7
+ [GitHub Release](https://github.com/SamuelChung2010/DSHift/releases/tag/v0.3.0)
8
+
9
+ ### 新增
10
+
11
+ - **文档模式(Documents)**:输入框上方新增「文档编辑」开关,与联网搜索、深度思考并排。开启后,Chat 把需求交给带官方 Office 技能的 Agent 任务:创建和编辑 Word(.docx)、Excel(.xlsx)、PowerPoint(.pptx),并可生成 PDF;上传的 Word / Excel / PowerPoint / PDF 以只读副本参与修改,原文件保持不变。
12
+ - **共享文档工作区**:每段对话在共享的 Documents 工作区中拥有独立子目录;交付文件用 `present` 声明,聊天内直接显示文件卡片,可预览、打开与另存。同一对话的后续修改复用同一任务目录。
13
+ - **后台生成**:文档任务运行期间可以新建对话、切换历史会话或切回 Agent,任务在后台继续;返回时恢复实时输出与停止按钮,侧栏显示运行中与未读标记。
14
+ - **执行过程与交互**:文档卡片内嵌可折叠的真实执行轨迹(思考、加载技能、写入、运行命令、转换、检查、交付),不显示虚构进度;需要授权时直接在卡片内允许或拒绝,运行中还可以追加补充要求,切换会话或模式后状态保留。
15
+ - **输入框与菜单**:`+`、联网搜索、深度思考、文档编辑统一为同高同圆角胶囊,开启为蓝色描边与浅蓝底、关闭为中性灰;Chat / Agent 模式菜单改用浏览器顶层浮层,不再被侧栏裁切,并随侧栏宽度自适应。
16
+
17
+ ### 升级说明
18
+
19
+ - 聊天历史与长期记忆格式未变,无需迁移。
20
+ - 文档任务使用 DSH 自带的 Office 技能与工具,首次使用会加载 office 技能。
21
+ - Host 端改动(审批桥接、文档路由、执行事件)需要重启 DSH;浏览器端需刷新。
22
+ - 仍保持一次运行一个 Chat 生成:切换会话不会中断当前任务,但在另一个会话发送会提示等待。
23
+
24
+ ### 已知限制
25
+
26
+ - PDF 不能直接编辑:需要改动 PDF 时先编辑源文档,再另存为 PDF。
27
+ - 文档任务共享同一个 Documents 工作区,隔离依靠任务提示约束,不是沙箱隔离。
28
+ - 授权请求经 DSH 原生审批流桥接到聊天卡片。
29
+
30
+ ## v0.2.0-beta.4 — 2026-11-27
31
+
32
+ [GitHub Release](https://github.com/SamuelChung2010/DSHift/releases/tag/v0.2.0-beta.4)
33
+
34
+ ### 修复与优化
35
+
36
+ - **长会话输入性能**:`useChat` 改为基于 `useSyncExternalStore` 的选择器精确订阅,无变化的 store patch 不再广播;消息行、Markdown 与 Thread 增加稳定的 memo 边界,输入草稿不再触发历史消息重渲染。Windows 11 / Chrome 158 基准中,300 条会话输入 P95 从 22.2 ms 降到 8.2 ms,500 条从 32.0 ms 降到 16.6 ms,500 条密集 Markdown 从 118.3 ms 降到 14.5 ms;普通输入时历史消息与 Markdown 重渲染为 0,流式期间只更新当前消息。详见 [性能报告](docs/perf/long-chat-performance.md)。
37
+ - **公式渲染增强**:支持 `\boxed{}`、`\qquad`、顶层 `\\` 换行以及 `latex` / `math` / `tex` 围栏公式;流式中未闭合的括号或 TeX 围栏保持原文,闭合后再整体渲染,不再画出半截公式。公式字体栈调整为 KaTeX / Times New Roman / Cambria Math。
38
+
39
+ ### 升级说明
40
+
41
+ - 聊天历史保持 v2 兼容,无需迁移;长期记忆文件格式未变。
42
+ - Host 端改动需要重启 DSH 或重载插件;浏览器端首次可能提示刷新。
43
+
44
+ ## v0.2.0-beta.3 — 2026-11-23
45
+
46
+ [GitHub Release](https://github.com/SamuelChung2010/DSHift/releases/tag/v0.2.0-beta.3)
47
+
48
+ ### 修复
49
+
50
+ - **公式与 Markdown 渲染**:先保护代码块、行内代码与公式占位符,修复行内代码显示成 `code:...`、矩阵/`bmatrix` 布局错位、未支持或未闭合 LaTeX 只画出半截公式,以及流式公式完成后内容跳动的问题。未知环境整条回退为浅底等宽源码,不丢字、不报错。
51
+ - **模式切换时的文件选择器**:修复从 Agent 切回 Chat 时误弹系统文件选择器。上传改为“实时注册 input + 模式门禁”,切换期间加锁;隐藏 input 不再进入 Tab 顺序,拖拽、粘贴与导入上传共用同一道守卫。
52
+ - **Harness 原生控件**:`+`、发送与停止按钮改用原生 16-unit 图形和 28/34px 正圆,补上 `corner-shape: round`,不再被主题的 `superellipse` 压成圆角矩形;`交给 Agent` 按钮调整为 40px 胶囊,与 Chat | Agent 切换器同高、同圆角并保持对齐,窄屏同步缩到 36px。
53
+ - **可观测性**:上传路径增加 `[upload]` 诊断日志与原生文件 input 点击栈,便于复现时定位触发来源。
54
+
55
+ ### 升级说明
56
+
57
+ - 无数据格式变化;从 Beta 2 升级无需迁移。Host 端改动需要重载插件或重启 DSH。
58
+
59
+ ## v0.2.0-beta.2 — 2026-11-21
60
+
61
+ [GitHub Release](https://github.com/SamuelChung2010/DSHift/releases/tag/v0.2.0-beta.2)
62
+
63
+ ### 修复
64
+
65
+ - **Windows 主面板对齐**:Chat 主内容区左上角改用框架同款 `--dsh-windows-content-radius`(16px)圆角,并按原生中间列的方式裁切内容、由侧栏底色填充缺口;Windows 下同时去掉 Chat 侧栏右边线,与原生 Windows 布局一致。
66
+ - **macOS 顶栏与侧栏**:`Chat | Agent` 切换器改为按当前模式的主内容列居中;Chat 打开时隐藏被遮住的原生侧栏开关;侧栏底色、分隔线与抽屉遮罩对齐原生。
67
+ - **macOS 拖拽区与可读性**:Chat 侧栏品牌行退出 `-webkit-app-region: drag`,盖在原生拖拽行上的控件仍可点击;对话框主按钮与开关改用原生强调色 token,深色模式不再白底白字;发送快捷键提示在 macOS 显示 Command + Enter。
68
+
69
+ ### 升级说明
70
+
71
+ - 只包含界面修复,无数据格式变化;从 Beta 1 升级无需迁移。
72
+
73
+ ## v0.2.0-beta.1 — 2026-11-20
74
+
75
+ [GitHub Release](https://github.com/SamuelChung2010/DSHift/releases/tag/v0.2.0-beta.1)
76
+
77
+ ### 新增
78
+
79
+ - **聊天记录导入**:读取 DeepSeek App / 网页版导出的官方 ZIP,在本机解析、预览并选择会话导入。消息、思考过程、搜索步骤、引用来源、分支版本与可恢复图片都会转换到 Chat 历史;重复导入不会产生重复会话,导入的会话可以搜索、管理并继续聊天。
80
+ - **长期记忆**:可选的跨会话记忆,支持自动记忆提取、按问题相关度检索、Memory Summary、Ask or Update、手动增删改、从 ChatGPT / Claude / Gemini 导入已有记忆,以及记忆总开关与隐私控制。记忆保存在本机 `memory.json`,与聊天记录分开。
81
+ - **原生界面收尾**:输入框、`+` 菜单和模型座统一到 Harness 原生风格。`+` 是贴近输入框、近乎等宽的大圆角浮层,左侧图标与名称、右侧简短说明;模型与推理等级合并在同一个双层菜单中;`+` 与发送按钮保持圆形,联网搜索与深度思考仍是独立按钮。
82
+ - **导入后提取记忆**:导入完成页可选择部分导入会话分析长期记忆;默认不勾选、不调用模型,确认费用提示后才逐个分析,候选记忆先预览再合并。已分析的会话会标记并默认跳过,提取失败不影响已导入的聊天。
83
+
84
+ ### 升级说明
85
+
86
+ - 聊天历史升级为 v2 节点树;旧 v1 历史在加载时自动迁移,迁移前保留 `state.json.v1-backup-*` 备份。
87
+ - 长期记忆使用独立的 `$DSH_HOME/deepseek-chat/memory.json`。
88
+
89
+ ## v0.1.0-beta.1 — 2026-11-19
90
+
91
+ [GitHub Release](https://github.com/SamuelChung2010/DSHift/releases/tag/v0.1.0-beta.1)
92
+
93
+ 首个公开 beta:DSH 中的原生 Chat 模式、独立历史与输入框、流式回答与停止、多轮上下文、模型选择、文件上传、Chat → Agent 交接,以及 Markdown / LaTeX / Mermaid 渲染。本版本面向早期试用,后续版本增加了导入、长期记忆和渲染/性能改进。
94
+
95
+ ## 更早版本
96
+
97
+ 所有历史版本、安装包与校验信息见 [GitHub Releases](https://github.com/SamuelChung2010/DSHift/releases)。
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 SamuelChung2010
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.en.md ADDED
@@ -0,0 +1,116 @@
1
+ # DSHift
2
+
3
+ [![Release](https://img.shields.io/github/v/release/SamuelChung2010/DSHift?include_prereleases&label=release)](https://github.com/SamuelChung2010/DSHift/releases)
4
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
5
+ ![DSH](https://img.shields.io/badge/DSH-%E2%89%A50.2.2--rc.5-5b6ee1)
6
+
7
+ [简体中文](README.md) | **English**
8
+
9
+ **Go from conversation to action inside DeepSeek Harness.**
10
+
11
+ DSHift adds a native **DeepSeek Chat mode** alongside Agent mode in [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH). Import DeepSeek chat history, bring long-term memory over from other platforms, and hand conversations off to Agent as tasks.
12
+
13
+ ## Quick start
14
+
15
+ ```sh
16
+ dsh plugin add github:SamuelChung2010/DSHift
17
+ ```
18
+
19
+ **Requirements**
20
+
21
+ - DeepSeek Harness `>=0.2.2-rc.5`
22
+ - A signed-in DeepSeek account or a DeepSeek API key
23
+ - Windows or macOS desktop
24
+
25
+ You can also pick this repository directory from DSH **Plugins**, or install the `.tgz` from [Releases](https://github.com/SamuelChung2010/DSHift/releases). A `.zip` must be extracted and installed from the resulting directory.
26
+
27
+ Restart DSH or reload the plugin after installing the Host half; the browser side may ask for a refresh the first time.
28
+
29
+ ![DSHift interface demo](assets/dshift-readme.gif)
30
+
31
+ ## Core features
32
+
33
+ ### Chat and Agent, side by side
34
+
35
+ The shared `Chat | Agent` switch moves between two views in the same window. Chat has its own conversations, search, drafts, and composer. Agent has its own sessions and workspaces. Switching preserves unsent drafts. The switch appears only on blank pages. Opening an existing conversation or sending the first message hides only the switch. It reappears when you return to a blank page.
36
+
37
+ ### Chat → Agent handoff
38
+
39
+ When the discussion is ready, click **Hand off to Agent**. DSHift turns it into an editable task brief, lets you pick or create a Harness workspace, then opens a real Agent session with that brief as the first prompt.
40
+
41
+ ### Document editing
42
+
43
+ Turn on **Documents** in the Chat composer to create or edit Word, Excel, and PowerPoint files, or to generate a PDF. Track progress and send additional instructions while the task runs. When it finishes, open or download the files from chat, or preview supported formats.
44
+
45
+ ### Long-term memory and migration
46
+
47
+ Cross-conversation memory is stored locally, separately from chat history. Long-term memory is on by default, and **automatic extraction is off by default**. You can enable extraction in **Chat settings**. DSHift supports relevance-based memory injection, Memory Summary, Ask or Update, and imports from ChatGPT / Claude / Gemini. Turning off long-term memory stops retrieval, injection, and extraction.
48
+
49
+ ### DeepSeek chat import
50
+
51
+ Import an official DeepSeek App / web export ZIP locally. Titles, timestamps, thinking, search sources, answer branches, and recoverable images are preserved. Re-imports are deduplicated, and imported conversations can be continued or handed to an Agent.
52
+
53
+ ## Other features
54
+
55
+ - **Web search and deep thinking**: independent composer toggles; answers carry numbered citations and a collapsible source list.
56
+ - **Attachments and images**: PDF / Word / PowerPoint parsing, image input, and `user_data` for text, code, spreadsheets, and ebooks.
57
+ - **Models and reasoning effort**: `deepseek-flash` / `deepseek-v4-pro`, with model and `Off / Low / High / Max` in one two-level menu, saved per conversation.
58
+ - **Conversation management**: folders, pinning, archive, history search, message editing, regeneration, answer versions, and continue-from-prefix.
59
+ - **Markdown / LaTeX / Mermaid**: highlighted and copyable code, formulas including `\boxed{}`, Mermaid diagrams; unsupported syntax falls back to source with an explanation.
60
+ - **Native-feeling interface**: English and Chinese, light and dark themes, responsive layout, and Windows / macOS styling.
61
+ - **Zero additional npm runtime dependencies.** DSHift runs in the Harness environment.
62
+
63
+ ## Beta 4 long-chat performance
64
+
65
+ Beta 4 rebuilds client subscriptions and render isolation: typing no longer re-renders historical messages, Markdown, or the sidebar, and streaming updates only the current answer. Measured on Windows 11, Intel Core Ultra 5 228V / 31.5 GB, Chrome 158 headless, the real DSH Web UI, with **synthetic conversations**:
66
+
67
+ | Scenario | Before P95 | After P95 |
68
+ | --- | --- | --- |
69
+ | 500 messages, dense Markdown | 118.3 ms | **14.5 ms** |
70
+ | 500 messages, regular content | 32.0 ms | **16.6 ms** |
71
+ | 300 messages, regular content | 22.2 ms | **8.2 ms** |
72
+
73
+ A normal keystroke now causes **zero** re-renders of historical messages, Markdown, or `renderBlocks`. P95 is the delay from the input event to a task after paint; these are local synthetic results and do not represent every user or macOS / Electron. See the [performance report](docs/perf/long-chat-performance.md) for method, raw data, and remaining bottlenecks.
74
+
75
+ ## Usage and authentication
76
+
77
+ On a blank page, the shared `Chat | Agent` switch appears at the top. Chat needs authentication on first use: open **Chat settings → Authentication** and choose the DSH account or an API key. The default lookup order is:
78
+
79
+ 1. API key saved in Chat settings (`DEEPSEEK_CHAT_API_KEY`)
80
+ 2. `DEEPSEEK_API_KEY` from the DSH credential store or environment
81
+ 3. The signed-in DeepSeek account token
82
+
83
+ API keys stay in the DSH Host process and are never sent to the browser. Enter sends, Shift + Enter inserts a newline, and the send key can be changed to Ctrl + Enter. Enter during an IME composition commits the candidate; it does not send.
84
+
85
+ See the [user guide](docs/user-guide.md) for everyday workflows and [configuration](docs/configuration.md) for authentication and options. The detailed guides are currently written in Chinese.
86
+
87
+ ## Privacy, compatibility, and limitations
88
+
89
+ - Chat history, long-term memory, import staging, and imported images stay under `$DSH_HOME/deepseek-chat/`; import ZIPs are never uploaded. Chat, web search, file parsing, and memory extraction call the DeepSeek API on demand and may incur usage costs.
90
+ - DSHift is an independent plugin verified on DSH `0.2.2-rc.5`. The Windows and macOS desktop interfaces were checked on real devices. The Web UI has undergone limited performance testing. Full Web compatibility still needs verification.
91
+ - Math support is a chat-focused LaTeX subset. Mermaid covers flowcharts, sequence diagrams, pie charts, and basic class diagrams; unsupported syntax falls back to source instead of failing.
92
+ - Stop a running answer before switching conversations or editing messages. `deepseek-v4-pro` does not support image understanding.
93
+ - The first mount of a 500-message dense conversation still takes about 3 seconds; that one-time cost is outside the typing path.
94
+
95
+ See [limitations](docs/limitations.md) for the full list and platform/test boundaries.
96
+
97
+ ## Documentation
98
+
99
+ | Document | Contents |
100
+ | --- | --- |
101
+ | [User guide](docs/user-guide.md) | Chat, search, attachments, sessions, handoff, import, and memory workflows |
102
+ | [Architecture](docs/architecture.md) | Host / client split, state, streaming protocol, rendering, and import pipeline |
103
+ | [Configuration](docs/configuration.md) | Authentication, Host options, data storage, and model preferences |
104
+ | [Development](docs/development.md) | Build, tests, checks, performance benchmarking, and local install |
105
+ | [Limitations](docs/limitations.md) | Compatibility, feature boundaries, and performance test scope |
106
+ | [Memory integration](docs/memory-integration.md) | Imported-conversation and memory-extraction contract |
107
+ | [Performance report](docs/perf/long-chat-performance.md) | Beta 4 root causes, fix, and before/after data |
108
+ | [Changelog](CHANGELOG.md) | Release history with GitHub Releases links |
109
+
110
+ ## Feedback, contributing, and license
111
+
112
+ - Questions and bugs: [GitHub Issues](https://github.com/SamuelChung2010/DSHift/issues)
113
+ - Contributing: see the [development guide](docs/development.md). Run the tests and checks before submitting, and never include real chat logs or secrets.
114
+ - Packages and checksums: [GitHub Releases](https://github.com/SamuelChung2010/DSHift/releases)
115
+
116
+ DSHift is released under the **MIT** license. See [LICENSE](LICENSE).
package/README.md CHANGED
@@ -1,3 +1,116 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
1
+ # DSHift
2
+
3
+ [![Release](https://img.shields.io/github/v/release/SamuelChung2010/DSHift?include_prereleases&label=release)](https://github.com/SamuelChung2010/DSHift/releases)
4
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
5
+ ![DSH](https://img.shields.io/badge/DSH-%E2%89%A50.2.2--rc.5-5b6ee1)
6
+
7
+ **简体中文** | [English](README.en.md)
8
+
9
+ **从对话到行动,都在 DeepSeek Harness 内完成。**
10
+
11
+ DSHift 为 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(DSH)加入原生 **DeepSeek Chat 模式**,与 Agent 模式并列。你可以导入 DeepSeek 聊天记录、跨平台迁移长期记忆,并把讨论直接交给 Agent 执行。
12
+
13
+ ## 快速开始
14
+
15
+ ```sh
16
+ dsh plugin add github:SamuelChung2010/DSHift
17
+ ```
18
+
19
+ **前置条件**
20
+
21
+ - DeepSeek Harness `>=0.2.2-rc.5`
22
+ - 已登录的 DeepSeek 账号,或可用的 DeepSeek API Key
23
+ - Windows 或 macOS 桌面端
24
+
25
+ 也可以在 DSH 的 **Plugins** 页面选择本仓库目录,或安装 [Releases](https://github.com/SamuelChung2010/DSHift/releases) 中的 `.tgz`。`.zip` 需要先解压再从目录安装。
26
+
27
+ 安装 Host 端后重启 DSH 或重载插件;浏览器端首次可能提示刷新。
28
+
29
+ ![DSHift 界面演示](assets/dshift-readme.gif)
30
+
31
+ ## 核心特色
32
+
33
+ ### Chat 与 Agent 双模式
34
+
35
+ 使用顶部的 `Chat | Agent` 切换器,可以在同一窗口内切换两套独立界面。Chat 有自己的会话、搜索、草稿与输入框,Agent 有自己的会话和工作区。切换时会保留未发送的内容。切换器仅在空白页显示。进入已有会话或发送第一条消息后,只有切换器会自动隐藏,返回空白页时会重新显示。
36
+
37
+ ### Chat → Agent 任务交接
38
+
39
+ 在 Chat 里讨论完需求,点击「交给 Agent」。DSHift 会把对话整理成可编辑的任务说明,选择或新建 Harness 工作区后创建真实 Agent 会话,并把说明作为首条提示提交。不需要手工复制上下文。
40
+
41
+ ### 文档编辑
42
+
43
+ 在 Chat 输入框开启「文档编辑」,即可创建或修改 Word、Excel 和 PowerPoint 文件,也能生成 PDF。任务运行时可以查看进度、追加要求。完成后可在聊天里打开或下载文件,也可以预览受支持的格式。
44
+
45
+ ### 长期记忆与跨平台迁移
46
+
47
+ 跨会话记忆与聊天记录分开保存在本机。长期记忆默认开启,**自动提取默认关闭**,可在 **Chat 设置 → 长期记忆** 中按需开启自动提取。支持按问题相关度注入记忆、Memory Summary、Ask or Update,以及从 ChatGPT / Claude / Gemini 导入已有记忆。关闭长期记忆总开关后,检索、注入和自动提取全部停止。
48
+
49
+ ### DeepSeek 聊天记录导入
50
+
51
+ 读取 DeepSeek App / 网页版导出的官方 ZIP,在本机解析、预览并选择会话导入。标题、时间、思考过程、搜索来源、分支版本、可恢复图片都会保留;重复导入自动去重,导入的会话可以继续聊天或交给 Agent。
52
+
53
+ ## 其他功能
54
+
55
+ - **联网搜索与深度思考**:输入框下方的独立开关;搜索回答带正文引用编号和可折叠来源列表。
56
+ - **附件与图片**:PDF / Word / PPT 走版面解析,图片可作为图片输入,文本、代码、表格与电子书走 `user_data`。
57
+ - **模型与推理等级**:`deepseek-flash` / `deepseek-v4-pro`,在同一个双层菜单中选择模型和 `Off / Low / High / Max`,按会话保存。
58
+ - **完整会话管理**:文件夹、置顶、归档、历史搜索;编辑消息、重新生成、回答版本切换、从已有正文继续生成。
59
+ - **Markdown / LaTeX / Mermaid**:代码高亮与复制、公式渲染(含 `\boxed{}`)、Mermaid 图表;失败时保留源码并说明原因。
60
+ - **本地化界面**:中英文、明暗主题、响应式布局,以及 macOS / Windows 原生风格适配。
61
+ - **零额外 npm 运行时依赖**,复用 Harness 提供的运行环境。
62
+
63
+ ## Beta 4 长会话性能
64
+
65
+ Beta 4 重做了客户端订阅与渲染隔离:输入草稿不再触发历史消息、Markdown 或侧栏重渲染;流式输出只更新当前生成的消息。在 Windows 11、Intel Core Ultra 5 228V / 31.5 GB、Chrome 158 headless、真实 DSH Web UI、**合成会话** 下测得:
66
+
67
+ | 场景 | 修复前 P95 | 修复后 P95 |
68
+ | --- | --- | --- |
69
+ | 500 条密集 Markdown 消息 | 118.3 ms | **14.5 ms** |
70
+ | 500 条普通消息 | 32.0 ms | **16.6 ms** |
71
+ | 300 条普通消息 | 22.2 ms | **8.2 ms** |
72
+
73
+ 普通输入时,历史消息、Markdown 和 `renderBlocks` 的重渲染次数均为 **0**。P95 指输入事件到绘制后任务的延迟;以上为本机合成数据,不代表所有用户或 macOS / Electron 的实际体验。完整方法、原始数据与剩余瓶颈见 [性能报告](docs/perf/long-chat-performance.md)。
74
+
75
+ ## 使用与认证
76
+
77
+ 安装后,空白页顶部会出现 `Chat | Agent`。首次使用 Chat 需要完成认证:在 **Chat 设置 → 认证** 中选择 DSH 账号或 API Key。默认按以下顺序取用:
78
+
79
+ 1. Chat 设置中保存的 API Key(`DEEPSEEK_CHAT_API_KEY`)
80
+ 2. DSH 凭证库 / 环境变量中的 `DEEPSEEK_API_KEY`
81
+ 3. 已登录的 DeepSeek 账号令牌
82
+
83
+ API Key 只在 DSH Host 进程中使用,不会发送到浏览器。输入框默认 Enter 发送、Shift + Enter 换行,可在设置中改为 Ctrl + Enter 发送;中文/日文输入法组合文字时 Enter 只确认候选,不会误发。
84
+
85
+ 更多操作见 [用户指南](docs/user-guide.md),认证与配置细节见 [配置说明](docs/configuration.md)。
86
+
87
+ ## 隐私、兼容性与限制
88
+
89
+ - 聊天历史、长期记忆、导入暂存与图片都保存在本机 `$DSH_HOME/deepseek-chat/`;导入 ZIP 不上传。聊天、联网搜索、文件解析和记忆提取会按需调用 DeepSeek API,可能产生用量费用。
90
+ - DSHift 不是 DeepSeek 官方产品。当前在 DSH `0.2.2-rc.5` 上验证,Windows 与 macOS 桌面界面已实机核对。Web 端已完成部分性能测试,完整兼容性仍待验证。
91
+ - 数学公式是面向聊天的 LaTeX 子集;Mermaid 支持流程图、时序图、饼图和基础类图;更复杂的语法会回退为源码而不是报错。
92
+ - 生成过程中需要先停止回答,才能切换会话或编辑消息;`deepseek-v4-pro` 不支持图片理解。
93
+ - 长会话首次挂载(500 条密集内容)仍约 3 秒,这是一次性成本,不在输入路径。
94
+
95
+ 完整限制、平台差异与测试边界见 [已知限制](docs/limitations.md)。
96
+
97
+ ## 文档
98
+
99
+ | 文档 | 内容 |
100
+ | --- | --- |
101
+ | [用户指南](docs/user-guide.md) | 聊天、搜索、附件、会话管理、交接、导入与记忆的完整操作 |
102
+ | [架构说明](docs/architecture.md) | Host / Client 结构、状态管理、流式协议、渲染与导入管线 |
103
+ | [配置说明](docs/configuration.md) | 认证、Host 配置、数据存储与模型偏好 |
104
+ | [开发指南](docs/development.md) | 构建、测试、检查、性能基准与本地安装 |
105
+ | [已知限制](docs/limitations.md) | 兼容性、功能边界与性能测试范围 |
106
+ | [长期记忆集成](docs/memory-integration.md) | 导入会话与记忆提取的接口契约 |
107
+ | [性能报告](docs/perf/long-chat-performance.md) | Beta 4 根因、修复与修复前后数据 |
108
+ | [更新日志](CHANGELOG.md) | 各版本变更与 GitHub Releases 链接 |
109
+
110
+ ## 反馈、贡献与许可证
111
+
112
+ - 问题与建议:[GitHub Issues](https://github.com/SamuelChung2010/DSHift/issues)
113
+ - 参与开发:[开发指南](docs/development.md);提交前请运行测试与检查,不要提交真实聊天记录或敏感数据。
114
+ - 发布包与校验信息:[GitHub Releases](https://github.com/SamuelChung2010/DSHift/releases)
115
+
116
+ DSHift 采用 **MIT** 许可证,详见 [LICENSE](LICENSE)。
Binary file