pi-ask-user 0.5.1 → 0.6.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.
package/README.md CHANGED
@@ -14,6 +14,7 @@ High-quality video: [ask-user-demo.mp4](./media/ask-user-demo.mp4)
14
14
  - Responsive split-pane details preview on wide terminals with single-column fallback on narrow terminals
15
15
  - Multi-select option lists
16
16
  - Optional freeform responses
17
+ - User-toggleable extra context on structured selections
17
18
  - Context display support
18
19
  - Overlay mode — dialog floats over conversation, preserving context
19
20
  - Pi-TUI-aligned keybinding and editor behavior
@@ -62,6 +63,7 @@ The registered tool name is:
62
63
  | `options` | `(string \| {title, description?})[]?` | `[]` | Multiple-choice options |
63
64
  | `allowMultiple` | `boolean?` | `false` | Enable multi-select mode |
64
65
  | `allowFreeform` | `boolean?` | `true` | Add a "Type something" freeform option |
66
+ | `allowComment` | `boolean?` | `false` | Expose a user-toggleable extra-context option in the overlay (`ctrl+g` or the toggle row) and collect an optional comment in fallback dialogs |
65
67
  | `timeout` | `number?` | — | Auto-dismiss after N ms and return `null` if the prompt times out |
66
68
 
67
69
  ## Example usage shape
@@ -75,7 +77,8 @@ The registered tool name is:
75
77
  { "title": "production", "description": "Customer-facing" }
76
78
  ],
77
79
  "allowMultiple": false,
78
- "allowFreeform": true
80
+ "allowFreeform": true,
81
+ "allowComment": true
79
82
  }
80
83
  ```
81
84
 
@@ -84,13 +87,16 @@ The registered tool name is:
84
87
  All tool results include a structured `details` object for rendering and session state reconstruction:
85
88
 
86
89
  ```typescript
90
+ type AskResponse =
91
+ | { kind: "selection"; selections: string[]; comment?: string }
92
+ | { kind: "freeform"; text: string };
93
+
87
94
  interface AskToolDetails {
88
95
  question: string;
89
96
  context?: string;
90
97
  options: QuestionOption[];
91
- answer: string | null;
98
+ response: AskResponse | null;
92
99
  cancelled: boolean;
93
- wasCustom?: boolean;
94
100
  }
95
101
  ```
96
102