@capdiem/pi-ask-user 0.1.1 → 0.1.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 +22 -7
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -3,20 +3,26 @@
|
|
|
3
3
|
An interactive `ask_user` form tool for the [Pi coding agent](https://pi.dev/).
|
|
4
4
|
|
|
5
5
|
When the model needs your decision, preference, or input — especially during a
|
|
6
|
-
grilling / design-interview session — it
|
|
7
|
-
|
|
8
|
-
with numbered text.
|
|
6
|
+
[grilling](https://github.com/mattpocock/skills) / design-interview session — it
|
|
7
|
+
calls `ask_user` and you answer in an interactive **Custom UI** form instead of
|
|
8
|
+
reading a plain-text `Q1..QN` block and replying with numbered text. Each
|
|
9
|
+
question (with its `➡️ recommended answer`) becomes a selectable option or a
|
|
10
|
+
free-text field in the form.
|
|
9
11
|
|
|
10
12
|
## Features
|
|
11
13
|
|
|
14
|
+
- **Questions as a form, not text** — the official pi **Custom UI** mechanism
|
|
15
|
+
(`ctx.ui.custom()`): a full-screen interactive form where each question is a
|
|
16
|
+
selector (choice options with a free-text escape) or a free-text field. No
|
|
17
|
+
more replying to a wall of `Q1..QN` text.
|
|
12
18
|
- **One call, many questions** — pass the whole round (a grilling frontier, a
|
|
13
19
|
clarification batch) as a single form with up to 10 questions.
|
|
14
20
|
- **Choice and free-text** — each question is `type: "choice"` (options list,
|
|
15
21
|
with an optional "Type something" free-text escape) or `type: "text"`.
|
|
16
22
|
- **Question numbering (optional)** — set `numbered: true` to label questions `Q1`, `Q2`, … in the form body with an optional short title (`Q1 - Scope:`), mirroring the original grilling format. Ordinary (non-grill) forms show just the prompt.
|
|
17
23
|
- **Recommended-answer hints** — each question may carry a `recommendation` (the grilling skill's `➡️ recommended answer`). When it matches one of a choice question's options, that option is marked with a **`★`** between the option number and the label (bold label), and its description (muted) plus the recommendation detail (default + bold, wrapped as `(推荐:…)`) are shown together on one line — a leading title in the recommendation is stripped (grill shape `<标题> - <详情>`, taking only the `<详情>` after the first dash). Otherwise the recommendation appears dimmed under the question as `Recommended: …`.
|
|
18
|
-
- **TUI mode** — a full-screen tabbed form (↑↓ select, Tab/←→
|
|
19
|
-
confirm, Esc cancel) via `ctx.ui.custom()`.
|
|
24
|
+
- **TUI mode** — a full-screen tabbed **Custom UI** form (↑↓ select, Tab/←→
|
|
25
|
+
switch, Enter confirm, Esc cancel) via `ctx.ui.custom()`.
|
|
20
26
|
- **RPC mode** — the same questions as sequential `select`/`input` dialogs over
|
|
21
27
|
the [extension UI protocol](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/rpc.md#extension-ui-protocol).
|
|
22
28
|
The recommended option's label carries the `(推荐:…)` detail merged in,
|
|
@@ -67,8 +73,17 @@ The top-level call accepts an optional `numbered` flag (default `false`):
|
|
|
67
73
|
## Wiring it into grilling skills
|
|
68
74
|
|
|
69
75
|
`ask_user` ships `promptGuidelines` that tell the model to prefer the form over
|
|
70
|
-
plain-text `Q1..QN`.
|
|
71
|
-
|
|
76
|
+
plain-text `Q1..QN`. It maps naturally onto [Matt Pocock's `grilling`
|
|
77
|
+
skill](https://github.com/mattpocock/skills) format:
|
|
78
|
+
|
|
79
|
+
| grilling skill | `ask_user` |
|
|
80
|
+
| --- | --- |
|
|
81
|
+
| `❓ Q1 - <title>: <body>` | numbered question (`numbered: true`) with title |
|
|
82
|
+
| choice options in the body | `type: "choice"` options |
|
|
83
|
+
| `➡️ <recommended answer>` | `recommendation` hint (marked `★` on the matching option) |
|
|
84
|
+
| free-form asks | `type: "text"` questions |
|
|
85
|
+
|
|
86
|
+
To make a grilling skill deterministic, add one line to the skill:
|
|
72
87
|
|
|
73
88
|
> Present each round's frontier via the `ask_user` tool as a form. If the
|
|
74
89
|
> `ask_user` tool is not available, fall back to numbered plain-text questions.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capdiem/pi-ask-user",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "An interactive ask_user form
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "An interactive ask_user form (Custom UI) for the Pi coding agent: turns grilling-skill questions into selectable options with recommended-answer hints — TUI full form, RPC sequential dialogs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"pi": {
|
|
7
7
|
"extensions": [
|
|
@@ -13,8 +13,11 @@
|
|
|
13
13
|
"pi",
|
|
14
14
|
"coding-agent",
|
|
15
15
|
"ask-user",
|
|
16
|
-
"
|
|
16
|
+
"custom-ui",
|
|
17
17
|
"form",
|
|
18
|
+
"form-selector",
|
|
19
|
+
"interactive-form",
|
|
20
|
+
"questionnaire",
|
|
18
21
|
"grilling"
|
|
19
22
|
],
|
|
20
23
|
"author": "capdiem <capdiem@live.com>",
|