@henryqw/pi-ask-question 0.2.1 → 0.2.2
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 +9 -7
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -4,8 +4,8 @@ Ask the user one interactive question with up to three choices, or a custom answ
|
|
|
4
4
|
|
|
5
5
|
## Why
|
|
6
6
|
|
|
7
|
-
- **Created for**:
|
|
8
|
-
- **Advantage**:
|
|
7
|
+
- **Created for**: Ask the user one interactive question with up to three choices during a Pi session.
|
|
8
|
+
- **Advantage**: Show a keyboard-selectable prompt and return one explicit answer instead of parsing free-form chat.
|
|
9
9
|
|
|
10
10
|
## Install
|
|
11
11
|
|
|
@@ -15,9 +15,7 @@ pi install npm:@henryqw/pi-ask-question
|
|
|
15
15
|
|
|
16
16
|
## Use
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
| --- | --- | --- |
|
|
20
|
-
| `ask_question` | tool | Pause for one interactive answer. |
|
|
18
|
+
Use `ask_question` to pause for one interactive answer.
|
|
21
19
|
|
|
22
20
|
```json
|
|
23
21
|
{
|
|
@@ -30,6 +28,10 @@ pi install npm:@henryqw/pi-ask-question
|
|
|
30
28
|
}
|
|
31
29
|
```
|
|
32
30
|
|
|
33
|
-
Supply one to three options in preference order.
|
|
31
|
+
- Supply one to three options in preference order.
|
|
32
|
+
- The UI marks the first option `(Recommended)`.
|
|
33
|
+
- The UI adds `Something else.`, which opens a text input for a custom answer.
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
The tool returns an error for empty questions, blank or duplicate labels, empty lists, more than three options, and non-interactive sessions. Aborting the tool closes the pending question.
|
|
36
|
+
|
|
37
|
+
Extensions can reuse the validated interaction with `askQuestion(params, ctx, signal)`. This package export returns the tool's answer details without registering another UI flow.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@henryqw/pi-ask-question",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Ask Pi users one interactive question with choices or a custom answer.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
},
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"files": [
|
|
17
|
+
"LICENSE",
|
|
17
18
|
"dist",
|
|
18
19
|
"extensions",
|
|
19
|
-
"README.md"
|
|
20
|
-
"LICENSE"
|
|
20
|
+
"README.md"
|
|
21
21
|
],
|
|
22
22
|
"types": "./dist/index.d.ts",
|
|
23
23
|
"exports": {
|