dsh-manual-compact-plugin 0.1.0 → 0.1.3
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 +2 -2
- package/lib/client.js +8 -19
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
手动上下文压缩插件(DeepSeek Harness / DSH)。
|
|
4
4
|
|
|
5
|
-
> 点击上下文圆圈(或输入框旁的"压缩"按钮)→
|
|
5
|
+
> 点击上下文圆圈(或输入框旁的"压缩"按钮)→ 填写保留最近 N 条 → 停止或分批压缩 → 每次压缩都有存档可查。
|
|
6
6
|
|
|
7
7
|
## 功能
|
|
8
8
|
|
|
9
|
-
- **保留最近 N
|
|
9
|
+
- **保留最近 N 条**:直接输入保留数量(默认 4,建议 1–4 条)
|
|
10
10
|
- **处理方式**:
|
|
11
11
|
- 完成一批后停止
|
|
12
12
|
- 分批处理直到完成
|
package/lib/client.js
CHANGED
|
@@ -97,8 +97,7 @@ window.__ModuleLoader__.load({
|
|
|
97
97
|
function CompactControls(props) {
|
|
98
98
|
var state = useNamespaceSnapshot(props.scope);
|
|
99
99
|
var value = state.value || {};
|
|
100
|
-
var [keep, setKeep] = useState("
|
|
101
|
-
var [customKeep, setCustomKeep] = useState("");
|
|
100
|
+
var [keep, setKeep] = useState("4");
|
|
102
101
|
var [mode, setMode] = useState("stop");
|
|
103
102
|
var [localError, setLocalError] = useState("");
|
|
104
103
|
var [expandedSeq, setExpandedSeq] = useState(null);
|
|
@@ -115,7 +114,7 @@ window.__ModuleLoader__.load({
|
|
|
115
114
|
if (n && n.kind === "compaction") entries.push(n);
|
|
116
115
|
}
|
|
117
116
|
|
|
118
|
-
var effectiveKeep = keep
|
|
117
|
+
var effectiveKeep = keep;
|
|
119
118
|
function submit() {
|
|
120
119
|
var n = Number(effectiveKeep);
|
|
121
120
|
if (!Number.isInteger(n) || n < 1) {
|
|
@@ -147,27 +146,17 @@ window.__ModuleLoader__.load({
|
|
|
147
146
|
"div",
|
|
148
147
|
{ className: "dsmc-row" },
|
|
149
148
|
react.createElement("label", null, "保留最近"),
|
|
150
|
-
react.createElement(
|
|
151
|
-
"select",
|
|
152
|
-
{ value: keep, disabled: busy, onChange: function (e) { setKeep(e.target.value); } },
|
|
153
|
-
react.createElement("option", { value: "5" }, "5 条"),
|
|
154
|
-
react.createElement("option", { value: "10" }, "10 条(推荐)"),
|
|
155
|
-
react.createElement("option", { value: "20" }, "20 条"),
|
|
156
|
-
react.createElement("option", { value: "30" }, "30 条"),
|
|
157
|
-
react.createElement("option", { value: "50" }, "50 条"),
|
|
158
|
-
react.createElement("option", { value: "custom" }, "自定义")
|
|
159
|
-
)
|
|
160
|
-
),
|
|
161
|
-
keep === "custom"
|
|
162
|
-
? react.createElement("input", {
|
|
149
|
+
react.createElement("input", {
|
|
163
150
|
type: "number",
|
|
164
151
|
min: 1,
|
|
165
152
|
max: 10000,
|
|
166
|
-
placeholder: "
|
|
153
|
+
placeholder: "输入保留条数",
|
|
154
|
+
value: keep,
|
|
167
155
|
disabled: busy,
|
|
168
|
-
onChange: function (e) {
|
|
156
|
+
onChange: function (e) { setKeep(e.target.value); },
|
|
169
157
|
})
|
|
170
|
-
|
|
158
|
+
),
|
|
159
|
+
react.createElement("div", { className: "dsmc-msg" }, "建议保留 1–4 条(DSH 单轮输出较大)"),
|
|
171
160
|
react.createElement(
|
|
172
161
|
"div",
|
|
173
162
|
{ className: "dsmc-row" },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-manual-compact-plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Manual context compaction for DeepSeek Harness: keep the latest N conversation items with stop or batch mode and a per-session compaction archive — embedded in the context meter popup when the meter panel slot exists, or a composer button otherwise.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -31,16 +31,16 @@
|
|
|
31
31
|
"client": {
|
|
32
32
|
"inject": [
|
|
33
33
|
"@deepseek-ai/dsh-client-ui-conversation",
|
|
34
|
-
"@deepseek-ai/dsh-settings"
|
|
34
|
+
"@deepseek-ai/dsh-client-ui-settings"
|
|
35
35
|
],
|
|
36
36
|
"platform": "web"
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
41
|
-
"@deepseek-ai/dsh-agent": "^0.1.
|
|
42
|
-
"@deepseek-ai/dsh-settings": "^0.1.
|
|
43
|
-
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.
|
|
41
|
+
"@deepseek-ai/dsh-agent": "^0.1.1-rc.1",
|
|
42
|
+
"@deepseek-ai/dsh-settings": "^0.1.1-rc.1",
|
|
43
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.1-rc.1",
|
|
44
44
|
"@deepseek-ai/schemastery": "^3.18.1",
|
|
45
45
|
"react": "^18.2.0"
|
|
46
46
|
},
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
},
|
|
55
55
|
"repository": {
|
|
56
56
|
"type": "git",
|
|
57
|
-
"url": "git+https://github.com/kimkingyu/dsh-manual-compact.git"
|
|
57
|
+
"url": "git+https://github.com/kimkingyu/dsh-manual-compact-plugin.git"
|
|
58
58
|
},
|
|
59
|
-
"homepage": "https://github.com/kimkingyu/dsh-manual-compact#readme",
|
|
59
|
+
"homepage": "https://github.com/kimkingyu/dsh-manual-compact-plugin#readme",
|
|
60
60
|
"bugs": {
|
|
61
|
-
"url": "https://github.com/kimkingyu/dsh-manual-compact/issues"
|
|
61
|
+
"url": "https://github.com/kimkingyu/dsh-manual-compact-plugin/issues"
|
|
62
62
|
},
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|