dsh-more 0.0.1 → 0.0.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/CONTRIBUTING.md +6 -6
- package/README.md +21 -9
- package/README.zh-CN.md +21 -9
- package/dist/client.js +1232 -174
- package/dist/index.js +451 -25
- package/dist/types/generated/host-settings-schema.d.ts +6 -0
- package/dist/types/generated/patch-catalog.d.ts +24 -0
- package/dist/types/patches/conversation-markdown-export/client/filename.d.ts +1 -0
- package/dist/types/patches/conversation-markdown-export/client/index.d.ts +2 -0
- package/dist/types/patches/conversation-markdown-export/host/index.d.ts +2 -0
- package/dist/types/patches/conversation-markdown-export/host/transcript.d.ts +9 -0
- package/dist/types/patches/conversation-markdown-export/shared.d.ts +5 -0
- package/dist/types/patches/conversation-quick-navigation/client/index.d.ts +22 -0
- package/dist/types/patches/conversation-quick-navigation/client/navigation.d.ts +26 -0
- package/dist/types/patches/conversation-quick-navigation/host/index.d.ts +2 -0
- package/dist/types/patches/conversation-quick-navigation/shared.d.ts +1 -0
- package/dist/types/patches/model-reasoning-efforts/client/index.d.ts +39 -0
- package/dist/types/patches/model-reasoning-efforts/host/index.d.ts +2 -0
- package/dist/types/patches/model-reasoning-efforts/host/validate.d.ts +13 -0
- package/dist/types/patches/model-reasoning-efforts/shared.d.ts +51 -0
- package/dist/types/patches/session-delete/host/session-deletion.d.ts +0 -1
- package/dist/types/platform/dsh/client/api.d.ts +2 -0
- package/dist/types/platform/dsh/client/message-targets.d.ts +13 -1
- package/dist/types/platform/dsh/client/styles.d.ts +1 -1
- package/dist/types/platform/dsh/host/continuation.d.ts +4 -0
- package/dist/types/platform/dsh/host/error.d.ts +1 -1
- package/dist/types/platform/dsh/host/wire.d.ts +7 -0
- package/dsh.plugin.json +12 -2
- package/package.json +7 -4
package/CONTRIBUTING.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
开发环境要求:
|
|
12
12
|
|
|
13
|
-
- Node.js
|
|
13
|
+
- Node.js `22.19.x` 或 `>= 24`;
|
|
14
14
|
- pnpm;
|
|
15
15
|
- 与项目当前依赖匹配的 DSH。本版本面向 DSH `0.1.0-rc.7`。
|
|
16
16
|
|
|
@@ -220,9 +220,9 @@ Standalone 规则:
|
|
|
220
220
|
2. Host 路由继续经过 loopback/trusted-host、same-origin 和自定义请求头检查;
|
|
221
221
|
3. 预览与提交分离,提交时重新校验会话 revision、目标和确认令牌;
|
|
222
222
|
4. 忙碌会话应拒绝操作,或先完成明确的 cancel、idle、flush、unload 流程;
|
|
223
|
-
5. 删除路径必须从 DSH
|
|
223
|
+
5. 删除路径必须从 DSH 返回的逐对象定位信息推导,只接受已知的逐会话 artifact 布局,不把本机路径返回 Client;
|
|
224
224
|
6. 禁止对宽泛目录、未解析变量或 glob 执行递归删除;
|
|
225
|
-
7.
|
|
225
|
+
7. 多步写入必须把可撤销副作用记录下来,并在后续步骤失败时执行补偿;不要用“尽量成功”的部分写入掩盖失败。
|
|
226
226
|
|
|
227
227
|
以下内容属于持久化协议,不应在普通重构中随意改名:
|
|
228
228
|
|
|
@@ -283,7 +283,7 @@ pnpm run package:check
|
|
|
283
283
|
|
|
284
284
|
- 当前分支已经设置 upstream,并与远端完全同步;
|
|
285
285
|
- 工作区没有未提交文件;
|
|
286
|
-
-
|
|
286
|
+
- 正式发布前已执行 `npm login --registry=https://registry.npmjs.org/`,且当前 npm 用户有权发布 `dsh-more`;dry-run 不要求 npm 登录;
|
|
287
287
|
- Git 远端允许推送当前分支和 `v<version>` tag。
|
|
288
288
|
|
|
289
289
|
先执行不产生任何版本、tag 或发布记录的预检:
|
|
@@ -301,7 +301,7 @@ pnpm release:minor # 0.0.1 -> 0.1.0
|
|
|
301
301
|
pnpm release:major # 0.0.1 -> 1.0.0
|
|
302
302
|
```
|
|
303
303
|
|
|
304
|
-
脚本会依次检查 Git/npm 状态,运行完整项目检查,自动修改 `package.json`
|
|
304
|
+
脚本会依次检查 Git/npm 状态,运行完整项目检查,自动修改 `package.json` 版本并通过 npm `version` 生命周期同步 `dsh.plugin.json`,随后创建 `chore(release): v<version>` 提交和同名 tag,发布到公共 npm registry,最后以一次原子 push 同时推送版本提交和 tag。首次发布时,若 npm 上还不存在这个包,`pnpm release` 会直接发布 `package.json` 中的当前版本并为当前提交创建 tag。
|
|
305
305
|
|
|
306
306
|
如果 npm 账户要求一次性验证码,可以使用:
|
|
307
307
|
|
|
@@ -319,7 +319,7 @@ pnpm run release -- --otp=123456
|
|
|
319
319
|
- 运行时由 DSH 提供的外部包放入 `peerDependencies`,并在 `devDependencies` 固定本地开发版本;
|
|
320
320
|
- Client bundle 真正产生外部 `require()` 时,将对应模块加入 `dsh.client.inject`;
|
|
321
321
|
- 只用于 TypeScript module augmentation、且不会出现在发布声明或运行时 bundle 中的包,可以仅作为开发依赖;
|
|
322
|
-
- 同步 `pnpm-lock.yaml
|
|
322
|
+
- 同步 `pnpm-lock.yaml`;本仓库不维护并行的 `package-lock.json`;
|
|
323
323
|
- 不要为了一个很小的 helper 引入大型依赖。
|
|
324
324
|
|
|
325
325
|
更新锁文件后再次运行完整检查,并在变更说明中写明依赖的用途。
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Practical, independently switchable patches for missing context and history cont
|
|
|
6
6
|
|
|
7
7
|
`dsh-more` integrates with the existing DSH interface instead of adding a separate management dashboard. Its current patch set can edit a user message and restart from that point, remove one message while preserving the surrounding context, and permanently delete a session while leaving native archive behavior intact.
|
|
8
8
|
|
|
9
|
-
> **Compatibility:**
|
|
9
|
+
> **Compatibility:** the current release targets DeepSeek Harness `0.1.0-rc.7` and requires Node.js `>= 24`. DSH is still a release candidate, so upgrades may require changes in the centralized adapter layer described below.
|
|
10
10
|
|
|
11
11
|
## Features
|
|
12
12
|
|
|
@@ -22,7 +22,7 @@ All three switches live under **Settings → Plugins → Plugin configuration
|
|
|
22
22
|
|
|
23
23
|
### Requirements
|
|
24
24
|
|
|
25
|
-
- Node.js `>=
|
|
25
|
+
- Node.js `>= 24`
|
|
26
26
|
- A working `dsh` CLI and a Web profile compatible with DSH `0.1.0-rc.7`
|
|
27
27
|
- Access to the npm registry that publishes `dsh-more`
|
|
28
28
|
|
|
@@ -105,9 +105,7 @@ Restart `dsh web` once more. Removing the package removes its UI and runtime pat
|
|
|
105
105
|
### Edit a user message and restart
|
|
106
106
|
|
|
107
107
|
1. Hover over a user message and choose **Edit and restart from here**.
|
|
108
|
-
2. Change the text and select **
|
|
109
|
-
3. Review how many turns will be discarded.
|
|
110
|
-
4. Confirm the edit.
|
|
108
|
+
2. Change the text and select **Edit and restart**. The change is applied directly without a second preview-and-confirm step.
|
|
111
109
|
|
|
112
110
|
The plugin cuts the durable log immediately before the selected message's owning turn, creates a child session with the same workspace, live preset composition, provider/model selection, and token limit, then sends the edited message as the next user input. The source session is archived, not physically deleted.
|
|
113
111
|
|
|
@@ -123,7 +121,7 @@ Deletion is implemented as context reconstruction, not as a tombstone placed in
|
|
|
123
121
|
|
|
124
122
|
Only the selected node is removed unless a tool call/result range must remain atomic. Editing is the operation that intentionally discards the selected turn and everything after it.
|
|
125
123
|
|
|
126
|
-
|
|
124
|
+
Editing performs its state check and preallocates the continuation inside the single submission; message deletion still shows a preview before confirmation. Both operations watch DSH's incremental `session-added` event while committing. As soon as the child appears, the client hands off directly instead of refreshing the list, passing through a blank view, and then reopening. A full refresh remains only as a compatibility fallback when the incremental event is missing.
|
|
127
125
|
|
|
128
126
|
### Permanently delete a session
|
|
129
127
|
|
|
@@ -133,6 +131,17 @@ After confirmation, DSH More cancels a running task, waits for idle, flushes the
|
|
|
133
131
|
|
|
134
132
|
> **Irreversible:** permanent deletion does not archive the session and does not move it into a DSH More trash directory.
|
|
135
133
|
|
|
134
|
+
### Configure model reasoning effort
|
|
135
|
+
|
|
136
|
+
Open **Settings → Models**, expand a provider with **Edit**, and every model entry in the model catalog carries its own **Thinking effort** button:
|
|
137
|
+
|
|
138
|
+
1. Click a model's **Thinking effort**; in the dialog, check the levels the model offers (off / minimal / low / medium / high / xhigh / max) and, for each enabled level, fill in the wire spelling sent to the gateway (defaults to the level name); `off` needs no wire value — "supported, send nothing".
|
|
139
|
+
2. Click **Save**. The change is written to `reasoningEfforts` under `llm-pi-ai.providers.<route>.models[]` in `settings.yaml`, and the composer's model picker immediately offers those levels.
|
|
140
|
+
|
|
141
|
+
You can also check **This model does not reason** (writes `reasoningEfforts: false`) or use **Clear** to drop the field and fall back to the installed catalog. Only `off` may leave its wire value empty, and at least one non-`off` level is required — the same rules the pi-ai adapter enforces when resolving a route. Invalid configurations are rejected before any write, so a bad save never corrupts `settings.yaml`.
|
|
142
|
+
|
|
143
|
+
**Auto-fill:** models added via **Fetch available models** carry no `reasoningEfforts`, which the adapter treats as non-reasoning. After the provider is saved, this patch auto-fills the default `{ low, medium, high }` onto any model that has no `reasoningEfforts`, so a freshly fetched model can think immediately. To keep a model non-reasoning, set it to `reasoningEfforts: false` (explicit `false` is never auto-filled). The default levels can then be tuned per model from the thinking-effort button.
|
|
144
|
+
|
|
136
145
|
## Architecture
|
|
137
146
|
|
|
138
147
|

|
|
@@ -166,14 +175,16 @@ The generator rejects missing entries, invalid or mismatched IDs, duplicate orde
|
|
|
166
175
|
|
|
167
176
|
The generic protocol is stable even as patches are added:
|
|
168
177
|
|
|
169
|
-
- mutation routes accept `POST` only, cap
|
|
178
|
+
- mutation routes accept `POST` with `application/json` only, cap bodies at 64 KiB, and require `x-dsh-more: 1`;
|
|
170
179
|
- the request authority must be loopback or an explicitly trusted host, cross-site requests are rejected, and a supplied `Origin` must match;
|
|
171
180
|
- disabled patches are rejected at the Host router even if an old Client still sends a request;
|
|
172
181
|
- all wire payloads start as `unknown` and are validated before use;
|
|
173
|
-
- message
|
|
182
|
+
- message-operation state checks receive five-minute HMAC confirmation tokens bound to the session, log revision, surface generation, selected nodes, operation, target, preallocated continuation session, and edited-content digest; editing performs the check and commit within one click, while message deletion retains its visible preview confirmation;
|
|
174
183
|
- commits re-read current state, reject stale previews, and require an idle Agent maintenance window;
|
|
184
|
+
- failed continuation publication detaches the preallocated child and disposes its Agent handle before returning the error;
|
|
185
|
+
- unexpected Host failures are logged with diagnostics while the browser receives a generic internal-error response instead of local paths or stack details;
|
|
175
186
|
- Host setup and Client DOM effects are independently disposable when a patch is disabled;
|
|
176
|
-
- physical deletion accepts only an absolute per-session `jsonl` location
|
|
187
|
+
- physical deletion accepts only an absolute per-session `jsonl` location with DSH's fixed transcript filename, unloads the live session, then deletes that exact session-owned directory; local paths are not returned to the Client.
|
|
177
188
|
|
|
178
189
|
## Design principles
|
|
179
190
|
|
|
@@ -203,6 +214,7 @@ Read [CONTRIBUTING.md](./CONTRIBUTING.md) before adding a patch. It documents th
|
|
|
203
214
|
|
|
204
215
|
```sh
|
|
205
216
|
pnpm run generate # Validate manifests and rebuild src/generated/
|
|
217
|
+
pnpm run peers:check # Verify the locked peer-dependency graph
|
|
206
218
|
pnpm run typecheck # Generate, then run strict TypeScript checks
|
|
207
219
|
pnpm test # Generate, then run the Vitest suite
|
|
208
220
|
pnpm run build # Generate declarations plus Host and Client bundles
|
package/README.zh-CN.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
`dsh-more` 不创建平行的“管理中心”,而是把能力直接嵌入 DSH 现有界面。当前补丁可以编辑用户消息并从该处重新开始、在保留前后上下文的前提下删除单条消息,以及在不改变原生归档语义的情况下永久删除会话。
|
|
8
8
|
|
|
9
|
-
> **兼容性:**
|
|
9
|
+
> **兼容性:** 当前发布面向 DeepSeek Harness `0.1.0-rc.7`,要求 Node.js `>= 24`。DSH 仍是 RC 版本,升级后可能需要调整下文所述的集中适配层。
|
|
10
10
|
|
|
11
11
|
## 功能概览
|
|
12
12
|
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
### 环境要求
|
|
24
24
|
|
|
25
|
-
- Node.js `>=
|
|
25
|
+
- Node.js `>= 24`
|
|
26
26
|
- 可正常使用的 `dsh` CLI,以及与 DSH `0.1.0-rc.7` 兼容的 Web profile
|
|
27
27
|
- 能访问发布 `dsh-more` 的 npm registry
|
|
28
28
|
|
|
@@ -105,9 +105,7 @@ dsh plugin --profile web remove dsh-more
|
|
|
105
105
|
### 编辑用户消息并从这里重新开始
|
|
106
106
|
|
|
107
107
|
1. 把鼠标移到用户消息上,选择 **编辑并从这里重新开始**。
|
|
108
|
-
2. 修改文本并点击
|
|
109
|
-
3. 检查将丢弃的轮次数。
|
|
110
|
-
4. 确认编辑。
|
|
108
|
+
2. 修改文本并点击 **修改并重新开始**,修改会直接生效,不再显示二次预览确认。
|
|
111
109
|
|
|
112
110
|
插件会在所选消息所属轮次之前切断持久日志,创建继承相同 Workspace、源 Agent 当前 Preset composition、provider/model 和 token limit 的子会话,再把编辑后的消息作为下一条用户输入。源会话只会归档,不会物理删除。
|
|
113
111
|
|
|
@@ -123,7 +121,7 @@ dsh plugin --profile web remove dsh-more
|
|
|
123
121
|
|
|
124
122
|
除非工具调用与结果必须保持原子性,否则只删除用户点选的节点。会主动丢弃所选轮次及其后内容的是“编辑并重新开始”。
|
|
125
123
|
|
|
126
|
-
|
|
124
|
+
编辑会在单次提交内部完成状态检查并预分配延续会话;消息删除仍在确认前显示预览。两者都会在提交期间监听 DSH 的 `session-added` 增量事件;新会话一出现就直接完成交接,不再先刷新列表、短暂进入空白页再打开新会话。全量刷新只保留为增量事件缺失时的兼容兜底。
|
|
127
125
|
|
|
128
126
|
### 永久删除会话
|
|
129
127
|
|
|
@@ -133,6 +131,17 @@ dsh plugin --profile web remove dsh-more
|
|
|
133
131
|
|
|
134
132
|
> **不可恢复:** 永久删除不会归档会话,也不会把会话移入 DSH More 回收目录。
|
|
135
133
|
|
|
134
|
+
### 配置模型思考强度
|
|
135
|
+
|
|
136
|
+
打开 **设置 → 模型**,点击某个提供方的 **编辑** 展开「模型目录」,每个模型条目下都有一个 **思考强度** 按钮:
|
|
137
|
+
|
|
138
|
+
1. 点击模型的 **思考强度**,在弹窗中勾选该模型支持的级别(不思考 / 极简 / 低 / 中 / 高 / 极高 / 最高),并为每个开启的级别填写发送给网关的线上值(默认与级别同名);`不思考` 不需要线上值,表示“支持、但不发送任何参数”;
|
|
139
|
+
2. 点击 **保存**。修改会写入 `settings.yaml` 中 `llm-pi-ai.providers.<route>.models[].reasoningEfforts`,会话里的模型选择器随即按此提供级别。
|
|
140
|
+
|
|
141
|
+
也可以勾选 **该模型不支持思考**(写入 `reasoningEfforts: false`),或用 **清除配置** 移除该字段、回到内置目录的能力。只有 `off` 允许留空线上值,且必须至少声明一个非 `off` 的级别,与 pi-ai 适配器的解析规则一致;无效配置会在写入前被拒绝,不会破坏 `settings.yaml`。
|
|
142
|
+
|
|
143
|
+
**自动填充:** 通过 **获取可用模型** 添加的模型默认没有 `reasoningEfforts`,适配器会把它当作不思考。本补丁会在保存提供方后,为**没有任何 `reasoningEfforts` 的模型**自动填入默认思考强度 `{ low, medium, high }`,让新拉取的模型立刻可以思考;如需某个模型不思考,请把它设为 `reasoningEfforts: false`(显式 false 不会被自动填充)。默认级别可用每个模型条目下的思考强度按钮再微调。
|
|
144
|
+
|
|
136
145
|
## 架构
|
|
137
146
|
|
|
138
147
|

|
|
@@ -166,14 +175,16 @@ dsh plugin --profile web remove dsh-more
|
|
|
166
175
|
|
|
167
176
|
这套通用协议不会随补丁数量变化:
|
|
168
177
|
|
|
169
|
-
- 写接口只接受 `POST`,
|
|
178
|
+
- 写接口只接受 `POST` 与 `application/json`,body 上限为 64 KiB,并要求 `x-dsh-more: 1`;
|
|
170
179
|
- 请求 authority 必须是 loopback 或显式 trusted host;拒绝 cross-site;存在 `Origin` 时必须与 Host 匹配;
|
|
171
180
|
- 即使旧 Client 继续发请求,Host router 也会拒绝已关闭补丁;
|
|
172
181
|
- 所有线协议 payload 都从不可信 `unknown` 开始,先校验再使用;
|
|
173
|
-
-
|
|
182
|
+
- 消息操作的状态检查会获得五分钟 HMAC 确认令牌,绑定 Session、日志 revision、surface generation、选中节点、操作类型、目标、预分配的延续会话与编辑内容摘要;编辑在一次点击内完成检查与提交,消息删除则保留用户可见的预览确认;
|
|
174
183
|
- 提交阶段重新读取当前状态,过期或失配的预览会被拒绝,并要求 Agent 处于 idle maintenance window;
|
|
184
|
+
- 续接发布失败时,会先从 Workspace 移除预分配子会话并释放其 Agent handle,再返回错误;
|
|
185
|
+
- 未预期的 Host 异常保留在服务端日志中,浏览器只收到通用内部错误,不暴露本机路径或堆栈细节;
|
|
175
186
|
- 关闭补丁时,Host setup 和 Client DOM 副作用都可以独立清理;
|
|
176
|
-
- 物理删除只接受绝对的逐会话 `jsonl`
|
|
187
|
+
- 物理删除只接受绝对的逐会话 `jsonl` 定位与 DSH 固定 transcript 文件名,卸载实时会话后只删除该会话自有目录;本机路径不会返回 Client。
|
|
177
188
|
|
|
178
189
|
## 设计思想
|
|
179
190
|
|
|
@@ -203,6 +214,7 @@ build.mjs # Host ESM、Client bundle、声明和 inject 校验
|
|
|
203
214
|
|
|
204
215
|
```sh
|
|
205
216
|
pnpm run generate # 校验清单并重建 src/generated/
|
|
217
|
+
pnpm run peers:check # 校验锁定依赖的 peer 契约
|
|
206
218
|
pnpm run typecheck # 生成后执行严格 TypeScript 检查
|
|
207
219
|
pnpm test # 生成后执行 Vitest 测试
|
|
208
220
|
pnpm run build # 生成声明、Host 与 Client bundle
|