@kabxx/dsh-message-revision 0.0.0-stage → 0.1.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/README.md +39 -2
- package/cordis.patch.yml +3 -0
- package/icon.svg +23 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +43 -4
- package/src/client.js +1067 -0
- package/src/index.js +443 -0
- package/src/revision.js +484 -0
- package/src/rewrite-journal.js +319 -0
package/README.md
CHANGED
|
@@ -1,3 +1,40 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @kabxx/dsh-message-revision
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
面向 DeepSeek Harness Web(`0.2.2-rc.5`)的历史消息原位编辑与重发插件。
|
|
4
|
+
|
|
5
|
+
- 在已发送的用户消息旁提供「编辑消息」入口,原位复用原生输入框,支持修改正文、增删附件、切换模型与权限预设,并直接联动「语音输入」插件。
|
|
6
|
+
- 保留原会话 ID 及目标轮次之前的上下文,替换该消息与后续对话,并在 POSIX 环境下同步清理随旧轮次撤回的子智能体会话。
|
|
7
|
+
- 基于 v4 JSONL(含 Zstandard 压缩)事务日志实现崩溃自动回滚与多标签页重连同步;重发失败时自动保留编辑草稿与待传文件。
|
|
8
|
+
|
|
9
|
+
## 安装
|
|
10
|
+
|
|
11
|
+
需要 Node.js `>= 24.9.0`:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
dsh plugin --profile web add @kabxx/dsh-message-revision
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
也可在 DSH 插件管理器中选择「添加插件」并输入 `@kabxx/dsh-message-revision`。本地调试源码时,直接填入克隆后的仓库目录绝对路径或执行 `dsh plugin --profile web add .` 即可。
|
|
18
|
+
|
|
19
|
+
## 开发
|
|
20
|
+
|
|
21
|
+
本包无外部依赖、无构建步骤,直接基于 Node.js 原生 ESM 运行:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm run check
|
|
25
|
+
npm test
|
|
26
|
+
npm pack --dry-run
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## 项目结构
|
|
30
|
+
|
|
31
|
+
| 路径 | 内容 |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
| [`src/index.js`](src/index.js) | Host 入口,注册 `/api/message-revision` 接口与会话重开调度 |
|
|
34
|
+
| [`src/revision.js`](src/revision.js) | 轮次边界解析、v4 JSONL / Zstandard 重写与子智能体归属校验 |
|
|
35
|
+
| [`src/rewrite-journal.js`](src/rewrite-journal.js) | 事务意图持久化、子会话暂存移出与启动恢复 |
|
|
36
|
+
| [`src/client.js`](src/client.js) | 原位输入框挂载、草稿恢复与多标签页重连同步 |
|
|
37
|
+
| [`locale/`](locale/) | 插件管理页中英文标题与描述 |
|
|
38
|
+
| [`test/`](test/) | 多轮编辑、子智能体迁移、草稿恢复与崩溃回滚测试 |
|
|
39
|
+
|
|
40
|
+
插件入口与注入配置见 [package.json](package.json) 和 [cordis.patch.yml](cordis.patch.yml)。
|
package/cordis.patch.yml
ADDED
package/icon.svg
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36">
|
|
2
|
+
<!--
|
|
3
|
+
Lucide square-pen: https://lucide.dev/icons/square-pen
|
|
4
|
+
ISC License
|
|
5
|
+
Copyright (c) 2026 Lucide Icons and Contributors
|
|
6
|
+
|
|
7
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
8
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
9
|
+
copyright notice and this permission notice appear in all copies.
|
|
10
|
+
|
|
11
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
12
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
13
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
14
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
15
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
16
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
17
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
18
|
+
-->
|
|
19
|
+
<g transform="translate(6 6)" fill="none" stroke="#808080" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
20
|
+
<path d="M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/>
|
|
21
|
+
<path d="M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z"/>
|
|
22
|
+
</g>
|
|
23
|
+
</svg>
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kabxx/dsh-message-revision",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Edit and resend sent messages in place for DeepSeek Harness.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/kabxx/dsh-message-revision.git"
|
|
12
|
+
},
|
|
13
|
+
"exports": {
|
|
14
|
+
".": "./src/index.js",
|
|
15
|
+
"./client": "./src/client.js",
|
|
16
|
+
"./locale/*.json": "./locale/*.json",
|
|
17
|
+
"./icon": "./icon.svg"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"src/",
|
|
21
|
+
"cordis.patch.yml",
|
|
22
|
+
"locale/",
|
|
23
|
+
"icon.svg"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"check": "for f in src/*.js; do node --check \"$f\"; done",
|
|
27
|
+
"test": "node --test test/*.test.js"
|
|
28
|
+
},
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=24.9.0",
|
|
31
|
+
"dsh": "0.2.2-rc.5"
|
|
32
|
+
},
|
|
33
|
+
"dsh": {
|
|
34
|
+
"bundle": {
|
|
35
|
+
"patch": "./cordis.patch.yml"
|
|
36
|
+
},
|
|
37
|
+
"client": {
|
|
38
|
+
"platform": "web",
|
|
39
|
+
"inject": [
|
|
40
|
+
"@deepseek-ai/dsh-client-ui-chat",
|
|
41
|
+
"@deepseek-ai/dsh-client-ui-workspace"
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|