dsh-workplan 1.7.0 → 1.7.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,32 @@
1
+ ## 1.7.1 — 2026-10-30
2
+
3
+ **修复:1.7.0 在宿主上无法激活(整个插件被跳过)。**
4
+
5
+ 现象:升级到 1.7.0 并重启 DSH Web 后,终端出现
6
+
7
+ ```
8
+ dsh: warning: 1 entry did not activate
9
+ dsh-workplan-plugin: JsonSchemaError: unsupported JSON schema:
10
+ schema.properties.elapsedMs.type must be a single type string (type arrays are not supported)
11
+ ```
12
+
13
+ 结果是任务进度面板与四个工具**全部消失**——不是功能降级,而是插件条目在激活阶段抛错被跳过。
14
+
15
+ 根因:`statusToolOutputSchema()` 用 `type: ['number', 'null']` 表达「可为空的耗时」,而宿主的
16
+ `assertSupportedJsonSchema` 只接受**单一类型字符串**;同一处 `dsh_workplan_update` 的 `progress`
17
+ 还用了宿主子集不支持的 `minimum` / `maximum`。
18
+
19
+ 修复:
20
+
21
+ - `elapsedMs` 改为 `oneOf: [{ type: 'number' }, { type: 'null' }]`;
22
+ - `progress` 去掉 `minimum` / `maximum`,范围写进 `description`;
23
+ - `cancel` 的输出 schema 提取为 `cancelToolOutputSchema()`,与其余 schema 接受同一套校验;
24
+ - 新增 `tests/workplan-host-schema.test.ts`:按宿主子集规则递归校验全部工具的 `parameters` 与
25
+ `output.schema`,并锁死「可空标量只能经 `oneOf` 表达,不能写 type 数组」;
26
+ - 另用宿主真实的 `assertSupportedJsonSchema` 对 4 个工具各跑一遍(开发期校验,不入测试依赖)。
27
+
28
+ 验证:`npm test` 183 通过,`npm run check` 通过,四个工具 schema 均通过宿主校验。
29
+
1
30
  ## 1.7.0 — 2026-10-30
2
31
 
3
32
  **「协作契约」版:让主 Agent 与各部门在全程共享同一份事实。**
package/README.en.md CHANGED
@@ -20,7 +20,7 @@ For every new task with a real goal, the plugin inserts three beats:
20
20
 
21
21
  Greetings, thanks, and status questions ("how far along are we?") do not trigger a plan.
22
22
 
23
- ## How departments collaborate (what 1.7.0 actually does)
23
+ ## How departments collaborate (what 1.7.1 actually does)
24
24
 
25
25
  Every work item carries a department label (Engineering, Research, Design, Product, Data, QA, Security, DevOps, Writing, Operations, Legal, Finance). **The label drives the prompt and the stats, not an org chart**:
26
26
 
@@ -44,7 +44,7 @@ The full contract — roles, data shapes, state machine, recovery, and the three
44
44
  ## Install
45
45
 
46
46
  ```bash
47
- dsh plugin --profile web add dsh-workplan@1.7.0
47
+ dsh plugin --profile web add dsh-workplan@1.7.1
48
48
  ```
49
49
 
50
50
  Restart the DSH Web process (or reload the page) so the bundle is picked up.
package/README.md CHANGED
@@ -33,7 +33,7 @@
33
33
  ## 一键安装
34
34
 
35
35
  ```bash
36
- dsh plugin --profile web add dsh-workplan@1.7.0
36
+ dsh plugin --profile web add dsh-workplan@1.7.1
37
37
  ```
38
38
 
39
39
  装完**重启一次 DSH Web**(或重新载入当前页面)让插件生效。
@@ -75,7 +75,7 @@ dsh plugin --profile web add "$(pwd)"
75
75
 
76
76
  在 **plan 模式**下只会给你看计划,`dispatch` 会被明确拦下并说明原因,不会偷偷开跑。
77
77
 
78
- ## 部门怎么协作(1.7.0 的真实能力)
78
+ ## 部门怎么协作(1.7.1 的真实能力)
79
79
 
80
80
  计划里的每件工作都带一个部门标签(工程研发、研究分析、设计、产品、数据、质量验证、安全、运维、文档写作、运营、法务合规、财务)。**标签决定提示词与统计口径,不是组织架构**:
81
81
 
package/lib/host.js CHANGED
@@ -8,7 +8,7 @@ import { readFileSync } from 'node:fs';
8
8
  * - dsh_workplan_update and dsh_workplan_dispatch model tools;
9
9
  * - the read-only dashboard route.
10
10
  */
11
- import { createWorkplanRuntime, dispatchToolOutputSchema, plannerOutputSchema, statusToolOutputSchema, updateToolOutputSchema, } from './runtime.js';
11
+ import { cancelToolOutputSchema, createWorkplanRuntime, dispatchToolOutputSchema, plannerOutputSchema, statusToolOutputSchema, updateToolOutputSchema, } from './runtime.js';
12
12
  import { isRecord } from './plan.js';
13
13
  function phaseLabel(phase) {
14
14
  if (phase === 'paused')
@@ -100,9 +100,7 @@ function createUpdateTool(runtime) {
100
100
  },
101
101
  progress: {
102
102
  type: 'integer',
103
- minimum: 0,
104
- maximum: 100,
105
- description: '进度百分比;done 会自动置为 100。',
103
+ description: '进度百分比(0-100);done 会自动置为 100。',
106
104
  },
107
105
  evidence: {
108
106
  type: 'array',
@@ -166,17 +164,7 @@ function createCancelTool(runtime) {
166
164
  additionalProperties: false,
167
165
  },
168
166
  output: {
169
- schema: {
170
- type: 'object',
171
- properties: {
172
- ok: { type: 'boolean' },
173
- planId: { type: 'string' },
174
- phase: { type: 'string' },
175
- reason: { type: 'string' },
176
- },
177
- required: ['ok'],
178
- additionalProperties: true,
179
- },
167
+ schema: cancelToolOutputSchema(),
180
168
  render(_args, value) {
181
169
  const result = isRecord(value) ? value : {};
182
170
  return textContent(result.ok
@@ -366,7 +354,7 @@ export function apply(ctx, config = {}) {
366
354
  }
367
355
  export const meta = {
368
356
  name,
369
- version: '1.7.0',
357
+ version: '1.7.1',
370
358
  promptOrder: PROMPT_ORDER,
371
359
  routes: ['/dsh-workplan/plans', '/dsh-workplan/vendor/chart.umd.js'],
372
360
  };
package/lib/runtime.js CHANGED
@@ -2312,6 +2312,19 @@ export function updateToolOutputSchema() {
2312
2312
  additionalProperties: true,
2313
2313
  };
2314
2314
  }
2315
+ export function cancelToolOutputSchema() {
2316
+ return {
2317
+ type: 'object',
2318
+ properties: {
2319
+ ok: { type: 'boolean' },
2320
+ planId: { type: 'string' },
2321
+ phase: { type: 'string' },
2322
+ reason: { type: 'string' },
2323
+ },
2324
+ required: ['ok'],
2325
+ additionalProperties: true,
2326
+ };
2327
+ }
2315
2328
  export function statusToolOutputSchema() {
2316
2329
  return {
2317
2330
  type: 'object',
@@ -2320,7 +2333,9 @@ export function statusToolOutputSchema() {
2320
2333
  planId: { type: 'string' },
2321
2334
  running: { type: 'boolean' },
2322
2335
  phase: { type: 'string' },
2323
- elapsedMs: { type: ['number', 'null'] },
2336
+ // The host accepts only a single type string per node; a nullable scalar
2337
+ // is expressed with oneOf (type arrays throw JsonSchemaError at activation).
2338
+ elapsedMs: { oneOf: [{ type: 'number' }, { type: 'null' }] },
2324
2339
  stats: { type: 'object' },
2325
2340
  statuses: { type: 'array' },
2326
2341
  errors: { type: 'array' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-workplan",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "Automatic task decomposition, real department subagents, and a responsive workplan dashboard for DeepSeek Harness.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/host.ts CHANGED
@@ -10,6 +10,7 @@ import { readFileSync } from 'node:fs'
10
10
  */
11
11
 
12
12
  import {
13
+ cancelToolOutputSchema,
13
14
  createWorkplanRuntime,
14
15
  dispatchToolOutputSchema,
15
16
  plannerOutputSchema,
@@ -115,9 +116,7 @@ function createUpdateTool(runtime: any) {
115
116
  },
116
117
  progress: {
117
118
  type: 'integer',
118
- minimum: 0,
119
- maximum: 100,
120
- description: '进度百分比;done 会自动置为 100。',
119
+ description: '进度百分比(0-100);done 会自动置为 100。',
121
120
  },
122
121
  evidence: {
123
122
  type: 'array',
@@ -182,17 +181,7 @@ function createCancelTool(runtime: any) {
182
181
  additionalProperties: false,
183
182
  },
184
183
  output: {
185
- schema: {
186
- type: 'object',
187
- properties: {
188
- ok: { type: 'boolean' },
189
- planId: { type: 'string' },
190
- phase: { type: 'string' },
191
- reason: { type: 'string' },
192
- },
193
- required: ['ok'],
194
- additionalProperties: true,
195
- },
184
+ schema: cancelToolOutputSchema(),
196
185
  render(_args: any, value: any) {
197
186
  const result = isRecord(value) ? value : {}
198
187
  return textContent(
@@ -401,7 +390,7 @@ export function apply(ctx: any, config: WorkplanConfig = {}) {
401
390
 
402
391
  export const meta = {
403
392
  name,
404
- version: '1.7.0',
393
+ version: '1.7.1',
405
394
  promptOrder: PROMPT_ORDER,
406
395
  routes: ['/dsh-workplan/plans', '/dsh-workplan/vendor/chart.umd.js'],
407
396
  }
package/src/runtime.ts CHANGED
@@ -2299,6 +2299,20 @@ export function updateToolOutputSchema() {
2299
2299
  }
2300
2300
  }
2301
2301
 
2302
+ export function cancelToolOutputSchema() {
2303
+ return {
2304
+ type: 'object',
2305
+ properties: {
2306
+ ok: { type: 'boolean' },
2307
+ planId: { type: 'string' },
2308
+ phase: { type: 'string' },
2309
+ reason: { type: 'string' },
2310
+ },
2311
+ required: ['ok'],
2312
+ additionalProperties: true,
2313
+ }
2314
+ }
2315
+
2302
2316
  export function statusToolOutputSchema() {
2303
2317
  return {
2304
2318
  type: 'object',
@@ -2307,7 +2321,9 @@ export function statusToolOutputSchema() {
2307
2321
  planId: { type: 'string' },
2308
2322
  running: { type: 'boolean' },
2309
2323
  phase: { type: 'string' },
2310
- elapsedMs: { type: ['number', 'null'] },
2324
+ // The host accepts only a single type string per node; a nullable scalar
2325
+ // is expressed with oneOf (type arrays throw JsonSchemaError at activation).
2326
+ elapsedMs: { oneOf: [{ type: 'number' }, { type: 'null' }] },
2311
2327
  stats: { type: 'object' },
2312
2328
  statuses: { type: 'array' },
2313
2329
  errors: { type: 'array' },