@hank-warren/pi-ask-user-question 0.4.0 → 0.4.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/CHANGELOG.md +93 -0
- package/package.json +4 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# @hank-warren/pi-ask-user-question
|
|
2
|
+
|
|
3
|
+
## 0.4.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- cf12677: ship CHANGELOG.md in the published tarball
|
|
8
|
+
- Updated dependencies [cf12677]
|
|
9
|
+
- @hank-warren/pi-permission-selector@1.0.1
|
|
10
|
+
|
|
11
|
+
## 0.4.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [500fe67]
|
|
16
|
+
- @hank-warren/pi-permission-selector@1.0.0
|
|
17
|
+
|
|
18
|
+
## 0.4.0
|
|
19
|
+
|
|
20
|
+
### Minor Changes
|
|
21
|
+
|
|
22
|
+
- 716a6a7: Add the preview pane — the last capability gap versus `@juicesharp/rpiv-ask-user-question`.
|
|
23
|
+
|
|
24
|
+
Options may carry an optional `preview` field: markdown rendered in a pane below the options while that option is highlighted, using pi's own markdown theme so previews match the transcript. The pane follows the highlight and disappears for options without one.
|
|
25
|
+
|
|
26
|
+
Stacked rather than side-by-side, per `docs/specs/pi-ask-user-question.md` §6.2 — rpiv spent ~712 lines largely on making a two-column layout behave at narrow widths. Long previews are clipped at 12 rows with a `… N more lines` marker so the options can never be pushed off screen.
|
|
27
|
+
|
|
28
|
+
The chosen option's preview is carried into the tool result as `selected preview: …`, matching rpiv's envelope. A typed custom answer never carries one.
|
|
29
|
+
|
|
30
|
+
Markdown rendering degrades to plain wrapped text rather than throwing: pi's `getMarkdownTheme()` returns lazily-bound functions that throw until `initTheme()` has run, and a throw inside `render()` would take down the whole dialog instead of one pane.
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- Updated dependencies [716a6a7]
|
|
35
|
+
- @hank-warren/pi-permission-selector@0.3.2
|
|
36
|
+
|
|
37
|
+
## 0.3.0
|
|
38
|
+
|
|
39
|
+
### Minor Changes
|
|
40
|
+
|
|
41
|
+
- f470d81: Multi-question support with Tab cycling, matching `@juicesharp/rpiv-ask-user-question`.
|
|
42
|
+
|
|
43
|
+
`MAX_QUESTIONS` rises from 1 to 4. Several questions render as tabs: `Tab` / `→` move forward, `Shift+Tab` / `←` move back, both wrapping, with a strip showing which questions are answered. Answering jumps to the next unanswered question, and the call returns once every question has an answer. Cycling back and re-answering replaces that question's answer instead of recording a second one — answers are keyed by question index.
|
|
44
|
+
|
|
45
|
+
`n` now opens the note editor in the questionnaire, because `Tab` is needed for cycling. `pi-auto-permissions` approval prompts are unchanged and keep `Tab` for notes: `OptionSelector` gains a `commentTrigger` predicate that defaults to `Tab`, and only the questionnaire overrides it.
|
|
46
|
+
|
|
47
|
+
Cycling is deliberately inert while a text field owns the keyboard, so a stray `Tab` cannot teleport you to another question and strand a half-typed answer.
|
|
48
|
+
|
|
49
|
+
### Patch Changes
|
|
50
|
+
|
|
51
|
+
- Updated dependencies [f470d81]
|
|
52
|
+
- @hank-warren/pi-permission-selector@0.3.0
|
|
53
|
+
|
|
54
|
+
## 0.2.2
|
|
55
|
+
|
|
56
|
+
### Patch Changes
|
|
57
|
+
|
|
58
|
+
- d60e648: Anchor the questionnaire above the input dock, and wrap long custom answers.
|
|
59
|
+
|
|
60
|
+
**Position.** The overlay is now bottom-anchored and full width (`anchor: "bottom-center"`, `width: "100%"`, `margin.bottom: 0`), so it sits directly above the input dock instead of floating over the middle of the transcript — the geometry `@juicesharp/rpiv-ask-user-question` used. The dialog fills the overlay width to match; a narrower box inside a full-width overlay region would let the transcript show through beside it.
|
|
61
|
+
|
|
62
|
+
**Wrapping.** Text typed into the "Type something." field ran past the right border and off the screen indefinitely, because an input field renders as one line unless something breaks it up. It now wraps on word boundaries, with a hard break for unbroken runs, and the caret follows to the last row.
|
|
63
|
+
|
|
64
|
+
**Border integrity.** `render` now clamps any over-long line as a last-resort invariant, so no content source — a pathological option label included — can break the right border. `test/dialog-render.test.ts` asserts every rendered line is exactly the overlay width across widths from 20 to 200 columns; 8 of its 9 cases fail against 0.2.1.
|
|
65
|
+
|
|
66
|
+
## 0.2.1
|
|
67
|
+
|
|
68
|
+
### Patch Changes
|
|
69
|
+
|
|
70
|
+
- 8a479f1: Fix two dialog bugs that made 0.2.0 unusable in a Kitty-protocol terminal.
|
|
71
|
+
|
|
72
|
+
**Trapped in the custom-answer field.** The free-text branch compared key data with `===` (`keyData === "\x1b"`) instead of using the shared predicates. Under the Kitty keyboard protocol — Ghostty's default — Esc arrives as `\x1b[27u`, Enter as `\x1b[13u` and Backspace as `\x1b[127u`, so all three were dead once the user selected "Type something.": no way to submit, no way to back out. The option list was unaffected because `OptionSelector` already used the shared predicates, and that asymmetry is what hid the bug. All key handling now routes through `@hank-warren/pi-permission-selector/keys.ts`, and Kitty-encoded printables are decoded rather than dropped.
|
|
73
|
+
|
|
74
|
+
**Dialog rendered over the transcript.** Lines were emitted unpadded and unframed, and pi's overlay compositing only overwrites the columns an overlay actually emits — so chat text showed through and the dialog appeared as garbage interleaved with the conversation. The dialog now draws a border and pads every line to the full overlay width, wraps question text, and caps itself at 84 columns.
|
|
75
|
+
|
|
76
|
+
Also adds `Focusable` support: the hardware cursor now parks in the text field via `CURSOR_MARKER` instead of sitting at the bottom of the screen.
|
|
77
|
+
|
|
78
|
+
## 0.2.0
|
|
79
|
+
|
|
80
|
+
### Minor Changes
|
|
81
|
+
|
|
82
|
+
- f52494b: Initial release: a structured questionnaire tool (`ask_user_question`) with numbered options, digit hotkeys, a "Type something." free-text row, and Tab-to-comment.
|
|
83
|
+
|
|
84
|
+
v0.1 handles one question per call with 2-4 options; multi-question and preview panes follow in v0.2 (see `docs/specs/pi-ask-user-question.md`).
|
|
85
|
+
|
|
86
|
+
The dialog composes the shared `OptionSelector` from `@hank-warren/pi-permission-selector` through `ctx.ui.custom()`, so it gets the same key behavior as approval prompts without patching any pi internals.
|
|
87
|
+
|
|
88
|
+
The tool is stripped from the active tool set whenever `ctx.hasUI` is false, so headless subagent children can never block waiting on a human or route a question to their supervisor.
|
|
89
|
+
|
|
90
|
+
### Patch Changes
|
|
91
|
+
|
|
92
|
+
- Updated dependencies [f52494b]
|
|
93
|
+
- @hank-warren/pi-permission-selector@0.2.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hank-warren/pi-ask-user-question",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Structured questionnaire tool for Pi with numbered options, digit hotkeys and Tab-to-comment, composed from the shared permission-selector component.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -42,10 +42,11 @@
|
|
|
42
42
|
"tool/envelope.ts",
|
|
43
43
|
"view/dialog.ts",
|
|
44
44
|
"README.md",
|
|
45
|
-
"LICENSE"
|
|
45
|
+
"LICENSE",
|
|
46
|
+
"CHANGELOG.md"
|
|
46
47
|
],
|
|
47
48
|
"dependencies": {
|
|
48
|
-
"@hank-warren/pi-permission-selector": "^0.
|
|
49
|
+
"@hank-warren/pi-permission-selector": "^1.0.1"
|
|
49
50
|
},
|
|
50
51
|
"peerDependencies": {
|
|
51
52
|
"@earendil-works/pi-coding-agent": "*",
|