dsh-input-assistant 0.1.3 → 0.1.4
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/CHANGELOG.md +83 -0
- package/LICENSE +21 -21
- package/README.en.md +100 -0
- package/README.md +215 -184
- package/cordis.patch.yml +3 -3
- package/docs/CHANGELOG-0.1.2.md +102 -102
- package/docs/evaluation.md +111 -111
- package/docs/images/dark.png +0 -0
- package/docs/images/light.png +0 -0
- package/docs/images/optimize.png +0 -0
- package/docs/references.md +39 -39
- package/docs/smoke-comparison.md +37 -37
- package/docs/validation.md +180 -100
- package/lib/browser/components.d.ts +1 -1
- package/lib/browser/controller.d.ts +47 -4
- package/lib/browser/dom.d.ts +1 -1
- package/lib/browser/index.d.ts +1 -1
- package/lib/browser/public.d.ts +2 -2
- package/lib/browser/runtime.d.ts +4 -2
- package/lib/browser/settings.d.ts +1 -1
- package/lib/browser/styles.d.ts +1 -1
- package/lib/client.js +1164 -222
- package/lib/client.meta.json +40 -40
- package/lib/core/config.d.ts +1 -1
- package/lib/core/context.d.ts +1 -1
- package/lib/core/generation.d.ts +2 -2
- package/lib/core/index.d.ts +9 -8
- package/lib/core/models.d.ts +15 -0
- package/lib/core/protection.d.ts +3 -4
- package/lib/core/scheduler.d.ts +1 -1
- package/lib/core/snapshot.d.ts +1 -1
- package/lib/core/types.d.ts +11 -0
- package/lib/core.js +280 -53
- package/lib/core.js.map +2 -2
- package/lib/host/rpc.d.ts +2 -0
- package/lib/host/runtime.d.ts +5 -3
- package/lib/host/storage.d.ts +11 -3
- package/lib/host/transcript.d.ts +1 -1
- package/lib/index.d.ts +5 -3
- package/lib/index.js +451 -156
- package/lib/index.js.map +4 -4
- package/package.json +10 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# 更新日志
|
|
2
|
+
|
|
3
|
+
本文件记录面向用户的变更。完整的技术修正记录见 [`docs/CHANGELOG-0.1.2.md`](docs/CHANGELOG-0.1.2.md)。
|
|
4
|
+
|
|
5
|
+
## [0.1.4] - 2026-11-10
|
|
6
|
+
|
|
7
|
+
- 整合定制 0.1.4 的独立预测按钮、三档预测详略度、三种设置预设和界面样式,保留现有 core/host/browser 架构。
|
|
8
|
+
- 详略度始终遵守显式长度上限;详尽预测与续写统一支持多行,并通过可滚动候选面板完整展示。
|
|
9
|
+
- 手动预测复用取消、快照和重试路径,编辑或 IME 中断后不再卡住操作;后台页面不触发建议。
|
|
10
|
+
- 暂存支持「取消清空」,保存期间取消、编辑、修改设置或切换模型均保留当前输入;删除与撤销不提供误导的取消入口。
|
|
11
|
+
- 保留原文路径引号,拒绝清理后空文本及不完整 Unicode;固定辅助模型、跨客户端取消、存储失败重试和严格声明消费均补齐回归。
|
|
12
|
+
- 修复样式过渡造成的预览焦点丢失,以及隐藏滑块阻止合法精确数值保存的问题。
|
|
13
|
+
- 新增直接加载实际安装包的 Edge 回归;严格类型验证隔离源码解析,并用负向控制验证检查有效性。
|
|
14
|
+
|
|
15
|
+
- 修复中文说明紧贴文件名时的漏保护与过度保护,保留线性扫描性能及明确引用路径的完整性。
|
|
16
|
+
- 撤销备份跨会话切换保留原截止时间;恢复失败目标独立保留,不被后续删除覆盖,提供复制和重试。
|
|
17
|
+
- 增加单次手动建议与显式重试,展示失败、弃权、限流和暂停状态,沿用取消、快照及最小间隔约束。
|
|
18
|
+
- 草稿卡增加复制;设置页增加分组辅助模型选择、跟随模式、目录刷新及高级手填,不改变主会话模型。
|
|
19
|
+
- 页面隐藏停止自动建议;请求 ID 增加随机前缀;预览自动失效时恢复原面板中的键盘焦点。
|
|
20
|
+
- 统一 Unicode 字符预算,修复 emoji 长稿被不同层使用不同单位拒绝的问题。
|
|
21
|
+
- 修复 Node ESM 声明解析,安装包验证覆盖 Bundler、NodeNext、Node16;CI 增加 Node 22.19 下限并避免 tag 双跑完整验证。
|
|
22
|
+
|
|
23
|
+
- 修复固定辅助模型保存后丢失、首次存储打开失败无法重试。
|
|
24
|
+
- 文本保护改为候选扫描,补齐常见 dotfile、Windows 相对路径、空格路径、含括号 URL;保留保护标记完整性校验。
|
|
25
|
+
- 区分续写临时限流与模型弃权,按宿主期限恢复;下一句预测失败与切换模型后可恢复。
|
|
26
|
+
- 优化先展示差异,经明确采纳才写入输入框;提供取消、Esc 放弃、原生撤销及显式还原。
|
|
27
|
+
- 菜单集中快捷操作,完整配置放在全局设置页;补齐键盘焦点、灰字可访问提示、设置失败重载与草稿删除撤销。
|
|
28
|
+
- 后台页面降低状态轮询频率,状态未变时减少渲染,缓存差异计算。
|
|
29
|
+
- 修复公开 core 入口的 TypeScript 声明映射;包校验实际检查打包产物与消费者类型。
|
|
30
|
+
- 发布依赖完整 CI 成功,复用已验证的同一份安装包,校验 tag 与版本。
|
|
31
|
+
|
|
32
|
+
本次工程修复不改变质量评测结论:60 条真实模型评测和独立语义标注仍未完成。
|
|
33
|
+
|
|
34
|
+
## [0.1.3] - 2026-10-23
|
|
35
|
+
|
|
36
|
+
兼容性版本,不改变功能。
|
|
37
|
+
|
|
38
|
+
### 兼容性
|
|
39
|
+
|
|
40
|
+
- **支持 DSH `0.2.1-rc.3`**。此前 `engines.dsh` 与全部 `@deepseek-ai/*` 对等依赖精确锁定 `0.2.1-rc.2`,DSH 升级到 rc.3 后会触发"不兼容,可能导致崩溃或数据丢失"警告并要求卸载。现改为经全量测试验证的声明范围 `>=0.2.1-rc.2 <0.3.0-0`,rc.2 与 rc.3 均可直接安装,后续 `0.2.1-rc.x` 补丁无需再发版。
|
|
41
|
+
- 开发依赖与主题测试基准升级到 `0.2.1-rc.3` 并去重 `dsh-typert-protocol` 实例;121 条测试(含真实 Edge 渲染)在 rc.3 基准上全部通过。
|
|
42
|
+
- 无功能、配置与存储格式变化;从 0.1.2 升级只需覆盖安装并重启 DSH。
|
|
43
|
+
|
|
44
|
+
## [0.1.2] - 2026-10-23
|
|
45
|
+
|
|
46
|
+
缺陷修正版本,不新增用户可见功能。测试从 105 条增至 121 条。
|
|
47
|
+
|
|
48
|
+
### 修复
|
|
49
|
+
|
|
50
|
+
- **相对路径与裸文件名不再被模型改写**。此前 `修改 package.json 里的 scripts`、`看看 src/index.ts` 这类常见草稿完全不受保护;`src/core/generation.ts` 只保护后半段,模型把 `src` 改成 `lib` 会静默产生错误路径。现在带扩展名的相对路径、深层无扩展名路径、已知扩展名的裸文件名都会被锁定。
|
|
51
|
+
- **一次网络抖动不再中断正在进行的优化**。此前状态轮询失败会 abort 在途请求,且没有任何提示,用户的操作无声消失。
|
|
52
|
+
- **`debounceMs` 大于 900ms 时续写不再失效**。此前任何超过 900ms 的停顿设置都会让续写定时器被反复重置、永远不触发;设置页允许到 5000ms。
|
|
53
|
+
- **存储中的未知配置键不再锁死插件**。版本漂移后旧记录里的未知键会让设置读写全部失败且无法自愈;现在读取时忽略未知键、非法字段逐项回退,下次保存自动洗净。
|
|
54
|
+
- **中文差异对比粒度细化到词**。此前 `请解释` → `请说明` 会整段删除再插入,现在只标出实际改动的字词。
|
|
55
|
+
- 长会话中的两个内部集合加上限,避免内存无界增长。
|
|
56
|
+
|
|
57
|
+
### 文档
|
|
58
|
+
|
|
59
|
+
- 新增 `docs/CHANGELOG-0.1.2.md`,逐条记录复现步骤、根因与回归用例。
|
|
60
|
+
- 补充 `CONTRIBUTING.md`、`SECURITY.md`。
|
|
61
|
+
|
|
62
|
+
## [0.1.1] - 2026-10-22
|
|
63
|
+
|
|
64
|
+
首个对外发布版本。
|
|
65
|
+
|
|
66
|
+
### 功能
|
|
67
|
+
|
|
68
|
+
- **提示词优化**:整稿或选区改写,三档强度(轻/标准/深度),改动差异对比,一键撤销。
|
|
69
|
+
- **下一句预测**:回复完成后预测用户可能的下一句,以灰字提示,Tab 采纳。
|
|
70
|
+
- **输入续写**:根据当前草稿预测后续内容,防抖与最小间隔可配。
|
|
71
|
+
- **草稿暂存**:当前会话最多保留 3 份草稿,显式恢复。
|
|
72
|
+
- 设置页:四模块独立开关、三档强度、高级参数。
|
|
73
|
+
|
|
74
|
+
### 保护机制
|
|
75
|
+
|
|
76
|
+
代码块、行内代码、URL、盘符绝对路径、用户锁定片段在改写中保持不变;占位符被篡改时拒绝结果并保留原稿。
|
|
77
|
+
|
|
78
|
+
### 已知边界
|
|
79
|
+
|
|
80
|
+
- 60 条固定合成质量集尚未完成全量真实模型评测与独立人工标注,状态为 `not_evaluated`。
|
|
81
|
+
- 6 次真实模型小样本对照只能说明接线可用,不足以证明效果领先。
|
|
82
|
+
- 中文 IME 候选组合、附件/引用组合、非 Windows x64 平台未验证。
|
|
83
|
+
- 目标 DSH 版本锁定 `0.2.1-rc.2`。
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 dsh-input-assistant contributors
|
|
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.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dsh-input-assistant contributors
|
|
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,100 @@
|
|
|
1
|
+
# DSH Input Assistant
|
|
2
|
+
|
|
3
|
+
[简体中文](README.md) | English
|
|
4
|
+
|
|
5
|
+
An input assistant for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness): rewrite drafts, suggest the next message or a continuation, and save drafts for later. Suggestions are never sent automatically.
|
|
6
|
+
|
|
7
|
+
The current source version is **0.1.4**. Build this checkout to install it locally, and check [Releases](https://github.com/Somnus678/dsh-input-assistant/releases) for published GitHub packages.
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
Screenshots use the production components and host theme in a local browser fixture with simulated model output.
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- **Prompt optimization:** rewrite the whole draft or a selection with light, standard, or deep intensity. Review the diff and explicitly accept it; undo or restore the original afterward.
|
|
16
|
+
- **Predictions and completion:** show a candidate after a completed response or continue the current draft. Press Tab to accept, or Esc to dismiss. The independent Predict button also works when automatic suggestions are disabled; failed requests can be retried explicitly.
|
|
17
|
+
- **Detail and presets:** concise, standard, and detailed suggestions respect the configured character limit. Detailed suggestions can contain multiple lines and use a scrollable panel. Presets change the form and take effect only after saving.
|
|
18
|
+
- **Drafts:** save up to three drafts per session, then explicitly restore, append, copy, or delete them. Deletion has a ten-second undo window. During saving, Cancel clear keeps the editor contents while the save finishes.
|
|
19
|
+
- **Auxiliary model:** choose a model from the host catalog or enter provider and model IDs manually. This affects the plugin's calls only; it does not switch the main conversation model.
|
|
20
|
+
|
|
21
|
+
Recognized code, URLs, paths, and explicitly selected fragments are protected during rewriting. Altered or missing protection markers cause the result to be rejected. Automatic recognition and marker preservation do not guarantee semantic correctness: review the preview, and quote or manually protect ambiguous paths and filenames.
|
|
22
|
+
|
|
23
|
+
## Requirements and installation
|
|
24
|
+
|
|
25
|
+
Node.js **22.19 or later** and DeepSeek Harness are required. The declared DSH range is `>=0.2.1-rc.2 <0.3.0-0`; this build's dependency tests use `0.2.1-rc.3`. The complete native host and every version in that range have not been tested.
|
|
26
|
+
|
|
27
|
+
Build from this checkout:
|
|
28
|
+
|
|
29
|
+
```powershell
|
|
30
|
+
pnpm install --frozen-lockfile
|
|
31
|
+
pnpm build
|
|
32
|
+
pnpm pack --pack-destination dist
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Install the local package into a Web profile:
|
|
36
|
+
|
|
37
|
+
```powershell
|
|
38
|
+
dsh --version
|
|
39
|
+
dsh plugin --profile web add (Resolve-Path './dist/dsh-input-assistant-0.1.4.tgz').Path
|
|
40
|
+
dsh --profile web --dump-config
|
|
41
|
+
dsh --profile web
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
For the Windows desktop profile, use the CLI bundled with the desktop application:
|
|
45
|
+
|
|
46
|
+
```powershell
|
|
47
|
+
$dsh = Join-Path $env:LOCALAPPDATA 'Programs\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd'
|
|
48
|
+
& $dsh plugin --profile desktop add (Resolve-Path './dist/dsh-input-assistant-0.1.4.tgz').Path
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Completely quit and restart the relevant DSH instance after installation or upgrade. To remove the Web plugin, run `dsh plugin --profile web remove dsh-input-assistant` and restart. Uninstalling does not remove saved plugin settings or drafts from host storage.
|
|
52
|
+
|
|
53
|
+
If another archive was previously installed under the same 0.1.4 version, verify its source and SHA256 and check the plugin files actually loaded after restart. A same-version cache can reuse old files; the version number alone does not confirm that the new build was loaded.
|
|
54
|
+
|
|
55
|
+
## Getting started and settings
|
|
56
|
+
|
|
57
|
+
After restarting, use **Optimize** or **Predict** next to the input, and open the assistant menu for draft operations. Full settings are under **Settings → Input Assistant** and apply to all conversations. Labels in the current interface are in Chinese.
|
|
58
|
+
|
|
59
|
+
Automatic next-message prediction and completion are **enabled by default** and invoke the configured model. Disable both in settings if you only want explicit requests. Optimization and draft saving are also enabled by default.
|
|
60
|
+
|
|
61
|
+
| Setting | Default | Range / choices |
|
|
62
|
+
|---|---:|---|
|
|
63
|
+
| Optimization intensity | Standard | Light, standard, deep |
|
|
64
|
+
| Prediction detail | Standard | Concise, standard, detailed |
|
|
65
|
+
| Display | Ghost | Ghost text or panel; detailed mode uses the panel |
|
|
66
|
+
| Next-message limit | 120 | 20–1000 Unicode characters |
|
|
67
|
+
| Completion limit | 80 | 10–500 Unicode characters |
|
|
68
|
+
| Completion debounce | 600 ms | 200–5000 ms |
|
|
69
|
+
| Minimum completion interval | 2000 ms | 500–30000 ms |
|
|
70
|
+
| Auxiliary model | Follow composer | Catalog selection or provider/model pair |
|
|
71
|
+
|
|
72
|
+
Manual suggestions require an idle, visible, connected plain-text composer without attachments or references, with the caret at the end. The host's minimum interval still applies; a throttled manual request is delayed at most once. Hiding the page suppresses automatic suggestions. During draft saving, edits, model changes, or settings changes preserve the current editor contents and save only the original snapshot.
|
|
73
|
+
|
|
74
|
+
## Privacy and limitations
|
|
75
|
+
|
|
76
|
+
The plugin does not collect telemetry. Drafts and settings are stored by DSH; model calls go through the provider configured in the host. Draft text and relevant context are sent to that provider for optimization and suggestions. The plugin does not store API keys. See [SECURITY.md](SECURITY.md) for reporting and privacy details.
|
|
77
|
+
|
|
78
|
+
The 60-case model quality evaluation remains `not_evaluated`; a six-call historical smoke comparison does not establish comparative quality. Native operating-system IME composition, full desktop and other-plugin combinations, and non-Windows platforms have not been verified for this build. Consult [validation](docs/validation.md) and [the small model comparison](docs/smoke-comparison.md) for the actual evidence and its limits.
|
|
79
|
+
|
|
80
|
+
## Development and verification
|
|
81
|
+
|
|
82
|
+
```powershell
|
|
83
|
+
pnpm install --frozen-lockfile
|
|
84
|
+
pnpm typecheck
|
|
85
|
+
pnpm build
|
|
86
|
+
pnpm pack --pack-destination dist
|
|
87
|
+
pnpm test # full suite, including Edge theme tests
|
|
88
|
+
pnpm test:package # strict consumers and actual archive
|
|
89
|
+
pnpm test:web # source components in Edge
|
|
90
|
+
pnpm test:package:web # archive client/core in Edge, local RPC fixture
|
|
91
|
+
pnpm eval:validate
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Edge browser tests require Microsoft Edge. The package browser fixture uses local model and RPC replacements; the official Loader/Gateway tests cover the host integration separately. Linux CI excludes Edge-only tests. See [CONTRIBUTING.md](CONTRIBUTING.md) for the contribution workflow and [CHANGELOG.md](CHANGELOG.md) for release notes.
|
|
95
|
+
|
|
96
|
+
Pushing a `v*` tag triggers the npm publishing workflow after CI and requires the repository's `NPM_TOKEN`. It does not create a GitHub Release; create one separately and attach the validated archive if GitHub downloads are desired. Confirm that the tag, package version, and archive match and that the version has not already been published.
|
|
97
|
+
|
|
98
|
+
## License
|
|
99
|
+
|
|
100
|
+
[MIT](LICENSE). Third-party dependencies and reference implementations retain their own licenses; see [references](docs/references.md).
|