@juicesharp/rpiv-ask-user-question 0.12.5 → 0.12.7

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
@@ -1,14 +1,17 @@
1
1
  # rpiv-ask-user-question
2
2
 
3
- Pi extension that registers the `ask_user_question` tool — a structured option
4
- selector (with free-text "Other" fallback) the model can use to ask you a
5
- clarifying question instead of guessing.
3
+ [![npm version](https://img.shields.io/npm/v/@juicesharp/rpiv-ask-user-question.svg)](https://www.npmjs.com/package/@juicesharp/rpiv-ask-user-question)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+
6
+ Let the model ask a structured clarifying question instead of guessing. `rpiv-ask-user-question` adds the `ask_user_question` tool to [Pi Agent](https://github.com/badlogic/pi-mono) — a structured option selector with an optional free-text "Other" fallback.
6
7
 
7
8
  ![Structured question prompt](https://raw.githubusercontent.com/juicesharp/rpiv-mono/main/packages/rpiv-ask-user-question/docs/prompt.jpg)
8
9
 
9
- ## Installation
10
+ ## Install
10
11
 
11
- pi install npm:@juicesharp/rpiv-ask-user-question
12
+ ```bash
13
+ pi install npm:@juicesharp/rpiv-ask-user-question
14
+ ```
12
15
 
13
16
  Then restart your Pi session.
14
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juicesharp/rpiv-ask-user-question",
3
- "version": "0.12.5",
3
+ "version": "0.12.7",
4
4
  "description": "Pi extension: lets the model ask you a clarifying question with structured options instead of guessing",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -1,5 +1,5 @@
1
1
  import type { Component } from "@mariozechner/pi-tui";
2
- import { visibleWidth, wrapTextWithAnsi } from "@mariozechner/pi-tui";
2
+ import { truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@mariozechner/pi-tui";
3
3
 
4
4
  export interface WrappingSelectItem {
5
5
  label: string;
@@ -127,7 +127,7 @@ export class WrappingSelect implements Component {
127
127
  const contentWidth = Math.max(WrappingSelect.MIN_CONTENT_WIDTH, width - visibleWidth(rowPrefix));
128
128
 
129
129
  if (this.shouldRenderAsInlineInput(item, isActive)) {
130
- return [this.renderInlineInputRow(rowPrefix)];
130
+ return [this.renderInlineInputRow(rowPrefix, width)];
131
131
  }
132
132
 
133
133
  return [
@@ -147,8 +147,9 @@ export class WrappingSelect implements Component {
147
147
  return !!item.isOther && isActive;
148
148
  }
149
149
 
150
- private renderInlineInputRow(rowPrefix: string): string {
151
- return this.theme.selectedText(`${rowPrefix}${this.inputBuffer}${WrappingSelect.INPUT_CURSOR}`);
150
+ private renderInlineInputRow(rowPrefix: string, width: number): string {
151
+ const raw = `${rowPrefix}${this.inputBuffer}${WrappingSelect.INPUT_CURSOR}`;
152
+ return truncateToWidth(this.theme.selectedText(raw), width, "");
152
153
  }
153
154
 
154
155
  private renderLabelBlock(