@zhushanwen/pi-ask-user 3.0.0 → 5.0.0-dev.0
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/package.json +4 -4
- package/src/component.ts +1 -1
- package/src/index.ts +1 -1
- package/src/types.ts +2 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhushanwen/pi-ask-user",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Inline adaptive ask_user tool for Pi — single/multi-question structured input with split-pane preview, inline editor
|
|
3
|
+
"version": "5.0.0-dev.0",
|
|
4
|
+
"description": "Inline adaptive ask_user tool for Pi — single/multi-question structured input with split-pane preview, inline editor and optional comments.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|
|
7
7
|
"pi": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"ARCHITECTURE.md"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@xyz-agent/extension-protocol": "^0.
|
|
29
|
+
"@xyz-agent/extension-protocol": "^0.3.1-dev.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@earendil-works/pi-tui": "*",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@earendil-works/pi-coding-agent": "*",
|
|
39
39
|
"@earendil-works/pi-tui": "*",
|
|
40
40
|
"typebox": "*",
|
|
41
|
-
"@zhushanwen/pi-subagent-workflow": "
|
|
41
|
+
"@zhushanwen/pi-subagent-workflow": "5.0.0-dev.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependenciesMeta": {
|
|
44
44
|
"@earendil-works/pi-tui": {
|
package/src/component.ts
CHANGED
|
@@ -450,7 +450,7 @@ export class AskUserComponent implements Component {
|
|
|
450
450
|
this.rerender();
|
|
451
451
|
}
|
|
452
452
|
|
|
453
|
-
/** 选中确认后的处理:若 allowComment
|
|
453
|
+
/** 选中确认后的处理:若 allowComment(4.0.1 restore 字段),进入评论模式(可重入编辑/清除已有评论);否则前进。 */
|
|
454
454
|
private afterConfirm(state: QuestionState, q: Question): void {
|
|
455
455
|
state.confirmed = true;
|
|
456
456
|
if (q.allowComment && state.mode !== "comment") {
|
package/src/index.ts
CHANGED
|
@@ -135,7 +135,7 @@ function toProtoQuestions(questions: Question[]): AskUserQuestion[] {
|
|
|
135
135
|
/**
|
|
136
136
|
* 把协议包 AskUserAnswers 转换为 ask-user 内部 Result.answers。
|
|
137
137
|
*
|
|
138
|
-
* 协议格式:key=header/question, 单选=string, 多选=JSON数组, Other=__other, comment=__comment
|
|
138
|
+
* 协议格式:key=header/question, 单选=string, 多选=JSON数组, Other=__other, comment=__comment(4.0.1 restore)
|
|
139
139
|
* ask-user 格式:key=question 全文, value=逗号分隔 label + Other, comment 内联(` — `)
|
|
140
140
|
*
|
|
141
141
|
* 拼装逻辑复用 formatAnswer(与 TUI 版 getAnswerText 共享同一格式函数),
|
package/src/types.ts
CHANGED
|
@@ -10,7 +10,7 @@ export const SPLIT_PANE_MIN_WIDTH = 84;
|
|
|
10
10
|
export const SPLIT_PANE_SEPARATOR = " │ ";
|
|
11
11
|
export const SPLIT_PANE_LEFT_MIN = 32;
|
|
12
12
|
export const SPLIT_PANE_RIGHT_MIN = 28;
|
|
13
|
-
export const ANSWER_COMMENT_SEPARATOR = " — ";
|
|
13
|
+
export const ANSWER_COMMENT_SEPARATOR = " — "; // 答案内联评论分隔符(4.0.1 restore,见 .changeset/restore-ask-user-comment.md)
|
|
14
14
|
|
|
15
15
|
// ── Input schema(LLM 调用参数) ─────────────────────
|
|
16
16
|
// description 用英文:这些字符串会进 LLM 的 tool schema,英文更利于模型理解。
|
|
@@ -48,7 +48,7 @@ export const QuestionSchema = Type.Object({
|
|
|
48
48
|
Type.Boolean({ description: "Default false. Set true only when more than one option can validly apply simultaneously; otherwise leave false for a single best answer." }),
|
|
49
49
|
),
|
|
50
50
|
allowComment: Type.Optional(
|
|
51
|
-
Type.Boolean({ description: "Default false. Set true to let the user append a short free-text comment after selecting (e.g. to note a constraint)." }),
|
|
51
|
+
Type.Boolean({ description: "Default false. Set true to let the user append a short free-text comment after selecting (e.g. to note a constraint). Restored in 4.0.1." }),
|
|
52
52
|
),
|
|
53
53
|
});
|
|
54
54
|
|