@lynn123411/dsh-ask-user-grilling 0.2.3 → 0.2.5

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 +7 -9
  2. package/lib/index.js +25 -22
  3. package/package.json +5 -5
package/README.md CHANGED
@@ -1,18 +1,16 @@
1
1
  # @lynn123411/dsh-ask-user-grilling
2
2
 
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 投递指引),子代理停轮纪律只写在工具描述里(软纪律、无硬拦)、不进 SKILL(避免诱导模型派遣子代理),preset persona 保持原厂原样不做任何修改。
3
+ DSH 原生 `ask_user_question`([`@deepseek-ai/dsh-tool-ask-user`](https://www.npmjs.com/package/@deepseek-ai/dsh-tool-ask-user))的**表单呈现变体**:与原生共用同一条 `ctx.userQuestions` seam,工具描述与全部参数描述**与原生逐字相同**,只改表单本身的呈现——强制多选、并自动追加一道轮末补充题。因此它可以直接顶替原生工具而不带来任何提示词漂移,本身不施加任何额外纪律或约束。
4
4
 
5
5
  > ⚠️ **安装约束:本插件是 preset 工具行消费的 Cordis 插件,严禁加入 profile `package.json` 的 `dsh.profile.bundles`**(bundle 层必须在包内声明 `dsh.bundle`,本插件没有,加入会导致启动报错)。只需通过 `pnpm add` / `dsh plugin --profile web add` 进入 dependencies 即可,preset 的工具行会直接从 node_modules 解析本包。
6
6
 
7
7
  ## 特性
8
8
 
9
- - **ask_user_grilling**:本 preset 唯一的提问工具(grilling 轮次与一切其他提问都走它——`tool-ask-user` 行已从三份 preset 删除)。
10
- - **子代理等齐(软纪律,无硬拦)**:若本轮派了子代理且下轮依赖其结论,优先**结束当前回合**、等全部结算后再问——事实没回就先问只会浪费一轮;子代理运行时提问不再被拒绝;
11
- - **强制多选**:所有问题一律多选(schema 不提供关闭开关;此行为刻意**不写入工具描述**——模型若知道只能多选,会为避免互斥选项而影响出题质量,见「描述即纪律」);
12
- - **补充机制**:每题末尾的补充输入框由 UI 自动渲染、轮末补充题由代码自动追加,两者都不依赖模型也不写入描述(模型自加补充项只会与它们重复);仅当轮末补充输入非空时才应再开一轮;
13
- - **题干引导**:要求题干只含问题本身、不重复选项文本(仅模型侧引导,不做硬校验——避免误伤自然提及选项名称的题干);
14
- - **描述即纪律**:工具描述保持精简,只承载工具必知项(以 `lib/index.js` 实物为准:唯一提问工具路由、散文预告 + 同一回合一次投递、字段映射与推荐标记、id 规则、勿自加收尾题、子代理等齐软纪律(无硬闸门));投递协议细节由技能旁注 DSH delivery 承载,不与工具描述重复;停轮纪律不在技能里写,只由本工具描述现教(软纪律,无硬闸门)。
15
- - 轮次收尾不自动进入 plan mode:grilling 达成共识后由用户决定继续方式(直接执行、或需要方案时自行 `/plan on`)。
9
+ - **ask_user_grilling**:与原生 `ask_user_question` 同形同名同描述,只改呈现。
10
+ - **强制多选**:所有问题一律多选——schema 不提供 `multi_select` 参数,也就没有关闭开关。此行为刻意**不写入工具描述**(描述与原生逐字一致):模型不知道只能多选,才不会为避免互斥选项而影响出题质量;
11
+ - **轮末补充题**:每次调用由代码自动追加一道「这轮还有什么要补充或调整的吗?(无需补充)」,每题末尾的补充输入框则由 UI 自动渲染——两者都不依赖模型、也不写入描述,模型自加补充项只会与它们重复;
12
+ - **id 前缀保护**:`__grill_` 开头的 id 会被拒绝(该前缀归自动追加的轮末补充题所有),保证两者不会撞 id;模型侧的 id 描述与原生一致,正常出题不会触发;
13
+ - **同一条 seam**:直接调 `ctx.userQuestions.ask`,与原生工具走同一通道、行为一致。
16
14
 
17
15
  ## 安装
18
16
 
@@ -22,4 +20,4 @@ dsh plugin --profile web add @lynn123411/dsh-ask-user-grilling
22
20
 
23
21
  已发布至 npm,供三个 matt 预设(`matt-standard` / `matt-ptc` / `matt-cordis`)使用(preset 的工具行直接消费本包)。
24
22
 
25
- **本地开发**:临时联调可将本目录复制到 `~/.dsh/profiles/web/node_modules/@lynn123411/dsh-ask-user-grilling/`(preset 的工具行会直接从 node_modules 解析),但裸拷贝是未注册状态:`pnpm install` / `dsh plugin add|remove` 等任何 profile 同步都会把它当 extraneous 清掉,并导致三份 matt preset 从模式选择里消失(2026-09-08 真实事故,见 `patches/matt-presets-bootstrap/README.md` §四)——“被清重拷”只是重复踩坑。注意:**不要**把它加进 profile `package.json` 的 `dsh.profile.bundles`(bundle 层必须在包内声明 `dsh.bundle`,否则启动报错)。含未发布改点时调完即发版,再用 `pnpm add` 回装为注册版本。
23
+ **本地开发**:临时联调可将本目录复制到 `~/.dsh/profiles/web/node_modules/@lynn123411/dsh-ask-user-grilling/`(preset 的工具行会直接从 node_modules 解析),但裸拷贝是未注册状态:`pnpm install` / `dsh plugin add|remove` 等任何 profile 同步都会把它当 extraneous 清掉,并导致三份 matt preset 从模式选择里消失(roster 对每份 preset 做行可解析性健康检查,插件被剪即整份隐藏)——“被清重拷”只是重复踩坑。注意:**不要**把它加进 profile `package.json` 的 `dsh.profile.bundles`(bundle 层必须在包内声明 `dsh.bundle`,否则启动报错)。含未发布改点时调完即发版,再用 `pnpm add` 回装为注册版本。
package/lib/index.js CHANGED
@@ -2,19 +2,18 @@ import { defineTool } from "@deepseek-ai/dsh-tools";
2
2
  import "@deepseek-ai/dsh-user-questions";
3
3
 
4
4
  /**
5
- * @lynn123411/dsh-ask-user-grilling — DSH delivery adaptations for grilling
6
- * rounds (mattpocock/skills). No skill file is modified; this package only
7
- * hardens how rounds are asked inside DSH.
5
+ * @lynn123411/dsh-ask-user-grilling — a presentation variant of the native
6
+ * `ask_user_question` (`@deepseek-ai/dsh-tool-ask-user`). Same capability seam
7
+ * (ctx.userQuestions) and the same tool/parameter descriptions verbatim; only
8
+ * the rendered form differs.
8
9
  *
9
10
  * ask_user_grilling:
10
- * - no hard gate on running subagents: waiting for settlement is description-level discipline only (soft, was R1)
11
- * - forces multi-select on every question (R2)
12
- * - appends a round-end supplement question (R3) per-question supplement is
13
- * via the built-in custom input ("Type your answer" / "输入你的答案"), no
14
- * extra per-question "Supplement" option to avoid duplication with that
15
- * field (see image.png issue: checkbox + input were redundant)
16
- * - stem/option separation is guidance only — never rejects stems (R4
17
- * relaxed: substring checks false-positive on legitimate stems)
11
+ * - forces multi-select on every question the schema offers no opt-out
12
+ * - appends a round-end supplement question; per-question supplement goes
13
+ * through the built-in custom input ("Type your answer" / "输入你的答案"),
14
+ * so no extra per-question option is added (it would duplicate that field)
15
+ * - rejects question ids using the reserved `__grill_` prefix, so the
16
+ * auto-appended question can never be shadowed
18
17
  */
19
18
  const name = "tool-ask-user-grilling";
20
19
  const inject = ["tools", "userQuestions"];
@@ -32,12 +31,12 @@ const ROUND_END_QUESTION = {
32
31
  function apply(ctx) {
33
32
  ctx.tools.register(defineTool({
34
33
  name: "ask_user_grilling",
35
- description: "Ask the user questions as a form — the only question tool in these presets; route every user-facing question through here, grilling rounds and all other questions alike. For a grilling round, deliver the round the skill had you announce in the message text — the SAME round, ONE call, in the same turn; the prose and the form must match one-to-one. Map each announced question to the fields below (title → header, body → question, the A/B/C choices → options; recommendation as below). Each question needs a stable id matching the Q-number you announced, never starting 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). Mark your recommended option by appending \"(Recommended)\" to its label (any position; if it isn't an option, state it briefly in the question text). If you dispatched subagents whose findings the next round depends on, prefer ending your turn and waiting until all of them have settled before asking — asking the frontier before the facts arrive wastes a round.",
34
+ description: "Ask the user a concise question when you need confirmation, a choice, or missing information before proceeding. Send one or more questions, each with a stable id that will be echoed in the answer.",
36
35
  parameters: {
37
36
  questions: {
38
37
  type: "array",
39
38
  required: true,
40
- description: "The current round's questions (round/frontier protocol: see the grilling skill). Each needs a stable id, a stem and options.",
39
+ description: "Questions to ask the user before continuing.",
41
40
  items: {
42
41
  type: "object",
43
42
  additionalProperties: true,
@@ -45,20 +44,20 @@ function apply(ctx) {
45
44
  id: {
46
45
  type: "string",
47
46
  required: true,
48
- description: "Stable id for this question; echoed in the answer. Must NOT start with __grill_ (reserved prefix).",
47
+ description: "Stable id for this question; echoed in the answer.",
49
48
  },
50
49
  question: {
51
50
  type: "string",
52
51
  required: true,
53
- description: "The question stem — write only the question. The A/B/C choices belong in options, never in the stem.",
52
+ description: "The specific question to ask the user.",
54
53
  },
55
54
  header: {
56
55
  type: "string",
57
- description: "Optional short heading, e.g. \"Q2 Deadline\".",
56
+ description: "Optional short heading for the question, such as \"Confirm\" or \"Choose Mode\".",
58
57
  },
59
58
  options: {
60
59
  type: "array",
61
- description: "Choices to show the user. Mark your recommended option by appending \"(Recommended)\" to its label; any list position is fine.",
60
+ description: "Optional choices to show the user. If you recommend one, put it first and append \"(Recommended)\" to that label.",
62
61
  items: {
63
62
  type: "object",
64
63
  additionalProperties: true,
@@ -99,6 +98,7 @@ function apply(ctx) {
99
98
  },
100
99
  answers: {
101
100
  type: "array",
101
+ required: true,
102
102
  description: "One entry per question, in the order asked.",
103
103
  items: {
104
104
  type: "object",
@@ -128,8 +128,8 @@ function apply(ctx) {
128
128
  },
129
129
  async execute(args, exec) {
130
130
  // 1. input validation: reserved id prefix guard only (the round-end
131
- // question owns __grill_). Stem/option separation (R4) is guidance,
132
- // NOT enforced: substring matching rejected legitimate stems (e.g. a
131
+ // question owns __grill_). Stem/option separation is guidance, NOT
132
+ // enforced: substring matching would reject legitimate stems (e.g. a
133
133
  // stem that naturally mentions an option name), so no stem check may
134
134
  // refuse a round — a bad stem is preferable to a false rejection.
135
135
  const violations = [];
@@ -146,7 +146,7 @@ function apply(ctx) {
146
146
  };
147
147
  }
148
148
 
149
- // 2. transform: force multi-select (R2); per-question supplement is via the built-in custom input ("Type your answer"/"输入你的答案") — no extra option is added to avoid duplication with that field
149
+ // 2. transform: force multi-select; per-question supplement is via the built-in custom input ("Type your answer"/"输入你的答案") — no extra option is added to avoid duplication with that field
150
150
  const questions = args.questions.map((question) => ({
151
151
  id: question.id,
152
152
  question: question.question,
@@ -160,8 +160,11 @@ function apply(ctx) {
160
160
  multiSelect: true,
161
161
  }));
162
162
 
163
- // 3. round-end supplement question (R3) — single "无需补充" option; supplement is via custom input, so no "I have something to add" option (duplicates that field)
164
- questions.push(ROUND_END_QUESTION);
163
+ // 3. round-end supplement question — single "无需补充" option; supplement is via custom input, so no "I have something to add" option (duplicates that field)
164
+ questions.push({
165
+ ...ROUND_END_QUESTION,
166
+ options: ROUND_END_QUESTION.options.map((option) => ({ ...option })),
167
+ });
165
168
 
166
169
  // 4. ask through the userQuestions seam (UI renders from the service)
167
170
  const answer = await ctx.userQuestions.ask({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lynn123411/dsh-ask-user-grilling",
3
- "version": "0.2.3",
4
- "description": "DSH delivery adaptations for grilling rounds: ask_user_grilling (sole question tool / forced multi-select / round-end supplement / stem guidance). Does not modify any skill file.",
3
+ "version": "0.2.5",
4
+ "description": "Form-presentation variant of the native ask_user_question: same tool and parameter descriptions verbatim, forced multi-select, plus an auto-appended round-end supplement question.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -14,9 +14,9 @@
14
14
  ],
15
15
  "license": "MIT",
16
16
  "peerDependencies": {
17
- "@deepseek-ai/cordis": "^4.0.1",
18
- "@deepseek-ai/dsh-tools": "^0.1.2-alpha.1",
19
- "@deepseek-ai/dsh-user-questions": "^0.1.2-alpha.1"
17
+ "@deepseek-ai/cordis": "^4.0.2",
18
+ "@deepseek-ai/dsh-tools": "^0.1.5-rc.1",
19
+ "@deepseek-ai/dsh-user-questions": "^0.1.5-rc.1"
20
20
  },
21
21
  "engines": {
22
22
  "node": "^22.19 || >=24"