dsh-session-title-format 1.0.1 → 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.
Files changed (3) hide show
  1. package/README.md +14 -3
  2. package/index.js +4 -3
  3. package/package.json +6 -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)与 0.1.5-alpha.1(Linux)上验证:headless 独立进程与运行中的 web 服务器(RPC 建会话)两条路径,模型均于首轮主动命名(示例:`0910|研究|闭包概念解释`、`0910|开发|统计log文件总行数`)。
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,11 +128,22 @@ dsh plugin --profile web remove dsh-session-title-format # 方式一:pnpm
128
128
 
129
129
  ## 版本兼容性说明
130
130
 
131
- - dsh 0.1.2-alpha.3 / 0.1.5-alpha.1 实测通过(headless + 运行中 web 服务器 RPC 两条路径)
132
- - 家级补丁热重载在两版本上行为不一致(0.1.2 上条目变更触发重载实证有效;0.1.5 上新建/touch 未触发,需重启)——因此两种安装方式的最后一步都建议重启进程
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 进程以使插件生效
133
134
 
134
135
  ## 变更记录
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
+
136
147
  ### 1.0.1
137
148
 
138
149
  修复 npm 安装报错 `ERR_PNPM_NO_MATCHING_VERSION No matching version found for @deepseek-ai/dsh-tools@>=0.1.5 <0.2.0`。
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 profile module fallback.
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": "1.0.1",
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,13 @@
22
22
  "README.md"
23
23
  ],
24
24
  "engines": {
25
- "node": ">=20"
25
+ "dsh": ">=0.2.2-rc.3",
26
+ "node": ">=24.9"
26
27
  },
27
28
  "peerDependencies": {
28
- "@deepseek-ai/dsh-llm": ">=0.1.0-rc.8",
29
- "@deepseek-ai/dsh-tools": ">=0.1.0-rc.8",
30
- "@deepseek-ai/schemastery": "^3.18.2"
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"
31
32
  },
32
33
  "peerDependenciesMeta": {
33
34
  "@deepseek-ai/dsh-llm": {