@lynn123411/dsh-ask-user-grilling 0.1.2 → 0.2.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/README.md +6 -5
- package/lib/index.js +26 -42
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
# @lynn123411/dsh-ask-user-grilling
|
|
2
2
|
|
|
3
|
-
DSH 侧的 grilling 适配层(输送机制):把 Matt Pocock 的 grilling 流程在 DSH
|
|
3
|
+
DSH 侧的 grilling 适配层(输送机制):把 Matt Pocock 的 grilling 流程在 DSH 里的提问环节做成工具级硬约束。本插件只提供 `ask_user_grilling`,不提供任何 plan-mode 工具——共识达成后不自动进入 plan mode,交还用户决定下一步。分工:本插件负责「在 DSH 里怎么问」的工具与报错层;grilling 纪律文案(散文预告 + 表单投递、子代理停轮)写在工具描述与 matt-* 预设 vendor 的 `skills/grilling/SKILL.md` 里(`matt-ptc` 另含 PTC 投递指引),preset persona 保持原厂原样不做任何修改。
|
|
4
4
|
|
|
5
5
|
## 特性
|
|
6
6
|
|
|
7
7
|
- **ask_user_grilling**:grilling 轮次专用提问工具。
|
|
8
8
|
- **子代理闸门**:后台有子代理运行时会拒绝提问,返回「阻塞 + 运行中名单」——agent 应**结束当前回合**,子代理结算通知自动唤醒后再调用,不在回合内反复重试;
|
|
9
|
-
- **强制多选**:所有问题一律多选(schema
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
9
|
+
- **强制多选**:所有问题一律多选(schema 不提供关闭开关;此行为刻意**不写入工具描述**——模型若知道只能多选,会为避免互斥选项而影响出题质量,见「描述即纪律」);
|
|
10
|
+
- **补充机制**:每题末尾的补充输入框由 UI 自动渲染、轮末补充题由代码自动追加,两者都不依赖模型也不写入描述(模型自加补充项只会与它们重复);仅当轮末补充输入非空时才应再开一轮;
|
|
11
|
+
- **题干引导**:要求题干只含问题本身、不重复选项文本(仅模型侧引导,不做硬校验——避免误伤自然提及选项名称的题干);
|
|
12
|
+
- **描述即纪律**:工具描述保持精简,只承载「grilling 轮次专用(其余用 ask_user_question)、先散文预告同一轮、再以一次调用投递表单、字段映射、勿自加收尾题、子代理运行中返回 blocked」等工具必知项;投递协议细节(散文预告与表单一一对应、PTC 形态)由技能旁注(DSH delivery / Sub-agent rounds)承载,不与工具描述重复。
|
|
13
|
+
- 轮次收尾不自动进入 plan mode:grilling 达成共识后由用户决定继续方式(直接执行、或需要方案时自行 `/plan on`)。
|
|
13
14
|
|
|
14
15
|
## 安装
|
|
15
16
|
|
package/lib/index.js
CHANGED
|
@@ -15,9 +15,6 @@ import "@deepseek-ai/dsh-user-questions";
|
|
|
15
15
|
* field (see image.png issue: checkbox + input were redundant)
|
|
16
16
|
* - stem/option separation is guidance only — never rejects stems (R4
|
|
17
17
|
* relaxed: substring checks false-positive on legitimate stems)
|
|
18
|
-
*
|
|
19
|
-
* enter_plan_mode:
|
|
20
|
-
* - activates DSH plan mode for the current agent (planMode.set)
|
|
21
18
|
*/
|
|
22
19
|
const name = "tool-ask-user-grilling";
|
|
23
20
|
const inject = ["tools", "userQuestions"];
|
|
@@ -39,12 +36,12 @@ function displayName(entry) {
|
|
|
39
36
|
function apply(ctx) {
|
|
40
37
|
ctx.tools.register(defineTool({
|
|
41
38
|
name: "ask_user_grilling",
|
|
42
|
-
description: "
|
|
39
|
+
description: "Deliver one ROUND of grilling questions as a form. Use it only when the grilling skill (grill-me / grill-with-docs, or the grilling phases of triage / wayfinder / improve-codebase-architecture) directs a round: first announce the whole round in the message text (title, options and your recommendation, per the skill's template), then deliver the SAME round as ONE call here — the prose and the form must match one-to-one. Map each question to the fields below (title → header, body → question, the A/B/C choices → options; mark your recommended option with \"(Recommended)\" (it need not be listed first); if your recommendation is not an option, state it briefly in the question text). Each question needs a stable id that does not start with __grill_ (reserved for the auto-appended round-end supplement question — never add your own catch-all/\"anything else?\" question; a non-empty supplement input reshapes the tree: ask a further round, and stop asking once the user confirms shared understanding). If background subagents are still running, this tool returns blocked: end your turn and wait for the settlement notice, do not retry within the same turn. For any non-grilling question use the plain ask_user_question tool.",
|
|
43
40
|
parameters: {
|
|
44
41
|
questions: {
|
|
45
42
|
type: "array",
|
|
46
43
|
required: true,
|
|
47
|
-
description: "
|
|
44
|
+
description: "The current round's questions (round/frontier protocol: see the grilling skill). Each needs a stable id, a stem and options.",
|
|
48
45
|
items: {
|
|
49
46
|
type: "object",
|
|
50
47
|
additionalProperties: true,
|
|
@@ -57,15 +54,15 @@ function apply(ctx) {
|
|
|
57
54
|
question: {
|
|
58
55
|
type: "string",
|
|
59
56
|
required: true,
|
|
60
|
-
description: "The question stem only
|
|
57
|
+
description: "The question stem — write only the question. The A/B/C choices belong in options, never in the stem.",
|
|
61
58
|
},
|
|
62
59
|
header: {
|
|
63
60
|
type: "string",
|
|
64
|
-
description: "Optional short heading
|
|
61
|
+
description: "Optional short heading, e.g. \"Q2 — Deadline\".",
|
|
65
62
|
},
|
|
66
63
|
options: {
|
|
67
64
|
type: "array",
|
|
68
|
-
description: "Choices to show the user.
|
|
65
|
+
description: "Choices to show the user. Mark your recommended option by appending \"(Recommended)\" to its label; any list position is fine.",
|
|
69
66
|
items: {
|
|
70
67
|
type: "object",
|
|
71
68
|
additionalProperties: true,
|
|
@@ -109,16 +106,32 @@ function apply(ctx) {
|
|
|
109
106
|
items: { type: "string" },
|
|
110
107
|
description: "Validation violations when rejected (reserved id prefix only).",
|
|
111
108
|
},
|
|
112
|
-
error: {
|
|
109
|
+
error: {
|
|
110
|
+
type: "string",
|
|
111
|
+
description: "Human-readable error when blocked or rejected.",
|
|
112
|
+
},
|
|
113
113
|
answers: {
|
|
114
114
|
type: "array",
|
|
115
|
+
description: "One entry per question, in the order asked.",
|
|
115
116
|
items: {
|
|
116
117
|
type: "object",
|
|
117
118
|
additionalProperties: false,
|
|
118
119
|
properties: {
|
|
119
|
-
id: {
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
id: {
|
|
121
|
+
type: "string",
|
|
122
|
+
required: true,
|
|
123
|
+
description: "The question id you supplied.",
|
|
124
|
+
},
|
|
125
|
+
selected: {
|
|
126
|
+
type: "array",
|
|
127
|
+
required: true,
|
|
128
|
+
items: { type: "string" },
|
|
129
|
+
description: "Labels of the options the user picked (may be empty if skipped).",
|
|
130
|
+
},
|
|
131
|
+
custom: {
|
|
132
|
+
type: "string",
|
|
133
|
+
description: "User-typed free text for this question, if any.",
|
|
134
|
+
},
|
|
122
135
|
},
|
|
123
136
|
},
|
|
124
137
|
},
|
|
@@ -146,7 +159,7 @@ function apply(ctx) {
|
|
|
146
159
|
return {
|
|
147
160
|
blocked: true,
|
|
148
161
|
waiting: [],
|
|
149
|
-
error: "Cannot confirm background subagent status (subagents query failed).
|
|
162
|
+
error: "Cannot confirm background subagent status (subagents query failed). End your turn and wait; call this tool again in a later turn.",
|
|
150
163
|
};
|
|
151
164
|
}
|
|
152
165
|
}
|
|
@@ -209,35 +222,6 @@ function apply(ctx) {
|
|
|
209
222
|
};
|
|
210
223
|
},
|
|
211
224
|
}));
|
|
212
|
-
|
|
213
|
-
ctx.tools.register(defineTool({
|
|
214
|
-
name: "enter_plan_mode",
|
|
215
|
-
description: "Enter plan mode for the current agent. Call it after the final round of a grilling session once the user has confirmed shared understanding, so a plan is written for review instead of executing directly. Plan mode ends via exit_plan_mode or the /plan off command.",
|
|
216
|
-
parameters: {},
|
|
217
|
-
output: {
|
|
218
|
-
schema: {
|
|
219
|
-
type: "object",
|
|
220
|
-
additionalProperties: false,
|
|
221
|
-
properties: {
|
|
222
|
-
ok: { type: "boolean" },
|
|
223
|
-
result: { type: "string" },
|
|
224
|
-
error: { type: "string" },
|
|
225
|
-
},
|
|
226
|
-
},
|
|
227
|
-
render: (_args, value) => [{ type: "text", text: JSON.stringify(value) }],
|
|
228
|
-
},
|
|
229
|
-
async execute(_args, exec) {
|
|
230
|
-
const planMode = ctx.get("planMode");
|
|
231
|
-
if (planMode === undefined) return { ok: false, error: "planMode service unavailable" };
|
|
232
|
-
const agent = exec.agent;
|
|
233
|
-
if (agent === undefined) return { ok: false, error: "current agent unavailable" };
|
|
234
|
-
const outcome = planMode.set(agent, true);
|
|
235
|
-
// cancelled = an opposite pending selection was cleared and the logged
|
|
236
|
-
// state already matches the requested active state — plan mode IS active.
|
|
237
|
-
const ok = outcome === "committed" || outcome === "queued" || outcome === "cancelled" || outcome === "noop";
|
|
238
|
-
return { ok, result: `plan mode ${outcome}` };
|
|
239
|
-
},
|
|
240
|
-
}));
|
|
241
225
|
}
|
|
242
226
|
|
|
243
227
|
export { apply, inject, name };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynn123411/dsh-ask-user-grilling",
|
|
3
|
-
"version": "0.1
|
|
4
|
-
"description": "DSH delivery adaptations for grilling rounds: ask_user_grilling (subagent gate / forced multi-select / round-end supplement / stem guidance)
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "DSH delivery adaptations for grilling rounds: ask_user_grilling (subagent gate / forced multi-select / round-end supplement / stem guidance). Does not modify any skill file.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|