@henryqw/pi-ask-question 1.0.1 → 2.0.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.
Files changed (2) hide show
  1. package/README.md +7 -8
  2. package/package.json +5 -2
package/README.md CHANGED
@@ -1,14 +1,9 @@
1
1
  # `@henryqw/pi-ask-question`
2
2
 
3
- Pause Pi for one clear user choice, with up to three options or a custom answer.
3
+ Pause Pi for one clear user choice, with up to three options or a custom answer. Its keyboard-selectable prompt gives agents and extensions an explicit answer without parsing free-form chat.
4
4
 
5
5
  ![Pi asking the user to choose a database](./example.png)
6
6
 
7
- ## Why
8
-
9
- - **Created for**: Agents and extensions that need one decision before they continue.
10
- - **Advantage**: A keyboard-selectable prompt returns an explicit answer without parsing free-form chat.
11
-
12
7
  ## Install
13
8
 
14
9
  ```bash
@@ -34,8 +29,12 @@ Call `ask_question` to pause for one interactive answer. Pi shows the choices an
34
29
  - The UI marks the first option `(Recommended)`.
35
30
  - The UI adds `Something else.`, which opens a text input for a custom answer.
36
31
 
37
- 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.
38
-
39
32
  While an interactive TUI question is open, the tool publishes `herdr:blocked` with the `Input required` label. It clears the status after completion, cancellation, or failure.
40
33
 
34
+ ## API
35
+
41
36
  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.
37
+
38
+ ## Limits and recovery
39
+
40
+ 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@henryqw/pi-ask-question",
3
- "version": "1.0.1",
3
+ "version": "2.0.0",
4
4
  "description": "Ask Pi users one interactive question with choices or a custom answer.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -35,7 +35,7 @@
35
35
  "pack:check": "npm pack --dry-run"
36
36
  },
37
37
  "peerDependencies": {
38
- "@earendil-works/pi-coding-agent": "^0.85.1",
38
+ "@earendil-works/pi-coding-agent": "^0.86.0",
39
39
  "typebox": "^1.3.15"
40
40
  },
41
41
  "repository": {
@@ -54,5 +54,8 @@
54
54
  "./extensions/ask-question.ts"
55
55
  ],
56
56
  "image": "https://raw.githubusercontent.com/HenryQW/pi-harness/main/extensions/pi-ask-question/example.png"
57
+ },
58
+ "devDependencies": {
59
+ "@earendil-works/pi-coding-agent": "0.86.0"
57
60
  }
58
61
  }