@deepseek-ai/dsh-tool-ask-user 0.0.1-rc.2 → 0.0.1-rc.3
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.i18n.yaml +2 -2
- package/README.md +3 -3
- package/README.zh.md +3 -3
- package/lib/index.js +4 -4
- package/lib/types/index.d.ts +2 -2
- package/package.json +12 -12
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/interaction/tool-ask-user/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: bf2ba369fca36c462c6155ed2354ab3d0e930dd0
|
|
6
|
+
README.zh.md: 671bea0132093b890de4ce27095fa60dac396276
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
English | [中文](README.zh.md)
|
|
4
4
|
|
|
5
|
-
Model-facing `ask_user_question` tool over `ctx.
|
|
5
|
+
Model-facing `ask_user_question` tool over `ctx.userQuestions`. It lets the model ask the human a concise question when it needs confirmation, a choice, or missing information before continuing.
|
|
6
6
|
|
|
7
7
|
## Tool
|
|
8
8
|
|
|
@@ -15,11 +15,11 @@ Model-facing `ask_user_question` tool over `ctx.userInteraction`. It lets the mo
|
|
|
15
15
|
- `options` — optional choices with `label` and `description`. If recommending a choice, put it first and append `(Recommended)` to that label.
|
|
16
16
|
- `multi_select` — whether that question may return more than one selected option.
|
|
17
17
|
|
|
18
|
-
The tool calls `ctx.
|
|
18
|
+
The tool calls `ctx.userQuestions.ask()` and returns canonical `{ answers: [{ id, selected, custom? }] }`. `selected` contains option labels; `custom` carries a free-form answer, supplementing `selected` for a multi-select question and overriding it for a single-select question. The Native renderer preserves the compact JSON text shape `{ "answers": [{ "id": "...", "selected": ["..."], "custom": "..." }] }`.
|
|
19
19
|
|
|
20
20
|
## Role
|
|
21
21
|
|
|
22
|
-
This is the Consumer package for the user-
|
|
22
|
+
This is the Consumer package for the user-questions seam. It does not render UI and does not know how input is collected; it only translates model arguments into `AskUserQuestionRequest` and returns the human answer to the agent loop.
|
|
23
23
|
|
|
24
24
|
## Model Experience
|
|
25
25
|
|
package/README.zh.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.md) | 中文
|
|
4
4
|
|
|
5
|
-
模型侧 `ask_user_question` 工具,基于 `ctx.
|
|
5
|
+
模型侧 `ask_user_question` 工具,基于 `ctx.userQuestions` 实现。当模型需要确认、选择结果或缺失的信息才能继续时,它可以借此向用户提出简明问题。
|
|
6
6
|
|
|
7
7
|
## 工具
|
|
8
8
|
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
- `options`:可选选项,包含 `label` 和 `description`。如需推荐某个选项,请将其置于首位,并在该标签末尾追加 `(Recommended)`。
|
|
16
16
|
- `multi_select`:该问题是否可以返回多个选中的选项。
|
|
17
17
|
|
|
18
|
-
工具调用 `ctx.
|
|
18
|
+
工具调用 `ctx.userQuestions.ask()`,并返回规范的 `{ answers: [{ id, selected, custom? }] }`。`selected` 包含选项标签;`custom` 携带自由填写的回答,对于多选题会补充 `selected`,对于单选题则会覆盖它。Native 渲染器会保留紧凑的 JSON 文本形式 `{ "answers": [{ "id": "...", "selected": ["..."], "custom": "..." }] }`。
|
|
19
19
|
|
|
20
20
|
## 职责
|
|
21
21
|
|
|
22
|
-
此包是用户交互 seam 的
|
|
22
|
+
此包是用户交互 seam 的Consumer 包。它不渲染 UI,也不了解输入的收集方式;它只将模型参数转换为 `AskUserQuestionRequest`,并把用户回答返回给 agent loop(智能体循环)。
|
|
23
23
|
|
|
24
24
|
## 模型体验
|
|
25
25
|
|
package/lib/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { defineTool } from "@deepseek-ai/dsh-tools";
|
|
2
|
-
import "@deepseek-ai/dsh-user-
|
|
2
|
+
import "@deepseek-ai/dsh-user-questions";
|
|
3
3
|
//#region lib/types/index.js
|
|
4
4
|
/**
|
|
5
|
-
* Model-facing Consumer of the `ctx.
|
|
5
|
+
* Model-facing Consumer of the `ctx.userQuestions` capability seam.
|
|
6
6
|
* The tool pauses until a UI provider returns a human answer, then feeds that
|
|
7
7
|
* answer back into the agent loop as an ordinary tool result.
|
|
8
8
|
*
|
|
9
9
|
* @module @deepseek-ai/dsh-tool-ask-user
|
|
10
10
|
*/
|
|
11
11
|
const name = "tool-ask-user";
|
|
12
|
-
const inject = ["tools", "
|
|
12
|
+
const inject = ["tools", "userQuestions"];
|
|
13
13
|
const 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.";
|
|
14
14
|
function apply(ctx) {
|
|
15
15
|
ctx.tools.register(defineTool({
|
|
@@ -94,7 +94,7 @@ function apply(ctx) {
|
|
|
94
94
|
}]
|
|
95
95
|
},
|
|
96
96
|
async execute(args, exec) {
|
|
97
|
-
return { answers: (await ctx.
|
|
97
|
+
return { answers: (await ctx.userQuestions.ask({
|
|
98
98
|
questions: args.questions.map((question) => ({
|
|
99
99
|
id: question.id,
|
|
100
100
|
question: question.question,
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Model-facing Consumer of the `ctx.
|
|
2
|
+
* Model-facing Consumer of the `ctx.userQuestions` capability seam.
|
|
3
3
|
* The tool pauses until a UI provider returns a human answer, then feeds that
|
|
4
4
|
* answer back into the agent loop as an ordinary tool result.
|
|
5
5
|
*
|
|
6
6
|
* @module @deepseek-ai/dsh-tool-ask-user
|
|
7
7
|
*/
|
|
8
8
|
import type { Context } from '@deepseek-ai/cordis';
|
|
9
|
-
import '@deepseek-ai/dsh-user-
|
|
9
|
+
import '@deepseek-ai/dsh-user-questions';
|
|
10
10
|
export declare const name = "tool-ask-user";
|
|
11
11
|
export declare const inject: string[];
|
|
12
12
|
export declare function apply(ctx: Context): void;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-tool-ask-user",
|
|
3
|
-
"description": "Model-facing ask_user_question tool over the ctx.
|
|
4
|
-
"version": "0.0.1-rc.
|
|
3
|
+
"description": "Model-facing ask_user_question tool over the ctx.userQuestions seam",
|
|
4
|
+
"version": "0.0.1-rc.3",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "restricted"
|
|
7
7
|
},
|
|
@@ -32,19 +32,19 @@
|
|
|
32
32
|
],
|
|
33
33
|
"license": "BSD-3-Clause",
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@deepseek-ai/dsh-
|
|
36
|
-
"@deepseek-ai/dsh-
|
|
35
|
+
"@deepseek-ai/dsh-agent": "^0.0.1-rc.3",
|
|
36
|
+
"@deepseek-ai/dsh-invariants": "^0.0.1-rc.3",
|
|
37
|
+
"@deepseek-ai/dsh-tools": "^0.0.1-rc.3",
|
|
37
38
|
"@deepseek-ai/cordis": "^4.0.1-rc.1",
|
|
38
|
-
"@deepseek-ai/dsh-
|
|
39
|
-
"@deepseek-ai/dsh-user-interaction": "^0.0.1-rc.2"
|
|
39
|
+
"@deepseek-ai/dsh-user-questions": "^0.0.1-rc.3"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@deepseek-ai/dsh-invariants": "^0.0.1-rc.
|
|
43
|
-
"@deepseek-ai/dsh-agent": "^0.0.1-rc.
|
|
44
|
-
"@deepseek-ai/dsh-system-prompt": "^0.0.1-rc.
|
|
45
|
-
"@deepseek-ai/dsh-tools": "^0.0.1-rc.
|
|
46
|
-
"@deepseek-ai/dsh-
|
|
47
|
-
"@deepseek-ai/dsh-
|
|
42
|
+
"@deepseek-ai/dsh-invariants": "^0.0.1-rc.3",
|
|
43
|
+
"@deepseek-ai/dsh-agent": "^0.0.1-rc.3",
|
|
44
|
+
"@deepseek-ai/dsh-system-prompt": "^0.0.1-rc.3",
|
|
45
|
+
"@deepseek-ai/dsh-tools": "^0.0.1-rc.3",
|
|
46
|
+
"@deepseek-ai/dsh-user-questions": "^0.0.1-rc.3",
|
|
47
|
+
"@deepseek-ai/dsh-llm": "^0.0.1-rc.3",
|
|
48
48
|
"@deepseek-ai/cordis": "^4.0.1-rc.1"
|
|
49
49
|
}
|
|
50
50
|
}
|