@lynn123411/dsh-ask-user-grilling 0.2.4 → 0.2.6
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 +7 -10
- package/lib/index.js +20 -21
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
# @lynn123411/dsh-ask-user-grilling
|
|
2
2
|
|
|
3
|
-
DSH
|
|
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
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
- **题干引导**:要求题干只含问题本身、不重复选项文本(仅模型侧引导,不做硬校验——避免误伤自然提及选项名称的题干);
|
|
15
|
-
- **描述即纪律**:工具描述保持精简,只承载工具必知项(以 `lib/index.js` 实物为准:唯一提问工具路由、散文预告 + 同一回合一次投递、字段映射与推荐标记、id 规则、勿自加收尾题、子代理等齐软纪律(无硬闸门));投递协议细节由技能旁注 DSH delivery 承载,不与工具描述重复;停轮纪律不在技能里写,只由本工具描述现教(软纪律,无硬闸门)。
|
|
16
|
-
- 轮次收尾不自动进入 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`,与原生工具走同一通道、行为一致。
|
|
17
14
|
|
|
18
15
|
## 安装
|
|
19
16
|
|
|
@@ -23,4 +20,4 @@ dsh plugin --profile web add @lynn123411/dsh-ask-user-grilling
|
|
|
23
20
|
|
|
24
21
|
已发布至 npm,供三个 matt 预设(`matt-standard` / `matt-ptc` / `matt-cordis`)使用(preset 的工具行直接消费本包)。
|
|
25
22
|
|
|
26
|
-
|
|
23
|
+
**本地开发**:用 `link:`,不要拷贝——运行副本软链接到本仓库目录后,仓库里的文件就是“已安装内容”,改完即生效、不必发版:`cd ~/.dsh/profiles/web && pnpm add "link:<my-dsh 绝对路径>/plugins/dsh-ask-user-grilling" --offline`。本插件宿主半边 `import` 了 `@deepseek-ai/dsh-tools` 与 `@deepseek-ai/dsh-user-questions`;`link:` 的插件沿**仓库路径**解析这些裸包名,故仓库根 `node_modules/@deepseek-ai/` 必须备好这两个包(指向当前 DSH 版本里的同一份,升级后需重指)——做法见仓库 `docs/rules/plugins.md` 第 3 条。**不要**手工拷贝进 `node_modules/`:裸拷贝是未注册状态,`pnpm install` / `dsh plugin add|remove` 等任何 profile 同步都会把它当 extraneous 清掉,而 roster 对每份 preset 做行可解析性健康检查——插件一旦被剪,引用它的三份 matt preset 会整体从模式选择里消失。也**不要**把它加进 profile `package.json` 的 `dsh.profile.bundles`(bundle 层必须在包内声明 `dsh.bundle`,否则启动报错)。
|
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 —
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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
|
-
* -
|
|
11
|
-
* -
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
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
|
|
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: "
|
|
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.
|
|
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
|
|
52
|
+
description: "The specific question to ask the user.",
|
|
54
53
|
},
|
|
55
54
|
header: {
|
|
56
55
|
type: "string",
|
|
57
|
-
description: "Optional short heading,
|
|
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: "
|
|
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,
|
|
@@ -129,8 +128,8 @@ function apply(ctx) {
|
|
|
129
128
|
},
|
|
130
129
|
async execute(args, exec) {
|
|
131
130
|
// 1. input validation: reserved id prefix guard only (the round-end
|
|
132
|
-
// question owns __grill_). Stem/option separation
|
|
133
|
-
//
|
|
131
|
+
// question owns __grill_). Stem/option separation is guidance, NOT
|
|
132
|
+
// enforced: substring matching would reject legitimate stems (e.g. a
|
|
134
133
|
// stem that naturally mentions an option name), so no stem check may
|
|
135
134
|
// refuse a round — a bad stem is preferable to a false rejection.
|
|
136
135
|
const violations = [];
|
|
@@ -147,7 +146,7 @@ function apply(ctx) {
|
|
|
147
146
|
};
|
|
148
147
|
}
|
|
149
148
|
|
|
150
|
-
// 2. transform: force multi-select
|
|
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
|
|
151
150
|
const questions = args.questions.map((question) => ({
|
|
152
151
|
id: question.id,
|
|
153
152
|
question: question.question,
|
|
@@ -161,7 +160,7 @@ function apply(ctx) {
|
|
|
161
160
|
multiSelect: true,
|
|
162
161
|
}));
|
|
163
162
|
|
|
164
|
-
// 3. round-end supplement 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)
|
|
165
164
|
questions.push({
|
|
166
165
|
...ROUND_END_QUESTION,
|
|
167
166
|
options: ROUND_END_QUESTION.options.map((option) => ({ ...option })),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynn123411/dsh-ask-user-grilling",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.6",
|
|
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": {
|