dsh-context-redline 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/CHANGELOG.md +34 -0
- package/LICENSE +43 -0
- package/LICENSE-Apache-2.0 +201 -0
- package/NOTICE +13 -0
- package/README.md +136 -2
- package/README.zh.md +137 -0
- package/UPSTREAM.md +71 -0
- package/cordis.patch.yml +11 -0
- package/icon.svg +12 -0
- package/lib/client.js +8645 -0
- package/lib/client.js.map +1 -0
- package/lib/index.d.ts +885 -0
- package/lib/index.js +6822 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +162 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# 更新日志 / Changelog
|
|
2
|
+
|
|
3
|
+
## [0.1.0] — 未发布 / Unreleased
|
|
4
|
+
|
|
5
|
+
**兼容性 / Compatibility:** DeepSeek Harness `>=0.2.1-alpha.2 <0.3.0`.
|
|
6
|
+
|
|
7
|
+
### 新增 / Added
|
|
8
|
+
|
|
9
|
+
- 可编辑、可删除的上下文迁移副本;本地保存不改来源会话。
|
|
10
|
+
- 在当前工作区创建零历史普通根会话,不继承 fork 历史。
|
|
11
|
+
- 可直接编辑最终发送全文,并选择新会话模型与推理等级。
|
|
12
|
+
- 固定 ID 持久台账、精确字节校验、崩溃恢复和自动原样回程。
|
|
13
|
+
- 混合文字 / 图片消息迁移文字并明确报告遗漏图片。
|
|
14
|
+
|
|
15
|
+
### 安全与恢复 / Safety and recovery
|
|
16
|
+
|
|
17
|
+
- 删除项不进入新会话,来源日志保持 append-only。
|
|
18
|
+
- 工具结果必须匹配原调用;未知媒体和文件附件不会静默丢失。
|
|
19
|
+
- 同一 request ID 必须匹配精确正文,并在 flush 后由冷日志证明持久化。
|
|
20
|
+
- unknown 状态不重发;损坏台账、配置或回程指纹会停止执行。
|
|
21
|
+
- 新会话配置与来源会话回程恢复配置分开冻结。
|
|
22
|
+
|
|
23
|
+
### 界面 / UI
|
|
24
|
+
|
|
25
|
+
- 上下文统计、趋势、事件、七类浏览器与普通承载会话索引。
|
|
26
|
+
- 行下全文编辑、可逆删除、最终全文编辑器。
|
|
27
|
+
- 与 DSH 输入框一致的一行模型 / 推理等级浮动选择器。
|
|
28
|
+
- 深浅主题、窄屏布局和 CSS 命名空间隔离。
|
|
29
|
+
|
|
30
|
+
### 许可 / License
|
|
31
|
+
|
|
32
|
+
- 原创代码采用 MIT。
|
|
33
|
+
- 复制自 `dsh-context` 的部分保留 Apache-2.0。
|
|
34
|
+
- 详见 `NOTICE`、`LICENSE-Apache-2.0` 和 `UPSTREAM.md`。
|
package/LICENSE
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DSH Context Redline 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.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
This project also contains code derived from `dsh-context`
|
|
26
|
+
(https://github.com/bowenliang123/dsh-context), which is licensed under the
|
|
27
|
+
Apache License, Version 2.0. The full text of that license is kept verbatim in
|
|
28
|
+
`LICENSE-Apache-2.0`, and the exact upstream revision plus the list of our
|
|
29
|
+
modifications is recorded in `UPSTREAM.md`.
|
|
30
|
+
|
|
31
|
+
Licensing here is **per portion**, not a dual license over every file:
|
|
32
|
+
|
|
33
|
+
- Original contributions of this project: MIT (the text above).
|
|
34
|
+
- Anything copied from, or derived from, `dsh-context`: Apache-2.0, with the
|
|
35
|
+
upstream notices preserved (`NOTICE`, `UPSTREAM.md`).
|
|
36
|
+
|
|
37
|
+
As of the M0 documentation stage **no upstream source code has been copied into
|
|
38
|
+
this repository yet**, so there is currently no Apache-2.0-licensed portion
|
|
39
|
+
here; `LICENSE-Apache-2.0` / `NOTICE` / `UPSTREAM.md` exist so that provenance
|
|
40
|
+
and notices are in place before the upstream source is brought in (M1). Once
|
|
41
|
+
such a portion exists, the combined distribution is conventionally described as
|
|
42
|
+
`MIT AND Apache-2.0` in `package.json`; that string describes the combination,
|
|
43
|
+
not a second license on our own files.
|
|
@@ -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 2025 bowenliang123
|
|
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,13 @@
|
|
|
1
|
+
# NOTICE
|
|
2
|
+
|
|
3
|
+
This product includes software developed by **bowenliang123** as part of
|
|
4
|
+
`dsh-context` (https://github.com/bowenliang123/dsh-context), licensed under the
|
|
5
|
+
Apache License, Version 2.0.
|
|
6
|
+
|
|
7
|
+
- Copied baseline: tag `v0.59.2`, commit `fc44fff9548d404da3c4935525d01b5e4fb62517`
|
|
8
|
+
- Upstream license: `LICENSE-Apache-2.0`
|
|
9
|
+
- Provenance and material modifications: `UPSTREAM.md`
|
|
10
|
+
- Original additions in this repository: MIT, see `LICENSE`
|
|
11
|
+
|
|
12
|
+
No `dsh-context-console` code is included. This is an independent fork and is
|
|
13
|
+
not affiliated with or endorsed by the upstream author.
|
package/README.md
CHANGED
|
@@ -1,3 +1,137 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">Context Redline</h1>
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<p align="center">Inspect, redline, and migrate DeepSeek Harness context, then return the bound task result verbatim.</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://www.npmjs.com/package/dsh-context-redline"><img src="https://img.shields.io/npm/v/dsh-context-redline?label=npm&color=CB3837" alt="npm version"></a>
|
|
7
|
+
<a href="https://github.com/idoall/dsh-context-redline/actions/workflows/ci.yml"><img src="https://github.com/idoall/dsh-context-redline/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
8
|
+
<a href="https://github.com/idoall/dsh-context-redline/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT%20AND%20Apache--2.0-0F172A" alt="License"></a>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">English | <a href="https://github.com/idoall/dsh-context-redline/blob/main/README.zh.md">中文</a></p>
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<a href="#features">Features</a> ·
|
|
15
|
+
<a href="#install">Install</a> ·
|
|
16
|
+
<a href="#usage">Usage</a> ·
|
|
17
|
+
<a href="#boundaries">Boundaries</a> ·
|
|
18
|
+
<a href="https://github.com/idoall/dsh-context-redline/blob/main/CHANGELOG.md">Changelog</a>
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
> A DeepSeek Harness community plugin. It does not modify DSH source or rewrite the source session log.
|
|
22
|
+
>
|
|
23
|
+
> **Supports DSH `>=0.2.1-alpha.2 <0.3.0`.** The first release is verified against `0.2.1-alpha.2`.
|
|
24
|
+
|
|
25
|
+
Edits stay local until confirmation. The plugin then opens a zero-history ordinary session in the current workspace and sends the exact final message you approved. When the task finishes, its bound result returns verbatim to the source session.
|
|
26
|
+
|
|
27
|
+
<p align="center">
|
|
28
|
+
<img src="https://raw.githubusercontent.com/idoall/dsh-context-redline/main/assets/overview.png" width="100%" alt="Context Redline desktop overview: statistics, trend, events, seven context categories, and carrier sessions">
|
|
29
|
+
</p>
|
|
30
|
+
|
|
31
|
+
<p align="center"><sub>Current interactive demo, desktop: context scale and events on the left; review, edit, delete, and carrier controls on the right.</sub></p>
|
|
32
|
+
|
|
33
|
+
## Features
|
|
34
|
+
|
|
35
|
+
- **Full durable text.** Editors read the complete event body, never the shortened list preview.
|
|
36
|
+
- **Local redlining.** Edit user messages, injected/skill material, assistant migration copies, and paired tool results.
|
|
37
|
+
- **Reversible deletion.** Delete means “do not migrate this identity”; the source log remains append-only.
|
|
38
|
+
- **Authoritative final message.** The confirmation textarea is the exact first user message written to the new session.
|
|
39
|
+
- **Per-session model selection.** A compact floating picker configures only the carrier Agent and never changes the source/global default.
|
|
40
|
+
- **Ordinary zero-history session.** The carrier is a root session in the current workspace, not inherited fork history.
|
|
41
|
+
- **Automatic verbatim return.** Only the result bound to the fixed prompt request is returned.
|
|
42
|
+
- **Crash recovery.** Fixed IDs, strict ledgers, exact-content matching, flush, cold reads, and three-state recovery prevent guessing and duplicate sends.
|
|
43
|
+
|
|
44
|
+
<p align="center">
|
|
45
|
+
<img src="https://raw.githubusercontent.com/idoall/dsh-context-redline/main/assets/carrier-confirm.png" width="100%" alt="Open ordinary session confirmation: task, model and reasoning effort, and exact final message">
|
|
46
|
+
</p>
|
|
47
|
+
|
|
48
|
+
<p align="center"><sub>Desktop confirmation: task, model/effort, and the final message freeze in one explicit authorization.</sub></p>
|
|
49
|
+
|
|
50
|
+
<p align="center">
|
|
51
|
+
<img src="https://raw.githubusercontent.com/idoall/dsh-context-redline/main/assets/mobile-confirm.png" width="430" alt="Mobile ordinary-session confirmation">
|
|
52
|
+
</p>
|
|
53
|
+
|
|
54
|
+
<p align="center"><sub>Mobile confirmation: model and effort stay on one row; long content scrolls inside the final-message editor.</sub></p>
|
|
55
|
+
|
|
56
|
+
> Screenshots come from the current interactive demo and illustrate layout and the product flow; they are not presented as production session data.
|
|
57
|
+
|
|
58
|
+
## Install
|
|
59
|
+
|
|
60
|
+
Requires DeepSeek Harness `0.2.1-alpha.2` or a newer `0.2.x`, plus Node.js `22.19+` or `24+`.
|
|
61
|
+
|
|
62
|
+
After the npm release:
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
dsh plugin --profile web add dsh-context-redline@latest
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Local development:
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
pnpm install
|
|
72
|
+
pnpm run build
|
|
73
|
+
dsh plugin --profile web add "link:$(pwd)"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The user must restart `dsh web` after installation or Host changes. A rebuilt Client-only change normally needs only a hard refresh.
|
|
77
|
+
|
|
78
|
+
Remove:
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
dsh plugin --profile web remove dsh-context-redline
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Uninstalling does not automatically delete local drafts and operation ledgers under `$DSH_HOME/dsh-context-redline/`.
|
|
85
|
+
|
|
86
|
+
## Usage
|
|
87
|
+
|
|
88
|
+
1. Open a session with messages and select **Context Redline**.
|
|
89
|
+
2. Optionally edit/delete individual items; saves remain local.
|
|
90
|
+
3. Choose **Open ordinary new session**.
|
|
91
|
+
4. Enter the task and finish the exact final message.
|
|
92
|
+
5. Choose a model; keep effort at **Use model default** unless needed.
|
|
93
|
+
6. Confirm creation and open the new session from the left sidebar.
|
|
94
|
+
7. The bound result returns automatically after completion.
|
|
95
|
+
|
|
96
|
+
See the [user guide](https://github.com/idoall/dsh-context-redline/blob/main/docs/12-user-guide.md).
|
|
97
|
+
|
|
98
|
+
## Images and attachments
|
|
99
|
+
|
|
100
|
+
- Mixed text/image messages migrate all text and report omitted images.
|
|
101
|
+
- Pure-image messages do not create fabricated empty paragraphs.
|
|
102
|
+
- Image identities remain in the source fingerprint, so changes invalidate confirmation.
|
|
103
|
+
- Image binaries, files, file refs, and generic attachments are not migrated yet; unknown media refuses instead of disappearing silently.
|
|
104
|
+
|
|
105
|
+
## Boundaries
|
|
106
|
+
|
|
107
|
+
- Never rewrites or deletes source history.
|
|
108
|
+
- System prompts and tool schemas come from the target preset; migrated prose never pretends to alter those layers.
|
|
109
|
+
- Tool results require a matching call identity.
|
|
110
|
+
- No history/version UI, rollback, compaction, team task board, or session deletion UI.
|
|
111
|
+
- The plugin provides lock-scoped idempotence and recovery; it does not claim platform-native exactly-once delivery.
|
|
112
|
+
|
|
113
|
+
## Development
|
|
114
|
+
|
|
115
|
+
```sh
|
|
116
|
+
pnpm install
|
|
117
|
+
pnpm run typecheck
|
|
118
|
+
pnpm run lint
|
|
119
|
+
pnpm run test
|
|
120
|
+
./node_modules/.bin/vitest run
|
|
121
|
+
node scripts/release-check.mjs
|
|
122
|
+
pnpm pack --dry-run
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Pushing a `v*` tag runs the version and bilingual-release-note gate, tests, package creation, npm Trusted Publishing over OIDC (no `NPM_TOKEN`), and GitHub Release creation.
|
|
126
|
+
|
|
127
|
+
## Documentation
|
|
128
|
+
|
|
129
|
+
- [User guide](https://github.com/idoall/dsh-context-redline/blob/main/docs/12-user-guide.md)
|
|
130
|
+
- [Context migration contract](https://github.com/idoall/dsh-context-redline/blob/main/docs/13-context-migration.md)
|
|
131
|
+
- [System prompt and injection boundaries](https://github.com/idoall/dsh-context-redline/blob/main/docs/14-system-prompt-and-injection.md)
|
|
132
|
+
- [Carrier lifecycle](https://github.com/idoall/dsh-context-redline/blob/main/docs/15-carrier-lifecycle.md)
|
|
133
|
+
- [Upstream provenance and modifications](https://github.com/idoall/dsh-context-redline/blob/main/UPSTREAM.md)
|
|
134
|
+
|
|
135
|
+
## License
|
|
136
|
+
|
|
137
|
+
Original work is MIT; portions copied from `dsh-context` remain Apache-2.0. See [LICENSE](https://github.com/idoall/dsh-context-redline/blob/main/LICENSE), [LICENSE-Apache-2.0](https://github.com/idoall/dsh-context-redline/blob/main/LICENSE-Apache-2.0), [NOTICE](https://github.com/idoall/dsh-context-redline/blob/main/NOTICE), and [UPSTREAM.md](https://github.com/idoall/dsh-context-redline/blob/main/UPSTREAM.md). This is an independent fork and is not endorsed by the upstream author.
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
<h1 align="center">上下文批改 · Context Redline</h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">查看、批改并迁移 DeepSeek Harness 会话上下文,再把任务结果原样送回来源会话。</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://www.npmjs.com/package/dsh-context-redline"><img src="https://img.shields.io/npm/v/dsh-context-redline?label=npm&color=CB3837" alt="npm 版本"></a>
|
|
7
|
+
<a href="https://github.com/idoall/dsh-context-redline/actions/workflows/ci.yml"><img src="https://github.com/idoall/dsh-context-redline/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
8
|
+
<a href="https://github.com/idoall/dsh-context-redline/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT%20AND%20Apache--2.0-0F172A" alt="许可证"></a>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center"><a href="https://github.com/idoall/dsh-context-redline/blob/main/README.md">English</a> | 中文</p>
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<a href="#能做什么">能做什么</a> ·
|
|
15
|
+
<a href="#安装">安装</a> ·
|
|
16
|
+
<a href="#使用">使用</a> ·
|
|
17
|
+
<a href="#边界">边界</a> ·
|
|
18
|
+
<a href="https://github.com/idoall/dsh-context-redline/blob/main/CHANGELOG.md">更新记录</a>
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
> DeepSeek Harness 社区插件。它不修改 DSH 源码,也不改写来源会话日志。
|
|
22
|
+
>
|
|
23
|
+
> **支持 DSH `>=0.2.1-alpha.2 <0.3.0`。** 首版针对 `0.2.1-alpha.2` 验证。
|
|
24
|
+
|
|
25
|
+
本地编辑只写插件目录;确认后,插件在当前工作区创建一个零历史普通会话,逐字发送你确认的最终全文。任务完成后,绑定结果自动回到来源会话。
|
|
26
|
+
|
|
27
|
+
<p align="center">
|
|
28
|
+
<img src="https://raw.githubusercontent.com/idoall/dsh-context-redline/main/assets/overview.png" width="100%" alt="上下文批改桌面总览:统计、趋势、事件、七类上下文浏览器与承载会话">
|
|
29
|
+
</p>
|
|
30
|
+
|
|
31
|
+
<p align="center"><sub>当前交互 demo 的桌面总览:左侧看规模与事件,右侧查看、编辑或删除迁移材料。</sub></p>
|
|
32
|
+
|
|
33
|
+
## 能做什么
|
|
34
|
+
|
|
35
|
+
- **全文查看。** 编辑器读取 durable 全文,不使用列表里的短预览。
|
|
36
|
+
- **本地批改。** 编辑用户消息、注入 / 技能材料、助手迁移副本和已配对工具结果。
|
|
37
|
+
- **可逆删除。** 删除表示“不迁移这条”,来源日志保持 append-only。
|
|
38
|
+
- **最终全文。** 确认框中的文本就是新会话收到的完整第一条用户消息,可直接删段、改字、重排。
|
|
39
|
+
- **会话级模型。** 一行浮动选择器配置新会话模型和推理等级,不修改来源会话或全局默认。
|
|
40
|
+
- **普通新会话。** 在当前工作区创建零历史 root session,不继承 fork 历史。
|
|
41
|
+
- **自动回程。** 只取与固定 prompt request ID 绑定的结果,原样送回来源会话。
|
|
42
|
+
- **可恢复。** 固定 ID、持久台账、精确正文匹配、flush、冷读和三态恢复共同防止重复或猜测。
|
|
43
|
+
|
|
44
|
+
<p align="center">
|
|
45
|
+
<img src="https://raw.githubusercontent.com/idoall/dsh-context-redline/main/assets/carrier-confirm.png" width="100%" alt="开启普通新会话确认框:任务、模型和推理等级、最终发送全文">
|
|
46
|
+
</p>
|
|
47
|
+
|
|
48
|
+
<p align="center"><sub>桌面确认框:任务、模型 / 推理等级和最终发送全文在一次明确授权中冻结。</sub></p>
|
|
49
|
+
|
|
50
|
+
<p align="center">
|
|
51
|
+
<img src="https://raw.githubusercontent.com/idoall/dsh-context-redline/main/assets/mobile-confirm.png" width="430" alt="移动端普通新会话确认框">
|
|
52
|
+
</p>
|
|
53
|
+
|
|
54
|
+
<p align="center"><sub>移动端确认框:选择器保持一行,长内容只在最终全文框内滚动。</sub></p>
|
|
55
|
+
|
|
56
|
+
> 截图来自仓库当前版本的交互 demo,用于说明布局与关键流程,不冒充生产会话数据。
|
|
57
|
+
|
|
58
|
+
## 安装
|
|
59
|
+
|
|
60
|
+
需要 DeepSeek Harness `0.2.1-alpha.2` 或更新的 `0.2.x`,以及 Node.js `22.19+` 或 `24+`。
|
|
61
|
+
|
|
62
|
+
npm 发布后:
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
dsh plugin --profile web add dsh-context-redline@latest
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
本地开发:
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
pnpm install
|
|
72
|
+
pnpm run build
|
|
73
|
+
dsh plugin --profile web add "link:$(pwd)"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
安装或宿主代码更新后,由用户本人重启 `dsh web`。仅客户端改动构建后通常只需硬刷新。
|
|
77
|
+
|
|
78
|
+
卸载:
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
dsh plugin --profile web remove dsh-context-redline
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
卸载插件不会自动删除 `$DSH_HOME/dsh-context-redline/` 中的本地草稿和操作台账。
|
|
85
|
+
|
|
86
|
+
## 使用
|
|
87
|
+
|
|
88
|
+
1. 打开已有消息的会话,进入「上下文批改」。
|
|
89
|
+
2. 可选:逐条编辑或删除;保存只写本地。
|
|
90
|
+
3. 点击「开启普通新会话」。
|
|
91
|
+
4. 填写任务,并在「最终发送全文」中完成最后修改。
|
|
92
|
+
5. 选择模型;推理等级可保持「使用模型默认值」。
|
|
93
|
+
6. 确认创建;在左侧打开新会话。
|
|
94
|
+
7. 新会话结束后,结果会自动回到来源会话。
|
|
95
|
+
|
|
96
|
+
详见[用户指南](https://github.com/idoall/dsh-context-redline/blob/main/docs/12-user-guide.md)。
|
|
97
|
+
|
|
98
|
+
## 图片和附件
|
|
99
|
+
|
|
100
|
+
- 混合文字 / 图片消息迁移全部文字,并显示「图片 N 个未迁移」。
|
|
101
|
+
- 纯图片消息不生成空白段,但计入遗漏数。
|
|
102
|
+
- 图片引用仍参与来源指纹,图片变化会使旧确认失效。
|
|
103
|
+
- 图片二进制、文件、file-ref 和通用附件当前不迁移;未知媒体明确拒绝,不会静默消失。
|
|
104
|
+
|
|
105
|
+
## 边界
|
|
106
|
+
|
|
107
|
+
- 不改写或删除来源会话历史。
|
|
108
|
+
- 系统提示词和工具定义由目标预设生成;迁移文字不冒充系统层。
|
|
109
|
+
- 工具结果必须匹配原工具调用。
|
|
110
|
+
- 不提供历史版本、回滚、压缩、团队任务板或会话删除 UI。
|
|
111
|
+
- 插件保证自身锁内幂等与可恢复,不宣称平台天然 exactly-once。
|
|
112
|
+
|
|
113
|
+
## 开发
|
|
114
|
+
|
|
115
|
+
```sh
|
|
116
|
+
pnpm install
|
|
117
|
+
pnpm run typecheck
|
|
118
|
+
pnpm run lint
|
|
119
|
+
pnpm run test
|
|
120
|
+
./node_modules/.bin/vitest run
|
|
121
|
+
node scripts/release-check.mjs
|
|
122
|
+
pnpm pack --dry-run
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
推送 `v*` tag 后,GitHub Actions 会校验版本和双语发布说明、测试、打包,并通过 npm Trusted Publishing(OIDC,无 `NPM_TOKEN`)发布,再创建 GitHub Release。
|
|
126
|
+
|
|
127
|
+
## 文档
|
|
128
|
+
|
|
129
|
+
- [用户指南](https://github.com/idoall/dsh-context-redline/blob/main/docs/12-user-guide.md)
|
|
130
|
+
- [上下文迁移合同](https://github.com/idoall/dsh-context-redline/blob/main/docs/13-context-migration.md)
|
|
131
|
+
- [系统提示词与注入边界](https://github.com/idoall/dsh-context-redline/blob/main/docs/14-system-prompt-and-injection.md)
|
|
132
|
+
- [承载会话生命周期](https://github.com/idoall/dsh-context-redline/blob/main/docs/15-carrier-lifecycle.md)
|
|
133
|
+
- [上游来源与修改记录](https://github.com/idoall/dsh-context-redline/blob/main/UPSTREAM.md)
|
|
134
|
+
|
|
135
|
+
## 许可
|
|
136
|
+
|
|
137
|
+
原创部分采用 MIT;复制自 `dsh-context` 的部分保留 Apache-2.0。详见 [LICENSE](https://github.com/idoall/dsh-context-redline/blob/main/LICENSE)、[LICENSE-Apache-2.0](https://github.com/idoall/dsh-context-redline/blob/main/LICENSE-Apache-2.0)、[NOTICE](https://github.com/idoall/dsh-context-redline/blob/main/NOTICE) 和 [UPSTREAM.md](https://github.com/idoall/dsh-context-redline/blob/main/UPSTREAM.md)。本插件是独立 fork,不代表上游作者背书。
|
package/UPSTREAM.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Upstream provenance and modifications
|
|
2
|
+
|
|
3
|
+
## Source
|
|
4
|
+
|
|
5
|
+
| Field | Value |
|
|
6
|
+
|---|---|
|
|
7
|
+
| Upstream repository | `https://github.com/bowenliang123/dsh-context` |
|
|
8
|
+
| Copied baseline | tag `v0.59.2`, commit `fc44fff9548d404da3c4935525d01b5e4fb62517` |
|
|
9
|
+
| Upstream license | Apache-2.0 |
|
|
10
|
+
| Preserved license | `LICENSE-Apache-2.0` |
|
|
11
|
+
| Notice | `NOTICE` |
|
|
12
|
+
|
|
13
|
+
The npm package did not ship source, so the baseline was copied from the tagged Git repository. This project is an independent fork and is not endorsed by the upstream author.
|
|
14
|
+
|
|
15
|
+
## License compliance
|
|
16
|
+
|
|
17
|
+
- Apache-2.0 notices and the original license are retained.
|
|
18
|
+
- `package.json` declares `MIT AND Apache-2.0`.
|
|
19
|
+
- Original project code is MIT; copied/derived upstream portions remain Apache-2.0.
|
|
20
|
+
- This file records the material modification categories.
|
|
21
|
+
|
|
22
|
+
## Material modifications
|
|
23
|
+
|
|
24
|
+
### Independent identity
|
|
25
|
+
|
|
26
|
+
All global identities were separated from `dsh-context` so both plugins can coexist:
|
|
27
|
+
|
|
28
|
+
- package and bundle ID: `dsh-context-redline`;
|
|
29
|
+
- HTTP route prefix: `/api/dsh-context-redline/*`;
|
|
30
|
+
- projection keys: `redline*`;
|
|
31
|
+
- conversation view ID: `redline`;
|
|
32
|
+
- locale/message/storage/localStorage namespaces: `dsh-context-redline`;
|
|
33
|
+
- CSS/data prefixes: `redline-*` / `data-redline-*`.
|
|
34
|
+
|
|
35
|
+
### Product behavior
|
|
36
|
+
|
|
37
|
+
The upstream read-only context panel was extended with:
|
|
38
|
+
|
|
39
|
+
- full-text reads through Session Query;
|
|
40
|
+
- plugin-local editing and reversible delete marks;
|
|
41
|
+
- editable migration copies for supported event roles;
|
|
42
|
+
- stable source identities and role-preserving migration manifests;
|
|
43
|
+
- final-message editing and per-carrier model/reasoning selection;
|
|
44
|
+
- ordinary zero-history root sessions in the current workspace;
|
|
45
|
+
- durable operation ledgers, fixed IDs, cold-read verification and recovery;
|
|
46
|
+
- task-bound automatic verbatim return to the source session;
|
|
47
|
+
- explicit mixed-image omission reporting without blocking text migration.
|
|
48
|
+
|
|
49
|
+
Legacy fork/subagent creation remains only as a zero-write refusal for stale clients; the product path uses `carrier.plan`, `carrier.start`, and `carrier.list`.
|
|
50
|
+
|
|
51
|
+
### UI and styles
|
|
52
|
+
|
|
53
|
+
The Client UI was substantially changed:
|
|
54
|
+
|
|
55
|
+
- renamed and isolated every component/style namespace;
|
|
56
|
+
- added inline editors, delete states, carrier confirmation and carrier index;
|
|
57
|
+
- added a compact floating model/reasoning picker;
|
|
58
|
+
- retained the context statistics/trend/browser foundation while removing unrelated upstream features;
|
|
59
|
+
- added light/dark theme-token and CSS-closure safeguards.
|
|
60
|
+
|
|
61
|
+
### Host and persistence
|
|
62
|
+
|
|
63
|
+
New Host modules under `src/host/redline-*` and pure modules under `src/redline` / `src/shared/redline-*` implement source capture, manifests, strict ledgers, ordinary-session control, result attribution, recovery and return delivery.
|
|
64
|
+
|
|
65
|
+
### Tests and tooling
|
|
66
|
+
|
|
67
|
+
The fork adds independent edit/channel/client logic/client UI lanes, namespace and CSS isolation checks, i18n orphan detection, demo rendering checks, release readiness checks, and a consolidated release gate.
|
|
68
|
+
|
|
69
|
+
## Files intentionally retained from upstream
|
|
70
|
+
|
|
71
|
+
The repository still contains adapted upstream layout, projection, rendering and utility modules. File headers and Git history identify exact changes; this provenance file and `NOTICE` are included in every package tarball.
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Bundle patch layer: the row loads the package's main entry as the host half
|
|
2
|
+
# (a plain Cordis plugin); the `dsh.client` declaration makes the web app load
|
|
3
|
+
# its ./client bundle as the browser half.
|
|
4
|
+
#
|
|
5
|
+
# The id/name MUST equal the package name: the Host half's entry `name` export,
|
|
6
|
+
# the client bundle's `__ModuleLoader__.load({ id })` banner (tsdown.config.ts
|
|
7
|
+
# reads `pkg.name`) and this loader row are one identity. A mismatch raises
|
|
8
|
+
# `loaded without registering "<id>"` at boot (`docs/01` F3).
|
|
9
|
+
- insert:
|
|
10
|
+
- id: dsh-context-redline
|
|
11
|
+
name: dsh-context-redline
|