dsh-strata-sync 0.10.1 → 0.10.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 +64 -147
- package/docs/README.zh-CN.md +69 -116
- package/docs/README.zh-TW.md +69 -116
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,205 +2,122 @@
|
|
|
2
2
|
|
|
3
3
|
**English** · [简体中文](https://github.com/ethan741205/dsh-strata-sync/blob/main/docs/README.zh-CN.md) · [繁體中文](https://github.com/ethan741205/dsh-strata-sync/blob/main/docs/README.zh-TW.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Connect **DeepSeek Harness (DSH)** to the model loaded in **Strata Server**, with model settings and summary controls in one DSH settings page.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The plugin reads Strata's model information, previews the changes, and updates DSH's custom model and context-compaction budgets. It also adds an editable length instruction to supported summary requests, helping the model keep checkpoints concise.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## What you can do
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
- **Sync model settings:** context window, response output limit, and confirmed input types and reasoning levels.
|
|
12
|
+
- **Align compaction budgets:** update the matching policies in enabled DSH Agent presets.
|
|
13
|
+
- **Control summary length:** edit the supplemental prompt and adjust three target-length ratios.
|
|
14
|
+
- **Sync on startup:** optionally synchronize once after DSH becomes idle.
|
|
15
|
+
- **Review and recover:** preview differences, back up settings, and view the last synchronization result.
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
Strata Server is read-only to this plugin. Synchronization does not switch or load server models, change server settings, or send test inference requests. Unconfirmed model capabilities keep their existing DSH values.
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
## Get started
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
### 1. Prepare the connection
|
|
18
22
|
|
|
19
|
-
|
|
20
|
-
Keep the entire checkpoint, including all required headings, within a target of {target} tokens by retaining only information essential to continue the remaining work, consolidating prior summaries, and removing redundant or obsolete details.
|
|
21
|
-
```
|
|
23
|
+
Load a model in Strata Server. In **DSH → Settings → Models**, configure its OpenAI-compatible provider, API URL and credentials, with an explicit custom model entry.
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
The plugin reuses that connection; you do not need to copy an API key into it.
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
|---|---:|---|
|
|
27
|
-
| `summaryGuidance` | `true` | Append guidance to supported summary requests. |
|
|
28
|
-
| `summaryContextDivisor` | `16` | Divide the verified context by this value. |
|
|
29
|
-
| `summaryOutputDivisor` | `2` | Divide the actual summary output cap by this value. |
|
|
30
|
-
| `summarySourceDivisor` | `2` | Divide the estimated source length by this value. |
|
|
31
|
-
| `summaryPromptTemplate` | English template above | Supplement appended after substituting `{target}`. |
|
|
32
|
-
|
|
33
|
-
All three divisors accept finite numbers of at least 1, including decimals such as 1.5 or 2.5. A larger divisor makes its bound smaller. The final target is the smallest of the three bounds, rounded down; these controls do not change the actual output hard limit.
|
|
27
|
+
### 2. Install the plugin
|
|
34
28
|
|
|
35
|
-
|
|
29
|
+
In DSH's plugin manager, choose **Add plugin** and enter:
|
|
36
30
|
|
|
37
31
|
```text
|
|
38
|
-
|
|
39
|
-
target = floor(min(context / summaryContextDivisor,
|
|
40
|
-
actual summary maxTokens / summaryOutputDivisor,
|
|
41
|
-
selected-content estimated tokens / summarySourceDivisor))
|
|
32
|
+
dsh-strata-sync
|
|
42
33
|
```
|
|
43
34
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
Saving these controls changes only plugin preferences; it does not synchronize model budgets or change Strata Server settings. DSH's native prompt, eight-section format and request options remain intact. The default supplement is one sentence; a custom template is appended as entered. The target is a writing instruction, **not a new hard output limit or a guarantee against truncation**. No retry loop or extra inference request is added.
|
|
47
|
-
|
|
48
|
-
Unverified routes/metadata, unknown native prompts, unpriced attachments, invalid templates, cancellation, disabled guidance and targets below 256 tokens leave the native request unchanged. Removing the plugin stops the supplement without rewriting saved conversation history.
|
|
49
|
-
|
|
50
|
-
### Automatic model capabilities (0.4.0)
|
|
51
|
-
|
|
52
|
-
The preview includes **Input types**, **Reasoning levels**, and **Reasoning request mapping**, with the same backup, rollback and idle-only safeguards as token budgets.
|
|
53
|
-
|
|
54
|
-
- Input types follow the server's explicit `architecture.input_modalities`: text, or text plus image. Unknown or unsupported values preserve the existing field.
|
|
55
|
-
- Reasoning requires matching Strata identity, model identity and a reviewed chat-template fingerprint from `/props?model=...`. A model name alone is insufficient.
|
|
56
|
-
- Verified Qwen3.8-Flash-Next templates offer **off / low / medium / xhigh**. Verified DeepSeek-V4.1-Flash templates offer **off / low / high / max**, including the inspected Huihui variants. The template, not quantization, determines eligibility.
|
|
57
|
-
- Native DSH request mapping sends both thinking enablement and the selected effort. Unknown templates or unavailable props preserve existing reasoning settings and show a warning.
|
|
58
|
-
- Provider defaults and current conversation selections are not changed. An incompatible provider default skips reasoning synchronization with a warning. Start a new conversation after syncing.
|
|
59
|
-
|
|
60
|
-
See [capability evidence and exact mappings](https://github.com/ethan741205/dsh-strata-sync/blob/main/docs/CAPABILITIES.md). No additional plugin or Strata server changes are required.
|
|
61
|
-
|
|
62
|
-
### Existing synchronization features
|
|
63
|
-
|
|
64
|
-
- Reads `/v1/models` and, when available, `/slots`. Uses the loaded canonical text-model ID and actual engine context; it never guesses context from a model name. Verified aliases refer to the same model; image-generation endpoints are excluded.
|
|
65
|
-
- Updates that DSH model's context and output limit, and its native `compaction-basic` policy inside enabled Agent presets. The preview identifies the affected presets.
|
|
66
|
-
- Shows server-reported values separately from client-derived budgets.
|
|
67
|
-
- Uses **Follow Strata** for output selection by default. **Advanced settings** provides an explicit manual override. Server-reported output defaults, effective output values and their sources are shown separately. Default-model following remains optional.
|
|
68
|
-
- When enabled before startup, synchronizes once per DSH host process/profile after tasks become idle. If a task starts during discovery, the pending sync waits and resumes after it finishes. There are no recurring checks after completion; other failures are shown in the UI and require manual retry or the next start. Enabling it during a session takes effect on the next start; use **Back up and sync** for an immediate sync. No generation requests, model loading or server changes.
|
|
69
|
-
- Previews differences, rechecks the server and the same configuration revision before applying, rejects stale previews, backs up the profile and rolls back completed edits if a later edit fails. Preferences also use revision checks: untouched forms follow fresh values; locally edited forms report conflicts instead of silently overwriting another window.
|
|
70
|
-
- Keeps a read-only last-sync result with model, budgets, output source and backup information. Reports verified and preserved capabilities separately.
|
|
71
|
-
- Uses DSH's existing credential service. Keys never appear in the page or diagnostics; redirects are not followed.
|
|
72
|
-
|
|
73
|
-
**Start a new conversation after syncing model or budget settings.** Existing conversations keep their selected model route and Agent preset revision. Default-model following and updated preset policies apply to new work; this plugin does not rewrite existing conversations or restart DSH. Dynamic summary guidance operates on supported summary requests while the updated plugin is active and does not require changing those saved settings.
|
|
74
|
-
|
|
75
|
-
## Compatibility
|
|
76
|
-
|
|
77
|
-
Developed against **DSH desktop 0.2.1-rc.3** and Strata's OpenAI-compatible model/slot metadata. Requires the standard desktop services `configEditor`, `connection`, `agents`, `credentials`, `llm-pi-ai`, and enabled Agent presets containing `compaction-basic` (or an active legacy global compaction plugin). Only API-key or unauthenticated `openai-completions` providers are supported. Configure the provider in DSH Models first.
|
|
78
|
-
|
|
79
|
-
Configure an explicit, nonempty custom `models` list for the Strata provider. Catalog-only routes and nonempty `modelOverrides` routes are rejected during preview, before any backup or write; the plugin does not convert catalog providers or combine incompatible model configuration formats.
|
|
80
|
-
|
|
81
|
-
Unknown context, no loaded text model, ambiguous multiple loaded text models, or conflicting slot capacities are refused. Aliases are resolved to their loaded canonical model, and explicit non-text output endpoints are excluded. Invalid alias chains are refused. This version's UI follows one loaded text model; it does not select among multiple simultaneously loaded text models.
|
|
82
|
-
|
|
83
|
-
The startup idle-wait scheduler includes a narrow DSH 0.2.1-rc.3 compatibility adapter for HMR's `executing.exit` context, following the host's own watcher pattern. This prevents timers created during a settings reload from retaining the completed HMR transaction. All writes still go through ConfigEditor and its normal transaction queue. Revalidate this adapter after upgrading DSH.
|
|
84
|
-
|
|
85
|
-
## Install
|
|
86
|
-
|
|
87
|
-
Package name: `dsh-strata-sync` (formerly `@ethan741205/dsh-strata-sync`). Remove the old scoped plugin before installing this package to avoid loading two copies; retain its settings when migrating.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
For the existing npm release, finish active tasks and fully quit DSH Desktop, then install with the official DSH CLI:
|
|
35
|
+
Or, after finishing active tasks and fully quitting DSH Desktop, use the official CLI:
|
|
91
36
|
|
|
92
37
|
```sh
|
|
93
38
|
dsh plugin --profile desktop add dsh-strata-sync --registry=https://registry.npmjs.org/
|
|
94
39
|
```
|
|
95
40
|
|
|
96
|
-
Reopen DSH
|
|
41
|
+
Reopen DSH if needed to load the settings page. If the plugin is disabled, enable it in the plugin manager.
|
|
97
42
|
|
|
98
|
-
|
|
43
|
+
### 3. Preview and synchronize
|
|
99
44
|
|
|
100
|
-
|
|
101
|
-
git clone https://github.com/ethan741205/dsh-strata-sync.git
|
|
102
|
-
cd dsh-strata-sync
|
|
103
|
-
npm ci
|
|
104
|
-
npm test
|
|
105
|
-
npm pack
|
|
106
|
-
dsh plugin --profile desktop add ./dsh-strata-sync-0.10.1.tgz
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
Use an absolute tarball path if running the last command elsewhere. DSH's plugin installer selects the included bundle; it can require a desktop reload to mount the new browser entry. Finish any active task before restarting DSH.
|
|
110
|
-
|
|
111
|
-
Then open **Settings → dsh-strata-sync**:
|
|
112
|
-
|
|
113
|
-
1. Choose the existing Strata provider and save preferences. Keep **Follow Strata** enabled, or open **Advanced settings** for a manual output override.
|
|
114
|
-
2. Click **Check differences** to read the loaded model and preview the proposed settings.
|
|
115
|
-
3. Click **Back up and sync** while DSH is idle.
|
|
116
|
-
4. Optionally enable **Automatically sync when DSH starts** and save. It defaults to off and takes effect on the next start. Existing `autoSync: true` preferences now use startup behavior.
|
|
117
|
-
5. Start a new conversation to use the new Agent preset revision.
|
|
118
|
-
|
|
119
|
-
The **Dynamic summary target** card is independent of model synchronization. Leave guidance enabled, keep the default template, and use divisors 16 / 2 / 2 to retain the previous behavior, or change these preferences and save. Turning this switch off does not disable DSH's own compaction.
|
|
45
|
+
Open **Settings → dsh-strata-sync**:
|
|
120
46
|
|
|
121
|
-
|
|
47
|
+
1. Select your Strata provider and click **Save preferences**.
|
|
48
|
+
2. Click **Check differences** to inspect the loaded model and proposed changes.
|
|
49
|
+
3. While DSH is idle, click **Back up and sync**.
|
|
50
|
+
4. **Start a new conversation** to use the updated model and Agent preset settings.
|
|
122
51
|
|
|
123
|
-
|
|
52
|
+
Existing conversations keep their selected model route and preset revision. To make future setup automatic, enable **Automatically sync when DSH starts** and save. This option is off by default and takes effect on the next start; it waits for idle and does not poll continuously.
|
|
124
53
|
|
|
125
|
-
|
|
54
|
+
## Model and output settings
|
|
126
55
|
|
|
127
|
-
|
|
56
|
+
| Setting | How it is chosen |
|
|
57
|
+
|---|---|
|
|
58
|
+
| Model and context | Strata's loaded text model and verified context capacity. |
|
|
59
|
+
| Response output limit | Manual override, if set; otherwise the verified Strata output default. If unavailable or unlimited, use 30% of context, capped at 16,384 tokens. |
|
|
60
|
+
| Input types | Confirmed server capabilities, such as text or text plus image. |
|
|
61
|
+
| Reasoning levels | Verified model-template support; unknown templates preserve existing settings. |
|
|
62
|
+
| Default model | Follows the loaded Strata model when **Follow the loaded Strata model as the default** is enabled. |
|
|
128
63
|
|
|
129
|
-
|
|
130
|
-
- Simplifies the summary card and moves detailed formula explanations into expandable help in all three languages. Adds advanced output/source divisors and decimal support for all three divisors.
|
|
131
|
-
- Validates and saves prompt edits through existing backup and revision safeguards without changing native instructions or other budgets.
|
|
64
|
+
Keep **Follow Strata output limit** enabled for automatic selection. Turn it off to set a manual override under **Advanced settings**. The preview shows the server default, effective value and source separately.
|
|
132
65
|
|
|
133
|
-
|
|
66
|
+
When synchronizing, the plugin sets a 4,096-token summary output cap and 4,096-token compaction headroom. The effective compaction trigger is the smaller of **80% of context** and **context − response output − 4,096**. Recent-content retention is **(context − response output) × 16%**, rounded down. These are client-side budgets calculated by the plugin, not settings supplied by Strata.
|
|
134
67
|
|
|
135
|
-
|
|
136
|
-
- Saves both controls through the existing preferences and revision checks, with matching English, Simplified Chinese and Traditional Chinese UI and documentation.
|
|
137
|
-
- Keeps native summary instructions, hard output limits, other budgets and server settings unchanged when saving these controls.
|
|
68
|
+
For example, with automatic output calculation, a 32K context uses a 9,830-token response allowance and an 18,842-token compaction trigger. It does **not** necessarily compact at 80%.
|
|
138
69
|
|
|
139
|
-
##
|
|
70
|
+
## Summary prompt and target length
|
|
140
71
|
|
|
141
|
-
|
|
142
|
-
- Performs one optional startup sync per host process/profile, waiting for idle. Hot reloads and reopening Settings do not repeat it.
|
|
143
|
-
- Preserves the existing opt-in `autoSync` preference; no recurring server polling.
|
|
72
|
+
**Dynamic summary target** is enabled by default. It supplements DSH's native summary instructions; disabling it keeps native summary and compaction behavior.
|
|
144
73
|
|
|
145
|
-
|
|
74
|
+
The editable **Supplemental summary prompt** starts with:
|
|
146
75
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
## Changes in 0.2.0
|
|
152
|
-
|
|
153
|
-
- Moves the dsh-strata-sync interface into DSH's native **Settings** navigation.
|
|
154
|
-
- Uses English throughout the interface and repository documentation.
|
|
155
|
-
- Preserves the synchronization policy, optional idle polling, backups and existing-conversation behavior described below.
|
|
76
|
+
```text
|
|
77
|
+
Keep the entire checkpoint, including all required headings, within a target of {target} tokens by retaining only information essential to continue the remaining work, consolidating prior summaries, and removing redundant or obsolete details.
|
|
78
|
+
```
|
|
156
79
|
|
|
157
|
-
|
|
80
|
+
Keep `{target}` in your text—it is replaced with the calculated token target before each supported summary. The template can contain up to 2,048 characters. Use **Restore default prompt** to reset it, then **Save preferences** to apply your choice.
|
|
158
81
|
|
|
159
|
-
|
|
82
|
+
Expand **Calculation and limits** for the additional ratios:
|
|
160
83
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
thresholdRatio = 0.8
|
|
167
|
-
retainRatio = 0.16
|
|
168
|
-
effective trigger = floor(min(context × 0.8, context − ordinary output − 4096))
|
|
169
|
-
recent retention = floor((context − ordinary output) × 0.16)
|
|
170
|
-
```
|
|
84
|
+
| Divisor | Default | Limits the target to |
|
|
85
|
+
|---|---:|---|
|
|
86
|
+
| Context (N) | 16 | Context ÷ N |
|
|
87
|
+
| Summary output (O) | 2 | Actual summary output cap ÷ O |
|
|
88
|
+
| Source length (S) | 2 | Estimated content being summarized ÷ S |
|
|
171
89
|
|
|
172
|
-
|
|
90
|
+
The target is the smallest result, rounded down. All divisors accept decimals of at least 1. Increasing a divisor lowers its bound; another bound may still determine the final target. Context uses the smaller verified server/client window, and the source estimate excludes system prompts and tool definitions.
|
|
173
91
|
|
|
174
|
-
|
|
92
|
+
With 32K context, a 4,096-token summary cap and enough source content, the defaults target **2,048 tokens**. This is a writing instruction, **not a hard output limit or a guarantee against truncation**. The UI previews a ceiling; the actual request may have a smaller target.
|
|
175
93
|
|
|
176
|
-
|
|
177
|
-
|---|---:|---:|---:|---:|---:|
|
|
178
|
-
| 32,768 | 9,830 | 4,096 | 4,096 | 18,842 (57.50%) | 3,670 |
|
|
179
|
-
| 65,536 | 16,384 | 4,096 | 4,096 | 45,056 (68.75%) | 7,864 |
|
|
94
|
+
Saving summary preferences does not change model budgets. Native prompt content is preserved, and no extra inference or retry loop is added. If the request cannot be verified or safely estimated, or the target is below 256 tokens, the original summary request proceeds unchanged.
|
|
180
95
|
|
|
181
|
-
|
|
96
|
+
## Backups and compatibility
|
|
182
97
|
|
|
183
|
-
|
|
98
|
+
Settings writes create a backup of `cordis.patch.yml` under the profile's `backups/strata-sync/` directory. Synchronization checks for concurrent edits and attempts to roll back completed changes if a later step fails. Backups may contain private configuration; keep them local.
|
|
184
99
|
|
|
185
|
-
|
|
100
|
+
Removing the plugin does not undo previously synchronized settings. To restore a backup, fully quit DSH first.
|
|
186
101
|
|
|
187
|
-
|
|
102
|
+
Tested with **DSH Desktop 0.2.1-rc.3**. Use an API-key or unauthenticated OpenAI-compatible provider with an explicit custom model list and an enabled Agent preset containing `compaction-basic`. Contexts below 8,192 tokens, catalog-only providers, nonempty `modelOverrides`, and ambiguous loaded-model metadata are unsupported.
|
|
188
103
|
|
|
189
|
-
|
|
104
|
+
See [verified capabilities and reasoning mappings](https://github.com/ethan741205/dsh-strata-sync/blob/main/docs/CAPABILITIES.md) and [validation notes](https://github.com/ethan741205/dsh-strata-sync/blob/main/docs/VALIDATION.md) for technical details and test coverage.
|
|
190
105
|
|
|
191
106
|
## Development
|
|
192
107
|
|
|
193
|
-
|
|
108
|
+
Requires Node.js 22 or newer.
|
|
194
109
|
|
|
195
110
|
```sh
|
|
111
|
+
git clone https://github.com/ethan741205/dsh-strata-sync.git
|
|
112
|
+
cd dsh-strata-sync
|
|
196
113
|
npm ci
|
|
197
114
|
npm test
|
|
198
115
|
npm run build
|
|
199
|
-
npm pack
|
|
116
|
+
npm pack
|
|
200
117
|
```
|
|
201
118
|
|
|
202
|
-
|
|
119
|
+
To install your build, fully quit DSH and run `dsh plugin --profile desktop add <path-to-generated.tgz>`.
|
|
203
120
|
|
|
204
|
-
|
|
121
|
+
Source: `src/plugin.mjs` (host integration), `src/core.mjs` (discovery and budgets), `src/summary.mjs` (summary guidance), and `src/client.js` (settings UI).
|
|
205
122
|
|
|
206
|
-
MIT
|
|
123
|
+
[npm](https://www.npmjs.com/package/dsh-strata-sync) · [Report an issue](https://github.com/ethan741205/dsh-strata-sync/issues) · [MIT license](https://github.com/ethan741205/dsh-strata-sync/blob/main/LICENSE)
|
package/docs/README.zh-CN.md
CHANGED
|
@@ -2,169 +2,122 @@
|
|
|
2
2
|
|
|
3
3
|
[English](https://github.com/ethan741205/dsh-strata-sync/blob/main/README.md) · **简体中文** · [繁體中文](https://github.com/ethan741205/dsh-strata-sync/blob/main/docs/README.zh-TW.md)
|
|
4
4
|
|
|
5
|
-
让 **DeepSeek Harness(DSH)**
|
|
5
|
+
让 **DeepSeek Harness(DSH)** 连接 **Strata Server** 当前加载的模型,在同一个 DSH 设置页管理模型配置与摘要控制。
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
插件读取 Strata 的模型信息,预览差异,再更新 DSH 自定义模型与上下文压缩预算。它还会为支持的摘要请求补充可编辑的长度指令,帮助模型生成精简的摘要。
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## 可以做什么
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
- **同步模型设置:**上下文窗口、回复输出上限,以及已确认的输入类型和推理等级。
|
|
12
|
+
- **对齐压缩预算:**更新已启用的 DSH Agent 预设中,对应模型的压缩策略。
|
|
13
|
+
- **控制摘要长度:**编辑补充提示词,调整三项目标长度比例。
|
|
14
|
+
- **启动时同步:**可选择在 DSH 启动并空闲后同步一次。
|
|
15
|
+
- **预览与恢复:**检查差异、备份设置,并查看最近一次同步结果。
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
插件只读访问 Strata Server。同步不会切换或加载服务器模型、修改服务器设置,也不会发送测试推理请求。无法确认的模型能力会保留 DSH 原有值。
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
## 开始使用
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
### 1. 准备连接
|
|
18
22
|
|
|
19
|
-
|
|
20
|
-
Keep the entire checkpoint, including all required headings, within a target of {target} tokens by retaining only information essential to continue the remaining work, consolidating prior summaries, and removing redundant or obsolete details.
|
|
21
|
-
```
|
|
23
|
+
先在 Strata Server 加载模型,再到 **DSH → 设置 → 模型**,配置兼容 OpenAI 的提供方、API 地址与认证,并明确添加自定义模型条目。
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
| 插件偏好 | 默认值 | 含义 |
|
|
26
|
-
|---|---:|---|
|
|
27
|
-
| `summaryGuidance` | `true` | 对支持的摘要请求附加补充提示词。 |
|
|
28
|
-
| `summaryContextDivisor` | `16` | 以上下文除以此值。 |
|
|
29
|
-
| `summaryOutputDivisor` | `2` | 以本次摘要输出硬上限除以此值。 |
|
|
30
|
-
| `summarySourceDivisor` | `2` | 以原文估算长度除以此值。 |
|
|
31
|
-
| `summaryPromptTemplate` | 上方英文模板 | 替换 `{target}` 后附加的补充内容。 |
|
|
25
|
+
插件直接复用这个连接,无需另外复制 API key。
|
|
32
26
|
|
|
33
|
-
|
|
27
|
+
### 2. 安装插件
|
|
34
28
|
|
|
35
|
-
|
|
29
|
+
在 DSH 插件管理器选择**添加插件**,输入:
|
|
36
30
|
|
|
37
31
|
```text
|
|
38
|
-
|
|
39
|
-
目标 = floor(min(上下文 / summaryContextDivisor,
|
|
40
|
-
本次摘要实际 maxTokens / summaryOutputDivisor,
|
|
41
|
-
待替换内容的估算 tokens / summarySourceDivisor))
|
|
32
|
+
dsh-strata-sync
|
|
42
33
|
```
|
|
43
34
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
保存这些控件只修改插件偏好,不会同步模型预算或修改 Strata Server 设置。DSH 原生提示词、八个章节和请求参数保持不变。默认补充内容只有一句,自定义模板则按输入内容附加。目标是写作指令,**不是新的输出硬上限,也不能保证不截断**;不增加重试流程或额外推理请求。
|
|
47
|
-
|
|
48
|
-
无法确认路由或信息、原生提示词格式未知、附件用量无法估算、模板无效、请求取消、功能关闭或目标低于 256 tokens 时,保留原生请求。移除插件会停止附加内容,不改写已保存的对话历史。
|
|
49
|
-
|
|
50
|
-
### 模型能力自动同步(0.4.0)
|
|
51
|
-
|
|
52
|
-
预览新增“输入类型”“推理等级”和“推理请求映射”,与 token 预算共用备份、回滚及空闲时才应用的保护。
|
|
53
|
-
|
|
54
|
-
- 输入类型按服务器明确报告的 `architecture.input_modalities` 设置为文本或文本+图片;缺少信息或格式不支持时保留原值。
|
|
55
|
-
- 推理等级从 `/props?model=...` 核对 Strata 身份、模型身份及已审查的对话模板指纹,不只凭名称猜测。
|
|
56
|
-
- 已验证的 Qwen3.8-Flash-Next:**off/low/medium/xhigh**;DeepSeek-V4.1-Flash:**off/low/high/max**。包含已核对的 Huihui 版本,以模板而非量化名称判定。
|
|
57
|
-
- 使用 DSH 原生请求映射,同时设置是否思考及推理等级。模板未知或无法获取 props 时,保留原推理设置并显示原因。
|
|
58
|
-
- 不修改提供方默认等级或当前对话选择。提供方默认值与已验证选项冲突时,跳过推理同步并提示。同步后请开启新对话。
|
|
59
|
-
|
|
60
|
-
详见[能力验证与映射表](https://github.com/ethan741205/dsh-strata-sync/blob/main/docs/CAPABILITIES.md)。不新增其他插件、不修改 Strata 设置。
|
|
61
|
-
|
|
62
|
-
### 已有同步功能
|
|
63
|
-
|
|
64
|
-
- 读取 `/v1/models` 和可用的 `/slots`,确认文本模型的正式 ID 和引擎实际上下文,不从模型名称猜测。已确认的别名视为同一模型,图片生成端点不计入文本模型选择。
|
|
65
|
-
- 更新选定 DSH 模型的上下文、输出上限,以及已启用 Agent 预设中的原生 `compaction-basic` 策略;预览会列出受影响的预设。
|
|
66
|
-
- 默认使用“跟随 Strata”选择输出上限;手动覆盖放在“高级设置”。分别显示服务器原值、实际采用值与来源,也可选择让默认模型跟随服务器。
|
|
67
|
-
- 自动同步默认关闭;在启动前启用后,每次 DSH 宿主进程启动、所有任务空闲时同步一次。查询途中开始任务时保留待同步状态,任务完成后补做;成功后不再定期查询。其他错误需手动重试或下次启动再试。运行期间启用会在下次启动生效;立即同步请点击“备份并同步”。
|
|
68
|
-
- 应用前重新确认服务器与同一份设置版本、拒绝过期预览、备份设置;后续写入失败时回滚已完成的更改。偏好保存也会核对版本;未编辑的表单跟随最新值,已有编辑时提示冲突,避免覆盖其他窗口的更改。
|
|
69
|
-
- 同步完成后保留只读结果,包含模型、预算、输出来源及备份信息,并区分已确认与保留原值的能力。
|
|
70
|
-
- 沿用 DSH 现有认证,不在页面或诊断中显示密钥,不跟随 HTTP 重定向。
|
|
71
|
-
|
|
72
|
-
**同步模型或预算设置后请开启新对话。** 已有对话保留原模型路由与 Agent 预设版本;插件不改写已有对话、不重启 DSH,也不增加额外推理请求。新版插件启用期间,动态摘要引导会作用于支持的摘要请求,不需要修改这些已保存设置。
|
|
73
|
-
|
|
74
|
-
## 安装与使用
|
|
75
|
-
|
|
76
|
-
包名为 `dsh-strata-sync`(原名 `@ethan741205/dsh-strata-sync`);迁移时保留原设置,移除旧 scoped 插件后再安装新包,避免同时加载两份。
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
如需安装已有的 npm 版本,先完成任务并完全退出 DSH Desktop,再使用官方 DSH CLI 从 npm 官方 registry 安装:
|
|
35
|
+
也可以先完成当前任务、完全退出 DSH Desktop,再使用官方 CLI:
|
|
80
36
|
|
|
81
37
|
```sh
|
|
82
38
|
dsh plugin --profile desktop add dsh-strata-sync --registry=https://registry.npmjs.org/
|
|
83
39
|
```
|
|
84
40
|
|
|
85
|
-
|
|
41
|
+
如设置页尚未出现,请重新打开 DSH。若插件处于禁用状态,请在插件管理器启用。
|
|
86
42
|
|
|
87
|
-
|
|
43
|
+
### 3. 预览并同步
|
|
88
44
|
|
|
89
|
-
|
|
90
|
-
git clone https://github.com/ethan741205/dsh-strata-sync.git
|
|
91
|
-
cd dsh-strata-sync
|
|
92
|
-
npm ci
|
|
93
|
-
npm test
|
|
94
|
-
npm pack
|
|
95
|
-
dsh plugin --profile desktop add ./dsh-strata-sync-0.10.1.tgz
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
执行最后一行前同样需要完全退出 DSH Desktop,安装完成后重新打开。在其他目录执行时,请使用安装包的绝对路径。
|
|
45
|
+
打开**设置 → dsh-strata-sync**:
|
|
99
46
|
|
|
100
|
-
|
|
47
|
+
1. 选择 Strata 提供方,点击**保存偏好**。
|
|
48
|
+
2. 点击**检查差异**,查看已加载模型与拟修改的设置。
|
|
49
|
+
3. 在 DSH 空闲时,点击**备份并同步**。
|
|
50
|
+
4. **开启新对话**,使用更新后的模型与 Agent 预设。
|
|
101
51
|
|
|
102
|
-
|
|
103
|
-
2. 点击“检查差异”,预览当前加载模型与建议设置。
|
|
104
|
-
3. DSH 空闲时点击“备份并同步”。
|
|
105
|
-
4. 如需自动同步,勾选“启动 DSH 时自动同步”并保存,下次启动生效。原有 `autoSync: true` 会沿用为启动同步。
|
|
106
|
-
5. 开启新对话,使用更新后的 Agent 预设。
|
|
52
|
+
已有对话会保留原先选定的模型路由和预设版本。如需自动设置,可勾选**启动 DSH 时自动同步**并保存。此选项默认关闭,下次启动才生效;会等待空闲,不会持续轮询。
|
|
107
53
|
|
|
108
|
-
|
|
54
|
+
## 模型与输出设置
|
|
109
55
|
|
|
110
|
-
|
|
56
|
+
| 设置 | 如何决定 |
|
|
57
|
+
|---|---|
|
|
58
|
+
| 模型与上下文 | 采用 Strata 已加载的文本模型及已确认的上下文容量。 |
|
|
59
|
+
| 回复输出上限 | 优先使用手动覆盖值;否则采用已确认的 Strata 输出默认值。无法取得或未限制时,使用上下文的 30%,最多 16,384 tokens。 |
|
|
60
|
+
| 输入类型 | 采用服务器已确认的能力,例如文本或文本+图片。 |
|
|
61
|
+
| 推理等级 | 根据已验证的模型模板确定;未知模板保留原有设置。 |
|
|
62
|
+
| 默认模型 | 启用**默认模型跟随 Strata 已加载的模型**时,跟随服务器当前模型。 |
|
|
111
63
|
|
|
112
|
-
|
|
64
|
+
保持**输出上限跟随 Strata**开启,即可自动选择。关闭后可在**高级设置**输入手动覆盖值。预览会分别显示服务器默认值、实际应用值及其来源。
|
|
113
65
|
|
|
114
|
-
|
|
66
|
+
同步时,插件将摘要输出上限和压缩预留空间均设为 4,096 tokens。实际压缩阈值取**上下文的 80%**与**上下文 − 回复输出预算 − 4,096**中的较小值,近期内容保留量为 **(上下文 − 回复输出预算)× 16%**,向下取整。这些是插件计算的客户端预算,并非 Strata 提供的设置。
|
|
115
67
|
|
|
116
|
-
|
|
68
|
+
例如,采用自动输出计算时,32K 上下文的回复预算为 9,830 tokens,压缩阈值为 18,842 tokens,**不一定在 80% 时压缩**。
|
|
117
69
|
|
|
118
|
-
|
|
70
|
+
## 摘要提示词与目标长度
|
|
119
71
|
|
|
120
|
-
|
|
72
|
+
**动态摘要目标**默认开启,在 DSH 原生摘要指令后补充要求;关闭后仍保留原生摘要与压缩行为。
|
|
121
73
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
Strata 通过 `/props?model=...` 的 `default_generation_settings.params.n_predict` 提供共享 `max_tokens` 默认值,以及模型与上下文信息。这不是模型硬性上限,客户端明确指定的请求值会覆盖它。Strata **不提供 DSH 压缩策略**。以下是此插件的客户端策略,配合 DSH 0.2.1-rc.3 原生 4,096-token 上下文安全余量:
|
|
74
|
+
可编辑的**摘要补充提示词**默认内容为:
|
|
125
75
|
|
|
126
76
|
```text
|
|
127
|
-
|
|
128
|
-
备用输出 = min(16384, floor(上下文 × 0.30))
|
|
129
|
-
压缩余量 = 4096
|
|
130
|
-
摘要 maxTokens = 4096
|
|
131
|
-
thresholdRatio = 0.8
|
|
132
|
-
retainRatio = 0.16
|
|
133
|
-
实际压缩阈值 = floor(min(上下文 × 0.8, 上下文 − 普通输出 − 4096))
|
|
134
|
-
近期对话保留量 = floor((上下文 − 普通输出) × 0.16)
|
|
77
|
+
Keep the entire checkpoint, including all required headings, within a target of {target} tokens by retaining only information essential to continue the remaining work, consolidating prior summaries, and removing redundant or obsolete details.
|
|
135
78
|
```
|
|
136
79
|
|
|
137
|
-
|
|
80
|
+
请保留 `{target}`,每次支持的摘要请求前,它会替换成计算出的 token 目标。模板最多 2,048 个字符。点击**恢复默认提示词**可重置内容,再点击**保存偏好**应用修改。
|
|
138
81
|
|
|
139
|
-
|
|
82
|
+
展开**计算方式与限制**,可以调整其余比例:
|
|
140
83
|
|
|
141
|
-
|
|
|
142
|
-
|
|
143
|
-
|
|
|
144
|
-
|
|
|
84
|
+
| 除数 | 默认值 | 将目标限制为 |
|
|
85
|
+
|---|---:|---|
|
|
86
|
+
| 上下文(N) | 16 | 上下文 ÷ N |
|
|
87
|
+
| 摘要输出(O) | 2 | 本次摘要实际输出上限 ÷ O |
|
|
88
|
+
| 原文长度(S) | 2 | 待摘要内容的估算长度 ÷ S |
|
|
89
|
+
|
|
90
|
+
目标取三项结果的最小值,再向下取整。所有除数均支持大于或等于 1 的小数。增加除数会降低对应上限,但最终目标仍可能由另一项上限决定。上下文取已确认的服务器与客户端窗口中较小者,原文估算不包含系统提示词和工具定义。
|
|
145
91
|
|
|
146
|
-
|
|
92
|
+
32K 上下文、摘要上限为 4,096 tokens 且原文足够长时,默认目标为 **2,048 tokens**。这是写作指令,**不是输出硬上限,也不能保证不截断**。界面预览的是目标上限,实际请求的目标可能更小。
|
|
147
93
|
|
|
148
|
-
|
|
94
|
+
保存摘要偏好不会改变模型预算,也不会替换原生提示词或增加额外推理、重试循环。无法验证请求、无法安全估算内容,或目标小于 256 tokens 时,会沿用原本的摘要请求。
|
|
149
95
|
|
|
150
|
-
##
|
|
96
|
+
## 备份与兼容性
|
|
151
97
|
|
|
152
|
-
|
|
98
|
+
写入设置前,会将 `cordis.patch.yml` 备份到配置目录下的 `backups/strata-sync/`。同步会检查是否有并发修改,并在后续步骤失败时尝试回滚已完成的更改。备份可能包含私人配置,请保存在本机。
|
|
153
99
|
|
|
154
|
-
|
|
100
|
+
移除插件不会撤销已经同步的设置。如需恢复备份,请先完全退出 DSH。
|
|
155
101
|
|
|
156
|
-
|
|
102
|
+
已在 **DSH Desktop 0.2.1-rc.3** 上验证。请使用 API key 或无需认证的 OpenAI 兼容提供方,明确配置自定义模型列表,并启用包含 `compaction-basic` 的 Agent 预设。不支持小于 8,192 tokens 的上下文、仅使用模型目录的提供方、非空的 `modelOverrides`,或无法明确判断已加载模型的信息。
|
|
157
103
|
|
|
158
|
-
|
|
104
|
+
技术细节与测试范围请见[已验证能力与推理映射](https://github.com/ethan741205/dsh-strata-sync/blob/main/docs/CAPABILITIES.md)及[验证记录](https://github.com/ethan741205/dsh-strata-sync/blob/main/docs/VALIDATION.md)。
|
|
159
105
|
|
|
160
|
-
|
|
106
|
+
## 开发
|
|
161
107
|
|
|
162
|
-
|
|
108
|
+
需要 Node.js 22 或更新版本。
|
|
163
109
|
|
|
164
|
-
|
|
110
|
+
```sh
|
|
111
|
+
git clone https://github.com/ethan741205/dsh-strata-sync.git
|
|
112
|
+
cd dsh-strata-sync
|
|
113
|
+
npm ci
|
|
114
|
+
npm test
|
|
115
|
+
npm run build
|
|
116
|
+
npm pack
|
|
117
|
+
```
|
|
165
118
|
|
|
166
|
-
|
|
119
|
+
安装自行构建的版本前,请完全退出 DSH,再执行 `dsh plugin --profile desktop add <path-to-generated.tgz>`。
|
|
167
120
|
|
|
168
|
-
|
|
121
|
+
源码:`src/plugin.mjs`(宿主整合)、`src/core.mjs`(信息读取与预算)、`src/summary.mjs`(摘要引导)、`src/client.js`(设置界面)。
|
|
169
122
|
|
|
170
|
-
MIT
|
|
123
|
+
[npm](https://www.npmjs.com/package/dsh-strata-sync) · [反馈问题](https://github.com/ethan741205/dsh-strata-sync/issues) · [MIT 许可证](https://github.com/ethan741205/dsh-strata-sync/blob/main/LICENSE)
|
package/docs/README.zh-TW.md
CHANGED
|
@@ -2,169 +2,122 @@
|
|
|
2
2
|
|
|
3
3
|
[English](https://github.com/ethan741205/dsh-strata-sync/blob/main/README.md) · [简体中文](https://github.com/ethan741205/dsh-strata-sync/blob/main/docs/README.zh-CN.md) · **繁體中文**
|
|
4
4
|
|
|
5
|
-
讓 **DeepSeek Harness(DSH)**
|
|
5
|
+
讓 **DeepSeek Harness(DSH)** 連接 **Strata Server** 目前載入的模型,在同一個 DSH 設定頁管理模型配置與摘要控制。
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
外掛讀取 Strata 的模型資訊、預覽差異,再更新 DSH 自訂模型與上下文壓縮預算。它也會為支援的摘要請求補充可編輯的長度指令,幫助模型產生精簡的摘要。
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## 可以做什麼
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
- **同步模型設定:**上下文視窗、回覆輸出上限,以及已確認的輸入類型和推理等級。
|
|
12
|
+
- **對齊壓縮預算:**更新已啟用的 DSH Agent 預設中,對應模型的壓縮政策。
|
|
13
|
+
- **控制摘要長度:**編輯補充提示詞,調整三項目標長度比例。
|
|
14
|
+
- **啟動時同步:**可選擇在 DSH 啟動並閒置後同步一次。
|
|
15
|
+
- **預覽與復原:**檢查差異、備份設定,並查看最近一次同步結果。
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
外掛僅以唯讀方式存取 Strata Server。同步不會切換或載入伺服器模型、修改伺服器設定,也不會傳送測試推論請求。無法確認的模型能力會保留 DSH 原有值。
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
## 開始使用
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
### 1. 準備連線
|
|
18
22
|
|
|
19
|
-
|
|
20
|
-
Keep the entire checkpoint, including all required headings, within a target of {target} tokens by retaining only information essential to continue the remaining work, consolidating prior summaries, and removing redundant or obsolete details.
|
|
21
|
-
```
|
|
23
|
+
先在 Strata Server 載入模型,再到 **DSH → 設定 → 模型**,設定相容 OpenAI 的提供者、API 網址與認證,並明確新增自訂模型項目。
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
| 外掛偏好 | 預設值 | 含義 |
|
|
26
|
-
|---|---:|---|
|
|
27
|
-
| `summaryGuidance` | `true` | 對支援的摘要請求附加補充提示詞。 |
|
|
28
|
-
| `summaryContextDivisor` | `16` | 以上下文除以此值。 |
|
|
29
|
-
| `summaryOutputDivisor` | `2` | 以當次摘要輸出硬上限除以此值。 |
|
|
30
|
-
| `summarySourceDivisor` | `2` | 以原文估算長度除以此值。 |
|
|
31
|
-
| `summaryPromptTemplate` | 上方英文範本 | 替換 `{target}` 後附加的補充內容。 |
|
|
25
|
+
外掛直接沿用這個連線,不必另外複製 API key。
|
|
32
26
|
|
|
33
|
-
|
|
27
|
+
### 2. 安裝外掛
|
|
34
28
|
|
|
35
|
-
|
|
29
|
+
在 DSH 外掛管理員選擇**新增外掛**,輸入:
|
|
36
30
|
|
|
37
31
|
```text
|
|
38
|
-
|
|
39
|
-
目標 = floor(min(上下文 / summaryContextDivisor,
|
|
40
|
-
本次摘要實際 maxTokens / summaryOutputDivisor,
|
|
41
|
-
待替換內容的估算 tokens / summarySourceDivisor))
|
|
32
|
+
dsh-strata-sync
|
|
42
33
|
```
|
|
43
34
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
儲存這些控制項只更改外掛偏好,不會同步模型預算或修改 Strata Server 設定。DSH 原生提示詞、八個章節和請求參數保持不變。預設補充內容只有一句,自訂範本則按輸入內容附加。目標是寫作指令,**不是新的輸出硬上限,也不能保證不截斷**;不增加重試流程或額外推論請求。
|
|
47
|
-
|
|
48
|
-
無法確認路由或資訊、原生提示詞格式未知、附件用量無法估算、範本無效、請求取消、功能關閉或目標低於 256 tokens 時,保留原生請求。移除外掛會停止附加內容,不重寫已儲存的對話歷史。
|
|
49
|
-
|
|
50
|
-
### 模型能力自動同步(0.4.0)
|
|
51
|
-
|
|
52
|
-
預覽新增「輸入類型」、「推理等級」和「推理請求對應」,與 token 預算共用備份、回復及閒置才套用的保護。
|
|
53
|
-
|
|
54
|
-
- 輸入類型依伺服器明確回報的 `architecture.input_modalities` 設定為文字或文字+圖片;缺少資訊或格式不支援時保留原值。
|
|
55
|
-
- 推理等級從 `/props?model=...` 核對 Strata 身分、模型身分及已審查的對話範本指紋,不單憑名稱猜測。
|
|
56
|
-
- 已驗證的 Qwen3.8-Flash-Next:**off/low/medium/xhigh**;DeepSeek-V4.1-Flash:**off/low/high/max**。包含已核對的 Huihui 版本,以範本而非量化名稱判定。
|
|
57
|
-
- 使用 DSH 原生請求對應,同時設定是否思考及推理等級。範本未知或無法取得 props 時,保留原推理設定並顯示原因。
|
|
58
|
-
- 不修改供應者預設等級或目前對話選擇。供應者預設值與已驗證選項衝突時,跳過推理同步並提示。同步後請開新對話。
|
|
59
|
-
|
|
60
|
-
詳見[能力驗證與對應表](https://github.com/ethan741205/dsh-strata-sync/blob/main/docs/CAPABILITIES.md)。不新增其他外掛、不修改 Strata 設定。
|
|
61
|
-
|
|
62
|
-
### 既有同步功能
|
|
63
|
-
|
|
64
|
-
- 讀取 `/v1/models` 與可用的 `/slots`,確認文字模型的正式 ID 和引擎實際上下文,不從模型名稱猜測。已確認的別名視為同一模型,圖片生成端點不列入文字模型選擇。
|
|
65
|
-
- 更新選定 DSH 模型的上下文、輸出上限,以及已啟用 Agent 範本中的原生 `compaction-basic` 策略;預覽會列出受影響的範本。
|
|
66
|
-
- 預設使用「跟隨 Strata」選擇輸出上限;手動覆寫放在「進階設定」。分開顯示伺服器原值、實際採用值與來源,也可選擇讓預設模型跟隨伺服器。
|
|
67
|
-
- 自動同步預設關閉;在啟動前啟用後,每次 DSH 宿主程序啟動、所有工作閒置時同步一次。查詢途中開始工作時保留待同步狀態,工作完成後補做;成功後不再定期查詢。其他錯誤需手動重試或下次啟動再試。執行期間啟用會在下次啟動生效;立即同步請按「備份並同步」。
|
|
68
|
-
- 套用前重新確認伺服器與同一份設定版本、拒絕過期預覽、備份設定;後續寫入失敗時回復已完成的變更。偏好儲存也會核對版本;未編輯的表單跟隨最新值,已有編輯時提示衝突,避免覆蓋其他視窗的變更。
|
|
69
|
-
- 同步完成後保留唯讀結果,包含模型、預算、輸出來源及備份資訊,並區分已確認與保留原值的能力。
|
|
70
|
-
- 沿用 DSH 現有認證,不在頁面或診斷中顯示金鑰,不跟隨 HTTP 重新導向。
|
|
71
|
-
|
|
72
|
-
**同步模型或預算設定後請開新對話。** 既有對話保留原模型路由與 Agent 範本版本;外掛不重寫既有對話、不重啟 DSH,也不增加額外推論請求。新版外掛啟用期間,動態摘要引導會作用於支援的摘要請求,不需要修改這些已儲存設定。
|
|
73
|
-
|
|
74
|
-
## 安裝與使用
|
|
75
|
-
|
|
76
|
-
套件名稱為 `dsh-strata-sync`(原名 `@ethan741205/dsh-strata-sync`);遷移時保留原設定,移除舊 scoped 插件後再安裝新套件,避免同時載入兩份。
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
若要安裝既有的 npm 版本,先完成工作並完全結束 DSH Desktop,再使用官方 DSH CLI 從 npm 官方 registry 安裝:
|
|
35
|
+
也可以先完成目前工作、完全結束 DSH Desktop,再使用官方 CLI:
|
|
80
36
|
|
|
81
37
|
```sh
|
|
82
38
|
dsh plugin --profile desktop add dsh-strata-sync --registry=https://registry.npmjs.org/
|
|
83
39
|
```
|
|
84
40
|
|
|
85
|
-
|
|
41
|
+
若設定頁尚未出現,請重新開啟 DSH。若外掛處於停用狀態,請在外掛管理員啟用。
|
|
86
42
|
|
|
87
|
-
|
|
43
|
+
### 3. 預覽並同步
|
|
88
44
|
|
|
89
|
-
|
|
90
|
-
git clone https://github.com/ethan741205/dsh-strata-sync.git
|
|
91
|
-
cd dsh-strata-sync
|
|
92
|
-
npm ci
|
|
93
|
-
npm test
|
|
94
|
-
npm pack
|
|
95
|
-
dsh plugin --profile desktop add ./dsh-strata-sync-0.10.1.tgz
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
執行最後一行前同樣需要完全結束 DSH Desktop,安裝完成後重新開啟。在其他目錄執行時,請使用套件的絕對路徑。
|
|
45
|
+
開啟**設定 → dsh-strata-sync**:
|
|
99
46
|
|
|
100
|
-
|
|
47
|
+
1. 選擇 Strata 提供方,點選**儲存偏好**。
|
|
48
|
+
2. 點選**檢查差異**,查看已載入模型與預計修改的設定。
|
|
49
|
+
3. 在 DSH 閒置時,點選**備份並同步**。
|
|
50
|
+
4. **開啟新對話**,使用更新後的模型與 Agent 預設。
|
|
101
51
|
|
|
102
|
-
|
|
103
|
-
2. 按「檢查差異」,預覽目前載入模型與建議設定。
|
|
104
|
-
3. DSH 閒置時按「備份並同步」。
|
|
105
|
-
4. 如需自動同步,勾選「啟動 DSH 時自動同步」並儲存,下次啟動生效。原有 `autoSync: true` 會沿用為啟動同步。
|
|
106
|
-
5. 開啟新對話,使用更新後的 Agent 範本。
|
|
52
|
+
既有對話會保留原先選定的模型路由和預設版本。如需自動設定,可勾選**啟動 DSH 時自動同步**並儲存。此選項預設關閉,下次啟動才生效;會等待閒置,不會持續輪詢。
|
|
107
53
|
|
|
108
|
-
|
|
54
|
+
## 模型與輸出設定
|
|
109
55
|
|
|
110
|
-
|
|
56
|
+
| 設定 | 如何決定 |
|
|
57
|
+
|---|---|
|
|
58
|
+
| 模型與上下文 | 採用 Strata 已載入的文字模型及已確認的上下文容量。 |
|
|
59
|
+
| 回覆輸出上限 | 優先使用手動覆寫值;否則採用已確認的 Strata 輸出預設值。無法取得或未限制時,使用上下文的 30%,最多 16,384 tokens。 |
|
|
60
|
+
| 輸入類型 | 採用伺服器已確認的能力,例如文字或文字+圖片。 |
|
|
61
|
+
| 推理等級 | 依已驗證的模型範本決定;未知範本保留原有設定。 |
|
|
62
|
+
| 預設模型 | 啟用**預設模型跟隨 Strata 已載入的模型**時,跟隨伺服器目前模型。 |
|
|
111
63
|
|
|
112
|
-
|
|
64
|
+
保持**輸出上限跟隨 Strata**開啟,即可自動選擇。關閉後可在**進階設定**輸入手動覆寫值。預覽會分別顯示伺服器預設值、實際套用值及其來源。
|
|
113
65
|
|
|
114
|
-
|
|
66
|
+
同步時,外掛將摘要輸出上限和壓縮預留空間均設為 4,096 tokens。實際壓縮門檻取**上下文的 80%**與**上下文 − 回覆輸出預算 − 4,096**中的較小值,近期內容保留量為 **(上下文 − 回覆輸出預算)× 16%**,向下取整。這些是外掛計算的客戶端預算,並非 Strata 提供的設定。
|
|
115
67
|
|
|
116
|
-
|
|
68
|
+
例如,採用自動輸出計算時,32K 上下文的回覆預算為 9,830 tokens,壓縮門檻為 18,842 tokens,**不一定在 80% 時壓縮**。
|
|
117
69
|
|
|
118
|
-
|
|
70
|
+
## 摘要提示詞與目標長度
|
|
119
71
|
|
|
120
|
-
|
|
72
|
+
**動態摘要目標**預設開啟,在 DSH 原生摘要指令後補充要求;關閉後仍保留原生摘要與壓縮行為。
|
|
121
73
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
Strata 透過 `/props?model=...` 的 `default_generation_settings.params.n_predict` 提供共用 `max_tokens` 預設值,以及模型與上下文資訊。這不是模型硬性上限,客戶端明確指定的請求值會覆寫它。Strata **不提供 DSH 壓縮策略**。下列是此外掛的用戶端策略,配合 DSH 0.2.1-rc.3 原生 4,096-token 上下文安全餘裕:
|
|
74
|
+
可編輯的**摘要補充提示詞**預設內容為:
|
|
125
75
|
|
|
126
76
|
```text
|
|
127
|
-
|
|
128
|
-
備用輸出 = min(16384, floor(上下文 × 0.30))
|
|
129
|
-
壓縮餘裕 = 4096
|
|
130
|
-
摘要 maxTokens = 4096
|
|
131
|
-
thresholdRatio = 0.8
|
|
132
|
-
retainRatio = 0.16
|
|
133
|
-
實際壓縮門檻 = floor(min(上下文 × 0.8, 上下文 − 一般輸出 − 4096))
|
|
134
|
-
近期對話保留量 = floor((上下文 − 一般輸出) × 0.16)
|
|
77
|
+
Keep the entire checkpoint, including all required headings, within a target of {target} tokens by retaining only information essential to continue the remaining work, consolidating prior summaries, and removing redundant or obsolete details.
|
|
135
78
|
```
|
|
136
79
|
|
|
137
|
-
|
|
80
|
+
請保留 `{target}`,每次支援的摘要請求前,它會替換成計算出的 token 目標。範本最多 2,048 個字元。點選**還原預設提示詞**可重設內容,再點選**儲存偏好**套用修改。
|
|
138
81
|
|
|
139
|
-
|
|
82
|
+
展開**計算方式與限制**,可以調整其餘比例:
|
|
140
83
|
|
|
141
|
-
|
|
|
142
|
-
|
|
143
|
-
|
|
|
144
|
-
|
|
|
84
|
+
| 除數 | 預設值 | 將目標限制為 |
|
|
85
|
+
|---|---:|---|
|
|
86
|
+
| 上下文(N) | 16 | 上下文 ÷ N |
|
|
87
|
+
| 摘要輸出(O) | 2 | 本次摘要實際輸出上限 ÷ O |
|
|
88
|
+
| 原文長度(S) | 2 | 待摘要內容的估算長度 ÷ S |
|
|
89
|
+
|
|
90
|
+
目標取三項結果的最小值,再向下取整。所有除數均支援大於或等於 1 的小數。增加除數會降低對應上限,但最終目標仍可能由另一項上限決定。上下文取已確認的伺服器與客戶端視窗中較小者,原文估算不包含系統提示詞和工具定義。
|
|
145
91
|
|
|
146
|
-
|
|
92
|
+
32K 上下文、摘要上限為 4,096 tokens 且原文足夠長時,預設目標為 **2,048 tokens**。這是寫作指令,**不是輸出硬上限,也不能保證不截斷**。介面預覽的是目標上限,實際請求的目標可能更小。
|
|
147
93
|
|
|
148
|
-
|
|
94
|
+
儲存摘要偏好不會改變模型預算,也不會替換原生提示詞或增加額外推論、重試循環。無法驗證請求、無法安全估算內容,或目標小於 256 tokens 時,會沿用原本的摘要請求。
|
|
149
95
|
|
|
150
|
-
##
|
|
96
|
+
## 備份與相容性
|
|
151
97
|
|
|
152
|
-
|
|
98
|
+
寫入設定前,會將 `cordis.patch.yml` 備份至設定目錄下的 `backups/strata-sync/`。同步會檢查是否有並行修改,並在後續步驟失敗時嘗試回復已完成的變更。備份可能包含私人設定,請儲存在本機。
|
|
153
99
|
|
|
154
|
-
|
|
100
|
+
移除外掛不會撤銷已經同步的設定。如需還原備份,請先完全結束 DSH。
|
|
155
101
|
|
|
156
|
-
|
|
102
|
+
已在 **DSH Desktop 0.2.1-rc.3** 上驗證。請使用 API key 或不需認證的 OpenAI 相容提供者,明確設定自訂模型清單,並啟用包含 `compaction-basic` 的 Agent 預設。不支援小於 8,192 tokens 的上下文、僅使用模型目錄的提供者、非空的 `modelOverrides`,或無法明確判斷已載入模型的資訊。
|
|
157
103
|
|
|
158
|
-
|
|
104
|
+
技術細節與測試範圍請見[已驗證能力與推理對應](https://github.com/ethan741205/dsh-strata-sync/blob/main/docs/CAPABILITIES.md)及[驗證紀錄](https://github.com/ethan741205/dsh-strata-sync/blob/main/docs/VALIDATION.md)。
|
|
159
105
|
|
|
160
|
-
|
|
106
|
+
## 開發
|
|
161
107
|
|
|
162
|
-
|
|
108
|
+
需要 Node.js 22 或更新版本。
|
|
163
109
|
|
|
164
|
-
|
|
110
|
+
```sh
|
|
111
|
+
git clone https://github.com/ethan741205/dsh-strata-sync.git
|
|
112
|
+
cd dsh-strata-sync
|
|
113
|
+
npm ci
|
|
114
|
+
npm test
|
|
115
|
+
npm run build
|
|
116
|
+
npm pack
|
|
117
|
+
```
|
|
165
118
|
|
|
166
|
-
|
|
119
|
+
安裝自行建置的版本前,請完全結束 DSH,再執行 `dsh plugin --profile desktop add <path-to-generated.tgz>`。
|
|
167
120
|
|
|
168
|
-
|
|
121
|
+
原始碼:`src/plugin.mjs`(宿主整合)、`src/core.mjs`(資訊讀取與預算)、`src/summary.mjs`(摘要引導)、`src/client.js`(設定介面)。
|
|
169
122
|
|
|
170
|
-
MIT
|
|
123
|
+
[npm](https://www.npmjs.com/package/dsh-strata-sync) · [回報問題](https://github.com/ethan741205/dsh-strata-sync/issues) · [MIT 授權](https://github.com/ethan741205/dsh-strata-sync/blob/main/LICENSE)
|