dsh-context-redline 0.0.0-stage → 0.1.1

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 ADDED
@@ -0,0 +1,54 @@
1
+ # 更新日志 / Changelog
2
+
3
+ ## [0.1.1] — 2026-11-04
4
+
5
+ **兼容性 / Compatibility:** DeepSeek Harness `>=0.2.2-rc.1 <0.3.0-0`; verified with `0.2.2-rc.1`. Node.js `>=24.9.0`.
6
+
7
+ ### 修复 / Fixed
8
+
9
+ - 读取会话当前的模型选择,不再把启动配置误当成用户切换后的模型;未指定推理等级不继承旧值。承载会话恢复时按实际当前模型验证,配置不一致或未知则停止投递。
10
+ - Read the Session's current model selection instead of stale startup options. Omitted reasoning effort stays at the model default. Carrier recovery validates the effective route and refuses mismatched or unknown selections.
11
+ - 读取会话当前已记录的预设,不再优先使用创建时固定头信息;未知预设不猜测。
12
+ - Read the recorded preset selection instead of the immutable creation header; never guess an unknown preset.
13
+ - 等待异步会话投影注册完成后再启用详情读取,使用保留的投影句柄而非弃用的按 key 读取。
14
+ - Await asynchronous projection registration before exposing detail reads, and retain the projection handle instead of using deprecated registry key reads.
15
+ - 修复新版工具结果历史详情丢失正文与错误状态的问题,同时保留旧日志格式读取。
16
+ - Preserve current tool-result history content, call identity and failure status while continuing to read legacy log shapes.
17
+ - 开发依赖、Node.js 要求、中英文文档和 npm 包支持范围同步;GitHub Release 必须等待 npm 发布成功。
18
+ - Synchronize development dependencies, Node.js requirements, bilingual documentation and npm support metadata; create the GitHub Release only after successful npm publication.
19
+
20
+ 本次仅发布兼容性补丁,不包含尚未验收的上下文体检、carrier-seed 实验或其他未发布功能。自动化回归不代表生产人工验收。
21
+ This compatibility-only patch excludes unaccepted context diagnostics, carrier-seed experiments and other unpublished features. Automated regression checks do not constitute production manual acceptance.
22
+
23
+ ## [0.1.0] — 2026-10-15
24
+
25
+ **兼容性 / Compatibility:** DeepSeek Harness `>=0.2.1-alpha.2 <0.3.0`.
26
+
27
+ ### 新增 / Added
28
+
29
+ - 可编辑、可删除的上下文迁移副本;本地保存不改来源会话。
30
+ - 在当前工作区创建零历史普通根会话,不继承 fork 历史。
31
+ - 可直接编辑最终发送全文,并选择新会话模型与推理等级。
32
+ - 固定 ID 持久台账、精确字节校验、崩溃恢复和自动原样回程。
33
+ - 混合文字 / 图片消息迁移文字并明确报告遗漏图片。
34
+
35
+ ### 安全与恢复 / Safety and recovery
36
+
37
+ - 删除项不进入新会话,来源日志保持 append-only。
38
+ - 工具结果必须匹配原调用;未知媒体和文件附件不会静默丢失。
39
+ - 同一 request ID 必须匹配精确正文,并在 flush 后由冷日志证明持久化。
40
+ - unknown 状态不重发;损坏台账、配置或回程指纹会停止执行。
41
+ - 新会话配置与来源会话回程恢复配置分开冻结。
42
+
43
+ ### 界面 / UI
44
+
45
+ - 上下文统计、趋势、事件、七类浏览器与普通承载会话索引。
46
+ - 行下全文编辑、可逆删除、最终全文编辑器。
47
+ - 与 DSH 输入框一致的一行模型 / 推理等级浮动选择器。
48
+ - 深浅主题、窄屏布局和 CSS 命名空间隔离。
49
+
50
+ ### 许可 / License
51
+
52
+ - 原创代码采用 MIT。
53
+ - 复制自 `dsh-context` 的部分保留 Apache-2.0。
54
+ - 详见 `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,139 @@
1
- # Temporary Holding Version
1
+ <h1 align="center">Context Redline</h1>
2
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.
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
+ > **Version `0.1.1` — supports DSH `>=0.2.2-rc.1 <0.3.0-0`.** Built and regression-tested against `0.2.2-rc.1`; Node.js `>=24.9.0` is required. DSH `0.3.0` prereleases are excluded.
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.2-rc.1` or a newer supported `0.2.x`, plus Node.js `24.9+`. Older DSH installations should stay on plugin `0.1.0` until upgrading DSH.
61
+
62
+ Install or upgrade to this exact release:
63
+
64
+ ```sh
65
+ dsh plugin --profile web add dsh-context-redline@0.1.1
66
+ ```
67
+
68
+ This compatibility patch awaits projection registration, uses retained projection readers, reads the Session's current model and preset instead of stale startup metadata, and preserves current tool-result history content and errors. Unaccepted diagnostics and carrier-seed experiments are not included. Automated tests do not constitute production visual or real-session acceptance.
69
+
70
+ Local development:
71
+
72
+ ```sh
73
+ pnpm install
74
+ pnpm run build
75
+ dsh plugin --profile web add "link:$(pwd)"
76
+ ```
77
+
78
+ The user must restart `dsh web` after installation or Host changes. A rebuilt Client-only change normally needs only a hard refresh.
79
+
80
+ Remove:
81
+
82
+ ```sh
83
+ dsh plugin --profile web remove dsh-context-redline
84
+ ```
85
+
86
+ Uninstalling does not automatically delete local drafts and operation ledgers under `$DSH_HOME/dsh-context-redline/`.
87
+
88
+ ## Usage
89
+
90
+ 1. Open a session with messages and select **Context Redline**.
91
+ 2. Optionally edit/delete individual items; saves remain local.
92
+ 3. Choose **Open ordinary new session**.
93
+ 4. Enter the task and finish the exact final message.
94
+ 5. Choose a model; keep effort at **Use model default** unless needed.
95
+ 6. Confirm creation and open the new session from the left sidebar.
96
+ 7. The bound result returns automatically after completion.
97
+
98
+ See the [user guide](https://github.com/idoall/dsh-context-redline/blob/main/docs/12-user-guide.md).
99
+
100
+ ## Images and attachments
101
+
102
+ - Mixed text/image messages migrate all text and report omitted images.
103
+ - Pure-image messages do not create fabricated empty paragraphs.
104
+ - Image identities remain in the source fingerprint, so changes invalidate confirmation.
105
+ - Image binaries, files, file refs, and generic attachments are not migrated yet; unknown media refuses instead of disappearing silently.
106
+
107
+ ## Boundaries
108
+
109
+ - Never rewrites or deletes source history.
110
+ - System prompts and tool schemas come from the target preset; migrated prose never pretends to alter those layers.
111
+ - Tool results require a matching call identity.
112
+ - No history/version UI, rollback, compaction, team task board, or session deletion UI.
113
+ - The plugin provides lock-scoped idempotence and recovery; it does not claim platform-native exactly-once delivery.
114
+
115
+ ## Development
116
+
117
+ ```sh
118
+ pnpm install
119
+ pnpm run typecheck
120
+ pnpm run lint
121
+ pnpm run test
122
+ ./node_modules/.bin/vitest run
123
+ node scripts/release-check.mjs
124
+ pnpm pack --dry-run
125
+ ```
126
+
127
+ 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.
128
+
129
+ ## Documentation
130
+
131
+ - [User guide](https://github.com/idoall/dsh-context-redline/blob/main/docs/12-user-guide.md)
132
+ - [Context migration contract](https://github.com/idoall/dsh-context-redline/blob/main/docs/13-context-migration.md)
133
+ - [System prompt and injection boundaries](https://github.com/idoall/dsh-context-redline/blob/main/docs/14-system-prompt-and-injection.md)
134
+ - [Carrier lifecycle](https://github.com/idoall/dsh-context-redline/blob/main/docs/15-carrier-lifecycle.md)
135
+ - [Upstream provenance and modifications](https://github.com/idoall/dsh-context-redline/blob/main/UPSTREAM.md)
136
+
137
+ ## License
138
+
139
+ 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,139 @@
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
+ > **版本 `0.1.1` — 支持 DSH `>=0.2.2-rc.1 <0.3.0-0`。** 使用 `0.2.2-rc.1` 完成构建与回归测试;要求 Node.js `>=24.9.0`。不支持 DSH `0.3.0` 的预发布版本。
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.2-rc.1` 或更新且受支持的 `0.2.x`,以及 Node.js `24.9+`。旧版 DSH 请先使用插件 `0.1.0`,升级 DSH 后再更新插件。
61
+
62
+ 安装或升级到本次确切版本:
63
+
64
+ ```sh
65
+ dsh plugin --profile web add dsh-context-redline@0.1.1
66
+ ```
67
+
68
+ 本次兼容性补丁等待会话投影注册完成、通过保留的投影句柄读取状态,读取会话当前模型和预设而非过期的启动配置,并保留新版工具结果历史详情的正文与错误状态。不包含未验收的体检功能和 carrier-seed 实验。自动化测试不等于生产界面或真实会话人工验收。
69
+
70
+ 本地开发:
71
+
72
+ ```sh
73
+ pnpm install
74
+ pnpm run build
75
+ dsh plugin --profile web add "link:$(pwd)"
76
+ ```
77
+
78
+ 安装或宿主代码更新后,由用户本人重启 `dsh web`。仅客户端改动构建后通常只需硬刷新。
79
+
80
+ 卸载:
81
+
82
+ ```sh
83
+ dsh plugin --profile web remove dsh-context-redline
84
+ ```
85
+
86
+ 卸载插件不会自动删除 `$DSH_HOME/dsh-context-redline/` 中的本地草稿和操作台账。
87
+
88
+ ## 使用
89
+
90
+ 1. 打开已有消息的会话,进入「上下文批改」。
91
+ 2. 可选:逐条编辑或删除;保存只写本地。
92
+ 3. 点击「开启普通新会话」。
93
+ 4. 填写任务,并在「最终发送全文」中完成最后修改。
94
+ 5. 选择模型;推理等级可保持「使用模型默认值」。
95
+ 6. 确认创建;在左侧打开新会话。
96
+ 7. 新会话结束后,结果会自动回到来源会话。
97
+
98
+ 详见[用户指南](https://github.com/idoall/dsh-context-redline/blob/main/docs/12-user-guide.md)。
99
+
100
+ ## 图片和附件
101
+
102
+ - 混合文字 / 图片消息迁移全部文字,并显示「图片 N 个未迁移」。
103
+ - 纯图片消息不生成空白段,但计入遗漏数。
104
+ - 图片引用仍参与来源指纹,图片变化会使旧确认失效。
105
+ - 图片二进制、文件、file-ref 和通用附件当前不迁移;未知媒体明确拒绝,不会静默消失。
106
+
107
+ ## 边界
108
+
109
+ - 不改写或删除来源会话历史。
110
+ - 系统提示词和工具定义由目标预设生成;迁移文字不冒充系统层。
111
+ - 工具结果必须匹配原工具调用。
112
+ - 不提供历史版本、回滚、压缩、团队任务板或会话删除 UI。
113
+ - 插件保证自身锁内幂等与可恢复,不宣称平台天然 exactly-once。
114
+
115
+ ## 开发
116
+
117
+ ```sh
118
+ pnpm install
119
+ pnpm run typecheck
120
+ pnpm run lint
121
+ pnpm run test
122
+ ./node_modules/.bin/vitest run
123
+ node scripts/release-check.mjs
124
+ pnpm pack --dry-run
125
+ ```
126
+
127
+ 推送 `v*` tag 后,GitHub Actions 会校验版本和双语发布说明、测试、打包,并通过 npm Trusted Publishing(OIDC,无 `NPM_TOKEN`)发布,再创建 GitHub Release。
128
+
129
+ ## 文档
130
+
131
+ - [用户指南](https://github.com/idoall/dsh-context-redline/blob/main/docs/12-user-guide.md)
132
+ - [上下文迁移合同](https://github.com/idoall/dsh-context-redline/blob/main/docs/13-context-migration.md)
133
+ - [系统提示词与注入边界](https://github.com/idoall/dsh-context-redline/blob/main/docs/14-system-prompt-and-injection.md)
134
+ - [承载会话生命周期](https://github.com/idoall/dsh-context-redline/blob/main/docs/15-carrier-lifecycle.md)
135
+ - [上游来源与修改记录](https://github.com/idoall/dsh-context-redline/blob/main/UPSTREAM.md)
136
+
137
+ ## 许可
138
+
139
+ 原创部分采用 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,不代表上游作者背书。