@capdiem/pi-ask-user 0.1.1 → 0.1.3

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 +29 -10
  2. package/package.json +6 -3
package/README.md CHANGED
@@ -3,20 +3,30 @@
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 calls `ask_user` and you answer in an
7
- interactive form instead of reading a plain-text `Q1..QN` block and replying
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
- - **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/←→ switch, Enter
19
- confirm, Esc cancel) via `ctx.ui.custom()`.
23
+ - **Recommended-answer hints** — each question may carry a `recommendation`
24
+ (the grilling skill's `➡️ recommended answer`). When it matches one of a
25
+ choice question's options, that option is marked with **`★`** and the
26
+ recommendation shows beside it as `(推荐:…)`; otherwise it appears dimmed
27
+ under the question as `Recommended: …`.
28
+ - **TUI mode** — a full-screen tabbed **Custom UI** form (↑↓ select, Tab/←→
29
+ switch, Enter confirm, Esc cancel) via `ctx.ui.custom()`.
20
30
  - **RPC mode** — the same questions as sequential `select`/`input` dialogs over
21
31
  the [extension UI protocol](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/rpc.md#extension-ui-protocol).
22
32
  The recommended option's label carries the `(推荐:…)` detail merged in,
@@ -27,10 +37,10 @@ with numbered text.
27
37
  ## Install
28
38
 
29
39
  ```bash
30
- pi install npm:pi-ask-user
40
+ pi install npm:@capdiem/pi-ask-user
31
41
  ```
32
42
 
33
- Or load it directly from source during development:
43
+ To try it without installing:
34
44
 
35
45
  ```bash
36
46
  pi -e ./extensions/pi-ask-user/index.ts
@@ -67,8 +77,17 @@ The top-level call accepts an optional `numbered` flag (default `false`):
67
77
  ## Wiring it into grilling skills
68
78
 
69
79
  `ask_user` ships `promptGuidelines` that tell the model to prefer the form over
70
- plain-text `Q1..QN`. To make a grilling skill (e.g. Matt Pocock's
71
- `/grilling`) deterministic, add one line to the skill:
80
+ plain-text `Q1..QN`. It maps naturally onto [Matt Pocock's `grilling`
81
+ skill](https://github.com/mattpocock/skills) format:
82
+
83
+ | grilling skill | `ask_user` |
84
+ | --- | --- |
85
+ | `❓ Q1 - <title>: <body>` | numbered question (`numbered: true`) with title |
86
+ | choice options in the body | `type: "choice"` options |
87
+ | `➡️ <recommended answer>` | `recommendation` hint (marked `★` on the matching option) |
88
+ | free-form asks | `type: "text"` questions |
89
+
90
+ To make a grilling skill deterministic, add one line to the skill:
72
91
 
73
92
  > Present each round's frontier via the `ask_user` tool as a form. If the
74
93
  > `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.1",
4
- "description": "An interactive ask_user form tool for the Pi coding agent: choice or free-text questions with recommended-answer hints, in TUI (full form) and RPC (sequential dialogs)",
3
+ "version": "0.1.3",
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
- "questionnaire",
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>",