dsh-session-title-format 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -3
- package/index.js +4 -3
- package/package.json +17 -5
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ DeepSeek Harness 插件:为每个 Agent 注册 `set_session_title` 工具,
|
|
|
10
10
|
- 无法确定时模型不应调用工具(保留原标题);用户手动命名过的会话,工具直接跳过,不覆盖。
|
|
11
11
|
- 只写 `session/title` 日志事件(标题投影),不触碰项目名称、内容、归属、排序、置顶、归档状态。
|
|
12
12
|
|
|
13
|
-
已在 dsh 0.1.2-alpha.3(Windows
|
|
13
|
+
已在 dsh 0.1.2-alpha.3(Windows)/ 0.1.5-alpha.1(Linux)/ 0.2.2-rc.3(验证宿主)上验证:headless 独立进程与运行中的 web 服务器(RPC 建会话)两条路径,模型均于首轮主动命名(示例:`0910|研究|闭包概念解释`、`0910|开发|统计log文件总行数`)。
|
|
14
14
|
|
|
15
15
|
> **行为说明**:纯寒暄类对话(如「你好」)无法确定类型/主题,模型会按规则保留原标题——这是设计行为,不是插件失效。有实际内容的对话才会被命名。
|
|
16
16
|
|
|
@@ -128,5 +128,26 @@ dsh plugin --profile web remove dsh-session-title-format # 方式一:pnpm
|
|
|
128
128
|
|
|
129
129
|
## 版本兼容性说明
|
|
130
130
|
|
|
131
|
-
- dsh 0.
|
|
132
|
-
-
|
|
131
|
+
- dsh 0.2.2-rc.3 验证通过(本版本目标宿主)
|
|
132
|
+
- dsh 0.1.2-alpha.3 / 0.1.5-alpha.1 / 0.1.6-alpha.1 实测通过(历史版本)
|
|
133
|
+
- 家级补丁热重载在不同版本上行为不一致——建议重启 dsh 进程以使插件生效
|
|
134
|
+
|
|
135
|
+
## 变更记录
|
|
136
|
+
|
|
137
|
+
### 2.0.0
|
|
138
|
+
|
|
139
|
+
升级至 DSH 0.2.2-rc.3,含以下破坏性变更:
|
|
140
|
+
|
|
141
|
+
- **`engines.dsh`**:新增 `>=0.2.2-rc.3` 声明。DSH 0.2.x 的兼容性检查优先读取 `engines.dsh`(参见 `v0.2.1-alpha.3/plugin-engines-dsh` 升级指南),更准确地表达宿主版本要求。
|
|
142
|
+
- **`engines.node`**:由 `>=20` 升级到 `>=24.9`。DSH 0.2.x 要求 Node.js 24.9 或更高版本(参见 `v0.2.1-rc.2/node-24` 升级指南)。
|
|
143
|
+
- **`peerDependencies` 范围**:`@deepseek-ai/dsh-llm` 和 `@deepseek-ai/dsh-tools` 的最低版本由 `>=0.1.0-rc.8` 升级为 `>=0.2.0-rc.1`,`@deepseek-ai/schemastery` 改为 `>=3.18.2`。peer 仍标记为可选(`peerDependenciesMeta`),pnpm 不做自动安装,范围仅作为市场等工具的兼容性声明。
|
|
144
|
+
- **`execute()` 不再手动校验 `type` 枚举**:DSH 0.2.x 的 `defineTool` 通过 schema 编译自动校验参数,`ToolArgsError` 在无效枚举值时抛出(参见 `v0.2.1-rc.2/conditional-tools` 升级指南)。
|
|
145
|
+
- **`isConcurrencySafe` 签名兼容**:DSH 0.2.x 的 `isConcurrencySafe` 函数接收 `args` 参数,本插件的 `() => false` 在 JavaScript 中忽略额外参数,行为不变。
|
|
146
|
+
|
|
147
|
+
### 1.0.1
|
|
148
|
+
|
|
149
|
+
修复 npm 安装报错 `ERR_PNPM_NO_MATCHING_VERSION No matching version found for @deepseek-ai/dsh-tools@>=0.1.5 <0.2.0`。
|
|
150
|
+
|
|
151
|
+
- **原因**:1.0.0 把 `@deepseek-ai/dsh-llm` / `@deepseek-ai/dsh-tools` / `@deepseek-ai/schemastery` 声明为**非可选** peerDependencies。这些是宿主(dsh 运行时)通过模块回退(module fallback)注入的包,registry 上只有 prerelease(0.1.x 无稳定版)。`dsh plugin add` 转发给 pnpm 后,pnpm ≥8 的 `auto-install-peers`(默认开启;pnpm 8 不读 profile `pnpm-workspace.yaml` 里的 `autoInstallPeers: false`)会尝试从 registry 自动安装缺失 peer;当 profile 里其他插件(如 dsh-better-sidebar)也声明了同名 peer 时,pnpm 对多个版本范围取交集,产出剥掉 prerelease 的范围(如 `>=0.1.5 <0.2.0`),无任何已发布版本可满足,安装失败。即使单独安装"成功",也会把 0.1.0-rc.8 时代的宿主包整棵装进 profile,遮蔽运行中的宿主版本。
|
|
152
|
+
- **修复**:在 `peerDependenciesMeta` 中将三个 `@deepseek-ai/*` peer 全部标记为 `optional: true`。pnpm 对 optional peer 完全不做自动安装(`getMissingPeers` 在源头排除),既不触发范围交集报错,也不会拉入陈旧宿主包;peer 范围本身保留,仍作为兼容性声明供市场等工具读取(dshmarket 以 includePrerelease 语义判定,`>=0.1.0-rc.8` 对 0.1.6-alpha.1 宿主判为兼容)。
|
|
153
|
+
- 经 pnpm 8.15.9 / pnpm 10.21 在全新 profile 与含既有插件的 profile 两种上下文验证安装通过。
|
package/index.js
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* - MMDD: the session's actual creation date in the configured timezone
|
|
6
6
|
* (default Asia/Shanghai), computed from `session.header.createdAt`.
|
|
7
7
|
* - 类型: one of a fixed vocabulary (功能/设计/开发/修复/优化/发布/探索/文档/研究),
|
|
8
|
-
* enforced by the tool's parameter enum.
|
|
8
|
+
* enforced by the tool's parameter enum (DSH 0.2.x auto-validates args through
|
|
9
|
+
* `defineTool`'s schema compilation, so execute() reads `args.type` directly).
|
|
9
10
|
* - 主题: a concise topic supplied by the agent; the tool cleans it, rejects
|
|
10
11
|
* empty/oversized topics and topics repeating the project (workspace) name,
|
|
11
12
|
* then delegates to `ctx.sessionTitle.rename()`, whose accepted revision is
|
|
@@ -21,7 +22,8 @@
|
|
|
21
22
|
*
|
|
22
23
|
* Named exports only (name/inject/Config/apply) and no default export, per the
|
|
23
24
|
* loader's unwrapExports contract. Dependencies (`@deepseek-ai/dsh-tools`,
|
|
24
|
-
* `@deepseek-ai/schemastery`) resolve through the
|
|
25
|
+
* `@deepseek-ai/schemastery`, `@deepseek-ai/dsh-llm`) resolve through the
|
|
26
|
+
* profile module fallback; they are marked optional in `peerDependenciesMeta`.
|
|
25
27
|
* @module dsh-session-title-format
|
|
26
28
|
*/
|
|
27
29
|
|
|
@@ -256,7 +258,6 @@ export function apply(ctx, config) {
|
|
|
256
258
|
if (typeof sessionTitle !== 'object' || sessionTitle === null) throw new Error('set_session_title requires the session-title service')
|
|
257
259
|
|
|
258
260
|
const type = args.type
|
|
259
|
-
if (!TITLE_TYPES.includes(type)) throw new Error(`invalid type ${JSON.stringify(type)}; must be one of ${TITLE_TYPES.join(' / ')}`)
|
|
260
261
|
|
|
261
262
|
const previous = sessionTitle.get(session)
|
|
262
263
|
if (previous !== undefined && previous.source.kind === 'user') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-session-title-format",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "DSH plugin: set_session_title tool renaming the calling agent's session to「MMDD|类型|主题」— Shanghai-timezone creation date, fixed type vocabulary, concise topic",
|
|
6
6
|
"keywords": [
|
|
@@ -22,12 +22,24 @@
|
|
|
22
22
|
"README.md"
|
|
23
23
|
],
|
|
24
24
|
"engines": {
|
|
25
|
-
"
|
|
25
|
+
"dsh": ">=0.2.2-rc.3",
|
|
26
|
+
"node": ">=24.9"
|
|
26
27
|
},
|
|
27
28
|
"peerDependencies": {
|
|
28
|
-
"@deepseek-ai/dsh-llm": ">=0.
|
|
29
|
-
"@deepseek-ai/dsh-tools": ">=0.
|
|
30
|
-
"@deepseek-ai/schemastery": "
|
|
29
|
+
"@deepseek-ai/dsh-llm": ">=0.2.0-rc.1",
|
|
30
|
+
"@deepseek-ai/dsh-tools": ">=0.2.0-rc.1",
|
|
31
|
+
"@deepseek-ai/schemastery": ">=3.18.2"
|
|
32
|
+
},
|
|
33
|
+
"peerDependenciesMeta": {
|
|
34
|
+
"@deepseek-ai/dsh-llm": {
|
|
35
|
+
"optional": true
|
|
36
|
+
},
|
|
37
|
+
"@deepseek-ai/dsh-tools": {
|
|
38
|
+
"optional": true
|
|
39
|
+
},
|
|
40
|
+
"@deepseek-ai/schemastery": {
|
|
41
|
+
"optional": true
|
|
42
|
+
}
|
|
31
43
|
},
|
|
32
44
|
"dsh": {
|
|
33
45
|
"bundle": {
|